Include PKG_CHECK_VAR macro for reading variables in .pc files

Freedesktop #48098 (https://bugs.freedesktop.org/show_bug.cgi?id=48098)
feature/tap-sh
David Michael 2012-12-12 00:42:02 +00:00 committed by William Pitcock
parent 7b322d73e8
commit f8a2519d1b
1 changed files with 15 additions and 0 deletions

15
pkg.m4
View File

@ -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])