GNOME Bugzilla – Bug 111054
[PENDING] PKG_CONFIG_PATH startlingly verbose even when ACTION-IF-NOT-FOUND is set
Last modified: 2008-04-28 18:34:51 UTC
PKG_CHECK_MODULES(RENDER, render >= 0.8, [render_found_with_pkgconfig=yes], [render_found_with_pkgconfig=no]) [...] checking for pkg-config... /usr/bin/pkg-config checking for render >= 0.8... Package render was not found in the pkg-config search path. Perhaps you should add the directory containing `render.pc' to the PKG_CONFIG_PATH environment variable No package 'render' found checking X11/extensions/render.h usability... yes [...] When there is a user-specified ACTION-IF-NOT-FOUND, it shouldn't say all this stuff. It should just say "no". The end user is liable to see this output and think there was an error when in fact there was not.
Right, it's documented in the man page to be silent in that case. Looking at pkg.m4, I don't see what's wrong offhand, it looks like it should be silent. pkg-config --exists should be silent (and is in a simple test) and then: ## If we have a custom action on failure, don't print errors, but ## do set a variable so people can do so. $1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` ifelse([$4],, [echo $$1_PKG_ERRORS]) where $4 is your action if not found. Will take more investigation I guess.
It looks like the --errors-to-stdout bit isn't working as expected: $ pkg-config --errors-to-stdout --print-errors "render >= 0.8" >/dev/null Package render was not found in the pkg-config search path. Perhaps you should add the directory containing `render.pc' to the PKG_CONFIG_PATH environment variable No package 'render' found The macro isn't expecting the above to print anything.
There are two parts to this fix: 1) make --errors-to-stdout work, so that newer pkg-config executables do the right thing with old pkg.m4 macros 2) change the pkg.m4 macro so that it doesn't rely on --errors-to-stdout. This will make it function correctly with older pkg-config executables. I'll look at doing a patch for this tonight.
It looks like the --errors-to-stdout problem looks like it was fixed in pkg-config-0.15. Noah: do you still get the error if you upgrade to 0.15? It might still be worth changing the macro.
Yes, I see this problem with 0.15.0.
Reassigning open pkg-config bugs to Tollef Fog Heen (the new pkg-config maintainer), so he can triage them.
2007-12-29 Tollef Fog Heen <tfheen@err.no> * pkg.m4: Don't use --errors-to-stdout in pkg.m4, but rather redirect stderr to stdout. This makes pkg.m4 with old (pre 0.15) pkg-config look good, and it makes newer pkg-config with ancient pkg.m4 work well. Gnome #111054 This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.