[Top][All Lists]

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

Re: Autoconf on new platforms

From: Ralf Corsepius
Subject: Re: Autoconf on new platforms
Date: 22 Jul 2003 09:55:02 +0200

On Sun, 2003-07-20 at 16:17, Andreas Buening wrote:
> Ralf Corsepius wrote:
> > 
> > On Sat, 2003-07-19 at 13:50, Andreas Buening wrote:
> [snip]
> > > # we have memcpy()
> > > ac_cv_func_memcpy=yes
> > > # but we don't have bzero()
> > > ac_cv_func_bzero=no
> > This only works for native builds.
> Why that?
Sorry, my answer was a bit sloppy.

The actual problem is: The default "" is a configuration
table describing your native build-host. This does not have
any relation to your cross-target.

Therefore, if cross compiling, you have to setup a custom, non-default and to convince configure scripts to use the right on.

Simply running "configure --host=<host>" will pickup your build-host's and will pickup values that describe your build-host, and
not your cross-target.

IMHO, this is a defect in autoconf, but what's actually behind this is
the question "what shall a contain?":
1. build host settings?
2. target-host settings?

If 1. applies, must not contain any "features"
(ac_cv_have_<some-header> ac_cv_have_<some-feature> etc.).
If 2. applies it must not contain any tool setting (eg. Paths to tools)

Another problem is autoconf performing some wild guesses on the location
of (From an arbitrary configure script):

# Let the site file select an alternate cache file if it wants to.
# Prefer explicitly selected file to automatically selected ones.
if test -z "$CONFIG_SITE"; then
  if test "x$prefix" != xNONE; then
    CONFIG_SITE="$prefix/share/ $prefix/etc/"
for ac_site_file in $CONFIG_SITE; do
  if test -r "$ac_site_file"; then
    { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
echo "$as_me: loading site script $ac_site_file" >&6;}
    sed 's/^/| /' "$ac_site_file" >&5
    . "$ac_site_file"

With a "native style" cross configuration:
./configure CC=cross-compiler
=> The build-host native will be picked up.

With a 'cross style' cross configuration:
./configure --host=cross-target --prefix=/usr \
=> The build-host native will be picked up.

Now imagine Canadian cross-configurations (more than one target),
similar to what many cross-toolchain components apply (eg. binutils,

It depends on the details of how this Canadian cross compilation is
implemented, but the conventions applied by most toolchain
configurations will apply the build-host native

IMHO, the conclusion is: is not suitable to encode a
cross-target's features.

Actually, I strongly recommend (Personal preference) not to use in general at all. It's error-prone, hard to maintain and
(IMSHO) desturbs more than it helps.


reply via email to

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