2006-05-25 Stepan Kasal and Ralf Wildenhues * lib/autoconf/lang.m4 (_AC_COMPILER_EXEEXT_DEFAULT): Drop the initialization of `ac_cv_exeext', do not override it if it was already set, unless it was set to `no', for compatibility with Autoconf-2.13, and comment this. Do not export `ac_cv_exeext', Libtool hasn't needed this for years. (_AC_COMPILER_EXEEXT_DEFAULT): Likewise, do not export it. (_AC_COMPILER_EXEEXT_WORKS, _AC_COMPILER_EXEEXT_CROSS): Typos. * doc/autoconf.texi (Compilers and Preprocessors) : Document that this test may be overridden by setting `ac_cv_exeext'. --- lib/autoconf/lang.m4 2006-05-25 12:45:55.000000000 +0200 +++ lib/autoconf/lang.m4 2006-05-25 12:42:36.000000000 +0200 @@ -495,9 +495,11 @@ rm -f $ac_rmfiles AS_IF([AC_TRY_EVAL(ac_link_default)], -[# Be careful to initialize this variable, since it used to be cached. -# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. -ac_cv_exeext= +[# Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. Because we should not override ac_cv_exeext if it was +# cached, so that the user can short-circuit this test for compilers +# unknown to Autoconf. for ac_file in $ac_files do test -f "$ac_file" || continue @@ -509,16 +511,22 @@ # certainly right. break;; *.* ) - ac_cv_exeext=`expr "$ac_file" : ['[^.]*\(\..*\)']` - # FIXME: I believe we export ac_cv_exeext for Libtool, - # but it would be cool to find out if it's true. Does anybody - # maintain Libtool? --akim. - export ac_cv_exeext + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : ['[^.]*\(\..*\)']` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. break;; * ) break;; esac -done], +done +test "$ac_cv_exeext" = no && ac_cv_exeext= +], [_AC_MSG_LOG_CONFTEST AC_MSG_FAILURE([_AC_LANG compiler cannot create executables], 77)]) ac_exeext=$ac_cv_exeext @@ -529,7 +537,7 @@ # _AC_COMPILER_EXEEXT_WORKS # ------------------------- m4_define([_AC_COMPILER_EXEEXT_WORKS], -[# Check the compiler produces executables we can run. If not, either +[# 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 @@ -553,7 +561,7 @@ # _AC_COMPILER_EXEEXT_CROSS # ------------------------- m4_define([_AC_COMPILER_EXEEXT_CROSS], -[# Check the compiler produces executables we can run. If not, either +[# Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. AC_MSG_CHECKING([whether we are cross compiling]) AC_MSG_RESULT([$cross_compiling]) @@ -576,7 +584,6 @@ case $ac_file in _AC_COMPILER_EXEEXT_REJECT ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : ['[^.]*\(\..*\)']` - export ac_cv_exeext break;; * ) break;; esac Index: doc/autoconf.texi =================================================================== RCS file: /cvsroot/autoconf/autoconf/doc/autoconf.texi,v retrieving revision 1.1023 diff -u -r1.1023 autoconf.texi --- doc/autoconf.texi 25 May 2006 08:49:02 -0000 1.1023 +++ doc/autoconf.texi 25 May 2006 10:46:59 -0000 @@ -5911,7 +5911,9 @@ All the tests for compilers (@code{AC_PROG_CC}, @code{AC_PROG_CXX}, @code{AC_PROG_F77}) define the output variable @code{EXEEXT} based on the output of the compiler, typically to the empty string if -Posix and @samp{.exe} if a @acronym{DOS} variant. +Posix and @samp{.exe} if a @acronym{DOS} variant. It can be overridden +by passing the argument @address@hidden to address@hidden @ovindex OBJEXT They also define the output variable @code{OBJEXT} based on the