bug-autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 2.57c: Failure on Fortran


From: Akim Demaille
Subject: Re: 2.57c: Failure on Fortran
Date: Wed, 10 Sep 2003 18:51:30 +0200
User-agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3 (gnu/linux)

 > Whoops, I forgot that you need to 'rm -f conftest*' any time you use a
 > 'break' statement inside AC_*_IFELSE.  The attached patch should fix this 
 > (two places).

 > (Maybe this should be a macro?  _AC_BREAK?  Or at least _AC_CLEANUP
 > instead of 'rm -f conftest*'?  Food for thought.)

You are right.  Someone should :)

I'm installing the following patch.  Please check the test.

Index: ChangeLog
from  Akim Demaille  <address@hidden>

        * tests/fortran.at (GNU Fortran 77): Also exercise AC_FC_SRCEXT
        and AC_FC_FREEFORM.
        * tests/mktests.sh: Skip AC_FC_SRCEXT.
        * lib/autoconf/fortran.m4 (AC_FC_SRCEXT, AC_FC_FREEFORM): Likewise.

Index: lib/autoconf/fortran.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/fortran.m4,v
retrieving revision 1.170
diff -u -u -r1.170 fortran.m4
--- lib/autoconf/fortran.m4 5 Sep 2003 22:55:40 -0000 1.170
+++ lib/autoconf/fortran.m4 10 Sep 2003 16:48:06 -0000
@@ -1114,6 +1114,7 @@
   test "x$ac_flag" != xnone && FCFLAGS_SRCEXT="$ac_flag"
   AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [ac_cv_fc_srcext_$1=$ac_flag; break])
 done
+rm -f conftest.$ac_objext conftest.$1
 FCFLAGS_SRCEXT=$ac_fc_srcext_FCFLAGS_SRCEXT_save
 AC_LANG_POP(Fortran)dnl
 ])
@@ -1133,8 +1134,9 @@
 fi
 ])# AC_FC_SRCEXT
 
+
 # AC_FC_FREEFORM([ACTION-IF-SUCCESS], [ACTION-IF-FAILURE])
-# ----------------------
+# --------------------------------------------------------
 # Look for a compiler flag to make the Fortran (FC) compiler accept
 # free-format source code, and adds it to FCFLAGS.  Call
 # ACTION-IF-SUCCESS (defaults to nothing) if successful (i.e. can
@@ -1157,6 +1159,7 @@
        end
 ], [ac_cv_fc_freeform=$ac_flag; break])
 done
+rm -f conftest.$ac_objext conftest.$ac_ext
 FCFLAGS=$ac_fc_freeform_FCFLAGS_save
 AC_LANG_POP(Fortran)dnl
 ])
Index: tests/acfortran.at
===================================================================
RCS file: /cvsroot/autoconf/autoconf/tests/acfortran.at,v
retrieving revision 1.5
diff -u -u -r1.5 acfortran.at
--- tests/acfortran.at 4 Sep 2003 12:52:36 -0000 1.5
+++ tests/acfortran.at 10 Sep 2003 16:48:07 -0000
@@ -8,7 +8,6 @@
 AT_CHECK_MACRO([AC_F77_WRAPPERS])
 AT_CHECK_MACRO([AC_FC_FREEFORM])
 AT_CHECK_MACRO([AC_FC_MAIN])
-AT_CHECK_MACRO([AC_FC_SRCEXT])
 AT_CHECK_MACRO([AC_FC_WRAPPERS])
 AT_CHECK_MACRO([AC_PROG_F77_C_O])
 AT_CHECK_MACRO([AC_PROG_FC_C_O])
Index: tests/fortran.at
===================================================================
RCS file: /cvsroot/autoconf/autoconf/tests/fortran.at,v
retrieving revision 1.2
diff -u -u -r1.2 fortran.at
--- tests/fortran.at 23 Jun 2003 11:11:42 -0000 1.2
+++ tests/fortran.at 10 Sep 2003 16:48:07 -0000
@@ -48,4 +48,18 @@
   # Has not.
   test "$G77" = yes &&
     AC_MSG_ERROR([incorrectly recognized a GNU Fortran 77 compiler])
-fi]])
+fi
+
+# No Fortran compiler is known not to support "*.f".
+AC_FC_SRCEXT([f])
+
+# GNU Fortran is known to support freeform.
+AC_FC_FREEFORM([],
+               [AC_MSG_WARN([Fortran does not accept free-form source])])
+if test $G77 = yes; then
+  case $FCFLAGS in
+   *-ffree-form*) ;;
+   *) AC_MSG_ERROR([failed to recognize G77's -ffree-form option.]);;
+  esac
+fi
+]])
Index: tests/mktests.sh
===================================================================
RCS file: /cvsroot/autoconf/autoconf/tests/mktests.sh,v
retrieving revision 1.33
diff -u -u -r1.33 mktests.sh
--- tests/mktests.sh 4 Sep 2003 14:33:03 -0000 1.33
+++ tests/mktests.sh 10 Sep 2003 16:48:07 -0000
@@ -98,7 +98,7 @@
 # - AC_LANG*
 #   Heavily used by other macros.
 #
-# - AC_PATH_PROGS?, AC_F77_FUNC, AC_FC_FUNC
+# - AC_PATH_PROGS?, AC_F77_FUNC, AC_FC_FUNC, AC_FC_SRCEXT
 #   They produce `= val' because $1, the variable used to store the result,
 #   is empty.
 #
@@ -131,6 +131,7 @@
 ^AC_CHECK_(DECL|FILE|FUNC|HEADER|LIB|MEMBER|PROG|SIZEOF|TOOL|TYPE)S?$
 ^AC_CONFIG
 ^AC_(F77|FC)_FUNC$
+^AC_FC_(FUNC|SRCEXT)$
 ^AC_FD_CC$
 ^AC_FUNC_(GETLOADAVG|FNMATCH_GNU|WAIT3)$
 ^AC_INIT




reply via email to

[Prev in Thread] Current Thread [Next in Thread]