]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
EXEEXT and OBJEXT don't need to know $CYGWIN etc.
authorAkim Demaille <akim@epita.fr>
Wed, 13 Dec 2000 12:36:54 +0000 (12:36 +0000)
committerAkim Demaille <akim@epita.fr>
Wed, 13 Dec 2000 12:36:54 +0000 (12:36 +0000)
* acspecific.m4 (AC_EXEEXT, AC_OBJEXT, _AC_EXEEXT, _AC_OBJEXT):
Move as...
* aclang.m4 (AC_EXEEXT, AC_OBJEXT, _AC_COMPILER_EXEEXT)
(_AC_COMPILER_OBJEXT): these.
(_AC_COMPILER_EXEEXT): Use _AC_LINK_IFELSE.
Don't depend upon $CYGWIN and the like.
(_AC_COMPILER_OBJEXT): Model after _AC_COMPILER_EXEEXT.
Skip more extensions.
Use _AC_COMPILE_IFELSE.

ChangeLog
aclang.m4
acspecific.m4
doc/autoconf.texi
lib/autoconf/c.m4
lib/autoconf/fortran.m4
lib/autoconf/lang.m4
lib/autoconf/specific.m4

index f4f24ab9a0b52b27befdc3ddd47a0a1de1bc86bf..1d5bd5594095771710c4574db2a6d4022d880f4e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2000-12-13  Akim Demaille  <akim@epita.fr>
+
+       EXEEXT and OBJEXT don't need to know $CYGWIN etc.
+
+       * acspecific.m4 (AC_EXEEXT, AC_OBJEXT, _AC_EXEEXT, _AC_OBJEXT):
+       Move as...
+       * aclang.m4 (AC_EXEEXT, AC_OBJEXT, _AC_COMPILER_EXEEXT)
+       (_AC_COMPILER_OBJEXT): these.
+       (_AC_COMPILER_EXEEXT): Use _AC_LINK_IFELSE.
+       Don't depend upon $CYGWIN and the like.
+       (_AC_COMPILER_OBJEXT): Model after _AC_COMPILER_EXEEXT.
+       Skip more extensions.
+       Use _AC_COMPILE_IFELSE.
+
 2000-12-12  Pavel Roskin  <proski@gnu.org>
 
        * Makefile.am: Don't use suffix rules for perl and shell
index ed4e8ef9f80a290c0e36c8aa2efbe6b8fd49644e..7033ae7679f0c2e694459989b8953f7f7af175b4 100644 (file)
--- a/aclang.m4
+++ b/aclang.m4
@@ -613,11 +613,11 @@ AC_DEFUN_ONCE([AC_NO_EXECUTABLES],
 [m4_divert_push([KILL])
 
 AC_BEFORE([$0], [_AC_LANG_COMPILER_WORKS])
-AC_BEFORE([$0], [_AC_EXEEXT])
+AC_BEFORE([$0], [_AC_COMPILER_EXEEXT])
 
 m4_define([_AC_LANG_COMPILER_WORKS], [cross_compiling=maybe])
 
-m4_define([_AC_EXEEXT], [EXEEXT=])
+m4_define([_AC_COMPILER_EXEEXT], [EXEEXT=])
 
 m4_define([AC_LINK_IFELSE],
 [AC_FATAL([All the tests involving linking were disabled by $0])])
@@ -626,6 +626,86 @@ m4_divert_pop()dnl
 ])# # AC_NO_EXECUTABLES
 
 
