[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: --build and --host
From: |
Ralf Corsepius |
Subject: |
Re: --build and --host |
Date: |
14 Feb 2002 16:56:43 +0100 |
Am Don, 2002-02-14 um 16.17 schrieb Steve M. Robbins:
> Hello,
>
> In case Henrique's posting wasn't clear, the question is this: is
>
> ./configure --build=foo ...
>
> different from
>
> ./configure --build=foo --host=foo ...
>
> or not?
IMO, it is supposed not to be different.
> In other words, does configure change its behaviour (e.g. go
> into "cross compiling" mode) as soon as --host is specified, even when
> the host type is the same as the build type?
AFAIR, the logic initally was supposed to be:
* If --build is passed alone, assume host==build and imply native
building.
* If --host is passed alone, guess upon build. and assume native
compilation if host_alias == build_alias.
* If --host and --build are passed, and assume native compilation if
host_alias == build_alias.
> There are conflicting pieces of evidence.
Agreed.
> The first two suggest
> that cross compiling happens only if host != build. The second
> two suggest that things change as soon as you specify --host, no
> matter what the value you give it.
You need to destinguish 3 parts:
1. The options: --host and --build
2 $host_alias, $build_alias
3. $host, $build
Autoconf internally is rather imprecise about all these, ...
Even worse, somebody had considered it to be a good idea to explicitly
pass host_alias and build_alias as environment variables, which also can
(and does) cause conflicts with deep packages.
> 1. The autoconf doc (node System Type) says
>
> If you want to _use_ a cross compiler, that generates code for a
> platform different from the build platform, you should specify the host
> platform (i.e., that on which the generated programs will eventually be
> run) with `--host=TYPE'. In this case, you should also specify the
> build platform with `--build=TYPE', because, in this case, it may not
> be possible to guess the build platform (it sometimes involves
> compiling and running simple test programs, and this can't be done if
> the compiler is a cross compiler).
>
> [ well, on second reading, I'm not sure what this says about
> host == build ... ]
>
>
> 2. The autoconf doc (node Specifying Names) says
>
> 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.
>
>
> 3. Generated configure scripts have this bit
>
> ac_tool_prefix=
> test -n "$host_alias" && ac_tool_prefix=$host_alias-
AFAIU, this is the origin of Ian's question, this thread has started
with. I think, this fragment is bogus and ought to be changed. At least
I have repeately found myself (I _am_ used to using cross-compilation)
in situations where I had to revert this change by applying custom
autoconf-macros, similar to this:
AC_DEFUN(RTEMS_CHECK_TOOL,
[
AS_IF([test "x$build_alias" != "x$host_alias"],
[rtems_tool_prefix=${ac_tool_prefix}])
AC_CHECK_PROG($1, ${rtems_tool_prefix}$2, ${rtems_tool_prefix}$2, $3,
$4)
])
> 4. Akim posted a note saying
>
> - passing --host means you cross compile (whatever the relationship
> between host and build)
> [http://sources.redhat.com/ml/autoconf/2002-02/msg00059.html]
I do not agree with this view.
> So, we really just wanted to know which is the truth?
None and all of this is true :).
The only thing that currently can be relied upon is
* --host=TARGET --build=TARGET to mean native building
* --build alone also meaning native building.
Ralf
- Re: Why was handling of program_prefix changed?, (continued)
- Re: Why was handling of program_prefix changed?, Ian Lance Taylor, 2002/02/07
- Re: Why was handling of program_prefix changed?, Akim Demaille, 2002/02/11
- Re: Why was handling of program_prefix changed?, Maciej W. Rozycki, 2002/02/11
- Re: Why was handling of program_prefix changed?, Akim Demaille, 2002/02/11
- Re: Why was handling of program_prefix changed?, Ian Lance Taylor, 2002/02/11
- Re: Why was handling of program_prefix changed?, Tom Tromey, 2002/02/11
- Re: Why was handling of program_prefix changed?, Henrique de Moraes Holschuh, 2002/02/13
- Re: Why was handling of program_prefix changed?, Ralf Corsepius, 2002/02/14
- Re: Why was handling of program_prefix changed?, Henrique de Moraes Holschuh, 2002/02/14
- --build and --host, Steve M. Robbins, 2002/02/14
- Re: --build and --host,
Ralf Corsepius <=
- Re: --build and --host, Steve M. Robbins, 2002/02/14
- Re: --build and --host, Akim Demaille, 2002/02/28
- Re: --build and --host, Henrique de Moraes Holschuh, 2002/02/28
- Re: --build and --host, Steve M. Robbins, 2002/02/28
- Re: --build and --host, Henrique de Moraes Holschuh, 2002/02/28