After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 111054 - [PENDING] PKG_CONFIG_PATH startlingly verbose even when ACTION-IF-NOT-FOUND is set
[PENDING] PKG_CONFIG_PATH startlingly verbose even when ACTION-IF-NOT-FOUND i...
Status: RESOLVED FIXED
Product: pkg-config
Classification: Deprecated
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Tollef Fog Heen
pkg-config qa
Depends on:
Blocks:
 
 
Reported: 2003-04-17 22:41 UTC by Noah Levitt
Modified: 2008-04-28 18:34 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Noah Levitt 2003-04-17 22:41:44 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.
Comment 1 Havoc Pennington 2003-04-18 03:04:03 UTC
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.
Comment 2 James Henstridge 2003-05-01 05:30:43 UTC
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.
Comment 3 James Henstridge 2003-05-01 05:40:17 UTC
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.
Comment 4 James Henstridge 2003-05-01 11:35:15 UTC
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.
Comment 5 Noah Levitt 2003-05-01 15:13:53 UTC
Yes, I see this problem with 0.15.0.
Comment 6 James Henstridge 2005-04-12 02:07:36 UTC
Reassigning open pkg-config bugs to Tollef Fog Heen (the new pkg-config
maintainer), so he can triage them.
Comment 7 Tollef Fog Heen 2007-12-29 15:21:41 UTC
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.