+
+# ----------------------------- #
+# Computing EXEEXT and OBJEXT.  #
+# ----------------------------- #
+
+
+# Files to ignore
+# ---------------
+# Ignore .d files produced by CFLAGS=-MD.
+#
+# On UWIN (which uses a cc wrapper for MSVC), the compiler also generates
+# a .pdb file
+#
+# When the w32 free Borland C++ command line compiler links a program
+# (conftest.exe), it also produces a file named `conftest.tds' in
+# addition to `conftest.obj'
+
+
+# We must not AU define them, because autoupdate would them remove
+# them, which is right, but Automake 1.4 would remove the support for
+# $(EXEEXT) etc.
+# FIXME: Remove this once Automake fixed.
+AC_DEFUN([AC_EXEEXT],   [])
+AC_DEFUN([AC_OBJEXT],   [])
+
+
+# _AC_COMPILER_EXEEXT
+# -------------------
+# Check for the extension used for executables.  It compiles a test
+# executable.  If this is called, the executable extensions will be
+# automatically used by link commands run by the configure script.
+#
+# This macro is called by AC_LANG_COMPILER, the latter being required
+# by the AC_LINK_IFELSE macros, so use _AC_LINK_IFELSE.
+m4_define([_AC_COMPILER_EXEEXT],
+[AC_CACHE_CHECK([for executable suffix], ac_cv_exeext,
+[_AC_LINK_IFELSE([AC_LANG_PROGRAM()],
+[# If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in `ls conftest.exe conftest conftest.* 2>/dev/null`; do
+  case $ac_file in
+    *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb ) ;;
+    *) ac_cv_exeext=`expr "$ac_file" : 'conftest\(.*\)'`
+       break;;
+  esac
+done],
+              [AC_MSG_ERROR([cannot compute EXEEXT: cannot compile and link])])
+rm -f conftest$ac_cv_exeext])
+AC_SUBST([EXEEXT], [$ac_cv_exeext])dnl
+ac_exeext=$EXEEXT
+])# _AC_COMPILER_EXEEXT
+
+
+# _AC_COMPILER_OBJEXT
+# -------------------
+# Check the object extension used by the compiler: typically `.o' or
+# `.obj'.  If this is called, some other behaviour will change,
+# determined by ac_objext.
+#
+# This macro is called by AC_LANG_COMPILER, the latter being required
+# by the AC_COMPILE_IFELSE macros, so use _AC_COMPILE_IFELSE.
+m4_define([_AC_COMPILER_OBJEXT],
+[AC_CACHE_CHECK([for object suffix], ac_cv_objext,
+[_AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
+[for ac_file in `ls conftest.o conftest.obj conftest.* 2>/dev/null`; do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb ) ;;
+    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+       break;;
+  esac
+done],
+                     [AC_MSG_ERROR([cannot compute OBJEXT: cannot compile])])
+rm -f conftest.$ac_cv_objext])
+AC_SUBST([OBJEXT], [$ac_cv_objext])dnl
+ac_objext=$OBJEXT
+])# _AC_COMPILER_OBJEXT
+
+
 # -------------------- #
 # 3b. The C compiler.  #
 # -------------------- #
@@ -752,8 +832,8 @@ test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
 _AC_LANG_COMPILER_WORKS
 _AC_LANG_COMPILER_GNU
 GCC=`test $ac_compiler_gnu = yes && echo yes`
-AC_EXPAND_ONCE([_AC_OBJEXT])
-AC_EXPAND_ONCE([_AC_EXEEXT])
+AC_EXPAND_ONCE([_AC_COMPILER_OBJEXT])[]dnl
+AC_EXPAND_ONCE([_AC_COMPILER_EXEEXT])[]dnl
 _AC_PROG_CC_G
 AC_LANG_POP
 ])# AC_PROG_CC
@@ -945,8 +1025,8 @@ AC_CHECK_TOOLS(CXX,
 _AC_LANG_COMPILER_WORKS
 _AC_LANG_COMPILER_GNU
 GXX=`test $ac_compiler_gnu = yes && echo yes`
-AC_EXPAND_ONCE([_AC_OBJEXT])
-AC_EXPAND_ONCE([_AC_EXEEXT])
+AC_EXPAND_ONCE([_AC_COMPILER_OBJEXT])[]dnl
+AC_EXPAND_ONCE([_AC_COMPILER_EXEEXT])[]dnl
 _AC_PROG_CXX_G
 AC_LANG_POP
 ])# AC_PROG_CXX
@@ -1044,8 +1124,8 @@ ac_ext=F
 _AC_LANG_COMPILER_GNU
 ac_ext=$ac_save_ext
 G77=`test $ac_compiler_gnu = yes && echo yes`
-AC_EXPAND_ONCE([_AC_OBJEXT])
-AC_EXPAND_ONCE([_AC_EXEEXT])
+AC_EXPAND_ONCE([_AC_COMPILER_OBJEXT])[]dnl
+AC_EXPAND_ONCE([_AC_COMPILER_EXEEXT])[]dnl
 _AC_PROG_F77_G
 AC_LANG_POP
 ])# AC_PROG_F77
index 5b98d0086a243c17ba2447bf13de690a4fa6e2aa..55ce13a76ecb02f4f8202ec49e9afa07279af7e0 100644 (file)
@@ -1189,91 +1189,6 @@ AU_DEFUN([AC_EMXOS2],   [])
 AU_DEFUN([AC_MINGW32],  [])
 
 
