From patchwork Thu Mar 18 18:12:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [Openvpn-devel] Add PKG_CHECK_VAR compatibility definition for old autoconf versions X-Patchwork-Submitter: Juliusz Sosinowicz X-Patchwork-Id: 1627 Message-Id: <20210318181258.89704-1-juliusz@wolfssl.com> To: openvpn-devel@lists.sourceforge.net Date: Thu, 18 Mar 2021 19:12:58 +0100 From: Juliusz Sosinowicz List-Id: PKG_CHECK_VAR is not available on older versions of autoconf. 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. Signed-off-by: Juliusz Sosinowicz Acked-By: David Sommerseth --- compat.m4 | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/compat.m4 b/compat.m4 index e54a7203..47650f6d 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])