(With Debian's 0.25-1.1) First test case, mimicking the issue I had: configure.ac: --- AC_INIT PKG_PROG_PKG_CONFIG PKG_CHECK_MODULES(BUG, buga) buga.pc: --- Name: buga Description: Bug testcase A Version: 1 Requires: bugb >= 42 bugb.pc: --- Name: bugb Description: Bug testcase B Version: 1 Running that leads to: --- autoreconf -vfi && PKG_CONFIG_PATH=. ./configure && egrep 'BUG_(CFLAGS|LIBS)' config.log Removing aclocal.m4 Removing autom4te.cache/ Removing config.log Removing configure autoreconf: Entering directory `.' autoreconf: configure.ac: not using Gettext autoreconf: running: aclocal --force autoreconf: configure.ac: tracing autoreconf: configure.ac: not using Libtool autoreconf: running: /usr/bin/autoconf --force autoreconf: configure.ac: not using Autoheader autoreconf: configure.ac: not using Automake autoreconf: Leaving directory `.' checking for pkg-config... /usr/bin/pkg-config checking pkg-config is at least version 0.9.0... yes checking for BUG... yes 0 ac_cv_env_BUG_CFLAGS_set= ac_cv_env_BUG_CFLAGS_value= ac_cv_env_BUG_LIBS_set= ac_cv_env_BUG_LIBS_value= pkg_cv_BUG_CFLAGS= pkg_cv_BUG_LIBS= BUG_CFLAGS='' BUG_LIBS='' So versioned dependencies not detected, while: --- PKG_CONFIG_PATH=. pkg-config --cflags buga; echo $? Package 'buga' requires 'bugb >= 42' but version of bugb is 1 1 Is that only about versioned dependencies? No. Tweak the Requires line of buga.pc so that it looks like that instead: --- Name: buga Description: Bug testcase A Version: 1 Requires: bugc And now, running autoreconf -vfi && ./configure again leads to the same issue as before. Wild guess, that macro uses --exists, which works, but then --cflags and --libs fail. And tada, pkg.m4 agrees, pkg-config is called with: --exists --print-errors; and dependencies aren't checked.
Fixed in: commit 4366f5842fc6ca0432c5dfa6b6dcb20d83aa4ee8 Author: Tollef Fog Heen <tfheen@err.no> Date: Wed Apr 13 21:45:57 2011 +0200 Handle --exist working and --cflags or --libs failing --exists no longer does a full depth traversal, which means we need to pay attention to the exit status when calling pkg-config --libs and --cflags. If those fail, we run with --cflags and --libs to get the error message before printing it out. Fixes Freedesktop #36039
*** Bug 30937 has been marked as a duplicate of this bug. ***
*** Bug 29736 has been marked as a duplicate of this bug. ***
*** Bug 64674 has been marked as a duplicate of this bug. ***
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.