]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
build: Add support for pkg-config < 0.28 for old autoconf versions
authorJuliusz Sosinowicz <juliusz@wolfssl.com>
Thu, 18 Mar 2021 18:12:58 +0000 (19:12 +0100)
committerGert Doering <gert@greenie.muc.de>
Fri, 19 Mar 2021 07:08:10 +0000 (08:08 +0100)
The PKG_CHECK_VAR() macro is not available on versions of pkgconfig before
0.28, which breaks configure on RHEL-7, Ubuntu 16, and others.

This patch copies the definition generated by newer versions of autoconf
to be used for compatibility with older versions. Tested with automake
1.14.1-2ubuntu1 and autoconf 2.69-6 on Ubuntu 14.

Signed-off-by: Juliusz Sosinowicz <juliusz@wolfssl.com>
Acked-by: David Sommerseth <davids@openvpn.net>
Message-Id: <20210318181258.89704-1-juliusz@wolfssl.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg21708.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
compat.m4

index e54a72031b50c46bbd865f76f262bf2c5903d28e..47650f6d38a6759f2649e7b241e324767d7a3a36 100644 (file)
--- a/compat.m4
+++ b/compat.m4
@@ -64,6 +64,22 @@ ifdef(
                AC_DEFUN([AC_TYPE_UINT64_T], [])
        ]
 )
+ifdef(
+       [PKG_CHECK_VAR],
+       ,
+       [
+               AC_DEFUN([PKG_CHECK_VAR],
+               [AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+               AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])
+
+               _PKG_CONFIG([$1], [variable="][$3]["], [$2])
+               AS_VAR_COPY([$1], [pkg_cv_][$1])
+
+               AS_VAR_IF([$1], [""], [$5], [$4])
+               ])
+       ]
+)
+
 if test -z "${docdir}"; then
        docdir="\$(datadir)/doc/\$(PACKAGE_NAME)"
        AC_SUBST([docdir])