From 686142b0f5ac15ed2e759676ab6a88a6701fe9a7 Mon Sep 17 00:00:00 2001 Message-Id: <686142b0f5ac15ed2e759676ab6a88a6701fe9a7.1368844307.git.dbn.lists@gmail.com> From: Dan Nicholson Date: Fri, 17 May 2013 19:24:47 -0700 Subject: [PATCH] Error from PKG_CHECK_MODULES if either --cflags or --libs fails Older pkg-config (versions 0.24-0.26) had a bug where --exists failed to honor Requires. See commit 3ead3dfb. This means that some versions can fail --cflags but pass --libs. Ensure that PKG_CHECK_MODULES will return an error if either fails. Freedesktop #64674 (https://bugs.freedesktop.org/show_bug.cgi?id=64674) --- pkg.m4 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg.m4 b/pkg.m4 index c5b26b5..4370cf8 100644 --- a/pkg.m4 +++ b/pkg.m4 @@ -112,7 +112,9 @@ pkg_failed=no AC_MSG_CHECKING([for $1]) _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) -_PKG_CONFIG([$1][_LIBS], [libs], [$2]) +if test $pkg_failed = no; then + _PKG_CONFIG([$1][_LIBS], [libs], [$2]) +fi m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS and $1[]_LIBS to avoid the need to call pkg-config. -- 1.8.1.4