This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Preprocessing source files.


L.S.,

I tried the following patch to lang-specs.h (succesfully bootstrapped and reg-tested on powerpc-unknown-linux-gnu), but the resulting compiles failed because of:

In file /tmp/ccMmhgm6.f:1

# 1 "<built-in>"
1
Error: Non-numeric character in statement label at (1)

etc.

So something has to be done in the parser to complete this.

Should I apply the patch nevertheless ?

Thanks in advance.

--
Toon Moene - mailto:toon@moene.indiv.nluug.nl - phoneto: +31 346 214290
Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands
Maintainer, GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html
GNU Fortran 95: http://gcc.gnu.org/fortran/ (under construction)
2004-01-15  Toon Moene  <toon@moene.indiv.nluug.nl>

	* lang-specs.h: Enable preprocessing of source files
	ending in .F, .fpp, .FPP, .F90 and .F95.

*** lang-specs.h.orig	Tue Jan 13 07:25:54 2004
--- lang-specs.h	Wed Jan 14 19:56:15 2004
***************
*** 1,15 ****
  /* Contribution to the specs for the GNU Compiler Collection
     from GNU Fortran 95 compiler.
!    Copyright (C) 2002 Free Software Foundation, Inc.
  
  This file is licensed under the GPL.  */
  
  /* This is the contribution to the `default_compilers' array in gcc.c
     for the f95 language.  */
  
  {".f90", "@f95", 0},
  {".f95", "@f95", 0},
! {"@f95", "%{!E:f951 %i %<ffixed-format %(cc1_options) %{J*} %{I*}\
           %{!fsyntax-only:%(invoke_as)}}", 0},
  {".f",   "@f77", 0},
  {".for", "@f77", 0},
--- 1,32 ----
  /* Contribution to the specs for the GNU Compiler Collection
     from GNU Fortran 95 compiler.
!    Copyright (C) 2002,2004 Free Software Foundation, Inc.
  
  This file is licensed under the GPL.  */
  
  /* This is the contribution to the `default_compilers' array in gcc.c
     for the f95 language.  */
  
+ {".F",   "@f77-cpp-input", 0},
+ {".fpp", "@f77-cpp-input", 0},
+ {".FPP", "@f77-cpp-input", 0},
+ {"@f77-cpp-input",
+   "cc1 -E -traditional-cpp -D_LANGUAGE_FORTRAN %(cpp_options) \
+       %{E|M|MM:%(cpp_debug_options)}\
+       %{!M:%{!MM:%{!E: -o %|.f |\n\
+     f951 %|.f %{!ffree-form:-ffixed-form} %(cc1_options) %{J*} %{I*}\
+       %{!fsyntax-only:%(invoke_as)}}}}", 0},
+ {".F90", "@f95-cpp-input", 0},
+ {".F95", "@f95-cpp-input", 0},
+ {"@f95-cpp-input",
+   "cc1 -E -traditional-cpp -D_LANGUAGE_FORTRAN %(cpp_options) \
+       %{E|M|MM:%(cpp_debug_options)}\
+       %{!M:%{!MM:%{!E: -o %|.f95 |\n\
+     f951 %|.f95 %(cc1_options) %{J*} %{I*}\
+       %{!fsyntax-only:%(invoke_as)}}}}", 0},
  {".f90", "@f95", 0},
  {".f95", "@f95", 0},
! {"@f95", "%{!E:f951 %i %<ffixed-form %(cc1_options) %{J*} %{I*}\
           %{!fsyntax-only:%(invoke_as)}}", 0},
  {".f",   "@f77", 0},
  {".for", "@f77", 0},

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]