From 14493939e8d76096592411889e40d48701497a21 Mon Sep 17 00:00:00 2001 From: Ralf Wildenhues Date: Sat, 8 Mar 2008 13:20:20 +0100 Subject: [PATCH] Add support for newer Fortran extensions '.[fF]0[38]'. * 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. --- 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 e7015785a..88437cfbc 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 242abce5d..9612204f8 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 2c5dcfae8..fa9f9d991 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 -@file{N.o} is made automatically from @file{N.f90} or @file{N.f95} +@file{@var{N}.o} is made automatically from @file{@var{N}.f90}, +@file{@var{N}.f95}, @file{@var{N}.f03}, or @file{@var{N}.f08} 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) $<} +@item .f03 +@code{$(FC) $(AM_FCFLAGS) $(FCFLAGS) -c $(FCFLAGS_f03) $<} + +@item .f08 +@code{$(FC) $(AM_FCFLAGS) $(FCFLAGS) -c $(FCFLAGS_f08) $<} + @end table @node Java Support diff --git a/tests/fort2.test b/tests/fort2.test index b05b4b09b..ee25592c3 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 : -- 2.11.4.GIT