diff options
author | Ralf Wildenhues <Ralf.Wildenhues@gmx.de> | 2011-03-05 07:56:21 +0100 |
---|---|---|
committer | Ralf Wildenhues <Ralf.Wildenhues@gmx.de> | 2011-03-05 09:42:19 +0100 |
commit | 4c79761f40980100834f19147f1d1d4ec03742b0 (patch) | |
tree | 06ea44d8e930f5b2f879503a4c703f6faec9b60f | |
parent | 5f11bce4563d94fd2a675f83909066d12f6243ef (diff) | |
download | autoconf-4c79761f40980100834f19147f1d1d4ec03742b0.tar.gz |
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.
Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | lib/autoconf/fortran.m4 | 8 |
2 files changed, 11 insertions, 1 deletions
@@ -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. diff --git a/lib/autoconf/fortran.m4 b/lib/autoconf/fortran.m4 index 14e1c9c9..237cdd9c 100644 --- a/lib/autoconf/fortran.m4 +++ b/lib/autoconf/fortran.m4 @@ -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 |