-# We must not AU define them, because autoupdate would them remove
-# them, which is right, but Automake 1.4 would remove the support for
-# $(EXEEXT) etc.
-# FIXME: Remove this once Automake fixed.
-AC_DEFUN([AC_EXEEXT],   [])
-AC_DEFUN([AC_OBJEXT],   [])
-
-
-# _AC_EXEEXT
-# ----------
-# Check for the extension used for executables.  This knows that we
-# add .exe for Cygwin or mingw32.  Otherwise, it compiles a test
-# executable.  If this is called, the executable extensions will be
-# automatically used by link commands run by the configure script.
-#
-# Ignore .d files produced by CFLAGS=-MD.
-#
-# On UWIN (which uses a cc wrapper for MSVC), the compiler also generates
-# a .pdb file
-#
-# This macro is called by AC_LANG_COMPILER, the latter being required
-# by the AC_COMPILE_IFELSE macros, so use AC_TRY_EVAL.
-m4_define([_AC_EXEEXT],
-[AC_CACHE_CHECK([for executable suffix], ac_cv_exeext,
-[case "$CYGWIN $MINGW32 $EMXOS2" in
-  *yes*) ac_cv_exeext=.exe ;;
-  *)
-    AC_LANG_CONFTEST([AC_LANG_PROGRAM()])
-    if AC_TRY_EVAL(ac_link); then
-      # If both `conftest.exe' and `conftest' are `present' (well, observable)
-      # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
-      # work properly (i.e., refer to `conftest.exe'), while it won't with
-      # `rm'.
-      for ac_file in `ls conftest.exe conftest conftest.* 2>/dev/null`; do
-       case $ac_file in
-         *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb ) ;;
-         *) ac_cv_exeext=`expr "$ac_file" : 'conftest\(.*\)'`
-            break;;
-       esac
-      done
-      rm -f conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-    else
-      AC_MSG_ERROR([cannot compile and link])
-    fi
-    ;;
-esac])
-AC_SUBST([EXEEXT], [$ac_cv_exeext])dnl
-ac_exeext=$EXEEXT
-])# _AC_EXEEXT
-
-
-# _AC_OBJEXT
-# ----------
-# Check the object extension used by the compiler: typically .o or
-# .obj.  If this is called, some other behaviour will change,
-# determined by ac_objext.
-#
-# When the w32 free Borland C++ command line compiler links a program
-# (conftest.exe), it also produces a file named `conftest.tds' in
-# addition to `conftest.obj'
-#
-# Ignore .d files produced by CFLAGS=-MD.
-#
-# This macro is called by AC_LANG_COMPILER, the latter being required
-# by the AC_COMPILE_IFELSE macros, so use AC_TRY_EVAL.
-m4_define([_AC_OBJEXT],
-[AC_CACHE_CHECK([for object suffix], ac_cv_objext,
-[AC_LANG_CONFTEST([AC_LANG_PROGRAM()])
-if AC_TRY_EVAL(ac_compile); then
-  for ac_file in `ls conftest.o conftest.obj conftest.* 2>/dev/null`; do
-    case $ac_file in
-      *.$ac_ext | *.tds | *.d ) ;;
-      *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
-         break;;
-    esac
-  done
-  rm -f conftest.$ac_objext conftest.$ac_ext
-else
-  AC_MSG_ERROR([cannot compile])
-fi])
-AC_SUBST(OBJEXT, $ac_cv_objext)dnl
-ac_objext=$ac_cv_objext
-])# _AC_OBJEXT
-
-
 
 ## -------------------------- ##
 ## Checks for UNIX variants.  ##
