automake-patches
[Top][All Lists]
Advanced

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

[PATCH] Add support for newer Fortran extensions '.[fF]0[38]'.


From: Ralf Wildenhues
Subject: [PATCH] Add support for newer Fortran extensions '.[fF]0[38]'.
Date: Sat, 8 Mar 2008 13:22:20 +0100
User-agent: Mutt/1.5.17+20080114 (2008-01-14)

* automake.in (scan_autoconf_traces): Accept .f03, .f08 for
Fortran, .F03 and .F08 for preprocessed Fortran files.
Use $(FCFLAGS_f[09]x) accordingly.
* doc/automake.texi (Compiling Fortran 9x Files): Update.
* tests/fort2.test: Add more tests.
* NEWS: Update.
---

I noticed that GCC now also supports the .f08 extension (and that I had
missed the addition of support for .f03).  Applied to master.

Cheers,
Ralf

 NEWS              |    4 ++--
 automake.in       |    6 +++---
 doc/automake.texi |    9 ++++++++-
 tests/fort2.test  |   12 ++++++++++--
 4 files changed, 23 insertions(+), 8 deletions(-)

diff --git a/NEWS b/NEWS
index e701578..88437cf 100644
--- a/NEWS
+++ b/NEWS
@@ -16,8 +16,8 @@ New in 1.10a:
   - subdir-object mode works now with Fortran (F77, FC, preprocessed
     Fortran, and Ratfor).
 
-  - For files with extension .f90 or .f95, the flag $(FCFLAGS_f9x)
-    computed by AC_FC_SRCEXT is now honored in compile rules.
+  - For files with extension .f90, .f95, .f03, or .f08, the flag
+    $(FCFLAGS_f[09]x) computed by AC_FC_SRCEXT is now used in compile rules.
 
   - Files with extension .sx are also treated as preprocessed assembler.
 
diff --git a/automake.in b/automake.in
index 242abce..9612204 100755
--- a/automake.in
+++ b/automake.in
@@ -895,7 +895,7 @@ register_language ('name' => 'fc',
                   'lder' => 'FCLD',
                   'ld' => '$(FC)',
                   'pure' => 1,
-                  'extensions' => ['.f90', '.f95']);
+                  'extensions' => ['.f90', '.f95', '.f03', '.f08']);
 
 # Preprocessed Fortran
 register_language ('name' => 'ppfc',
@@ -912,7 +912,7 @@ register_language ('name' => 'ppfc',
                   'output_flag' => '-o',
                   'libtool_tag' => 'FC',
                   'pure' => 1,
-                  'extensions' => ['.F90','.F95']);
+                  'extensions' => ['.F90','.F95', '.F03', '.F08']);
 
 # Preprocessed Fortran 77
 #
@@ -4915,7 +4915,7 @@ sub scan_autoconf_traces ($)
          # These flags are used as %SOURCEFLAG% in depend2.am,
          # where the trailing space is important.
          $sourceflags{'.' . $suffix} = '$(FCFLAGS_' . $suffix . ') '
-           if ($suffix eq 'f90' || $suffix eq 'f95');
+           if ($suffix eq 'f90' || $suffix eq 'f95' || $suffix eq 'f03' || 
$suffix eq 'f08');
        }
       elsif ($macro eq 'AC_INIT')
        {
diff --git a/doc/automake.texi b/doc/automake.texi
index 2c5dcfa..fa9f9d9 100644
--- a/doc/automake.texi
+++ b/doc/automake.texi
@@ -6347,7 +6347,8 @@ library.
 @comment  node-name,  next,  previous,  up
 @subsection Compiling Fortran 9x Files
 
address@hidden is made automatically from @file{N.f90} or @file{N.f95}
address@hidden@var{N}.o} is made automatically from @address@hidden,
address@hidden@var{N}.f95}, @address@hidden, or @address@hidden
 by running the Fortran 9x compiler.  The precise command used
 is as follows:
 
@@ -6359,6 +6360,12 @@ is as follows:
 @item .f95
 @code{$(FC) $(AM_FCFLAGS) $(FCFLAGS) -c $(FCFLAGS_f95) $<}
 
address@hidden .f03
address@hidden(FC) $(AM_FCFLAGS) $(FCFLAGS) -c $(FCFLAGS_f03) $<}
+
address@hidden .f08
address@hidden(FC) $(AM_FCFLAGS) $(FCFLAGS) -c $(FCFLAGS_f08) $<}
+
 @end table
 
 @node Java Support
diff --git a/tests/fort2.test b/tests/fort2.test
index b05b4b0..ee25592 100755
--- a/tests/fort2.test
+++ b/tests/fort2.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2006  Free Software Foundation, Inc.
+# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -29,12 +29,14 @@ cat >>configure.in <<'END'
 AC_PROG_FC
 AC_FC_SRCEXT([f90])
 AC_FC_SRCEXT([f95])
+AC_FC_SRCEXT([f03])
+AC_FC_SRCEXT([f08])
 AC_FC_SRCEXT([blabla])
 END
 
 cat >Makefile.am <<'END'
 bin_PROGRAMS = hello goodbye
-hello_SOURCES = hello.f90 foo.f95 sub/bar.f95
+hello_SOURCES = hello.f90 foo.f95 sub/bar.f95 hi.f03 sub/howdy.f03 greets.f08 
sub/bonjour.f08
 goodbye_SOURCES = bye.f95 sub/baz.f90
 goodbye_FCFLAGS =
 END
@@ -49,6 +51,12 @@ grep '.\$(FCCOMPILE)'  Makefile.in > stdout
 grep -v '\$(FCFLAGS_f' stdout && exit 1
 grep '.\$(FC.*\$(FCFLAGS_blabla' Makefile.in && exit 1
 # Notice the TAB:
+grep '^[       ].*\$(FC.*\$(FCFLAGS_f90).*\.f90' Makefile.in
+grep '^[       ].*\$(FC.*\$(FCFLAGS_f95).*\.f95' Makefile.in
+grep '^[       ].*\$(FC.*\$(FCFLAGS_f03).*\.f03' Makefile.in
+grep '^[       ].*\$(FC.*\$(FCFLAGS_f08).*\.f08' Makefile.in
 grep '^[       ].*\$(FC.*\$(FCFLAGS_f90).*\.f95' Makefile.in && exit 1
 grep '^[       ].*\$(FC.*\$(FCFLAGS_f95).*\.f90' Makefile.in && exit 1
+grep '^[       ].*\$(FC.*\$(FCFLAGS_f90).*\.f03' Makefile.in && exit 1
+grep '^[       ].*\$(FC.*\$(FCFLAGS_f08).*\.f90' Makefile.in && exit 1
 :
-- 
1.5.4.3.422.g34cd6





reply via email to

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