From 7f2864b5b1b1174846c3131f6c3962bd3806da72 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Sat, 11 Feb 2023 00:26:08 +0100 Subject: [PATCH] acinclude.m4: add local copy of PKG_CHECK_VAR Just in case an old distro tries to autoreconf and doesn't come with newer pkg_ macros. --- acinclude.m4 | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/acinclude.m4 b/acinclude.m4 index 4ac611dd2..47fdd59c3 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -62,6 +62,24 @@ AC_DEFUN([AC_TRY_LDFLAGS], fi ]) + +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="][$3]["], [$2]) +AS_VAR_COPY([$1], [pkg_cv_][$1]) + +AS_VAR_IF([$1], [""], [$5], [$4])dnl +])dnl PKG_CHECK_VAR + + # =========================================================================== # http://www.gnu.org/software/autoconf-archive/ax_gcc_builtin.html # ===========================================================================