index 14bfb2cf644b14246e7015f675965b9d869cd395..8b138410a9875a5c2ab120c9a80b27d12d01aa36 100644 (file)
@@ -4056,16 +4056,17 @@ All the tests for compilers (@code{AC_PROG_CC}, @code{AC_PROG_CXX},
 the output of the compiler, typically to the empty string if Unix and
 @samp{.exe} if Win32 or OS/2.
 
-@ovindex CYGWIN
-@ovindex EMXOS2
-@ovindex MINGW32
-They also set the shell variable @code{CYGWIN} to @samp{yes} if run in
-the Cygwin environment, @code{EMXOS2} to @samp{yes} if in the EMX
-environment on OS/2, and @code{MINGW32} to @samp{yes} with the MingW32
-compiler.
+@c FIXME:
+@c @ovindex CYGWIN
+@c @ovindex EMXOS2
+@c @ovindex MINGW32
+@c They also set the shell variable @code{CYGWIN} to @samp{yes} if run in
+@c the Cygwin environment, @code{EMXOS2} to @samp{yes} if in the EMX
+@c environment on OS/2, and @code{MINGW32} to @samp{yes} with the MingW32
+@c compiler.
 
 @ovindex OBJEXT
-Finally, they define the output variable @code{OBJEXT} based on the
+They also define the output variable @code{OBJEXT} based on the
 output of the compiler, after .c files have been excluded, typically
 to @samp{o} if Unix, @samp{obj} if Win32.
 
index ed4e8ef9f80a290c0e36c8aa2efbe6b8fd49644e..7033ae7679f0c2e694459989b8953f7f7af175b4 100644 (file)
@@ -613,11 +613,11 @@ AC_DEFUN_ONCE([AC_NO_EXECUTABLES],
 [m4_divert_push([KILL])
 
 AC_BEFORE([$0], [_AC_LANG_COMPILER_WORKS])
-AC_BEFORE([$0], [_AC_EXEEXT])
+AC_BEFORE([$0], [_AC_COMPILER_EXEEXT])
 
 m4_define([_AC_LANG_COMPILER_WORKS], [cross_compiling=maybe])
 
-m4_define([_AC_EXEEXT], [EXEEXT=])
+m4_define([_AC_COMPILER_EXEEXT], [EXEEXT=])
 
 m4_define([AC_LINK_IFELSE],
 [AC_FATAL([All the tests involving linking were disabled by $0])])
@@ -626,6 +626,86 @@ m4_divert_pop()dnl
 ])# # AC_NO_EXECUTABLES
 
 
+
+# ----------------------------- #
+# Computing EXEEXT and OBJEXT.  #
+# ----------------------------- #
+
+
+# Files to ignore
+# ---------------
+# Ignore .d files produced by CFLAGS=-MD.
+#
+# On UWIN (which uses a cc wrapper for MSVC), the compiler also generates
+# a .pdb file
+#
+# When the w32 free Borland C++ command line compiler links a program
+# (conftest.exe), it also produces a file named `conftest.tds' in
+# addition to `conftest.obj'
+
+
+# We must not AU define them, because autoupdate would them remove
+# them, which is right, but Automake 1.4 would remove the support for
+# $(EXEEXT) etc.
+# FIXME: Remove this once Automake fixed.
+AC_DEFUN([AC_EXEEXT],   [])
+AC_DEFUN([AC_OBJEXT],   [])
+
+
+# _AC_COMPILER_EXEEXT
+# -------------------
+# Check for the extension used for executables.  It compiles a test
+# executable.  If this is called, the executable extensions will be
+# automatically used by link commands run by the configure script.
+#
+# This macro is called by AC_LANG_COMPILER, the latter being required
+# by the AC_LINK_IFELSE macros, so use _AC_LINK_IFELSE.
+m4_define([_AC_COMPILER_EXEEXT],
+[AC_CACHE_CHECK([for executable suffix], ac_cv_exeext,
+[_AC_LINK_IFELSE([AC_LANG_PROGRAM()],
+[# If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in `ls conftest.exe conftest conftest.* 2>/dev/null`; do
+  case $ac_file in
+    *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb ) ;;
+    *) ac_cv_exeext=`expr "$ac_file" : 'conftest\(.*\)'`
+       break;;
+  esac
+done],
+              [AC_MSG_ERROR([cannot compute EXEEXT: cannot compile and link])])
+rm -f conftest$ac_cv_exeext])
+AC_SUBST([EXEEXT], [$ac_cv_exeext])dnl
+ac_exeext=$EXEEXT
+])# _AC_COMPILER_EXEEXT
+
+
+# _AC_COMPILER_OBJEXT
+# -------------------
+# Check the object extension used by the compiler: typically `.o' or
+# `.obj'.  If this is called, some other behaviour will change,
+# determined by ac_objext.
+#
+# This macro is called by AC_LANG_COMPILER, the latter being required
+# by the AC_COMPILE_IFELSE macros, so use _AC_COMPILE_IFELSE.
+m4_define([_AC_COMPILER_OBJEXT],
+[AC_CACHE_CHECK([for object suffix], ac_cv_objext,
+[_AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
+[for ac_file in `ls conftest.o conftest.obj conftest.* 2>/dev/null`; do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb ) ;;
+    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+       break;;
+  esac
+done],
+                     [AC_MSG_ERROR([cannot compute OBJEXT: cannot compile])])
+rm -f conftest.$ac_cv_objext])
+AC_SUBST([OBJEXT], [$ac_cv_objext])dnl
+ac_objext=$OBJEXT
+])# _AC_COMPILER_OBJEXT
+
+
 # -------------------- #
 # 3b. The C compiler.  #
 # -------------------- #
