The attached patch fixes the false negative, by creating a file in the test program that is run. This should be safe because our other autoconf tests (e.g. AC_COMPUTE_INT) already assume that files can be created (via fopen/fclose) when not cross-compiling, so it's checking for a feature we rely on anyway.
The patch is against git head, and 'make check' passes for me. My copyright assignment for autoconf is already on file with the FSF for many years now.
Regards, Steven G. Johnson 2009-06-08 Steven G. Johnson <[email protected]> Create a file in test program when detecting cross-compilation. * lib/autoconf/lang.m4 (_AC_LANG_IO_PROGRAM): New macro, returns program that creates a file. (_AC_COMPILER_EXEEXT,_AC_COMPILER_EXEEXT_WORKS): Call new macro and document why it's needed to robustly detect cross-compiling. * lib/autoconf/c.m4 (_AC_LANG_IO_PROGRAM): Implement new macro. * lib/autoconf/fortran.m4 (_AC_LANG_IO_PROGRAM): Likewise. * lib/autoconf/erlang.m4 (_AC_LANG_IO_PROGRAM): Likewise.
patch.out
Description: Binary data
