From: "cron2 (Code Review)" Date: Mon, 6 May 2024 16:35:14 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="KnCMWSzMdCo="; 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: flichtenheld Cc: plaisthos , openvpn-devel --KnCMWSzMdCo= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/55= 8?usp=3Demail ) 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 Acked-by: Arne Schwabe Message-Id: <20240506160413.7189-1-gert@...1296...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg28= 631.html Signed-off-by: Gert Doering --- M m4/pkg.m4 1 file changed, 173 insertions(+), 57 deletions(-) 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: 3 Gerrit-Owner: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-MessageType: merged --KnCMWSzMdCo= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 submitted this change.

View Change

configure: update old copy of pkg.m4

If= we copy this code, let's at least make sure we update
it every deca= de ;)

I also considered removing it. However, then autoconf
can&#= 39;t be run on systems without pkg-config installed
anymore. While that = is very unusual, didn't see a good
reason to break that.

Chan= ge-Id: I34e96a225446693f401549d86d872c02427ef7d5
Signed-off-by: Frank Li= chtenheld <frank@...2641...>
Acked-by: Arne Schwabe <arne-openv= pn@...1227...>
Message-Id: <20240506160413.7189-1-gert@...1296...&= gt;
URL: https://www.mail-archive.com/openvpn-devel@...475...= t/msg28631.html
Signed-off-by: Gert Doering <gert@...1296...>
-= --
M m4/pkg.m4
1 file changed, 173 insertions(+), 57 deletions(-)
=
diff --git a/m4/pkg.m4 b/m4/pkg.m4
index cca47a7..13a889= 0 100644
--- a/m4/pkg.m4
+++ b/m4/pkg.m4
@@ -1,29 +1,60 @@
-# pkg.m4 - Macros to locate and utilise pkg-config. -*= - Autoconf -*-
-# seria= l 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 mo= dify
-# it under the te= rms of the GNU General Public License as published by
-# the Free Software Foundation; either vers= ion 2 of the License, or
-#
-#= This program is distributed in the hope that it will be useful, but=
-# WITHOUT ANY WARRANTY; with= out even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the = GNU
-# General Public L= icense for more details.
-# You should have= received a copy of the GNU General Public License along
-# with this program; if not, write to th= e 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 th= at program.
+# pkg.m4= - Macros to locate and utilise pkg-config. -*- Autoconf -*-
+# serial 12 (pkg-config-0.29.2)<= /span>

-# PK= G_PROG_PKG_CONFIG([MIN-VERSION])
-# ----------------------------------
+dnl Copyright =C2=A9 2004 Scott James Remnant &= lt;scott@...1668...>.
+dnl Copyright =C2=A9 2012-2015 Dan Nicholson <dbn.lists@...277...&g= t;
+dnl
+dnl This program is free software= ; you can redistribute it and/or modify

+dnl it under the terms of the GNU General Public Licens= e as published by
+dn= l the Free Software Foundation; either version 2 of the License, or<= br>+dnl (at your option) any la= ter version.
+dnl

+dnl This program is dis= tributed in the hope that it will be useful, but
+dnl WITHOUT ANY WARRANTY; without even the imp= lied warranty of
+dnl= MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU+dnl General Public License fo= r more details.
+dnl<= /span>
+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
+d= nl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+dnl 02111-1307, USA.

+dnl
+dnl As a special exception to the GNU General Pub= lic License, if you
+= dnl distribute this file as part of a program that contains a
+dnl configuration script generate= d by Autoconf, you may include it under
+dnl the same distribution terms that you use for the re= st of that
+dnl progr= am.
+
+dnl PKG_PREREQ(MIN-VERSION)<= br>+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&#= 39;s
+dnl installed v= ersion of pkg-config, this checks the developer's version
+dnl of pkg.m4 when generating con= figure.
+dnl+dnl To ensure that this macr= o 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 Se= e the "Since" comment for each macro you use to see what version<= /span>
+dnl of the macros yo= u require.
+m4_defun(= [PKG_PREREQ],
+[m4_de= fine([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_VERSION[ found])])<= br>+])dnl PKG_PREREQ
= +
+dnl PKG_PROG_PKG_CONFIG([MIN-VERSION])
= +dnl --------------------------= --------
+dnl Since: = 0.16
+dnl
<= span style=3D"color: hsl(120, 100%, 40%);">+dnl Search for the pkg-config t= ool 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<= br>+dnl used since that's t= he first version where most current features of
+dnl pkg-config existed.
AC_DEF= UN([PKG_PROG_PKG_CONFIG],
[m4_pattern_forbid([^_?PKG_[A-Z_= ]+$])
m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_= DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
@@ -45,18 +76,19 @@
PKG_CONFIG=3D""
fi
<= span> fi[]dnl

-])# PKG_= PROG_PKG_CONFIG
+])dn= l PKG_PROG_PKG_CONFIG

-# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF= -NOT-FOUND])
-#<= br>-# Check to see whether a part= icular set of modules exists. Similar
-# to PKG_CHECK_MODULES(), but does not set variables or pr= int errors.
-#-# Please remember that m4 expa= nds AC_REQUIRE([PKG_PROG_PKG_CONFIG])
-# only at the first occurrence in configure.ac, so if the f= irst 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, [ACTIO= N-IF-FOUND], [ACTION-IF-NOT-FOUND])
+dnl -------------------------------------------------------= ------------
+dnl Sin= ce: 0.18
+dnl<= br>+dnl Check to see whether a = particular set of modules exists. Similar to
+dnl PKG_CHECK_MODULES(), but does not set variable= s or print errors.
+d= nl
+dnl Please rememb= er that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+dnl only at the first occurence in config= ure.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_C= HECK_EXISTS],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl=
if test -n "$PKG_CONFIG" && \
= @@ -66,8 +98,10 @@
$3])dnl
fi])<= br>
-# _PKG_CONF= IG([VARIABLE], [COMMAND], [MODULES])
-# ---------------------------------------------
+dnl _PKG_CONFIG([VARIABLE], [COM= MAND], [MODULES])
+dn= l ---------------------------------------------
+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
f= i[]dnl
-])# _PKG_CONFIG=
+])dnl _PKG_CONFIG

