Date: Tue, 25 Apr 2000 11:26:24 -0400 (EDT)
From: Pavel Roskin <[EMAIL PROTECTED]>
> How about (under linux):
> ./configure --build=i386-pc-linux-gnu --host=i386-pc-linux-gnulibc1
>
> This definitely is cross-compilation (incompatible toolchains and
> libraries, libc6 files under /usr, libc5 files under
> /usr/i386-pc-linux-gnulibc1), but executables will run and autoconf will
> incorrectly assume native compilation.
Why incorrectly? What tests will be affected? What programs linked against
libc5 will behave differently on that machine and on a native libc5
system?
If you can run tests and intermediate programs, why should configure
forbid you doing that? Or maybe I don't understand what consequences
should cross-compiling have apart from that?
Because if you run tests and intermediate programs, you are testing
the wrong system. Perhaps the test is for some case which precisely
distinguishes the libraries. After all, I'm sure any of us could come
up with such a test. If autoconf runs that test on the build system,
it will come up with the wrong answer, and the program will be
misconfigured.
I've used tests in the past for things like the correct operation of
the system call ftime (on some versions of SCO Unix, ftime
periodically moves backward in time, which totally screwed my code).
If build == host, I run the test at configure time. If build != host,
I indicate that with a configure variable, and run the test at run
time. If autoconf outsmarted me by getting confused about whether it
was building for a different system, a test of that form would return
invalid results.
Canonical names are irrelevant to cross-compilation. If you compile a
simple portable program you don't even need to know either of those names.
You are responsible to specify the right compiler, and the compiler just
does its job.
Agreed.
As long as you don't run any intermediate programs on the build system,
you don't need to know whether you cross-compile or not.
Agreed. But if you do run intermediate programs on the build
system--i.e., you call AC_TRY_RUN--you do need to know.
Ian