From: "cron2 (Code Review)" Date: Mon, 6 May 2024 16:35:11 +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="UIb1jIn/jLQ="; 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 , plaisthos Cc: openvpn-devel --UIb1jIn/jLQ= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has uploaded a new patch set (#3) to the change originally created by= flichtenheld. ( http://gerrit.openvpn.net/c/openvpn/+/558?usp=3Demail ) The following approvals got outdated and were removed: Code-Review+2 by plaisthos 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(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/58/558/3 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: newpatchset --UIb1jIn/jLQ= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 uploaded patch set #3 to the change originally cr= eated by flichtenheld.

View Change

The following approvals got outda= ted and were removed: Code-Review+2 by plaisthos

configure: update old copy of pkg.m4

If w= e 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 Lich= tenheld <frank@...2641...>
Acked-by: Arne Schwabe <arne-openvpn= @...1227...>
Message-Id: <20240506160413.7189-1-gert@...1296...>= ;
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/= msg28631.html
Signed-off-by: Gert Doering <gert@...1296...>
---=
M m4/pkg.m4
1 file changed, 173 insertions(+), 57 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/58/558/3<=
/pre>
-# 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 an= d/or modify
-# it under= the terms of the GNU General Public License as published by
-# the Free Software Foundation; eith= er 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 WARRANT= Y; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. S= ee the GNU
-# General P= ublic License for more details.
-#
-# You shou= ld have received a copy of the GNU General Public License along
<= span style=3D"color: hsl(0, 100%, 40%);">-# with this program; if not, writ= e 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 gener= ated by Autoconf, you may include it under
-# the same distribution terms that you use for the res= t of that program.
+#= pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
+# serial 12 (pkg-config-0= .29.2)

-# ----------------------------------
+dnl Copyright =C2=A9 2004 Scott James Re= mnant <scott@...1668...>.
+dnl Copyright =C2=A9 2012-2015 Dan Nicholson <dbn.lists@...1665...= 77...>
+dnl=
+dnl This program is free s= oftware; 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<= /span>
+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 Lic= ense for more details.
+dnl You shoul= d have received a copy of the GNU General Public License
+dnl along with this program; if not, w= rite to the Free Software
+dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA<= br>+dnl 02111-1307, USA.=
+dnl
+dnl As a special exception to the GNU Gen= eral 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 fo= r the rest of that
+d= nl program.
+<= br>+dnl PKG_PREREQ(MIN-VERSION)=
+dnl ---------------= --------
+dnl Since: = 0.29
+dnl
<= span style=3D"color: hsl(120, 100%, 40%);">+dnl Verify that the version of = the pkg-config macros are at least

+dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks th= e user's
+dnl ins= talled version of pkg-config, this checks the developer's version
+dnl of pkg.m4 when genera= ting configure.
+dnl<= /span>
+dnl To ensure that t= his macro is defined, also add:
+dnl m4_ifndef([PKG_PREREQ],
+dnl [m4_fatal([must install pkg-config 0.29 or late= r before running autoconf/autogen])])
+dnl
+dnl See the "Since" comment for each macro you use to see what = version
+dnl of the m= acros you require.
+m= 4_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_VERSION[ 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 ver= sion 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([^_?P= KG_[A-Z_]+$])
m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|= SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|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], [A= CTION-IF-NOT-FOUND])
-#=
-# Check to see whethe= r a particular set of modules exists. Similar
-# to PKG_CHECK_MODULES(), but does not set variabl= es or print errors.
-#<= /span>
-# Please remember that= m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
-# only at the first occurrence in configure.ac, so = if the first place
-# i= t's called might be skipped (such as if it is within an "if",= you
-# have to call PK= G_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 wh= ether a particular set of modules exists. Similar to
+dnl PKG_CHECK_MODULES(), but does not set= variables or print errors.
+dnl
+dnl Plea= se remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+dnl only at the first occurence i= n configure.ac, so if the first place

