PKG_CHECK_MODULES(GTK, gtk+-2.0) AC_SUBST(GTK_CFLAGS) AC_SUBST(GTK_LIBS)Turns out that PKG_CHECK_MODULES in configure.ac gets translated to
pkg-config --exists --print-errors gtk+-2.0This returns 0 (success) on my machine - the gtk+-2.0.pc file is there. However, to get the CFLAGS, configure runs a different command and that returned an error:
$> pkg-config --cflags gtk+-2.0 Package libpng12 was not found in the pkg-config search path. Perhaps you should add the directory containing `libpng12.pc' to the PKG_CONFIG_PATH environment variable Package 'libpng12', required by 'GdkPixbuf', not foundAlas, this error isn't shown anywhere and it doesn't end up in the log either. What does happen though is that GTK_CFLAGS gets replaced with an empty string, causing the build error above. Once I installed the required libpng everything works fine. But if you ever run into issues where the CFLAGS aren't quite what they should be, check the pkg-config commands for success.
[Update Jun 07 2012]
As pointed out in the comments, looks like we're looking at https://bugs.freedesktop.org/show_bug.cgi?id=4738 and https://bugs.freedesktop.org/show_bug.cgi?id=43149 here.
Sounds like it would be more useful if PKG_CHECK_MODULES used --cflags then to actually ensure that dependencies are available (and hopefully also report the underlying error as a result).
ReplyDeletehttps://bugs.freedesktop.org/show_bug.cgi?id=43149
ReplyDeletehttps://bugs.freedesktop.org/show_bug.cgi?id=4738
Definitely some bugs there, but I haven't dove into that one in a while.
https://bugs.freedesktop.org/show_bug.cgi?id=4738
ReplyDeletehttps://bugs.freedesktop.org/show_bug.cgi?id=4738
Definitely some bugs, but also some tangled history. I haven't dove back into that one yet.