@@ -752,8 +832,8 @@ test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
 _AC_LANG_COMPILER_WORKS
 _AC_LANG_COMPILER_GNU
 GCC=`test $ac_compiler_gnu = yes && echo yes`
-AC_EXPAND_ONCE([_AC_OBJEXT])
-AC_EXPAND_ONCE([_AC_EXEEXT])
+AC_EXPAND_ONCE([_AC_COMPILER_OBJEXT])[]dnl
+AC_EXPAND_ONCE([_AC_COMPILER_EXEEXT])[]dnl
 _AC_PROG_CC_G
 AC_LANG_POP
 ])# AC_PROG_CC
@@ -945,8 +1025,8 @@ AC_CHECK_TOOLS(CXX,
 _AC_LANG_COMPILER_WORKS
 _AC_LANG_COMPILER_GNU
 GXX=`test $ac_compiler_gnu = yes && echo yes`
-AC_EXPAND_ONCE([_AC_OBJEXT])
-AC_EXPAND_ONCE([_AC_EXEEXT])
+AC_EXPAND_ONCE([_AC_COMPILER_OBJEXT])[]dnl
+AC_EXPAND_ONCE([_AC_COMPILER_EXEEXT])[]dnl
 _AC_PROG_CXX_G
 AC_LANG_POP
 ])# AC_PROG_CXX
@@ -1044,8 +1124,8 @@ ac_ext=F
 _AC_LANG_COMPILER_GNU
 ac_ext=$ac_save_ext
 G77=`test $ac_compiler_gnu = yes && echo yes`
-AC_EXPAND_ONCE([_AC_OBJEXT])
-AC_EXPAND_ONCE([_AC_EXEEXT])
+AC_EXPAND_ONCE([_AC_COMPILER_OBJEXT])[]dnl
+AC_EXPAND_ONCE([_AC_COMPILER_EXEEXT])[]dnl
 _AC_PROG_F77_G
 AC_LANG_POP
 ])# AC_PROG_F77
index ed4e8ef9f80a290c0e36c8aa2efbe6b8fd49644e..7033ae7679f0c2e694459989b8953f7f7af175b4 100644 (file)
@@ -613,11 +613,11 @@ AC_DEFUN_ONCE([AC_NO_EXECUTABLES],
 [m4_divert_push([KILL])
 
 AC_BEFORE([$0], [_AC_LANG_COMPILER_WORKS])
-AC_BEFORE([$0], [_AC_EXEEXT])
+AC_BEFORE([$0], [_AC_COMPILER_EXEEXT])
 
 m4_define([_AC_LANG_COMPILER_WORKS], [cross_compiling=maybe])
 
-m4_define([_AC_EXEEXT], [EXEEXT=])
+m4_define([_AC_COMPILER_EXEEXT], [EXEEXT=])
 
 m4_define([AC_LINK_IFELSE],
 [AC_FATAL([All the tests involving linking were disabled by $0])])
@@ -626,6 +626,86 @@ m4_divert_pop()dnl
 ])# # AC_NO_EXECUTABLES
 
 
