Bug 58847 - PKG_CHECK_MODULES should error if a .pc dependency is not met
Summary: PKG_CHECK_MODULES should error if a .pc dependency is not met
Status: RESOLVED DUPLICATE of bug 43149
Alias: None
Product: pkg-config
Classification: Unclassified
Component: src (show other bugs)
Version: unspecified
Hardware: Other Linux (All)
: medium normal
Assignee: pkg-config
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-29 01:47 UTC by Hashem Nasarat
Modified: 2012-12-29 13:45 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hashem Nasarat 2012-12-29 01:47:50 UTC
Running Debian Wheezy, pkg-config 0.26, autoconf 2.69.

The PKG_CHECK_MODULES autoconf macro currently does not issue an error and halt compilation when a dependency .pc file is not available.
For example, on my machine, for a particular project:

PKG_CHECK_MODULES([CAIRO], [cairo])

results in no error. However in the outputted Makefile, I see:
" PYCAIRO_CFLAGS =                                                               
  PYCAIRO_LIBS = -L/usr/lib/x86_64-linux-gnu -lcairo "

Curiously the CFLAGS was blank, resulting in a broken build. I finally debugged the issue from this:
"$ pkg-config --cflags pycairo
 Package xproto was not found in the pkg-config search path.
 Perhaps you should add the directory containing `xproto.pc'
 to the PKG_CONFIG_PATH environment variable
 Package 'xproto', required by 'Xau', not found "
and 
"$ pkg-config --libs pycairo
 -L/usr/lib/x86_64-linux-gnu -lcairo "
The solution was an incorrectly configured PKG_CONFIG_PATH variable.

I would expect that I would have gotten an error about missing xproto when I ran autoreconf, rather than having it produce a Makefile which would not compile.

Thanks!
Comment 1 Dan Nicholson 2012-12-29 13:45:58 UTC
This got fixed for pkg-config-0.27 in bug43149. I think if you try the latest release this should work correctly.

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


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.