cross-compile and autotools howto missing

Dan Nicholson dbn.lists at gmail.com
Wed Oct 8 09:51:57 PDT 2008


On Wed, Oct 8, 2008 at 4:33 AM, Matěj Týč <matej.tyc at gmail.com> wrote:
>> This may be of help:
>>
>>
>>  http://www.mega-nerd.com/erikd/Blog/CtheodeHacking/MinGWCross/pkg-config.html
>>
>> Erik
>>
> Thank you for your reply,
> I have read the article and I have realized two things:
>  1. That guy invokes pkg-config in the makefile instead of using pkg-config
> macros in configure.ac (This is a very bad practice, for instance the user
> doesn't get warning if a package is missing)
>  2. I don't want to do things that pkg-config should do by itself. The
> pkg-config autoconf macro should set the libdir according to $prefix or
> $host that are known.
> I think that this is not implemented at this moment.
> What do you think?

The pkg-config autoconf macro searches for pkg-config using
AC_PATH_TOOL. That means it will look for $host-pkg-config first
before falling back to pkg-config. So, if you can configure the build
machine so that it has $host-pkg-config is built with
--with-pc-path="$crossdir/lib/pkgconfig:$crossdir/share/pkgconfig", it
should just work. This is just like what Erik is suggesting in his
article, but without the wrapper scripts setting environment
variables. Of course, if you're using a sysroot for your cross
compile, you probably want to look into the PKG_CONFIG_SYSROOT_DIR
variable as well.

--
Dan


More information about the pkg-config mailing list