Bug 30937 - Silently empty CFLAGS and LIBS when condition has restrictions
Summary: Silently empty CFLAGS and LIBS when condition has restrictions
Status: RESOLVED DUPLICATE of bug 36039
Alias: None
Product: pkg-config
Classification: Unclassified
Component: src (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Tollef Fog Heen
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-17 08:26 UTC by Bastien Nocera
Modified: 2011-04-13 13:04 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Bastien Nocera 2010-10-17 08:26:45 UTC
consider the following configure.ac snippet:
PKG_CHECK_MODULES(CHEESE, clutter-1.0 clutter-gst-1.0)

If both are present, you should end up with CHEESE_CFLAGS and CHEESE_LIBS being set. Except if an error occurs when running --libs:

$ pkg-config --exists --print-errors "clutter-1.0 clutter-gst-1.0" && echo success
success
$ pkg-config --libs --print-errors "clutter-1.0 clutter-gst-1.0" 
Package 'clutter-gst' requires 'clutter-1.0 < 1.3.0' but version of Clutter is 1.5.3

pkg-config should check for version compatibility during --exists, and error out appropriately, otherwise configure tests will silently succeed, and CFLAGS will be empty and cause compilation failures.
Comment 1 Bastien Nocera 2010-10-18 10:27:23 UTC
Had the same problem trying to build gnome-shell:

$ pkg-config --libs gobject-2.0 gio-2.0 gio-unix-2.0 dbus-glib-1 gtk+-3.0 mutter-plugins gjs-gi-1.0 libgnome-menu gconf-2.0 gdk-x11-3.0 clutter-x11-1.0 clutter-glx-1.0 libstartup-notification-1.0 gobject-introspection-1.00
Package 'JavaScript' requires 'nspr >= 4.8.6' but version of NSPR is 4.8.4
Comment 2 Tollef Fog Heen 2011-04-13 13:04:33 UTC

*** This bug has been marked as a duplicate of bug 36039 ***


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.