+
+# ----------------------------- #
+# Computing EXEEXT and OBJEXT.  #
+# ----------------------------- #
+
+
+# Files to ignore
+# ---------------
+# Ignore .d files produced by CFLAGS=-MD.
+#
+# On UWIN (which uses a cc wrapper for MSVC), the compiler also generates
+# a .pdb file
+#
+# When the w32 free Borland C++ command line compiler links a program
+# (conftest.exe), it also produces a file named `conftest.tds' in
+# addition to `conftest.obj'
+
+
+# We must not AU define them, because autoupdate would them remove
+# them, which is right, but Automake 1.4 would remove the support for
+# $(EXEEXT) etc.
+# FIXME: Remove this once Automake fixed.
+AC_DEFUN([AC_EXEEXT],   [])
+AC_DEFUN([AC_OBJEXT],   [])
+
+
+# _AC_COMPILER_EXEEXT
+# -------------------
+# Check for the extension used for executables.  It compiles a test
+# executable.  If this is called, the executable extensions will be
+# automatically used by link commands run by the configure script.
+#
+# This macro is called by AC_LANG_COMPILER, the latter being required
+# by the AC_LINK_IFELSE macros, so use _AC_LINK_IFELSE.
+m4_define([_AC_COMPILER_EXEEXT],
+[AC_CACHE_CHECK([for executable suffix], ac_cv_exeext,
+[_AC_LINK_IFELSE([AC_LANG_PROGRAM()],
+[# If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in `ls conftest.exe conftest conftest.* 2>/dev/null`; do
+  case $ac_file in
+    *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb ) ;;
+    *) ac_cv_exeext=`expr "$ac_file" : 'conftest\(.*\)'`
+       break;;
+  esac
+done],
+              [AC_MSG_ERROR([cannot compute EXEEXT: cannot compile and link])])
+rm -f conftest$ac_cv_exeext])
+AC_SUBST([EXEEXT], [$ac_cv_exeext])dnl
+ac_exeext=$EXEEXT
+])# _AC_COMPILER_EXEEXT
+
+
+# _AC_COMPILER_OBJEXT
+# -------------------
+# Check the object extension used by the compiler: typically `.o' or
+# `.obj'.  If this is called, some other behaviour will change,
+# determined by ac_objext.
+#
+# This macro is called by AC_LANG_COMPILER, the latter being required
+# by the AC_COMPILE_IFELSE macros, so use _AC_COMPILE_IFELSE.
+m4_define([_AC_COMPILER_OBJEXT],
+[AC_CACHE_CHECK([for object suffix], ac_cv_objext,
+[_AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
+[for ac_file in `ls conftest.o conftest.obj conftest.* 2>/dev/null`; do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb ) ;;
+    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+       break;;
+  esac
+done],
+                     [AC_MSG_ERROR([cannot compute OBJEXT: cannot compile])])
+rm -f conftest.$ac_cv_objext])
+AC_SUBST([OBJEXT], [$ac_cv_objext])dnl
+ac_objext=$OBJEXT
+])# _AC_COMPILER_OBJEXT
+
+
 # -------------------- #
 # 3b. The C compiler.  #
 # -------------------- #
@@ -752,8 +832,8 @@ test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
 _AC_LANG_COMPILER_WORKS
 _AC_LANG_COMPILER_GNU
 GCC=`test $ac_compiler_gnu = yes && echo yes`
-AC_EXPAND_ONCE([_AC_OBJEXT])
-AC_EXPAND_ONCE([_AC_EXEEXT])
+AC_EXPAND_ONCE([_AC_COMPILER_OBJEXT])[]dnl
+AC_EXPAND_ONCE([_AC_COMPILER_EXEEXT])[]dnl
 _AC_PROG_CC_G
 AC_LANG_POP
 ])# AC_PROG_CC
@@ -945,8 +1025,8 @@ AC_CHECK_TOOLS(CXX,
 _AC_LANG_COMPILER_WORKS
 _AC_LANG_COMPILER_GNU
 GXX=`test $ac_compiler_gnu = yes && echo yes`
-AC_EXPAND_ONCE([_AC_OBJEXT])
-AC_EXPAND_ONCE([_AC_EXEEXT])
+AC_EXPAND_ONCE([_AC_COMPILER_OBJEXT])[]dnl
+AC_EXPAND_ONCE([_AC_COMPILER_EXEEXT])[]dnl
 _AC_PROG_CXX_G
 AC_LANG_POP
 ])# AC_PROG_CXX
@@ -1044,8 +1124,8 @@ ac_ext=F
 _AC_LANG_COMPILER_GNU
 ac_ext=$ac_save_ext
 G77=`test $ac_compiler_gnu = yes && echo yes`
-AC_EXPAND_ONCE([_AC_OBJEXT])
-AC_EXPAND_ONCE([_AC_EXEEXT])
+AC_EXPAND_ONCE([_AC_COMPILER_OBJEXT])[]dnl
+AC_EXPAND_ONCE([_AC_COMPILER_EXEEXT])[]dnl
 _AC_PROG_F77_G
 AC_LANG_POP
 ])# AC_PROG_F77
index ed4e8ef9f80a290c0e36c8aa2efbe6b8fd49644e..7033ae7679f0c2e694459989b8953f7f7af175b4 100644 (file)
@@ -613,11 +613,11 @@ AC_DEFUN_ONCE([AC_NO_EXECUTABLES],
 [m4_divert_push([KILL])
 
 AC_BEFORE([$0], [_AC_LANG_COMPILER_WORKS])
-AC_BEFORE([$0], [_AC_EXEEXT])
+AC_BEFORE([$0], [_AC_COMPILER_EXEEXT])
 
 m4_define([_AC_LANG_COMPILER_WORKS], [cross_compiling=maybe])
 
-m4_define([_AC_EXEEXT], [EXEEXT=])
+m4_define([_AC_COMPILER_EXEEXT], [EXEEXT=])
 
 m4_define([AC_LINK_IFELSE],
 [AC_FATAL([All the tests involving linking were disabled by $0])])
@@ -626,6 +626,86 @@ m4_divert_pop()dnl
 ])# # AC_NO_EXECUTABLES
 
 
