Correct default paths on W32

LRN lrn1986 at gmail.com
Sat Mar 30 10:52:25 PDT 2013


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I've noticed gcc complaining about escaping of some strings during
pkg-config building (it complained that it doesn't know what "\/"
escape means), and it brought me to default paths:
PKG_CONFIG_PC_PATH
PKG_CONFIG_SYSTEM_INCLUDE_PATH
PKG_CONFIG_SYSTEM_LIBRARY_PATH

PKG_CONFIG_PC_PATH is not a problem - on W32 it's detected at runtime.
The other two, however... They are passed by command line. That has a
consequence of invoking MSYS path mangling, so gcc gets DOS-style
paths in their place. That is, absolute paths.

PKG_CONFIG_SYSTEM_INCLUDE_PATH and PKG_CONFIG_SYSTEM_LIBRARY_PATH are
used to remove -I and -L flags that point to default system dirs.
Since pkg-config IS supposed to be relocatable on W32, using absolute
paths for that flag-removal functionality means that this
functionality is practically broken.

I see two ways of fixing this:
1) On W32, detect system include/lib paths at runtime (just use the
same prefix that PKG_CONFIG_PC_PATH uses, would be sane enough
default) and use these.
2) Keep using hardcoded paths, but pass them via config.h (or some
other header; the point is not to pass them via command line flags).
Then pkg-config can be built with default paths being
/mingw/include:/include and /mingw/lib:/lib, and if these paths get
into .pc files (they do, often), they will be removed, so path-removal
functionality will, in fact, function correctly.

(2) has some build-time implications. For example, you'll need to
reconfigure pkg-config to build with different paths (with current
system you can just pass different stuff via command line), and
variables (such as ${libdir}) will also expand during configure, not
at the moment of compiler invocation.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (MingW32)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJRVyZZAAoJEOs4Jb6SI2CwBlEH/2NQvWmdLJCpSuJgqr0ohnMi
ysLZA6LAnSafM/192mj79tTLDPPPC5w5xGQ0Z2gQkzkSx3yAg/FUF2v0/7iOZmU6
XbFXm5TIv047R4ami1F8ay9YZgI+9udphMlKfZY+XPxID4EGJmlkmB5QJMe98fkM
Y73T8bVXI4X2eUrv7C/o0Rlbjgnvl7EhjE+Kynirp/B4GzsnwKOcl688PWgkG4Bt
ccZufOd3YHTte8VVdyuZWde+dLoQNkMDNumool8URyicvyijLM6XlY4yXS00ketX
mrk+bKm5SwyRPqZ7lhqgXJ1QZp5ALUIPPBero9hspc0xrFeq5xDcQr4CPUCxWzU=
=mz21
-----END PGP SIGNATURE-----


More information about the pkg-config mailing list