-# _PK= G_SHORT_ERRORS_SUPPORTED
+dnl _PKG_SHORT_ERRORS_SUPPORTED
+dnl ---------------------------
+dnl Internal check to see if pkg-con= fig supports short errors.
AC_DEFUN([_PKG_SHORT_ERRORS_SUP= PORTED],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then

@@= -90,26 +125,24 @@
else
_pkg_shor= t_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-FOU= ND])
-#
-#
-# Note that if there is a possibility the first call to
-# PKG_CHECK_MODULES mig= ht not happen, you should be sure to include an
-# explicit call to PKG_PROG_PKG_CONFIG in your co= nfigure.ac
-#-#
-# -------------------------------------------------= -------------
+dnl PK= G_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
+dnl [ACTION-IF-NOT-FOUND])

+dnl ---------------------= -----------------------------------------
+dnl Since: 0.4.0
+dnl
+dnl PKG_CHECK_MODULES might not ha= ppen, you should be sure to include an
+dnl explicit call to PKG_PROG_PKG_CONFIG in your configu= re.ac
AC_DEFUN([PKG_CHECK_MODULES],
[AC_R= EQUIRE([PKG_PROG_PKG_CONFIG])dnl
AC_ARG_VAR([$1][_CFLAGS],= [C compiler flags for $1, overriding pkg-config])dnl
AC_A= RG_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
i= f test $_pkg_short_errors_supported =3D yes; then
= $1[]_PKG_ERRORS=3D`$PKG_CONFIG --short-errors --print-errors --cflags --li= bs "$2" 2>&1`
- else
- = AC_MSG_RESULT([no])
-])# PKG_C= HECK_MODULES
+])dnl P= KG_CHECK_MODULES
+

+
+dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PRE= FIX, MODULES, [ACTION-IF-FOUND],
+dnl [ACTION-IF-NOT-FOUND])
+dnl -------------------------------------------------= --------------------
= +dnl Since: 0.29
+dnl=
+dnl Checks for exis= tence of MODULES and gathers its build flags with
+dnl static libraries enabled. Sets VARIABLE-P= REFIX_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_ST= ATIC might not happen, you should be sure to
+dnl include an explicit call to PKG_PROG_PKG_CONFI= G in your
+dnl config= ure.ac.
+AC_DEFUN([PK= G_CHECK_MODULES_STATIC],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+_save_PKG_CONFIG=3D$PKG_CONFIG
+PKG_CONFIG=3D"$PKG_CONFIG --static&q= uot;
+PKG_CHECK_MODUL= ES($@)
+PKG_CONFIG=3D= $_save_PKG_CONFIG[]dnl
+
+
+dnl PKG_INSTALLDIR([DIRE= CTORY])
+dnl --------= -----------------
+dn= l Since: 0.27
+dnl
+dnl Substitutes the va= riable 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 c= an override through the --with-pkgconfigdir
+dnl parameter.
+AC_DEFUN([PKG_INSTALLDIR],
+[m4_pushdef([pkg_default], [m4_default([$1], [= 9;${libdir}/pkgconfig'])])
+m4_pushdef([pkg_description],
+ [pkg-config installation directory @<:@]pkg_def= ault[@:>@])
+AC_AR= G_WITH([pkgconfigdir],
+ [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 locat= ion where a
+dnl modu= le should install arch-independent pkg-config .pc files. By
+dnl default the directory is $datad= ir/pkgconfig, but the default can be

+dnl changed by passing DIRECTORY. The user can override th= rough the
+dnl --with= -noarch-pkgconfigdir parameter.
+AC_DEFUN([PKG_NOARCH_INSTALLDIR],
+[m4_pushdef([pkg_default], [m4_default([$1], [= 9;${datadir}/pkgconfig'])])
+m4_pushdef([pkg_description],
+ [pkg-config arch-independent installation directo= ry @<:@]pkg_default[@:>@])
+AC_ARG_WITH([noarch-pkgconfigdir],
+ [AS_HELP_STRING([--with-noarch-pkgconfigdir= ], pkg_description)],,
+AC_SUBST([noarch_pkgconfigdir], [$with_noarch_= pkgconfigdir])
+m4_po= pdef([pkg_default])
+= m4_popdef([pkg_description])
+])dnl PKG_NOARCH_INSTALLDIR
+
+
+dnl PKG_CHECK_VAR(VAR= IABLE, MODULE, CONFIG-VARIABLE,
+dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+dnl ---------------------------------= ----------
+dnl Since= : 0.28
+dnl+dnl Retrieves the value of th= e pkg-config variable for the given module.
+AC_DEFUN([PKG_CHECK_VAR],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl<= br>+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])dn= l
+])dnl PKG_CHECK_VA= R

To view, visit change 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: 3
Gerrit-Owner: flichtenheld <frank@...2723...= .>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-MessageType: merged
--KnCMWSzMdCo=--