]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* aclang.m4 (_AC_COMPILER_OBJEXT): Don't rely on
authorAkim Demaille <akim@epita.fr>
Tue, 19 Dec 2000 11:02:36 +0000 (11:02 +0000)
committerAkim Demaille <akim@epita.fr>
Tue, 19 Dec 2000 11:02:36 +0000 (11:02 +0000)
_AC_COMPILE_IFELSE which uses ac_objext in a `test -s'.
Reported by Lars J. Aas.

ChangeLog
aclang.m4
lib/autoconf/c.m4
lib/autoconf/fortran.m4
lib/autoconf/lang.m4

index 48d34f2bcc8b5e70154b7085fff9b1b82ffa504d..7297506e7b704ad41b15dd0a20e59a12a35cf987 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2000-12-19  Akim Demaille  <akim@epita.fr>
+
+       * aclang.m4 (_AC_COMPILER_OBJEXT): Don't rely on
+       _AC_COMPILE_IFELSE which uses ac_objext in a `test -s'.
+       Reported by Lars J. Aas.
+
 2000-12-19  Akim Demaille  <akim@epita.fr>
 
        * tests/compile.at (AC_PROG_CPP without warnings, GNU Fortran 77):
index 492dcec92fa31ec64631fe11dfeefb3079260942..5470e3e57b5c21335406f9729d55bb86633bdb27 100644 (file)
--- a/aclang.m4
+++ b/aclang.m4
@@ -723,10 +723,14 @@ ac_exeext=$EXEEXT
 # 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.
+# by the AC_COMPILE_IFELSE macros, so use _AC_COMPILE_IFELSE.  And in fact,
+# don't, since _AC_COMPILE_IFELSE needs to know ac_objext for the `test -s'
+# it includes.  So do it by hand.
 m4_define([_AC_COMPILER_OBJEXT],
 [AC_CACHE_CHECK([for object suffix], ac_cv_objext,
-[_AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
+[AC_LANG_CONFTEST([AC_LANG_PROGRAM()])
+rm -f conftest.o conftest.obj
+AS_IFELSE([AC_TRY_EVAL(ac_compile)],
 [for ac_file in `ls conftest.o conftest.obj conftest.* 2>/dev/null`; do
   case $ac_file in
     *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb ) ;;
@@ -734,8 +738,10 @@ m4_define([_AC_COMPILER_OBJEXT],
        break;;
   esac
 done],
-                     [AC_MSG_ERROR([cannot compute OBJEXT: cannot compile])])
-rm -f conftest.$ac_cv_objext])
+          [echo "$as_me: failed program was:" >&AS_MESSAGE_LOG_FD
+cat conftest.$ac_ext >&AS_MESSAGE_LOG_FD
+AC_MSG_ERROR([cannot compute OBJEXT: cannot compile])])
+rm -f conftest.$ac_cv_objext conftest.$ac_ext])
 AC_SUBST([OBJEXT], [$ac_cv_objext])dnl
 ac_objext=$OBJEXT
 ])# _AC_COMPILER_OBJEXT
index 492dcec92fa31ec64631fe11dfeefb3079260942..5470e3e57b5c21335406f9729d55bb86633bdb27 100644 (file)
@@ -723,10 +723,14 @@ ac_exeext=$EXEEXT
 # 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.
+# by the AC_COMPILE_IFELSE macros, so use _AC_COMPILE_IFELSE.  And in fact,
+# don't, since _AC_COMPILE_IFELSE needs to know ac_objext for the `test -s'
+# it includes.  So do it by hand.
 m4_define([_AC_COMPILER_OBJEXT],
 [AC_CACHE_CHECK([for object suffix], ac_cv_objext,
-[_AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
+[AC_LANG_CONFTEST([AC_LANG_PROGRAM()])
+rm -f conftest.o conftest.obj
+AS_IFELSE([AC_TRY_EVAL(ac_compile)],
 [for ac_file in `ls conftest.o conftest.obj conftest.* 2>/dev/null`; do
   case $ac_file in
     *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb ) ;;
@@ -734,8 +738,10 @@ m4_define([_AC_COMPILER_OBJEXT],
        break;;
   esac
 done],
-                     [AC_MSG_ERROR([cannot compute OBJEXT: cannot compile])])
-rm -f conftest.$ac_cv_objext])
+          [echo "$as_me: failed program was:" >&AS_MESSAGE_LOG_FD
+cat conftest.$ac_ext >&AS_MESSAGE_LOG_FD
+AC_MSG_ERROR([cannot compute OBJEXT: cannot compile])])
+rm -f conftest.$ac_cv_objext conftest.$ac_ext])
 AC_SUBST([OBJEXT], [$ac_cv_objext])dnl
 ac_objext=$OBJEXT
 ])# _AC_COMPILER_OBJEXT
