Hello, Ian!
> 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.
Tests normally don't require running programs.
If you expect broken behaviour you should always test at runtime, unless
maybe it will seriously affect performance.
Things like endianess are not likely to be different if you have binary
compatability :-)
> 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).
This is a different issue. But it is not so much relevant to
cross-compilation as it seens to be.
If you compile the program on a good system and then you run it on a bad
machine, you have a problem. Both machines may have exactly the same
canonical strings, but one of then is, say, HP-UX 10.20 with fixpacks and
another one is vanilla HP-UX 10.20
My approach has always been - if a problem is known to exist on the given
architecture (e.g. sparc) that the workaround should be enabled on all
machines with the same architecture.
Autoconf doesn't deal with portability of binaries.
> If build == host, I run the test at configure time. If build != host,
Don't compare them. i386-unknown-linux-gnu != i386-unknown-linux-gnu
because different machines run different kernels.
> 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.
That's why I proposed "--cross". If people don't like how Autoconf works,
let's simpify the life for those poor guys with broken systems. People who
know what they are doing will use "--cross" when appropriate.
> 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.
Intermediate program for me is something like kaffeh - generator of
headers for Kaffe, mfmt - generator of help file for MC, generator of
Unicode tables for lynx and so on, i.e. programs that are used in the
build process, not tests.
If you persuade configure that build != host then you have to generate
those tables, help files and headers somewhere else, which is ridiculous
for e.g. i586->i386 cross-compilation.
Pavel