pkg-config vs X11

Alexander Toresson alexander.toresson at gmail.com
Thu Oct 16 12:55:20 CEST 2008


On Thu, Oct 16, 2008 at 9:25 AM, Anders F Björklund <afb at algonet.se> wrote:
> Alexander Toresson wrote:
>
>> You could always create .pc files for the libraries in question.
>
> Create, where ? You mean as a add-on system patch for the user to
> install in /usr/X11R6/lib/pkgconfig ? Or local to xfce4-settings ?

Either in a system-wide location, or in a directory you yourself add
to PKG_CONFIG_PATH.

>> If you haven't got them, you have to either do that, or patch the
>> configure scripts -- XDT_CHECK_PACKAGE relies exclusively on
>> pkg-config for checking whether a library is installed.
>
> Well, that is what I was hoping to avoid (patching configure*),
> but if it is exclusively pkg-config that is what I'll do then.
>
> After patching (commenting out) the calls to $PKG_CONFIG, the
> port would then feed configure with the values to use instead:
>
>     configure.env-append       PKG_CONFIG_PATH="${x11prefix}/lib/pkgconfig" \
>        XI_VERSION="1.0.0" XI_CFLAGS="-I${x11prefix}/include" XI_LIBS="-L$
> {x11prefix}/lib -lXi" \
>        LIBX11_VERSION="6.2.0" LIBX11_CFLAGS="-I${x11prefix}/include"
> LIBX11_LIBS="-L${x11prefix}/lib -lX11" \
>        XRANDR_VERSION="2.0.0" XRANDR_CFLAGS="-I${x11prefix}/include"
> XRANDR_LIBS="-L${x11prefix}/lib -lXrandr"
>
> So basically falling back to -lXi -lX11 -lXrandr seem to be
> working just fine, but I might be missing a few details here...

Well, typically, -I to CFLAGS and -L and -l to LIBS is what is
required, unless the libraries and/or include files are already in a
path that is searched by your compiler, then you may only need -l.

> I do have proper .pc files for the other requirements, it is
> just X11 that is outside my control (and not being updated).
>
> --anders
>
> PS. For some reason it does have xcursor.pc installed.
>     But seems to fail to detect it anyway, typically.
>

Make sure the .pc file says that its version is big enough, and that
all requirements of it is satisfied. If any of these requirements are
not satisfied, detecting a library through pkg-config will fail.

// Alexander



More information about the Xfce4-dev mailing list