Making pkgconfig easier to use with autoconf

Havoc Pennington hp at redhat.com
Wed Nov 5 01:41:32 EET 2003


On Tue, 2003-11-04 at 12:17, Carl Worth wrote:
> And I don't want to have to maintain both lists. Is there already a
> way to do this, and I'm doing something wrong? Otherwise, how hard
> would it be for the PKG_CHECK_MODULES macro to set a variable that I
> could drop into my .pc.in file, something like:
> 
> 	Requires: @PKG_CHECK_REQUIRES@

This is probably pretty easy, you just do it the same as the
FOO_LIBS/FOO_CFLAGS stuff done now. I would call the subst'd variable
FOO_REQUIRES or something.

You'll also have to have AC_SUBST(FOO_REQUIRES) in configure.in as you
do now for the LIBS/CFLAGS.

Anyway, if you look at the m4 file I bet you can make this change in 10
minutes, the only complicated part looks like how to remove the version
number checks in shell code. A robust solution to that might be for
pkg-config itself to have an --output-requires option or something.

Havoc





More information about the xdg mailing list