2006-05-22 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. Add comment about this potential backward
incompatibility. 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-22 18:35:15.000000000 +0200
+++ lib/autoconf/lang.m4 2006-05-22 18:43:36.000000000 +0200
@@ -495,9 +495,12 @@
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=
+[# At one point in the past, the ac_cv_exeext variable could contain
+# the value `no'. This would lead to `EXEEXT = no' in a Makefile.
+# If you still have a cache file around with this value, please remove
+# the setting. 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,11 +512,13 @@
# 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
+ test "${ac_cv_exeext+set}" = set ||
+ ac_cv_exeext=`expr "$ac_file" : ['[^.]*\(\..*\)']`
+ # 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;;
@@ -529,7 +534,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 +558,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 +581,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.1021
diff -u -r1.1021 autoconf.texi
--- doc/autoconf.texi 22 May 2006 17:27:50 -0000 1.1021
+++ doc/autoconf.texi 22 May 2006 18:41:58 -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