summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTollef Fog Heen <tfheen@err.no>2011-04-13 21:45:57 +0200
committerTollef Fog Heen <tfheen@err.no>2011-04-13 21:45:57 +0200
commit4366f5842fc6ca0432c5dfa6b6dcb20d83aa4ee8 (patch)
tree86c142da2b18cf7f8fd3bafc96cfc3c8764779fb
parentad10a808144abb4925cd16e80a694c56b4061d7f (diff)
Handle --exist working and --cflags or --libs failing
--exists no longer does a full depth traversal, which means we need to pay attention to the exit status when calling pkg-config --libs and --cflags. If those fail, we run with --cflags and --libs to get the error message before printing it out. Fixes Freedesktop #36039
-rw-r--r--pkg.m47
1 files changed, 4 insertions, 3 deletions
diff --git a/pkg.m4 b/pkg.m4
index 31169b4..a6451d8 100644
--- a/pkg.m4
+++ b/pkg.m4
@@ -72,7 +72,8 @@ m4_define([_PKG_CONFIG],
pkg_cv_[]$1="$$1"
elif test -n "$PKG_CONFIG"; then
PKG_CHECK_EXISTS([$3],
- [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
+ [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes ],
[pkg_failed=yes])
else
pkg_failed=untried
@@ -120,9 +121,9 @@ if test $pkg_failed = yes; then
AC_MSG_RESULT([no])
_PKG_SHORT_ERRORS_SUPPORTED
if test $_pkg_short_errors_supported = yes; then
- $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
+ $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
else
- $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
+ $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD