]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
AC_FC_SRCEXT: allow gfortran to compile .f77 files.
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sat, 5 Mar 2011 06:56:21 +0000 (07:56 +0100)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sat, 5 Mar 2011 08:42:19 +0000 (09:42 +0100)
* lib/autoconf/fortran.m4 (AC_FC_SRCEXT): Try '-x f77' for .f77
files, '-x f95' for others, for gfortran.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
ChangeLog
lib/autoconf/fortran.m4

index 82d20395678a04a22687a5630b01c9c93556e734..ff84c50979ae2df2cfef99b60e1d09919c520d4c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2011-03-05  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
+       AC_FC_SRCEXT: allow gfortran to compile .f77 files.
+       * lib/autoconf/fortran.m4 (AC_FC_SRCEXT): Try '-x f77' for .f77
+       files, '-x f95' for others, for gfortran.
+
        New macros AC_{F77,FC}_IMPLICIT_NONE to disable Fortran implicit int.
        * lib/autoconf/fortran.m4 (_AC_FC_IMPLICIT_NONE): New internal
        macro.
index 14e1c9c99e69ac1eccba43c6e2da09d8946c4bf6..237cdd9cfaf5e3f295592e8de7b310088ed28bbe 100644 (file)
@@ -1137,6 +1137,8 @@ AC_LANG_POP(Fortran)dnl
 # Also, for Intel's ifc compiler (which does not accept .f95 by default in
 # some versions), the $FCFLAGS_<EXT> variable *must* go immediately before
 # the source file on the command line, unlike other $FCFLAGS.  Ugh.
+#
+# gfortran requires '-x f77' in order to recognize .f77 files.
 AC_DEFUN([AC_FC_SRCEXT],
 [AC_LANG_PUSH(Fortran)dnl
 AC_CACHE_CHECK([for Fortran flag to compile .$1 files],
@@ -1145,7 +1147,11 @@ AC_CACHE_CHECK([for Fortran flag to compile .$1 files],
 ac_fcflags_srcext_save=$ac_fcflags_srcext
 ac_fcflags_srcext=
 ac_cv_fc_srcext_$1=unknown
-for ac_flag in none -qsuffix=f=$1 -Tf; do
+case $ac_ext in #(
+  [[fF]]77) ac_try=f77;; #(
+  *) ac_try=f95;;
+esac
+for ac_flag in none -qsuffix=f=$1 -Tf "-x $ac_try"; do
   test "x$ac_flag" != xnone && ac_fcflags_srcext="$ac_flag"
   AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [ac_cv_fc_srcext_$1=$ac_flag; break])
 done