]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
fortran: define $GFC to "yes" if $FC is a GNU compiler
authorStefano Lattarini <stefano.lattarini@gmail.com>
Fri, 21 Oct 2011 12:00:36 +0000 (14:00 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Fri, 21 Oct 2011 12:00:36 +0000 (14:00 +0200)
* lib/autoconf/fortran.m4 (AC_PROG_FC): Define `$GFC' to "yes" if
the detected fortran compiler is a GNU compiler, define it to the
empty string otherwise.
This is mostly for consistency for what is done for the C, C++
and Fortran 77 compilers.
* doc/automake.texi: Update.

ChangeLog
doc/autoconf.texi
lib/autoconf/fortran.m4

index 1bf0196881d438a444a27badfdcf85729e195157..e51f7d7434e63547cdd68786878246942fadb084 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2011-10-21  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       fortran: define $GFC to "yes" if $FC is a GNU compiler
+       * lib/autoconf/fortran.m4 (AC_PROG_FC): Define `$GFC' to "yes" if
+       the detected fortran compiler is a GNU compiler, define it to the
+       empty string otherwise.
+       This is mostly for consistency for what is done for the C, C++
+       and Fortran 77 compilers.
+       * doc/automake.texi: Update.
+
 2011-10-13  Eric Blake  <eblake@redhat.com>
 
        admin: mention recent copyright assignments
index 2ab4599bda3ac1097069b34e0e6ff36b0a6d2b2d..b6dc67b846739c0e58b410ed536b18504b811415 100644 (file)
@@ -7931,6 +7931,8 @@ This macro may, alternatively, be invoked with an optional first argument
 which, if specified, must be a blank-separated list of Fortran
 compilers to search for, just as in @code{AC_PROG_F77}.
 
+If using @code{gfortran} or @code{g77} (the GNU Fortran compilers), then
+set the shell variable @code{GFC} to @samp{yes}.
 If the output variable @code{FCFLAGS} was not already set in the
 environment, then set it to @option{-g -02} for GNU @code{g77} (or
 @option{-O2} where @code{g77} does not accept @option{-g}).  Otherwise,
index 56488a97d5fc4206c6f96ce05c1aa3d5b837b8b8..e630f27658472c4d281fc79e0edd328454d708cf 100644 (file)
@@ -382,6 +382,11 @@ AC_ARG_VAR([FCFLAGS], [Fortran compiler flags])dnl
 _AC_ARG_VAR_LDFLAGS()dnl
 _AC_ARG_VAR_LIBS()dnl
 _AC_PROG_FC([$2], [$1])
+if test $ac_compiler_gnu = yes; then
+  GFC=yes
+else
+  GFC=
+fi
 AC_LANG_POP(Fortran)dnl
 ])# AC_PROG_FC