2005-06-27 Tollef Fog Heen <tfheen@err.no>

Author: tfheen
Date: 2005-06-26 22:51:05 GMT
2005-06-27  Tollef Fog Heen  <tfheen@err.no>

    * pkg.m4: Add PKG_CHECK_EXISTS to check if a module exists.
    Thanks to James Henstridge for the patch.
This commit is contained in:
Arch Librarian 2005-07-14 13:07:25 +00:00
parent a587da1739
commit 3062149924
2 changed files with 28 additions and 6 deletions

View file

@ -1,3 +1,8 @@
2005-06-27 Tollef Fog Heen <tfheen@err.no>
* pkg.m4: Add PKG_CHECK_EXISTS to check if a module exists.
Thanks to James Henstridge for the patch.
2005-06-26 Tollef Fog Heen <tfheen@err.no>
* pkg.m4: Get rid of caching again. This breaks too much stuff,

29
pkg.m4
View file

@ -43,16 +43,33 @@ if test -n "$PKG_CONFIG"; then
fi[]dnl
])# PKG_PROG_PKG_CONFIG
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
#
# Check to see whether a particular set of modules exists. Similar
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
#
#
# Similar to PKG_CHECK_MODULES, make sure that the first instance of
# this or PKG_CHECK_MODULES is called, or make sure to call
# PKG_CHECK_EXISTS manually
# --------------------------------------------------------------
AC_DEFUN([PKG_CHECK_EXISTS],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
if test -n "$PKG_CONFIG" && \
AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
m4_ifval([$2], [$2], [:])
m4_ifvaln([$3], [else
$3])dnl
fi])
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
# ---------------------------------------------
m4_define([_PKG_CONFIG],
[if test -n "$PKG_CONFIG"; then
if AC_RUN_LOG([$PKG_CONFIG --exists "$3" >/dev/null 2>&1]); then
pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
else
pkg_failed=yes
fi
else
PKG_CHECK_EXISTS([$3],
[pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
[pkg_failed=yes])
pkg_failed=untried
fi[]dnl
])# _PKG_CONFIG