cross compiling, pc files and `PKG_CONFIG_SYSROOT_DIR`

jcupitt at gmail.com jcupitt at gmail.com
Fri Apr 1 03:27:53 PDT 2011


On 1 April 2011 10:22, Paul Menzel <paulepanter at users.sourceforge.net> wrote:
> So it is `datadir=/usr/share` but for cross compiling it should be `${PKG_CONFIG_SYSROOT_DIR}/usr/share`.

Perhaps you've tried this, but I usually use "--define-variable" when
cross-compiling. Before you start, set your PKG_CONFIG to be something
like:

 $ export PKG_CONFIG="pkg-config --define-variable
datadir=${PKG_CONFIG_SYSROOT_DIR}/usr/share"

and you'll override the setting in the .pc file (I've probably got the
quoting wrong).

I think you're supposed to use the syntax "--define-variable=x=y", but
that breaks some older pkg-config and always causes me trouble, so I
usually avoid it.

John


More information about the pkg-config mailing list