RFC: PKG_CHECK_MODULES() should honor ${libdir} and ${datadir}

Benjamin Otte otte at gnome.org
Fri Mar 26 06:37:34 PDT 2010


Recently complained[1] on the Cairo mailing list about not being able
to compile into a custom prefix. It turned out he hadn't yet learned
about the need to set PKG_CONFIG_PATH when running configure. In the
discussion following that, someone asked why configure didn't look
into prefix by default[2], as that seems like a natural thing to do.

So I'm proposing that the pkg-config autotools macros should add
${libdir}/pkgconfig and ${datadir}/pkgconfig to the paths they look in
for pc files, preferring them to the default paths, but preferring
user-set environment variables.

This should get rid of the need to set PKG_CONFIG_PATH in a lot of
cases where people custom-compile software. I suppose jhbuild wouldn't
need to set it anymore. But most importantly it wouldn't require new
users who try to setup some libraries for their custom hacking to
learn about PKG_CONFIG_PATH.

I talked to Tollef about this on IRC and he liked the idea in general.
But we were both not sure if this could have any unwanted side
effects. So I'm asking here if anyone thinks this is a bad idea. If
so, please speak up now before I dust off my m4-fu and try to come up
with a patch.


[1]: http://lists.cairographics.org/archives/cairo/2010-March/019595.html
[2]: http://lists.cairographics.org/archives/cairo/2010-March/019596.html

More information about the pkg-config mailing list