Index: doc/autoconf.texi =================================================================== RCS file: /cvsroot/autoconf/autoconf/doc/autoconf.texi,v retrieving revision 1.804 diff -u -r1.804 autoconf.texi --- doc/autoconf.texi 19 Mar 2004 08:57:51 -0000 1.804 +++ doc/autoconf.texi 22 Mar 2004 10:46:50 -0000 @@ -12382,16 +12382,11 @@ If you mean to override the result of @command{config.guess}, use @option{--build}, not @option{--host}, since the latter enables -cross-compilation. For historical reasons, passing @option{--host} also -changes the build type. Therefore, whenever you specify @code{--host}, -be sure to specify @code{--build} too; this will be fixed in the -future. So, to enter cross-compilation mode, use a command like this +cross-compilation. For historical reasons, passing @option{--host} had +changed the build type, so whenever you specified @code{--host} you +also had to specify @code{--build} too; this is not true for scripts +generated with Autoconf 2.60 and later. 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} will fail if it can't run the code generated by the specified compiler. For example, configuring as follows will fail: @@ -14603,56 +14598,26 @@ The relationship between build, host, and target have been cleaned up: the chain of default is now simply: target defaults to host, host to -build, and build to the result of @command{config.guess}. Nevertheless, -in order to ease the transition from 2.13 to 2.50, the following -transition scheme is implemented. @emph{Do not rely on it}, as it will -be completely disabled in a couple of releases (we cannot keep it, as it -proves to cause more problems than it cures). - -They all default to the result of running @command{config.guess}, unless -you specify either @option{--build} or @option{--host}. In this case, -the default becomes the system type you specified. If you specify both, -and they're different, @command{configure} will enter cross compilation -mode, so it won't run any tests that require execution. - -Hint: if you mean to override the result of @command{config.guess}, -prefer @option{--build} over @option{--host}. In the future, address@hidden will not override the name of the build system type. -Whenever you specify @code{--host}, be sure to specify @code{--build} -too. - address@hidden 1 - -For backward compatibility, @command{configure} will accept a system -type as an option by itself. Such an option will override the -defaults for build, host, and target system types. The following -configure statement will configure a cross toolchain that will run on address@hidden/alpha but generate code for @acronym{GNU} Hurd/sparc, which is -also the build platform. +build, and build to the result of @command{config.guess}. Therefore, +if you mean to override the result of @command{config.guess}, +prefer @option{--build} over @option{--host}. @option{--host} does +not override the name of the build system type as it did in Autoconf +versions up to 2.60, so you do not need to specify @code{--build} +whenever you specify @code{--host}. + address@hidden will also accept a system type as an option +by itself. Such an option is equivalent to @code{--build} and will +override the defaults for build, host, and target system types. +The following configure statement will configure a program that +will run on address@hidden/alpha, and will be used for example if address@hidden misdetects the build platform: @example -./configure --host=alpha-netbsd sparc-gnu +./configure alpha-netbsd @end example @sp 1 -In Autoconf 2.13 and before, the variables @code{build}, @code{host}, -and @code{target} had a different semantics before and after the -invocation of @code{AC_CANONICAL_BUILD} etc. Now, the argument of address@hidden is strictly copied into @code{build_alias}, and is left -empty otherwise. After the @code{AC_CANONICAL_BUILD}, @code{build} is -set to the canonicalized build type. To ease the transition, before, -its contents is the same as that of @code{build_alias}. Do @emph{not} -rely on this broken feature. - -For consistency with the backward compatibility scheme exposed above, -when @option{--host} is specified but @option{--build} isn't, the build -system will be assumed to be the same as @option{--host}, and address@hidden will be set to that value. Eventually, this -historically incorrect behavior will go away. - address@hidden 1 - The former scheme to enable cross-compilation proved to cause more harm than good, in particular, it used to be triggered too easily, leaving regular end users puzzled in front of cryptic error messages. @@ -14664,33 +14629,17 @@ Now, @command{configure} enters cross-compilation mode if and only if @option{--host} is passed. -That's the short documentation. To ease the transition between 2.13 and -its successors, a more complicated scheme is implemented. @emph{Do not -rely on the following}, as it will be removed in the near future. - -If you specify @option{--host}, but not @option{--build}, when address@hidden performs the first compiler test it will try to run -an executable produced by the compiler. If the execution fails, it will -enter cross-compilation mode. This is fragile. Moreover, by the time -the compiler test is performed, it may be too late to modify the -build-system type: other tests may have already been performed. -Therefore, whenever you specify @code{--host}, be sure to specify address@hidden too. - address@hidden -./configure --build=i686-pc-linux-gnu --host=m68k-coff address@hidden example - address@hidden -will enter cross-compilation mode. The former interface, which -consisted in setting the compiler to a cross-compiler without informing address@hidden is obsolete. For instance, @command{configure} will -fail if it can't run the code generated by the specified compiler if you -configure as follows: address@hidden 1 address@hidden -./configure CC=m68k-coff-gcc address@hidden example +Also, in Autoconf 2.13 and before, the variables @code{build}, @code{host}, +and @code{target} had a different semantics before and after the +invocation of @code{AC_CANONICAL_BUILD} etc. Now, the argument of address@hidden is strictly copied into @code{build_alias}, and is left +empty otherwise. After the @code{AC_CANONICAL_BUILD}, @code{build} is +set to the canonicalized build type. To ease the transition, before, +its contents is the same as that of @code{build_alias}. Do @emph{not} +rely on this broken feature, though it causes little trouble and seems +unlikely to go away soon. @node AC_LIBOBJ vs LIBOBJS Index: lib/autoconf/general.m4 =================================================================== RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/general.m4,v retrieving revision 1.830 diff -u -r1.830 general.m4 --- lib/autoconf/general.m4 28 Jan 2004 22:21:16 -0000 1.830 +++ lib/autoconf/general.m4 22 Mar 2004 10:46:50 -0000 @@ -825,10 +825,9 @@ export $ac_envvar ;; *) - # FIXME: should be removed in autoconf 3.0. AC_MSG_WARN([you should use --build, --host, --target]) expr "x$ac_option" : "[.*[^-._$as_cr_alnum]]" >/dev/null && - AC_MSG_WARN([invalid host type: $ac_option]) + AC_MSG_WARN([invalid build type: $ac_option]) : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; @@ -868,15 +867,12 @@ host=$host_alias target=$target_alias -# 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 - cross_compiling=yes + if test "x$build_alias" = "x$host_alias"; then + AC_MSG_WARN([You specified --host, so cross-compile mode will be used. +If you wanted to set the --build type, you do not need --host.]) fi + cross_compiling=yes fi ac_tool_prefix= Index: lib/autoconf/lang.m4 =================================================================== RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/lang.m4,v retrieving revision 1.168 diff -u -r1.168 lang.m4 --- lib/autoconf/lang.m4 30 Jan 2004 14:21:36 -0000 1.168 +++ lib/autoconf/lang.m4 22 Mar 2004 10:46:50 -0000 @@ -513,20 +513,18 @@ [# Check 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_TRY_COMMAND([./$ac_file]); then - cross_compiling=no - else - if test "$cross_compiling" = maybe; then - cross_compiling=yes +case "$cross_compiling" in + yes) ;; + no) + if AC_TRY_COMMAND([./$ac_file]); then + : else - AC_MSG_FAILURE([cannot run _AC_LANG compiled programs. + AC_MSG_FAILURE([cannot run _AC_LANG compiled programs. If you meant to cross compile, use `--host'.]) fi - fi -fi + ;; +esac AC_MSG_RESULT([yes]) ])# _AC_COMPILER_EXEEXT_WORKS Index: tests/acprograms.at =================================================================== RCS file: /cvsroot/autoconf/autoconf/tests/acprograms.at,v retrieving revision 1.5 diff -u -r1.5 acprograms.at --- tests/acprograms.at 23 Jan 2004 08:21:51 -0000 1.5 +++ tests/acprograms.at 22 Mar 2004 10:46:50 -0000 @@ -9,6 +9,9 @@ AT_BANNER([Testing autoconf/programs macros.]) # Modern macros. +AT_CHECK_MACRO([AC_CHECK_TARGET_TOOL]) +AT_CHECK_MACRO([AC_CHECK_TARGET_TOOLS]) +AT_CHECK_MACRO([AC_PATH_TARGET_TOOL]) AT_CHECK_MACRO([AC_PROG_AWK]) AT_CHECK_MACRO([AC_PROG_FGREP]) AT_CHECK_MACRO([AC_PROG_INSTALL])