Re: Cross compiling with pkg.m4

2008-04-20 Thread Brian Dessent
John Darrington wrote:

> pkg.m4 doesn't behave in a very rational way, when configured with
> --host=xyzzy
> 
> All the PKG_CHECK_MODULES macros continue to find the local modules,
> not the ones for target xyzzy.Consequently, the build fails when
> the compiler/linker can't find the header/library for the necessary
> packages.

These macros are not part of automake, they're maintained by the
pkg-config project, whose mailing list is pkg-config at
lists.freedesktop.org.  You might be confused because automake does
provide aclocal which is a general purpose tool for bundling macros into
aclocal.m4, but that doesn't mean automake or aclocal has anything to do
with their content.

> Of course, one can get around this by setting the PKG_CONFIG_LIBDIR
> environment variable prior to running ./configure but I think that
> most people won't know that it's necessary, and it seems redundant to
> me, because of the --host flag.

According to the pkg-config README, the way this is supposed to work
when cross compiling is to name the pkg-config script in the sysroot as
$host-pkg-config to differentiate it from the pkg-config of the build
machine and it should figure out the rest automatically.  Maybe you need
to upgrade to a later version of pkg-config.

Brian




Re: Cross compiling with pkg.m4

2008-04-20 Thread Erik de Castro Lopo
John Darrington wrote:

> pkg.m4 doesn't behave in a very rational way, when configured with
> --host=xyzzy

I successfull use pkg-config when compiling from Linux to windows
using:

./configure --host=i586-mingw32msvc --target=i586-mingw32msvc 
--build=i586-linux

My i586-mingw32msvc-pkg-config is documented here:

http://www.mega-nerd.com/erikd/Blog/CodeHacking/MinGWCross/pkg-config.html

Erik
-- 
-
Erik de Castro Lopo
-
"We can build a better product than Linux" -- Microsoft
Corp.'s Windows operating-system chief, Jim Allchin.
One has to wonder why, with their huge resources, they haven't.




Cross compiling with pkg.m4

2008-04-20 Thread John Darrington
pkg.m4 doesn't behave in a very rational way, when configured with
--host=xyzzy


All the PKG_CHECK_MODULES macros continue to find the local modules,
not the ones for target xyzzy.Consequently, the build fails when
the compiler/linker can't find the header/library for the necessary
packages.

Of course, one can get around this by setting the PKG_CONFIG_LIBDIR
environment variable prior to running ./configure but I think that
most people won't know that it's necessary, and it seems redundant to
me, because of the --host flag.  

Shouldn't PKG_CONFIG_* find only packages pertaining to
the target architecture?

J'

-- 
PGP Public key ID: 1024D/2DE827B3 
fingerprint = 8797 A26D 0854 2EAB 0285  A290 8A67 719C 2DE8 27B3
See http://pgp.mit.edu or any PGP keyserver for public key.




signature.asc
Description: Digital signature