bug-autoconf
[Top][All Lists]
Advanced

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

removing the old build/host/target compatibility code (Was: current glib


From: Akim Demaille
Subject: removing the old build/host/target compatibility code (Was: current glibc vs debian sid)
Date: 24 Oct 2002 11:32:15 +0200
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Honest Recruiter)

| >>> "Akim" == Akim Demaille <address@hidden> writes:
| [...]
| 
|  Akim> Some people also said that they want to pretend they
|  Akim> cross-compile using their native compiling suite just to
|  Akim> be able to exercise their package in cross-compilation.
| 
|  Akim> in the end, everything amounts to: we do not want any form of educated
|  Akim> guess from configure: with --host it's cross, without, it's not.
| 
| Actually I wish this was true, in order to simulate cross
| compilation setups in Automake's test suite.
| 
| AFAICS ./configure is presently doing what other people in this
| thread want it to do: a native build when $host is set to the
| building arch.
| 
| % ./configure --host=`tools/config.guess`
| configure: WARNING: If you wanted to set the --build type, don't use --host.
|     If a cross compiler is detected then cross compile mode will be used.
| checking for a BSD-compatible install... /usr/bin/install -c
| checking whether build environment is sane... yes
| checking for gawk... gawk
| checking whether make sets ${MAKE}... yes
| checking for i686-pc-linux-gnu-strip... no
| checking for strip... strip
| checking build system type... i686-pc-linux-gnu
| checking host system type... i686-pc-linux-gnu
| checking for i686-pc-linux-gnu-gcc... no
| checking for gcc... gcc
| checking for C compiler default output... a.out
| checking whether the C compiler works... yes
| checking whether we are cross compiling... no
|                                           ^^^^
| 
| configure didn't found a cross compiler, so it assumes a native
| build :(
| 
| Is this some sort of backward compatibility heuristic that is
| planned for removal?  When?

Whenever people think we are ready...

I'm attaching the documentation, because I fear not everybody has read
it :(

| Hosts and Cross-Compilation
| ---------------------------
| 
|    Based on the experience of compiler writers, and after long public
| debates, many aspects of the cross-compilation chain have changed:
| 
|    - the relationship between the build, host, and target architecture
|      types,
| 
|    - the command line interface for specifying them to `configure',
| 
|    - the variables defined in `configure',
| 
|    - the enabling of cross-compilation mode.
| 
| 
|    The relationship between build, host, and target have been cleaned
| up: the chain of default is now simply: target defaults to host, host to
| build, and build to the result of `config.guess'.  Nevertheless, in
| order to ease the transition from 2.13 to 2.50, the following
| transition scheme is implemented.  _Do not rely on it_, as it will be
| completely disabled in a couple of releases (we cannot keep it, as it
| proves to cause more problems than it cures).
| 
|    They all default to the result of running `config.guess', unless you
| specify either `--build' or `--host'.  In this case, the default
| becomes the system type you specified.  If you specify both, and
| they're different, `configure' will enter cross compilation mode, so it
| won't run any tests that require execution.
| 
|    Hint: if you mean to override the result of `config.guess', prefer
| `--build' over `--host'.  In the future, `--host' will not override the
| name of the build system type.  Whenever you specify `--host', be sure
| to specify `--build' too.
| 
| 
|    For backward compatibility, `configure' will accept a system type as
| an option by itself.  Such an option will override the defaults for
| build, host, and target system types.  The following configure
| statement will configure a cross toolchain that will run on NetBSD/alpha
| but generate code for GNU Hurd/sparc, which is also the build platform.
| 
|      ./configure --host=alpha-netbsd sparc-gnu
| 
| 
|    In Autoconf 2.13 and before, the variables `build', `host', and
| `target' had a different semantics before and after the invocation of
| `AC_CANONICAL_BUILD' etc.  Now, the argument of `--build' is strictly
| copied into `build_alias', and is left empty otherwise.  After the
| `AC_CANONICAL_BUILD', `build' is set to the canonicalized build type.
| To ease the transition, before, its contents is the same as that of
| `build_alias'.  Do _not_ rely on this broken feature.
| 
|    For consistency with the backward compatibility scheme exposed above,
| when `--host' is specified but `--build' isn't, the build system will
| be assumed to be the same as `--host', and `build_alias' will be set to
| that value.  Eventually, this historically incorrect behavior will go
| away.
| 
| 
|    The former scheme to enable cross-compilation proved to cause more
| harm than good, in particular, it used to be triggered too easily,
| leaving regular end users puzzled in front of cryptic error messages.
| `configure' could even enter cross-compilation mode only because the
| compiler was not functional.  This is mainly because `configure' used
| to try to detect cross-compilation, instead of waiting for an explicit
| flag from the user.
| 
|    Now, `configure' enters cross-compilation mode if and only if
| `--host' is passed.
| 
|    That's the short documentation.  To ease the transition between 2.13
| and its successors, a more complicated scheme is implemented.  _Do not
| rely on the following_, as it will be removed in the near future.
| 
|    If you specify `--host', but not `--build', when `configure'
| performs the first compiler test it will try to run an executable
| produced by the compiler.  If the execution fails, it will enter
| cross-compilation mode.  This is fragile.  Moreover, by the time the
| compiler test is performed, it may be too late to modify the
| build-system type: other tests may have already been performed.
| Therefore, whenever you specify `--host', be sure to specify `--build'
| too.
| 
|      ./configure --build=i686-pc-linux-gnu --host=m68k-coff
| 
| will enter cross-compilation mode.  The former interface, which
| consisted in setting the compiler to a cross-compiler without informing
| `configure' is obsolete.  For instance, `configure' will fail if it
| can't run the code generated by the specified compiler if you configure
| as follows:
| 
|      ./configure CC=m68k-coff-gcc

I am fine with removing the old scheme for 2.55.  I'd like to have an
opinion from Alexandre Oliva (Hi pal!).




reply via email to

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