2007-01-11 Stepan Kasal * doc/autoconf.texi (Specifying Names): Remove the backward compatibility remark about `--host'. * lib/autoconf/general.m4 (_AC_INIT_PARSE_ARGS): When --host is given, but not --build, set cross_compiling=yes and issue a notice, but no warning. * lib/autoconf/lang.m4 (_AC_COMPILER_EXEEXT_WORKS): Remove the special code for cross_compiling=maybe. Index: doc/autoconf.texi =================================================================== RCS file: /cvsroot/autoconf/autoconf/doc/autoconf.texi,v retrieving revision 1.1125 diff -u -r1.1125 autoconf.texi --- doc/autoconf.texi 8 Jan 2007 19:54:10 -0000 1.1125 +++ doc/autoconf.texi 11 Jan 2007 16:41:49 -0000 @@ -15511,7 +15511,7 @@ @section Specifying the System Type @cindex System type -Like other @acronym{GNU} @command{configure} scripts, Autoconf-generated +Autoconf-generated @command{configure} scripts can make decisions based on a canonical name for the system type, which has the form: @address@hidden@address@hidden, where @var{os} can be @@ -15542,26 +15542,6 @@ produce code (rarely needed). By default, it is the same as host. @end table -If you mean to override the result of @command{config.guess}, use address@hidden, not @option{--host}, since the latter enables -cross-compilation. For historical reasons, passing @option{--host} also -changes the build type. Therefore, whenever you specify @option{--host}, -be sure to specify @option{--build} too; this will be fixed in the -future. So, to enter cross-compilation mode, use a command like this - address@hidden -./configure --build=i686-pc-linux-gnu --host=m68k-coff address@hidden example - address@hidden -Note that if you do not specify @option{--host}, @command{configure} -fails if it can't run the code generated by the specified compiler. For -example, configuring as follows fails: - address@hidden -./configure CC=m68k-coff-gcc address@hidden example - In the future, when cross-compiling Autoconf will @emph{not} accept tools (compilers, linkers, assemblers) whose name is not prefixed with the host type. The only case when this may be Index: lib/autoconf/general.m4 =================================================================== RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/general.m4,v retrieving revision 1.947 diff -u -r1.947 general.m4 --- lib/autoconf/general.m4 10 Jan 2007 17:59:57 -0000 1.947 +++ lib/autoconf/general.m4 11 Jan 2007 16:41:52 -0000 @@ -915,12 +915,11 @@ # FIXME: To remove some day. if test "x$host_alias" != x; then - if test "x$build_alias" = x; then - cross_compiling=maybe - AC_MSG_WARN([If you wanted to set the --build type, don't use --host. - If a cross compiler is detected then cross compile mode will be used.]) - elif test "x$build_alias" != "x$host_alias"; then + if test "x$build_alias" != "x$host_alias"; then cross_compiling=yes + if test "x$build_alias" = x; then + AC_MSG_NOTICE([--host used, supposing cross compile.]) + fi fi fi Index: lib/autoconf/lang.m4 =================================================================== RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/lang.m4,v retrieving revision 1.186 diff -u -r1.186 lang.m4 --- lib/autoconf/lang.m4 17 Nov 2006 21:04:54 -0000 1.186 +++ lib/autoconf/lang.m4 11 Jan 2007 16:41:52 -0000 @@ -542,19 +542,13 @@ [# Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. AC_MSG_CHECKING([whether the _AC_LANG compiler works]) -# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. -if test "$cross_compiling" != yes; then - if _AC_DO_TOKENS([./$ac_file]); then - cross_compiling=no - else - if test "$cross_compiling" = maybe; then - cross_compiling=yes - else - AC_MSG_FAILURE([cannot run _AC_LANG compiled programs. +if test "$cross_compiling" = no; then + _AC_DO_TOKENS([./$ac_file]) || { + AC_MSG_RESULT([no]) + AC_MSG_FAILURE([cannot run _AC_LANG compiled programs. If you meant to cross compile, use `--host'.]) - fi - fi + } fi AC_MSG_RESULT([yes]) ])# _AC_COMPILER_EXEEXT_WORKS