RFC: pkgconfigdir: where?

Alan Coopersmith alan.coopersmith at oracle.com
Mon Mar 4 18:41:31 UTC 2024


On 3/4/24 01:49, tlaronde at kergis.com wrote:
> As written in a previous mail, I'm trying to adjust meson to provide
> the same rope as AC.
> 
> For xorg-sgml-doctools, there was a small discrepancy if the user was
> not selecting the defaults. This is easy to fix (diff attached), but I
> now wonder about pkgconfig .pc files directory.
> 
> In generated aclocal.m4, pkgconfigdir is said to be, by default,
> ${libdir}/pkgconfig, and supposed to be settable with
> --with-pkgconfigdir (it is not settable in fact: the option is not
> recognized).
> 
> We put .pc files in ${datadir}/pkgconfig. By default, datadir ==
> datarootdir, but this can be changed (with AC) so that X11 stuff is
> put in a dedicated subdir, while pkgconfig files are reachable in a
> more general dir.
> 
> In fact, on my OS (NetBSD), pkgconfig files are placed in
> ${libdir}/pkgconfig and not ${datarootdir}/pkgconfig.
> 
> So is there some rule about this for X11 stuff?

X11 follows the general rules for pkg-config file installation:
${libdir}/pkgconfig for architecture-specific stuff,
${datarootdir}/pkgconfig for architecture-independent stuff.

Normally this means if your pkgconfig file specifies linking against a
library, it goes in ${libdir} so it gets the settings right for whatever
library you're actually linking against (32-bit vs. 64-bit, cross-compiling
for another architecture, etc.).

Stuff that ends up in ${datarootdir}/pkgconfig tends to be the same for
all OS'es/CPU's, things like the xorgproto header files and the
xorg-sgml-doctools XML files, and isn't used in linking binaries.

-- 
         -Alan Coopersmith-                 alan.coopersmith at oracle.com
          Oracle Solaris Engineering - https://blogs.oracle.com/solaris



More information about the xorg-devel mailing list