+
+# ----------------------------- #
+# Computing EXEEXT and OBJEXT.  #
+# ----------------------------- #
+
+
+# Files to ignore
+# ---------------
+# Ignore .d files produced by CFLAGS=-MD.
+#
+# On UWIN (which uses a cc wrapper for MSVC), the compiler also generates
+# a .pdb file
+#
+# When the w32 free Borland C++ command line compiler links a program
+# (conftest.exe), it also produces a file named `conftest.tds' in
+# addition to `conftest.obj'
+
+
+# We must not AU define them, because autoupdate would them remove
+# them, which is right, but Automake 1.4 would remove the support for
+# $(EXEEXT) etc.
+# FIXME: Remove this once Automake fixed.
+AC_DEFUN([AC_EXEEXT],   [])
+AC_DEFUN([AC_OBJEXT],   [])
+
+
+# _AC_COMPILER_EXEEXT
+# -------------------
+# Check for the extension used for executables.  It compiles a test
+# executable.  If this is called, the executable extensions will be
+# automatically used by link commands run by the configure script.
+#
+# This macro is called by AC_LANG_COMPILER, the latter being required
+# by the AC_LINK_IFELSE macros, so use _AC_LINK_IFELSE.
+m4_define([_AC_COMPILER_EXEEXT],
+[AC_CACHE_CHECK([for executable suffix], ac_cv_exeext,
+[_AC_LINK_IFELSE([AC_LANG_PROGRAM()],
+[# If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in `ls conftest.exe conftest conftest.* 2>/dev/null`; do
+  case $ac_file in
+    *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb ) ;;
+    *) ac_cv_exeext=`expr "$ac_file" : 'conftest\(.*\)'`
+       break;;
+  esac
+done],
+              [AC_MSG_ERROR([cannot compute EXEEXT: cannot compile and link])])
+rm -f conftest$ac_cv_exeext])
+AC_SUBST([EXEEXT], [$ac_cv_exeext])dnl
+ac_exeext=$EXEEXT
+])# _AC_COMPILER_EXEEXT
+
+
+# _AC_COMPILER_OBJEXT
+# -------------------
+# Check the object extension used by the compiler: typically `.o' or
+# `.obj'.  If this is called, some other behaviour will change,
+# determined by ac_objext.
+#
+# This macro is called by AC_LANG_COMPILER, the latter being required
+# by the AC_COMPILE_IFELSE macros, so use _AC_COMPILE_IFELSE.
+m4_define([_AC_COMPILER_OBJEXT],
+[AC_CACHE_CHECK([for object suffix], ac_cv_objext,
+[_AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
+[for ac_file in `ls conftest.o conftest.obj conftest.* 2>/dev/null`; do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb ) ;;
+    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+       break;;
+  esac
+done],
+                     [AC_MSG_ERROR([cannot compute OBJEXT: cannot compile])])
+rm -f conftest.$ac_cv_objext])
+AC_SUBST([OBJEXT], [$ac_cv_objext])dnl
+ac_objext=$OBJEXT
+])# _AC_COMPILER_OBJEXT
+
+
 # -------------------- #
 # 3b. The C compiler.  #
 # -------------------- #
@@ -752,8 +832,8 @@ test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
 _AC_LANG_COMPILER_WORKS
 _AC_LANG_COMPILER_GNU
 GCC=`test $ac_compiler_gnu = yes && echo yes`
-AC_EXPAND_ONCE([_AC_OBJEXT])
-AC_EXPAND_ONCE([_AC_EXEEXT])
+AC_EXPAND_ONCE([_AC_COMPILER_OBJEXT])[]dnl
+AC_EXPAND_ONCE([_AC_COMPILER_EXEEXT])[]dnl
 _AC_PROG_CC_G
 AC_LANG_POP
 ])# AC_PROG_CC
@@ -945,8 +1025,8 @@ AC_CHECK_TOOLS(CXX,
 _AC_LANG_COMPILER_WORKS
 _AC_LANG_COMPILER_GNU
 GXX=`test $ac_compiler_gnu = yes && echo yes`
-AC_EXPAND_ONCE([_AC_OBJEXT])
-AC_EXPAND_ONCE([_AC_EXEEXT])
+AC_EXPAND_ONCE([_AC_COMPILER_OBJEXT])[]dnl
+AC_EXPAND_ONCE([_AC_COMPILER_EXEEXT])[]dnl
 _AC_PROG_CXX_G
 AC_LANG_POP
 ])# AC_PROG_CXX