+dnl it's called might be skipped (such as if it is wi= thin an "if", you
+dnl have to call PKG_CHECK_EXISTS manually
AC_DEFU= N([PKG_CHECK_EXISTS],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dn= l
if test -n "$PKG_CONFIG" && \@@ -66,8 +98,10 @@
$3])dnl
fi])=

-# _= PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
-# ---------------------------------------------

+dnl _PKG_CONFIG([VARIABL= E], [COMMAND], [MODULES])
+dnl ---------------------------------------------
+dnl Internal wrapper calling pkg-config= via PKG_CONFIG and setting
+dnl pkg_failed based on the result.
m4_define([_PK= G_CONFIG],
[if test -n "$$1"; then
pkg_cv_[]$1=3D"$$1"
@@ -79,10 +113,11 @@<= /span>
else
pkg_failed=3Duntried
= fi[]dnl
-])# _PK= G_CONFIG
+])dnl _PKG_= CONFIG

-# -----------------------------
+dnl _PKG_SHORT_ERRORS_SUPPORTED
+dnl ---------------------------+dnl Internal check to see if= pkg-config supports short errors.
AC_DEFUN([_PKG_SHORT_ER= RORS_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_SUPP= ORTED


-# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-I= F-FOUND],
-# [ACTION-IF= -NOT-FOUND])
-#<= br>-#
-# Note that if there is a possibility the first c= all to
-# PKG_CHECK_MOD= ULES 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 migh= t 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])dn= l


pkg_failed=3Dno
-AC_MSG_CHECKING([for $1])
+AC_MSG_CHECKING([for $2])
<= span>
_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 confi= g.log where it belongs
@@ -140,7 +173,7 @@
= _PKG_TEXT])[]dnl
])
elif test $p= kg_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 P= KG_CONFIG environment variable to the full
@@ -156,4 +189,8= 7 @@
AC_MSG_RESULT([yes])
$3
fi[]dnl
-= ])# PKG_CHECK_MODULES
+])dnl PKG_CHECK_MODULES
+
+
+dnl PKG_CHECK_MODULES_STATIC(VAR= IABLE-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 V= ARIABLE-PREFIX_CFLAGS from --cflags
+dnl and VARIABLE-PREFIX_LIBS from --libs.
+dnl
+dnl Note that if there is a possibility the first cal= l to
+dnl PKG_CHECK_M= ODULES_STATIC might not happen, you should be sure to
+dnl include an explicit call to PKG_PROG_= PKG_CONFIG in your
+d= nl 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($@)
+PK= G_CONFIG=3D$_save_PKG_CONFIG[]dnl
+])dnl PKG_CHECK_MODULES_STATIC
+
+
+dnl PKG_INSTA= LLDIR([DIRECTORY])
+d= nl -------------------------
+dnl Since: 0.27
+dnl
+dnl Substit= utes 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 pa= ssing
+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 @&= lt;:@]pkg_default[@:>@])
+AC_ARG_WITH([pkgconfigdir],
+ [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)= ],,
+ [with_pkgcon= figdir=3D]pkg_default)
+m4_popdef([pkg_default])
+m4_popdef([pkg_description])
<= span style=3D"color: hsl(120, 100%, 40%);">+])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 ov= erride through the
+d= nl --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 installatio= n directory @<:@]pkg_default[@:>@])
+AC_ARG_WITH([noarch-pkgconfigdir],
+ [AS_HELP_STRING([--with-noarch-pkg= configdir], pkg_description)],,
+ [with_noarch_pkgconfigdir=3D]pkg_default)
+AC_SUBST([noarch_pkgconfigdir], [$wit= h_noarch_pkgconfigdir])
+m4_popdef([pkg_default])
+m4_popdef([pkg_description])
+])dnl PKG_NOARCH_INSTALLDIR
+
+
+dnl PKG_CHEC= K_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
+dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])+dnl ------------------------= -------------------
+= dnl Since: 0.28
+dnl<= /span>
+dnl Retrieves the va= lue of the pkg-config variable for the given module.
+AC_DEFUN([PKG_CHECK_VAR],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])d= nl

+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 PK= G_CHECK_VAR

To view, visit change 558. To un= subscribe, 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: newpatchset
--UIb1jIn/jLQ=--