From f8a2519d1bd23d10ecd3cf2a19daa7f934358870 Mon Sep 17 00:00:00 2001 From: David Michael Date: Wed, 12 Dec 2012 00:42:02 +0000 Subject: [PATCH] Include PKG_CHECK_VAR macro for reading variables in .pc files Freedesktop #48098 (https://bugs.freedesktop.org/show_bug.cgi?id=48098) --- pkg.m4 | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pkg.m4 b/pkg.m4 index 0354609..75a89ec 100644 --- a/pkg.m4 +++ b/pkg.m4 @@ -197,6 +197,21 @@ m4_popdef([pkg_default]) m4_popdef([pkg_description]) ]) dnl PKG_NOARCH_INSTALLDIR + +# PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, +# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +# ------------------------------------------- +# 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 +])# PKG_CHECK_VAR + # PKG_WITH_MODULES(VARIABLE-PREFIX, MODULES, # [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND], # [DESCRIPTION], [DEFAULT])