cross-compile and autotools howto missing

Matěj Týč matej.tyc at
Thu Oct 9 02:08:18 PDT 2008

Thank you Eric,

> which cross compiles from Linux to windows quite happily with
>    ./configure --host=i586-mingw32msvc --target=i586-pc-mingw32msvc \
>        --build=i686-pc-linux-gnu
I think that the  --target  option is redundant unless you are building a

> > The
> > pkg-config autoconf macro should set the libdir according to $prefix or
> > $host that are known.
> That would require the configure script to pass that information
> to pkg-config.

Dan just pointed out that it works if you have the correct $host-pkg-config
installed. I suggest changing
AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
AC_PATH_TOOL([PKG_CONFIG], [pkg-config], [<something>], [$prefix/bin])

The problem is that if you want to use pkg-config only on, let's say, Linux,
then, when you cross-compile to WIndows, the present behavior is that if you
don't have the $host-pkg-config, if uses your Linux pkg-config which
inevitably becomes a problem.
I think that if $host != $build, you want to use only and only your
$host-pkg-config or you want all your PKG_CHECK... tests to quietly fail.

2 Eric: I prefer using AS_IF macro instead of shell if, it looks more
compact :-)
Thank you for the example

-------------- next part --------------
An HTML attachment was scrubbed...

More information about the pkg-config mailing list