On Wed, 5 Jul 2000, Bernard Dautrevaux wrote:

> > i) if --host is specified but --build isn't, we use the old
> > compile-link-and-execute test to determine whether we're cross
> > compiling or not
> 
> Here I think Mo has bring an interesting, and useful IMNSHO, idea: if --host
> is given AND we can find a compiler named $host_alias-{cc|gcc|c++|g++}, THEN
> we assume cross-compiling, even if $(CC) generates a program that can be
> run; if this compiler is not able to produce a program we should reject it
> (in the proper macro probably).

The problem with that approach is that you never really know if you
found a cross compiler unless you test it. The only way we can test
it is to try to run it. It is really lame, but I don't see how the
situation can be improved. You can't just put code into the
AC_CHECK_TOOLS macro because that macro can be used for other
tools (not just the compiler). The user could also have set
the CC env var to a cross compiler.

> I thing this is very useful, as it does usually not bring backward
> compatibility (I usually do not have an alias i686-unknown-linux-gnu-gcc to
> gcc on mya Linux box) and allo me not to need setting CC to $host_alias-gcc
> AND CC_FOR_BUILD to gcc when I want cross-compiling (which was a desired
> feature).

You don't need to set CC to get a cross compile. The current CVS
version will automatically detect and use a cross triple that
you pass in with the --host argument. End users should see no
difference from the way it worked from last week, only the implementation
has changed to support backwards compatibility in the case that
a cross compiler was not found.

> I think the difference between Mo's idea and your's is that "detecting" a
> cross compiler for Mo is finding $host_alias-gcc while for you it is finding
> a compiler that generates non-executable files...

No the behavior from last week was to always cross compile when --host
is given. Now the behavior is to cross compile when --host is given
and the compiler is a cross compiler. The way you know it is a cross
compiler is the same old "try to run it" test.

Mo DeJong
Red Hat Inc

Reply via email to