@@ -1044,8 +1124,8 @@ ac_ext=F
 _AC_LANG_COMPILER_GNU
 ac_ext=$ac_save_ext
 G77=`test $ac_compiler_gnu = yes && echo yes`
-AC_EXPAND_ONCE([_AC_OBJEXT])
-AC_EXPAND_ONCE([_AC_EXEEXT])
+AC_EXPAND_ONCE([_AC_COMPILER_OBJEXT])[]dnl
+AC_EXPAND_ONCE([_AC_COMPILER_EXEEXT])[]dnl
 _AC_PROG_F77_G
 AC_LANG_POP
 ])# AC_PROG_F77
index 5b98d0086a243c17ba2447bf13de690a4fa6e2aa..55ce13a76ecb02f4f8202ec49e9afa07279af7e0 100644 (file)
@@ -1189,91 +1189,6 @@ AU_DEFUN([AC_EMXOS2],   [])
 AU_DEFUN([AC_MINGW32],  [])
 
 
-# We must not AU define them, because autoupdate would them remove
-# them, which is right, but Automake 1.4 would remove the support for
-# $(EXEEXT) etc.
-# FIXME: Remove this once Automake fixed.
-AC_DEFUN([AC_EXEEXT],   [])
-AC_DEFUN([AC_OBJEXT],   [])
-
-
-# _AC_EXEEXT
-# ----------
-# Check for the extension used for executables.  This knows that we
-# add .exe for Cygwin or mingw32.  Otherwise, it compiles a test
-# executable.  If this is called, the executable extensions will be
-# automatically used by link commands run by the configure script.
-#
-# Ignore .d files produced by CFLAGS=-MD.
-#
-# On UWIN (which uses a cc wrapper for MSVC), the compiler also generates
-# a .pdb file
-#
-# This macro is called by AC_LANG_COMPILER, the latter being required
-# by the AC_COMPILE_IFELSE macros, so use AC_TRY_EVAL.
-m4_define([_AC_EXEEXT],
-[AC_CACHE_CHECK([for executable suffix], ac_cv_exeext,
-[case "$CYGWIN $MINGW32 $EMXOS2" in
-  *yes*) ac_cv_exeext=.exe ;;
-  *)
-    AC_LANG_CONFTEST([AC_LANG_PROGRAM()])
-    if AC_TRY_EVAL(ac_link); then
-      # If both `conftest.exe' and `conftest' are `present' (well, observable)
-      # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
-      # work properly (i.e., refer to `conftest.exe'), while it won't with
-      # `rm'.
-      for ac_file in `ls conftest.exe conftest conftest.* 2>/dev/null`; do
-       case $ac_file in
-         *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb ) ;;
-         *) ac_cv_exeext=`expr "$ac_file" : 'conftest\(.*\)'`
-            break;;
-       esac
-      done
-      rm -f conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-    else
-      AC_MSG_ERROR([cannot compile and link])
-    fi
-    ;;
-esac])
-AC_SUBST([EXEEXT], [$ac_cv_exeext])dnl
-ac_exeext=$EXEEXT
-])# _AC_EXEEXT
-
-
-# _AC_OBJEXT
-# ----------
-# Check the object extension used by the compiler: typically .o or
-# .obj.  If this is called, some other behaviour will change,
-# determined by ac_objext.
-#
-# When the w32 free Borland C++ command line compiler links a program
-# (conftest.exe), it also produces a file named `conftest.tds' in
-# addition to `conftest.obj'
-#
-# Ignore .d files produced by CFLAGS=-MD.
-#
-# This macro is called by AC_LANG_COMPILER, the latter being required
-# by the AC_COMPILE_IFELSE macros, so use AC_TRY_EVAL.
-m4_define([_AC_OBJEXT],
-[AC_CACHE_CHECK([for object suffix], ac_cv_objext,
-[AC_LANG_CONFTEST([AC_LANG_PROGRAM()])
-if AC_TRY_EVAL(ac_compile); then
-  for ac_file in `ls conftest.o conftest.obj conftest.* 2>/dev/null`; do
-    case $ac_file in
-      *.$ac_ext | *.tds | *.d ) ;;
-      *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
-         break;;
-    esac
-  done
-  rm -f conftest.$ac_objext conftest.$ac_ext
-else
-  AC_MSG_ERROR([cannot compile])
-fi])
-AC_SUBST(OBJEXT, $ac_cv_objext)dnl
-ac_objext=$ac_cv_objext
-])# _AC_OBJEXT
-
-
 
 ## -------------------------- ##
 ## Checks for UNIX variants.  ##