DESTDIR and pkg-config variables

Peter Breitenlohner peb at mppmu.mpg.de
Tue Jan 13 02:47:49 PST 2009


On Mon, 12 Jan 2009, Dan Nicholson wrote:

> On Mon, Jan 12, 2009 at 10:21 AM, Paulo César Pereira de Andrade
> <pcpa at mandriva.com.br> wrote:
>>
>> ............
>>
>>  Thanks. For simplicity, I feel tempted to remove:
>>
>> PKG_CHECK_MODULES(APPDEFS, xt)
>> appdefaultdir=$(pkg-config --variable=appdefaultdir xt)
>> AC_SUBST(appdefaultdir)
>>
>> from configure.ac, and "hardcode" Makefile.am to:
>>
>> appdefaultdir = $(datadir)/X11/app-defaults
>
> If you're going to hardcode it in Makefile.am, then there's no reason
> to do any checking or substituting in configure.
>
>>  This mainly, because in my computer I have "app-defaults"
>> directories in:
>>
>> /etc/X11/app-defaults
>> /etc/X11/<choose-some-language>/app-defaults
>> /usr/X11R6/lib/X11/app-defaults
>> /usr/share/apps/kdisplay/app-defaults
>> /usr/share/app-defaults
>> /usr/share/X11/app-defaults
>> /usr/lib/app-defaults
>> /usr/lib/X11/app-defaults
>> /opt/kde3/share/apps/kdisplay/app-defaults
>> /usr/lib/<program-name>/app-defaults
>
> Sure, but there should really only be one directory where packages
> drop their app-defaults. That's what's exposed in $PKG_CONFIG
> --variable=appdefaultdir xt. Especially since you can build libXt to
> have its search path be anything you want. Hardcoding
> $(datadir)/X11/app-defaults completely defeats the purpose of that.

The GNU coding standards state more or less explicitly that ALL installation
directories ought to derive from ${prefix}, and any violation of that most
probably interferes with distcheck.

Even "configure --prefix=FOO --exec-prefix=FOO/ARCH" is bad, that ought
to be "configure --prefix=FOO --exec-prefix='${prefix}'/ARCH".

What I have seen in several packages is, however, this:
If $prefix==/usr and and $sysconfdir==/usr/etc, then (and only then) they
substitute sysconfdir=/etc.

In the same spirit one might proceed as follows:
If the string "$PKG_CONFIG --variable=prefix xt" is a prefix of the string
"$PKG_CONFIG --variable=appdefaultdir xt", then (and only then) replace that
prefix by '${prefix}'.  This will then be compatible with distcheck!

regards
Peter Breitenlohner <peb at mppmu.mpg.de>


More information about the xorg mailing list