diff options
author | Tobias Burnus <burnus@net-b.de> | 2007-10-27 16:43:53 +0200 |
---|---|---|
committer | Tobias Burnus <burnus@gcc.gnu.org> | 2007-10-27 16:43:53 +0200 |
commit | 1200489c4624638d172b15bb9adb303867bc9639 (patch) | |
tree | 6c55915b78e3302db29bd664156a7c2685709ba3 /gcc | |
parent | 094817b07029ca9ce995a8b96c0527c781b0d8ad (diff) | |
download | gcc-1200489c4624638d172b15bb9adb303867bc9639.zip gcc-1200489c4624638d172b15bb9adb303867bc9639.tar.gz gcc-1200489c4624638d172b15bb9adb303867bc9639.tar.bz2 |
re PR fortran/33862 (Support .FTN file extension for Fortran fixed-format source files)
2007-10-27 Tobias Burnus <burnus@net-b.de>
PR fortran/33862
* lang-specs.h: Support .ftn and .FTN extension, use CPP for .FOR.
* options.c (form_from_filename): Support .ftn extension.
* gfortran.texi: Document support of .for and .ftn file extension.
From-SVN: r129680
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/fortran/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/fortran/gfortran.texi | 19 | ||||
-rw-r--r-- | gcc/fortran/lang-specs.h | 4 | ||||
-rw-r--r-- | gcc/fortran/options.c | 3 |
4 files changed, 23 insertions, 10 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 6bfe792..ae70edd 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,10 @@ +2007-10-27 Tobias Burnus <burnus@net-b.de> + + PR fortran/33862 + * lang-specs.h: Support .ftn and .FTN extension, use CPP for .FOR. + * options.c (form_from_filename): Support .ftn extension. + * gfortran.texi: Document support of .for and .ftn file extension. + 2007-10-26 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/33162 diff --git a/gcc/fortran/gfortran.texi b/gcc/fortran/gfortran.texi index fb88695..f8e70d3 100644 --- a/gcc/fortran/gfortran.texi +++ b/gcc/fortran/gfortran.texi @@ -368,11 +368,11 @@ the relevant compiler front-end program (e.g., @command{f951} for Fortran) for each file in the source code, and then calls the assembler and linker as appropriate to produce the compiled output. In a copy of GCC which has been compiled with Fortran language support enabled, -@command{gcc} will recognize files with @file{.f}, @file{.f90}, @file{.f95}, -and @file{.f03} extensions as Fortran source code, and compile it -accordingly. A @command{gfortran} driver program is also provided, -which is identical to @command{gcc} except that it automatically links -the Fortran runtime libraries into the compiled program. +@command{gcc} will recognize files with @file{.f}, @file{.for}, @file{.ftn}, +@file{.f90}, @file{.f95}, and @file{.f03} extensions as Fortran source code, +and compile it accordingly. A @command{gfortran} driver program is also +provided, which is identical to @command{gcc} except that it automatically +links the Fortran runtime libraries into the compiled program. This manual specifically documents the Fortran front end, which handles the programming language's syntax and semantics. The aspects of GCC @@ -399,10 +399,11 @@ through a C preprocessor (CPP; sometimes also called Fortran preprocessor, FPP) to allow for conditional compilation. In case of GNU Fortran this is the GNU C Preprocessor in the traditional mode. On systems with case-preserving file names, the preprocessor is automatically invoked if the -file extension is @code{.F}, @code{.F90}, @code{.F95} or @code{.F03}; -otherwise use for fixed-format code the option @code{-x f77-cpp-input} -and for free-format code @code{-x f95-cpp-input}. Invocation of the -preprocessor can be suppressed using @code{-x f77} or @code{-x f95}. +file extension is @code{.F}, @code{.FOR}, @code{.FTN}, @code{.F90}, +@code{.F95} or @code{.F03}; otherwise use for fixed-format code the option +@code{-x f77-cpp-input} and for free-format code @code{-x f95-cpp-input}. +Invocation of the preprocessor can be suppressed using @code{-x f77} or +@code{-x f95}. If the GNU Fortran invoked the preprocessor, @code{__GFORTRAN__} is defined and @code{__GNUC__}, @code{__GNUC_MINOR__} and diff --git a/gcc/fortran/lang-specs.h b/gcc/fortran/lang-specs.h index 4a20242..4f752ec6 100644 --- a/gcc/fortran/lang-specs.h +++ b/gcc/fortran/lang-specs.h @@ -21,6 +21,8 @@ for the f95 language. */ {".F", "@f77-cpp-input", 0, 0, 0}, +{".FOR", "@f77-cpp-input", 0, 0, 0}, +{".FTN", "@f77-cpp-input", 0, 0, 0}, {".fpp", "@f77-cpp-input", 0, 0, 0}, {".FPP", "@f77-cpp-input", 0, 0, 0}, {"@f77-cpp-input", @@ -45,6 +47,6 @@ %{!nostdinc:-fintrinsic-modules-path finclude%s} %{!fsyntax-only:%(invoke_as)}}", 0, 0, 0}, {".f", "@f77", 0, 0, 0}, {".for", "@f77", 0, 0, 0}, -{".FOR", "@f77", 0, 0, 0}, +{".ftn", "@f77", 0, 0, 0}, {"@f77", "%{!E:f951 %i %{!ffree-form:-ffixed-form} %(cc1_options) %{J*} %{I*}\ %{!nostdinc:-fintrinsic-modules-path finclude%s} %{!fsyntax-only:%(invoke_as)}}", 0, 0, 0}, diff --git a/gcc/fortran/options.c b/gcc/fortran/options.c index b2c17dc..bfd0da0 100644 --- a/gcc/fortran/options.c +++ b/gcc/fortran/options.c @@ -161,6 +161,9 @@ form_from_filename (const char *filename) ".for", FORM_FIXED} , { + ".ftn", FORM_FIXED} + , + { "", FORM_UNKNOWN} }; /* sentinel value */ |