pkg-config and cross compiling

Tollef Fog Heen tfheen at
Sun Mar 23 11:53:50 PDT 2008

* Erik de Castro Lopo 

| so that PKG_CONFIG_LIBDIR and PKG_CONFIG_PATH get set to MinGW
| specific values. AFAIAC this works well.
| The problem is that anyone who uses a lot of cross compilers will
| end up with a bunch of XXXXX-pkg-config scripts which is just like
| the problem the pkg-config was originally created to avoid.
| Is there a better solution?

Two options:

- Set PKG_CONFIG_SYSROOT_DIR to /usr/i586-mingw32msvc  (you need to
  pull pkg-config from bzr for this to work correctly; there is a bug
  in 0.23 and I haven't yet gotten around to releasing 0.24).

- Compile a pkg-config where you pass --with-pc-path to configure
  pointing that to /usr/i586-mingw32msvc/lib and set PKG_CONFIG in
  your build environment.

Another option would be to have --host/--target support added to
pkg.m4 and the have a pkg-config with your paths compiled in located
in /usr/i586-mingw32msvc/bin.  This requires rerunning aclocal and
auto* to take effect, so it's not a short-term solution.  Patches for
this accepted. :-)

Tollef Fog Heen
UNIX is user friendly, it's just picky about who its friends are

More information about the pkg-config mailing list