autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: pkg-config wisdom


From: William Pursell
Subject: Re: pkg-config wisdom
Date: Sat, 24 Oct 2009 20:45:21 -1000
User-agent: Thunderbird 2.0.0.23 (Macintosh/20090812)

Alfred M. Szmidt wrote:
>    > pkg-config tries to solve an important problem, but it does so in the
>    > wrong way.  pkg-config checks for an exact library name, 
> 
>    PKG_CHECK_MODULES does not check for a library name at all,
>    but for the name of the .pc file.  This gives the administrator
>    one extra level of indirection.
> 
> The .pc file specifies the library name, so my point stands.  A user
> cannot modify the .pc files, so it makes it hard to modify that file
> for a user without setting PKG_CONFIG_PATH or similar, in which case
> you are back to square one with CFLAGS/LDFLAGS which are far more
> flexible.

I don't understand what is wrong with setting PKG_CONFIG_PATH.  Is
your argument merely that pkg-config is less well known than
the traditional methods, and therefore broken?  Setting PKG_CONFIG_PATH
is no more difficult than setting CFLAGS.  In fact, it strikes
me that using pkg-config is more flexible than using CFLAGS/LDFLAGS,
since the user can set PKG_CONFIG_PATH to gain complete control
of the contents of the .pc files and could
then make FOO_CFLAGS and FOO_LIBS be always
empty, and could then control the configury with CFLAGS/LDFLAGS if
so desired.  If the maintainer uses pkg-config, the user
can do everything that can be done with a traditional
setup, but the converse is not true--therefore packages using
pkg-config are more flexible.   The only drawback is that if
the user tweaks the .pc files in this way and the package
maintainer merely invokes PKG_CHECK_MODULES and does
not perform any additional tests to check the api,
then the build will fail.

> pkg-config is simply broken in far to many ways.

I've only seen one way in which pkg-config is deficient,
and that is that PKG_CHECK_MODULES does not actually
check that the library as specified in the .pc file
exists and can be succesfully linked against.  Rather,
the user is assumed to be competent.  In that sense,
it is very much in keeping with the autoconf philosophy.

In what ways, other than "not being in step with the
autoconf philosophy" is pkg-config actually broken?
It seems that if PKG_CHECK_MODULES were simply
expanded to invoke AC_LINK_IFELSE to check that
the contents of the .pc files are valid, then
there would be no issue at all.

-- 
William Pursell




reply via email to

[Prev in Thread] Current Thread [Next in Thread]