mingw-cross-env-list
[Top][All Lists]
Advanced

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

[Mingw-cross-env-list] Compiling pkg-config considered harmful :-)


From: Dmitry Groshev
Subject: [Mingw-cross-env-list] Compiling pkg-config considered harmful :-)
Date: Sat, 6 Feb 2010 22:03:24 +0300

Hello!

While working on a SlackBuild for MinGW for my own use, I used
mingw-cross-env as one source of inspiration. And during the process,
it came to my notice that target pkg-config which mingw-cross-env
creates, is in fact working wrong. That is, it still is adding  to its
search list all the host directories listed in PKG_CONFIG_PATH - which
is easily ascertained by running this command:

PKG_CONFIG_DEBUG_SPEW=1 i686-pc-mingw32-pkg-config 2>&1 | more

Maybe on some system which doesn't define PKG_CONFIG_PATH it could
still work, but here on Slackware it gets utterly confused, returning
info about a library (say, "gtk+-2.0 --libs") from the host instead of
the target. Because PKG_CONFIG_PATH is searched _before_ the builtin
path, and host .pc files found there take precedence over the target
ones which get to be searched later on.

The solution to this problem is simple. Refrain from building the
pkg-config package altogether, and instead place this simple script in
$PREFIX/bin/$TARGET-pkg-config (naturally, substituting actual values
for $PREFIX and $TARGET in the script and its name):

-----Begin cut-----
#!/bin/sh
export PKG_CONFIG_PATH=
export PKG_CONFIG_LIBDIR=$(PREFIX)/$(TARGET)/lib/pkgconfig
exec pkg-config "$@"
-----End cut-----

-- 
-= With best regards, Dmitry Groshev =-




reply via email to

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