Browse code

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 <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>

Juliusz Sosinowicz authored on 2021/03/19 03:12:58
Showing 1 changed files
... ...
@@ -64,6 +64,22 @@ ifdef(
64 64
 		AC_DEFUN([AC_TYPE_UINT64_T], [])
65 65
 	]
66 66
 )
67
+ifdef(
68
+	[PKG_CHECK_VAR],
69
+	,
70
+	[
71
+		AC_DEFUN([PKG_CHECK_VAR],
72
+		[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
73
+		AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])
74
+
75
+		_PKG_CONFIG([$1], [variable="][$3]["], [$2])
76
+		AS_VAR_COPY([$1], [pkg_cv_][$1])
77
+
78
+		AS_VAR_IF([$1], [""], [$5], [$4])
79
+		])
80
+	]
81
+)
82
+
67 83
 if test -z "${docdir}"; then
68 84
 	docdir="\$(datadir)/doc/\$(PACKAGE_NAME)"
69 85
 	AC_SUBST([docdir])