+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
[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])])
])# # 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. #
# -------------------- #
_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
_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
_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
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. ##
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.
[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])])
])# # 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. #
# -------------------- #
_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
_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
_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
[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])])
])# # 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. #
# -------------------- #
_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
_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
_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
[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])])
])# # 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. #
# -------------------- #
_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
_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
_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
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. ##