[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: autoconf and cross tools

From: Keith Marshall
Subject: Re: autoconf and cross tools
Date: Sat, 22 Mar 2008 17:49:12 +0000
User-agent: KMail/1.8.2

On Saturday 22 March 2008 07:31, Vincent Torri wrote:
> I'm porting some libraries to Windows CE using the cegcc cross
> compiling chain (using cegcc or mingw32ce compilers).
> When I use pkgconfig, the configure script displays the following
> warning:
> checking for arm-wince-cegcc-pkg-config... no

This tells us that, when your configure script checks for the presence 
of pkg-config, the test uses AC_CHECK_TOOL or AC_PATH_TOOL, to locate a 
version which is consistent with your cross-compiler tool chain, and...

> checking for pkg-config... /usr/bin/pkg-config

This tells ust that it didn't find one, but it has found, and will use, 
a native version; this may be ok, but it is likely not what you want, 

> configure: WARNING: In the future, Autoconf will not detect
> cross-tools whose name does not start with the host triplet.  If you
> think this configuration is useful to you, please write...

This is warning you that a future version of autoconf may assume that 
this behaviour is *not* what you want, but if you think it makes sense 
to mix tool chains for disparate hosts, you are invited to tell the 
autoconf maintainers why you think this is so.

> I run configure with --host=arm-wince-cegcc after having modified
> config.sub so that this host is detected correctly
> So, I think that this configuration is useful for me :) Hence i write
> to autoconf ML. Though I don't understand why :)
> So can someone explain me a bit what is that message for, and tell me
> what to do to set correctly configure (or something else) for that
> platform (if there is something to do)

To put this in context, here's an example which has caught me out more 
than once, of why it is *not* a good idea to allow detection of tools, 
for use when cross-compiling, which are not properly named with the 
host triplet as prefix:  I routinely use an i586-mingw32- prefixed tool 
chain, to build Win32 applications from a Linux build-host.  Sometimes, 
I neglect to specify an AC_CHECK_TOOL test for ar.  This comfigures to 
compile with i586-mingw32-gcc and friends, but leaves make trying to 
use the native Linux ar, to create libraries.  In this case, it isn't 
too serious; it doesn't work, but the native ar chokes on the Win32 
objects, and make barfs with a fairly obvious error message, and I'm 
easily able to remedy the problem.  However, imagine the consequences 
if it didn't fail so obviously, when running make...

So, what should you do?  Either pkg-config is generic, and doesn't 
require a cross-host specific variant to work with your tool chain, in 
which case you could use AC_CHECK_PROG rather than AC_CHECK_TOOL to 
detect it, or it is cross-host specific, in which case you could add a 
suitable variant of it to your cross-tool chain, which should be named 
with the host triplet as prefix, i.e. arm-wince-cegcc-pkg-config.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]