From: Juliusz Sosinowicz Date: Thu, 18 Mar 2021 18:12:58 +0000 (+0100) Subject: build: Add support for pkg-config < 0.28 for old autoconf versions X-Git-Tag: v2.6_beta1~608 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=60c18b45c04f4c86241d9f6e4dc422c5c07405a1;p=thirdparty%2Fopenvpn.git build: Add support for pkg-config < 0.28 for old autoconf versions 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 Acked-by: David Sommerseth 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 --- diff --git a/compat.m4 b/compat.m4 index e54a72031..47650f6d3 100644 --- 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])