From: "flichtenheld (Code Review)"
Date: Wed, 24 Apr 2024 10:16:01 +0000
In-Reply-To:
References:
Reply-To: frank@...2641..., arne-openvpn@...1227...,
openvpn-devel@lists.sourceforge.net
Message-ID: <296e4a72b66bd6f49c004225faec687d59fb0573-EmailReplacePatchSet-HTML@...2715...>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Disposition: inline
Content-Type: multipart/alternative; boundary="50hTzy6dSQg="; charset=UTF-8
Subject: [Openvpn-devel] [M] Change in openvpn[master]: configure: update
old copy of pkg.m4
List-Id:
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
To: plaisthos
Cc: openvpn-devel
--50hTzy6dSQg=
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Attention is currently required from: plaisthos.
Hello plaisthos,
I'd like you to reexamine a change. Please visit
http://gerrit.openvpn.net/c/openvpn/+/558?usp=3Demail
to look at the new patch set (#2).
Change subject: configure: update old copy of pkg.m4
......................................................................
configure: update old copy of pkg.m4
If we copy this code, let's at least make sure we update
it every decade ;)
I also considered removing it. However, then autoconf
can't be run on systems without pkg-config installed
anymore. While that is very unusual, didn't see a good
reason to break that.
Change-Id: I34e96a225446693f401549d86d872c02427ef7d5
Signed-off-by: Frank Lichtenheld
---
M m4/pkg.m4
1 file changed, 173 insertions(+), 57 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/58/558/2
diff --git a/m4/pkg.m4 b/m4/pkg.m4
index cca47a7..13a8890 100644
--- a/m4/pkg.m4
+++ b/m4/pkg.m4
@@ -1,29 +1,60 @@
-# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autocon=
f -*-
-# serial 1 (pkg-config-0.24)
-#
-# Copyright =C2=A9 2004 Scott James Remnant .
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
+# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
+# serial 12 (pkg-config-0.29.2)
-# PKG_PROG_PKG_CONFIG([MIN-VERSION])
-# ----------------------------------
+dnl Copyright =C2=A9 2004 Scott James Remnant .
+dnl Copyright =C2=A9 2012-2015 Dan Nicholson
+dnl
+dnl This program is free software; you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation; either version 2 of the License, or
+dnl (at your option) any later version.
+dnl
+dnl This program is distributed in the hope that it will be useful, but
+dnl WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+dnl General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+dnl 02111-1307, USA.
+dnl
+dnl As a special exception to the GNU General Public License, if you
+dnl distribute this file as part of a program that contains a
+dnl configuration script generated by Autoconf, you may include it under
+dnl the same distribution terms that you use for the rest of that
+dnl program.
+
+dnl PKG_PREREQ(MIN-VERSION)
+dnl -----------------------
+dnl Since: 0.29
+dnl
+dnl Verify that the version of the pkg-config macros are at least
+dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's
+dnl installed version of pkg-config, this checks the developer's version
+dnl of pkg.m4 when generating configure.
+dnl
+dnl To ensure that this macro is defined, also add:
+dnl m4_ifndef([PKG_PREREQ],
+dnl [m4_fatal([must install pkg-config 0.29 or later before running au=
toconf/autogen])])
+dnl
+dnl See the "Since" comment for each macro you use to see what version
+dnl of the macros you require.
+m4_defun([PKG_PREREQ],
+[m4_define([PKG_MACROS_VERSION], [0.29.2])
+m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
+ [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VER=
SION[ found])])
+])dnl PKG_PREREQ
+
+dnl PKG_PROG_PKG_CONFIG([MIN-VERSION])
+dnl ----------------------------------
+dnl Since: 0.16
+dnl
+dnl Search for the pkg-config tool and set the PKG_CONFIG variable to
+dnl first found in the path. Checks that the version of pkg-config found
+dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is
+dnl used since that's the first version where most current features of
+dnl pkg-config existed.
AC_DEFUN([PKG_PROG_PKG_CONFIG],
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLA=
GS|LIBS)))?$])
@@ -45,18 +76,19 @@
PKG_CONFIG=3D""
fi
fi[]dnl
-])# PKG_PROG_PKG_CONFIG
+])dnl PKG_PROG_PKG_CONFIG
-# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
-#
-# Check to see whether a particular set of modules exists. Similar
-# to PKG_CHECK_MODULES(), but does not set variables or print errors.
-#
-# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
-# only at the first occurrence in configure.ac, so if the first place
-# it's called might be skipped (such as if it is within an "if", you
-# have to call PKG_CHECK_EXISTS manually
-# --------------------------------------------------------------
+dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+dnl -------------------------------------------------------------------
+dnl Since: 0.18
+dnl
+dnl Check to see whether a particular set of modules exists. Similar to
+dnl PKG_CHECK_MODULES(), but does not set variables or print errors.
+dnl
+dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+dnl only at the first occurence in configure.ac, so if the first place
+dnl it's called might be skipped (such as if it is within an "if", you
+dnl have to call PKG_CHECK_EXISTS manually
AC_DEFUN([PKG_CHECK_EXISTS],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
if test -n "$PKG_CONFIG" && \
@@ -66,8 +98,10 @@
$3])dnl
fi])
-# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
-# ---------------------------------------------
+dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
+dnl ---------------------------------------------
+dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting
+dnl pkg_failed based on the result.
m4_define([_PKG_CONFIG],
[if test -n "$$1"; then
pkg_cv_[]$1=3D"$$1"
@@ -79,10 +113,11 @@
else
pkg_failed=3Duntried
fi[]dnl
-])# _PKG_CONFIG
+])dnl _PKG_CONFIG
-# _PKG_SHORT_ERRORS_SUPPORTED
-# -----------------------------
+dnl _PKG_SHORT_ERRORS_SUPPORTED
+dnl ---------------------------
+dnl Internal check to see if pkg-config supports short errors.
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
@@ -90,26 +125,24 @@
else
_pkg_short_errors_supported=3Dno
fi[]dnl
-])# _PKG_SHORT_ERRORS_SUPPORTED
+])dnl _PKG_SHORT_ERRORS_SUPPORTED
-# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
-# [ACTION-IF-NOT-FOUND])
-#
-#
-# Note that if there is a possibility the first call to
-# PKG_CHECK_MODULES might not happen, you should be sure to include an
-# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
-#
-#
-# --------------------------------------------------------------
+dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
+dnl [ACTION-IF-NOT-FOUND])
+dnl --------------------------------------------------------------
+dnl Since: 0.4.0
+dnl
+dnl Note that if there is a possibility the first call to
+dnl PKG_CHECK_MODULES might not happen, you should be sure to include an
+dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
AC_DEFUN([PKG_CHECK_MODULES],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config]=
)dnl
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
pkg_failed=3Dno
-AC_MSG_CHECKING([for $1])
+AC_MSG_CHECKING([for $2])
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
@@ -119,11 +152,11 @@
See the pkg-config man page for more details.])
if test $pkg_failed =3D yes; then
- AC_MSG_RESULT([no])
+ AC_MSG_RESULT([no])
_PKG_SHORT_ERRORS_SUPPORTED
if test $_pkg_short_errors_supported =3D yes; then
$1[]_PKG_ERRORS=3D`$PKG_CONFIG --short-errors --print-errors --cf=
lags --libs "$2" 2>&1`
- else
+ else
$1[]_PKG_ERRORS=3D`$PKG_CONFIG --print-errors --cflags --libs "$2=
" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
@@ -140,7 +173,7 @@
_PKG_TEXT])[]dnl
])
elif test $pkg_failed =3D untried; then
- AC_MSG_RESULT([no])
+ AC_MSG_RESULT([no])
m4_default([$4], [AC_MSG_FAILURE(
[The pkg-config script could not be found or is too old. Make sure it
is in your PATH or set the PKG_CONFIG environment variable to the full
@@ -156,4 +189,87 @@
AC_MSG_RESULT([yes])
$3
fi[]dnl
-])# PKG_CHECK_MODULES
+])dnl PKG_CHECK_MODULES
+
+
+dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
+dnl [ACTION-IF-NOT-FOUND])
+dnl ---------------------------------------------------------------------
+dnl Since: 0.29
+dnl
+dnl Checks for existence of MODULES and gathers its build flags with
+dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags
+dnl and VARIABLE-PREFIX_LIBS from --libs.
+dnl
+dnl Note that if there is a possibility the first call to
+dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to
+dnl include an explicit call to PKG_PROG_PKG_CONFIG in your
+dnl configure.ac.
+AC_DEFUN([PKG_CHECK_MODULES_STATIC],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+_save_PKG_CONFIG=3D$PKG_CONFIG
+PKG_CONFIG=3D"$PKG_CONFIG --static"
+PKG_CHECK_MODULES($@)
+PKG_CONFIG=3D$_save_PKG_CONFIG[]dnl
+])dnl PKG_CHECK_MODULES_STATIC
+
+
+dnl PKG_INSTALLDIR([DIRECTORY])
+dnl -------------------------
+dnl Since: 0.27
+dnl
+dnl Substitutes the variable pkgconfigdir as the location where a module
+dnl should install pkg-config .pc files. By default the directory is
+dnl $libdir/pkgconfig, but the default can be changed by passing
+dnl DIRECTORY. The user can override through the --with-pkgconfigdir
+dnl parameter.
+AC_DEFUN([PKG_INSTALLDIR],
+[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
+m4_pushdef([pkg_description],
+ [pkg-config installation directory @<:@]pkg_default[@:>@])
+AC_ARG_WITH([pkgconfigdir],
+ [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
+ [with_pkgconfigdir=3D]pkg_default)
+AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
+m4_popdef([pkg_default])
+m4_popdef([pkg_description])
+])dnl PKG_INSTALLDIR
+
+
+dnl PKG_NOARCH_INSTALLDIR([DIRECTORY])
+dnl --------------------------------
+dnl Since: 0.27
+dnl
+dnl Substitutes the variable noarch_pkgconfigdir as the location where a
+dnl module should install arch-independent pkg-config .pc files. By
+dnl default the directory is $datadir/pkgconfig, but the default can be
+dnl changed by passing DIRECTORY. The user can override through the
+dnl --with-noarch-pkgconfigdir parameter.
+AC_DEFUN([PKG_NOARCH_INSTALLDIR],
+[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
+m4_pushdef([pkg_description],
+ [pkg-config arch-independent installation directory @<:@]pkg_default[@=
:>@])
+AC_ARG_WITH([noarch-pkgconfigdir],
+ [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
+ [with_noarch_pkgconfigdir=3D]pkg_default)
+AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
+m4_popdef([pkg_default])
+m4_popdef([pkg_description])
+])dnl PKG_NOARCH_INSTALLDIR
+
+
+dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
+dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+dnl -------------------------------------------
+dnl Since: 0.28
+dnl
+dnl Retrieves the value of the pkg-config variable for the given module.
+AC_DEFUN([PKG_CHECK_VAR],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
+
+_PKG_CONFIG([$1], [variable=3D"][$3]["], [$2])
+AS_VAR_COPY([$1], [pkg_cv_][$1])
+
+AS_VAR_IF([$1], [""], [$5], [$4])dnl
+])dnl PKG_CHECK_VAR
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/558?usp=3Demail
To unsubscribe, or for help writing mail filters, visit http://gerrit.openv=
pn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I34e96a225446693f401549d86d872c02427ef7d5
Gerrit-Change-Number: 558
Gerrit-PatchSet: 2
Gerrit-Owner: flichtenheld
Gerrit-Reviewer: plaisthos
Gerrit-CC: openvpn-devel
Gerrit-Attention: plaisthos
Gerrit-MessageType: newpatchset
--50hTzy6dSQg=
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Attention is currently required from: plaisthos.
flichtenheld uploaded patch set #2 to this change.
<=
p>View Ch=
ange
configure: update old copy of pkg.m4
If we copy this code, =
let's at least make sure we update
it every decade ;)
I also =
considered removing it. However, then autoconf
can't be run on syste=
ms without pkg-config installed
anymore. While that is very unusual, did=
n't see a good
reason to break that.
Change-Id: I34e96a225446=
693f401549d86d872c02427ef7d5
Signed-off-by: Frank Lichtenheld <frank@=
...2641...>
---
M m4/pkg.m4
1 file changed, 173 insertions(+), =
57 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn r=
efs/changes/58/558/2
diff --git a/m4/pkg.m4 b/m4/pkg.m4
<=
span>index cca47a7..13a8890 100644
--- a/m4/pkg.m4+++ b/m4/pkg.m4
@@ -1,29 +1,60 @@
-# pkg.m4 - Macros to locate and utilise=
pkg-config. -*- Autoconf -*-
-# serial 1 (pkg-config-0.24)
-#
-# Copyright =C2=A9 2004 Scott James Remnant <scott@...1668...>=
.
-#
-# This program is free software; you can=
redistribute it and/or modify
-# it under the terms of the GNU General Public License as publishe=
d by
-# the Free Softwa=
re Foundation; either version 2 of the License, or
-# (at your option) any later version.-#
-# This program is distributed in the hope that it =
will be useful, but
-# =
WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PAR=
TICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public Licens=
e along
-# with this pr=
ogram; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Bo=
ston, MA 02110-1301 USA.
-#
-# As a special ex=
ception to the GNU General Public License, if you
-# distribute this file as part of a program tha=
t contains a
-# configu=
ration script generated by Autoconf, you may include it under
-# the same distribution terms that =
you use for the rest of that program.
+# pkg.m4 - Macros to locate and utilise pkg-config. -*-=
Autoconf -*-
+# seri=
al 12 (pkg-config-0.29.2)
-# PKG_PROG_PKG_CONFIG([MIN-VERSION])
-# ----------------------------------=
span>
+dnl Copyright =C2=A9 =
2004 Scott James Remnant <scott@...1668...>.
+dnl Copyright =C2=A9 2012-2015 Dan Nicholson=
<dbn.lists@...277...>
+dnl
+dnl Thi=
s program is free software; you can redistribute it and/or modify
+dnl it under the terms of the=
GNU General Public License as published by
+dnl the Free Software Foundation; either version 2 =
of the License, or
+d=
nl (at your option) any later version.
+dnl
+dnl This program is distributed in the hope that it will be useful, but<=
/span>
+dnl WITHOUT ANY WARR=
ANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURP=
OSE. See the GNU
+dnl=
General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License=
+dnl along with this=
program; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place - Suite 330,=
Boston, MA
+dnl 0211=
1-1307, USA.
+dnl
+dnl As a special except=
ion to the GNU General Public License, if you
+dnl distribute this file as part of a program tha=
t contains a
+dnl con=
figuration script generated by Autoconf, you may include it under
+dnl the same distribution ter=
ms that you use for the rest of that
+dnl program.
+
+dnl PKG_P=
REREQ(MIN-VERSION)
+d=
nl -----------------------
+dnl Since: 0.29
+dnl
+dnl Verify th=
at the version of the pkg-config macros are at least
+dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONF=
IG, which checks the user's
+dnl installed version of pkg-config, this checks the developer&=
#39;s version
+dnl of=
pkg.m4 when generating configure.
+dnl
+d=
nl To ensure that this macro is defined, also add:
+dnl m4_ifndef([PKG_PREREQ],
+dnl [m4_fatal([must install pkg-=
config 0.29 or later before running autoconf/autogen])])
+dnl
+dnl See the "Since" comment for each macro y=
ou use to see what version
+dnl of the macros you require.
+m4_defun([PKG_PREREQ],
+[m4_define([PKG_MACROS_VERSION], [0.29.2])
<=
span style=3D"color: hsl(120, 100%, 40%);">+m4_if(m4_version_compare(PKG_MA=
CROS_VERSION, [$1]), -1,
+ [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS=
_VERSION[ found])])
+=
])dnl PKG_PREREQ
+
+dnl PKG_PROG_PKG_CONFI=
G([MIN-VERSION])
+dnl=
----------------------------------
+dnl Since: 0.16
+dnl
+dnl =
Search for the pkg-config tool and set the PKG_CONFIG variable to
+dnl first found in the path. =
Checks that the version of pkg-config found
+dnl is at least MIN-VERSION. If MIN-VERSION is not =
specified, 0.9.0 is
+=
dnl used since that's the first version where most current features of<=
/span>
+dnl pkg-config exist=
ed.
AC_DEFUN([PKG_PROG_PKG_CONFIG],
[m4_p=
attern_forbid([^_?PKG_[A-Z_]+$])
m4_pattern_allow([^PKG_CO=
NFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
<=
span>@@ -45,18 +76,19 @@
PKG_CONFIG=3D""
fi
fi[]dnl
-])# PKG_PROG_PKG_CONFIG
+])dnl PKG_PROG_PKG_CONFIG
-# PKG_CHECK_EXISTS(MODULES, [A=
CTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
-#
-# =
Check to see whether a particular set of modules exists. Similar
-# to PKG_CHECK_MODULES(), but d=
oes not set variables or print errors.
-#
-# P=
lease remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
=
-# only at the first occurrence i=
n configure.ac, so if the first place
-# it's called might be skipped (such as if it is within=
an "if", you
-# have to call PKG_CHECK_EXISTS manually
-# ----------------------------------------------------=
----------
+dnl PKG_C=
HECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+dnl ----------------------------=
---------------------------------------
+dnl Since: 0.18
+dnl
+=
dnl Check to see whether a particular set of modules exists. Similar to
+dnl PKG_CHECK_MODULES()=
, but does not set variables or print errors.
+dnl
+dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONF=
IG])
+dnl only at the=
first occurence in configure.ac, so if the first place
+dnl it's called might be skipped (s=
uch as if it is within an "if", you
+dnl have to call PKG_CHECK_EXISTS manually=
AC_DEFUN([PKG_CHECK_EXISTS],
[AC_REQUIRE([PKG_P=
ROG_PKG_CONFIG])dnl
if test -n "$PKG_CONFIG" &am=
p;& \
@@ -66,8 +98,10 @@
$3])dnl
fi])
-# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
-# --------------------------------=
-------------
+dnl _P=
KG_CONFIG([VARIABLE], [COMMAND], [MODULES])
+dnl ---------------------------------------------=
span>
+dnl Internal wrapper =
calling pkg-config via PKG_CONFIG and setting
+dnl pkg_failed based on the result.
m4_define([_PKG_CONFIG],
[if test -n "$$1"; =
then
pkg_cv_[]$1=3D"$$1"
@@ =
-79,10 +113,11 @@
else
pkg_failed=3D=
untried
fi[]dnl
-])# _PKG_CONFIG
+])dnl _PKG_CONFIG
-# _PKG_SHORT_ERRORS_SUPPORTED
-# -----------------------------
+dnl _PKG_SHORT_ERRORS_SUPPORTED
+dnl ------------------=
---------
+dnl Intern=
al check to see if pkg-config supports short errors.
AC_DE=
FUN([_PKG_SHORT_ERRORS_SUPPORTED],
[AC_REQUIRE([PKG_PROG_P=
KG_CONFIG])
if $PKG_CONFIG --atleast-pkgconfig-version 0.2=
0; then
@@ -90,26 +125,24 @@
else _pkg_short_errors_supported=3Dno
fi[]dnl<=
/span>
-])# _PKG_SHORT_ERRORS_=
SUPPORTED
+])dnl _PKG=
_SHORT_ERRORS_SUPPORTED
-# PKG_CHECK_MODULES(VARIABLE-PREFIX, =
MODULES, [ACTION-IF-FOUND],
-# [ACTION-IF-NOT-FOUND])
-#
-#
-# Note that if there is a possi=
bility the first call to
-# PKG_CHECK_MODULES might not happen, you should be sure to include an=
span>
-# explicit call to PKG_=
PROG_PKG_CONFIG in your configure.ac
-#
-#
-# -----------------------=
---------------------------------------
+dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION=
-IF-FOUND],
+dnl [A=
CTION-IF-NOT-FOUND])
=
+dnl --------------------------------------------------------------<=
br>+dnl Since: 0.4.0
=
+dnl
+dnl Note that if there is a possibility the fi=
rst call to
+dnl PKG_=
CHECK_MODULES might not happen, you should be sure to include an
=
+dnl explicit call to PKG_PROG_=
PKG_CONFIG in your configure.ac
AC_DEFUN([PKG_CHECK_MODULE=
S],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
=
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config]=
)dnl
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overrid=
ing pkg-config])dnl
pkg_failed=3Dno
-AC_MSG_CHECKING([for $1])<=
/span>
+AC_MSG_CHECKING([for=
$2])
_PKG_CONFIG([$1][_CFLAGS], [cflags=
], [$2])
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
=
@@ -119,11 +152,11 @@
See the pkg-config man page fo=
r more details.])
if test $pkg_failed =
=3D yes; then
- AC_M=
SG_RESULT([no])
+ =
AC_MSG_RESULT([no])
_PKG_SHORT_ERRORS_SUPPORTE=
D
if test $_pkg_short_errors_supported =3D yes; th=
en
$1[]_PKG_ERRORS=3D`$PKG_CONFIG --short-errors =
--print-errors --cflags --libs "$2" 2>&1`
- else
+ else
$1[]_=
PKG_ERRORS=3D`$PKG_CONFIG --print-errors --cflags --libs "$2" 2&g=
t;&1`
fi
# Put the nasty err=
or message in config.log where it belongs
@@ -140,7 +173,7 =
@@
_PKG_TEXT])[]dnl
])
=
elif test $pkg_failed =3D untried; then
- AC_MSG_RESULT([no])
+ AC_MSG_RESULT([no])
=
m4_default([$4], [AC_MSG_FAILURE(
[The pkg-config script=
could not be found or is too old. Make sure it
is in you=
r PATH or set the PKG_CONFIG environment variable to the full
@@ -156,4 +189,87 @@
AC_MSG_RESULT([yes])
$3
fi[]dnl
-])# PKG_CHECK_MODULES
+])dnl PKG_CHECK_MODULES
+
+
+dnl PKG_CHECK=
_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
+dnl [ACTION-IF-NOT-FOUND])
+dnl ---------------------=
------------------------------------------------
+dnl Since: 0.29
+dnl
+dnl Checks for existence of MODULES and gathers its build flags wi=
th
+dnl static librar=
ies enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags
+dnl and VARIABLE-PREFIX_LIBS from --libs=
.
+dnl
+dnl Note that if there is a possib=
ility the first call to
+dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to
+dnl include an explici=
t call to PKG_PROG_PKG_CONFIG in your
+dnl configure.ac.
+AC_DEFUN([PKG_CHECK_MODULES_STATIC],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+_save_PKG_CONFIG=3D$PKG=
_CONFIG
+PKG_CONFIG=
=3D"$PKG_CONFIG --static"
+PKG_CHECK_MODULES($@)
+PKG_CONFIG=3D$_save_PKG_CONFIG[]dnl
+])dnl PKG_CHECK_MODULES_STATIC
=
+
+
+dnl PKG_INSTALLDIR([DIRECTORY])
+dnl -------------------------
+dnl Since: 0.27
+dnl
+dnl Substitutes the variable pkgconfigdir as the location where a =
module
+dnl should in=
stall pkg-config .pc files. By default the directory is
+dnl $libdir/pkgconfig, but the default =
can be changed by passing
+dnl DIRECTORY. The user can override through the --with-pkgconfigdir<=
/span>
+dnl parameter.
+AC_DEFUN([PKG_INSTALLDIR]=
,
+[m4_pushdef([pkg_d=
efault], [m4_default([$1], ['${libdir}/pkgconfig'])])
+m4_pushdef([pkg_description],
+ [pkg-config install=
ation directory @<:@]pkg_default[@:>@])
+AC_ARG_WITH([pkgconfigdir],
+ [AS_HELP_STRING([--with-pkgconfigdir]=
, pkg_description)],,
+ [with_pkgconfigdir=3D]pkg_default)
+AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])<=
br>+m4_popdef([pkg_default])
+m4_popdef([pkg_descrip=
tion])
+])dnl PKG_INS=
TALLDIR
+
<=
span style=3D"color: hsl(120, 100%, 40%);">+
+dnl PKG_NOARCH_INSTALLDIR([DIRECTORY])
<=
span style=3D"color: hsl(120, 100%, 40%);">+dnl ---------------------------=
-----
+dnl Since: 0.2=
7
+dnl
+dnl Substitutes the variable noarc=
h_pkgconfigdir as the location where a
+dnl module should install arch-independent pkg-config .p=
c files. By
+dnl defa=
ult the directory is $datadir/pkgconfig, but the default can be
<=
span style=3D"color: hsl(120, 100%, 40%);">+dnl changed by passing DIRECTOR=
Y. The user can override through the
+dnl --with-noarch-pkgconfigdir parameter.
+AC_DEFUN([PKG_NOARCH_INSTALLDIR],
+[m4_pushdef([pkg_defau=
lt], [m4_default([$1], ['${datadir}/pkgconfig'])])
+m4_pushdef([pkg_description],=
+ [pkg-config arch-indep=
endent installation directory @<:@]pkg_default[@:>@])
+AC_ARG_WITH([noarch-pkgconfigdir],<=
/span>
+ [AS_HELP_STRING(=
[--with-noarch-pkgconfigdir], pkg_description)],,
+ [with_noarch_pkgconfigdir=3D]pkg_default)=
+AC_SUBST([noarch_pk=
gconfigdir], [$with_noarch_pkgconfigdir])
+m4_popdef([pkg_default])
+m4_popdef([pkg_description])
+])dnl PKG_NOARCH_INSTALLDIR
<=
span style=3D"color: hsl(120, 100%, 40%);">+
+
+dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
+dnl [ACTION-IF-FOUND], [ACTION-IF-NO=
T-FOUND])
+dnl ------=
-------------------------------------
+dnl Since: 0.28
+dnl
+dn=
l Retrieves the value of the pkg-config variable for the given module.
+AC_DEFUN([PKG_CHECK_VAR]=
,
+[AC_REQUIRE([PKG_P=
ROG_PKG_CONFIG])dnl
+=
AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
=
+
+_PKG_CONFIG([$1], [variable=3D"][$3]["]=
, [$2])
+AS_VAR_COPY(=
[$1], [pkg_cv_][$1])
=
+
+AS_VAR_IF([$1], [&=
quot;"], [$5], [$4])dnl
+])dnl PKG_CHECK_VAR
To view, v=
isit chan=
ge 558. To unsubscribe, or for help writing mail filters, visit settings.
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I34e96a225446693f401549d86d8=
72c02427ef7d5
Gerrit-Change-Number: 558
Gerrit-PatchSet: 2
Gerrit-Owner: flichtenheld <frank@...2723...=
.>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...=
.1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...=
ts.sourceforge.net>
Gerrit-Attention: plaisthos <arne-openvpn@...220...=
..1227...>
Gerrit-MessageType: newpatchset
--50hTzy6dSQg=--