index 492dcec92fa31ec64631fe11dfeefb3079260942..5470e3e57b5c21335406f9729d55bb86633bdb27 100644 (file)
@@ -723,10 +723,14 @@ ac_exeext=$EXEEXT
 # 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.
+# by the AC_COMPILE_IFELSE macros, so use _AC_COMPILE_IFELSE.  And in fact,
+# don't, since _AC_COMPILE_IFELSE needs to know ac_objext for the `test -s'
+# it includes.  So do it by hand.
 m4_define([_AC_COMPILER_OBJEXT],
 [AC_CACHE_CHECK([for object suffix], ac_cv_objext,
-[_AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
+[AC_LANG_CONFTEST([AC_LANG_PROGRAM()])
+rm -f conftest.o conftest.obj
+AS_IFELSE([AC_TRY_EVAL(ac_compile)],
 [for ac_file in `ls conftest.o conftest.obj conftest.* 2>/dev/null`; do
   case $ac_file in
     *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb ) ;;
@@ -734,8 +738,10 @@ m4_define([_AC_COMPILER_OBJEXT],
        break;;
   esac
 done],
-                     [AC_MSG_ERROR([cannot compute OBJEXT: cannot compile])])
-rm -f conftest.$ac_cv_objext])
+          [echo "$as_me: failed program was:" >&AS_MESSAGE_LOG_FD
+cat conftest.$ac_ext >&AS_MESSAGE_LOG_FD
+AC_MSG_ERROR([cannot compute OBJEXT: cannot compile])])
+rm -f conftest.$ac_cv_objext conftest.$ac_ext])
 AC_SUBST([OBJEXT], [$ac_cv_objext])dnl
 ac_objext=$OBJEXT
 ])# _AC_COMPILER_OBJEXT
index 492dcec92fa31ec64631fe11dfeefb3079260942..5470e3e57b5c21335406f9729d55bb86633bdb27 100644 (file)
@@ -723,10 +723,14 @@ ac_exeext=$EXEEXT
 # 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.
+# by the AC_COMPILE_IFELSE macros, so use _AC_COMPILE_IFELSE.  And in fact,
+# don't, since _AC_COMPILE_IFELSE needs to know ac_objext for the `test -s'
+# it includes.  So do it by hand.
 m4_define([_AC_COMPILER_OBJEXT],
 [AC_CACHE_CHECK([for object suffix], ac_cv_objext,
-[_AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
+[AC_LANG_CONFTEST([AC_LANG_PROGRAM()])
+rm -f conftest.o conftest.obj
+AS_IFELSE([AC_TRY_EVAL(ac_compile)],
 [for ac_file in `ls conftest.o conftest.obj conftest.* 2>/dev/null`; do
   case $ac_file in
     *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb ) ;;
@@ -734,8 +738,10 @@ m4_define([_AC_COMPILER_OBJEXT],
        break;;
   esac
 done],
-                     [AC_MSG_ERROR([cannot compute OBJEXT: cannot compile])])
-rm -f conftest.$ac_cv_objext])
+          [echo "$as_me: failed program was:" >&AS_MESSAGE_LOG_FD
+cat conftest.$ac_ext >&AS_MESSAGE_LOG_FD
+AC_MSG_ERROR([cannot compute OBJEXT: cannot compile])])
+rm -f conftest.$ac_cv_objext conftest.$ac_ext])
 AC_SUBST([OBJEXT], [$ac_cv_objext])dnl
 ac_objext=$OBJEXT
 ])# _AC_COMPILER_OBJEXT