Created attachment 38142 [details] [review] patch _PKG_CONFIG in pkg.m4 _PKG_CONFIG doesn't check the return results of "pkg-config --libs|--cflags" and thus fails to notice when "pkg-config --exists" succeeds, but "pkg-config --libs|--cflags" doesn't. This can happen when a package exists but one of its dependencies doesn't. I've modified the code (see attachment) to check the results. Unfortunately this turned up another feature, namely that 'pkg-config --print-errors' doesn't pick the error, so the error message that iss dumped doesn't say anything about why the check failed. I removed the redirect to /dev/null in the call to pkg-config in _PKG_CONFIG in order to display the failure. A bit of a kludge...
Running into this too with jhbuild for GNOME. jhbuild builds nspr 4.8.4 in private prefix, but does not build nss or nss-utils. Instead, my local system has nss & nss-utils, which both require nspr >= 4.8.6. So when building something inside jhbuild's prefix that wants NSS, the PKG_CHECK_MODULES(NSS, nss >= 3.11) succeeds but NSS_CFLAGS and NSS_LIBS is empty due to the dependency error: [dcbw]$ pkg-config --exists --print-errors "nss >= 3.11" [dcbw]$ echo $? 0 [dcbw]$ pkg-config --cflags --libs nss >= 3.11 Package 'NSS-UTIL' requires 'nspr >= 4.8.6' but version of NSPR is 4.8.4 [dcbw]$ echo $? 1 which makes me believe that the PKG_CHECK_MODULES should fail.
I hit this too today, seems like a good thing to fix.
This has been fixed in git.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.