xref: /netbsd-src/external/gpl3/gcc.old/dist/gcc/fortran/lang-specs.h (revision 4c3eb207d36f67d31994830c0a694161fc1ca39b)
1627f7eb2Smrg /* Contribution to the specs for the GNU Compiler Collection
2627f7eb2Smrg    from GNU Fortran 95 compiler.
3*4c3eb207Smrg    Copyright (C) 2002-2020 Free Software Foundation, Inc.
4627f7eb2Smrg 
5627f7eb2Smrg    This file is free software; you can redistribute it and/or modify
6627f7eb2Smrg    it under the terms of the GNU General Public License as published by
7627f7eb2Smrg    the Free Software Foundation; either version 3 of the License, or
8627f7eb2Smrg    (at your option) any later version.
9627f7eb2Smrg 
10627f7eb2Smrg    This file is distributed in the hope that it will be useful,
11627f7eb2Smrg    but WITHOUT ANY WARRANTY; without even the implied warranty of
12627f7eb2Smrg    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13627f7eb2Smrg    GNU General Public License for more details.
14627f7eb2Smrg 
15627f7eb2Smrg    You should have received a copy of the GNU General Public License
16627f7eb2Smrg    along with GCC; see the file COPYING3.  If not see
17627f7eb2Smrg    <http://www.gnu.org/licenses/>.  */
18627f7eb2Smrg 
19627f7eb2Smrg /* This is the contribution to the `default_compilers' array in gcc.c
20627f7eb2Smrg    for the f95 language.  */
21627f7eb2Smrg 
22627f7eb2Smrg /* Identical to gcc.c (cpp_options), but omitting %(cpp_unique_options)
23627f7eb2Smrg    and -fpch-preprocess on -save-temps.  */
24627f7eb2Smrg #define CPP_ONLY_OPTIONS    "%1 %{m*} %{f*} %{g*:%{!g0:%{g*} \
25627f7eb2Smrg 			     %{!fno-working-directory:-fworking-directory}}} \
26627f7eb2Smrg 			     %{std*&ansi&trigraphs} %{W*&pedantic*} %{w} \
27627f7eb2Smrg 			     %{O*} %{undef}"
28627f7eb2Smrg 
29627f7eb2Smrg /* Options that f951 should know about, even if not preprocessing.  */
30627f7eb2Smrg #define CPP_FORWARD_OPTIONS "%{i*} %{I*} %{M*}"
31627f7eb2Smrg 
32627f7eb2Smrg #define F951_CPP_OPTIONS    "%{!nocpp: -cpp=%g.f90 %{E} %(cpp_unique_options) \
33627f7eb2Smrg 			     %{E|M|MM:%(cpp_debug_options) " CPP_ONLY_OPTIONS \
34627f7eb2Smrg 			     " -fsyntax-only};: " CPP_FORWARD_OPTIONS "}"
35627f7eb2Smrg 
36627f7eb2Smrg #ifndef TARGET_F951_OPTIONS
37627f7eb2Smrg #define TARGET_F951_OPTIONS
38627f7eb2Smrg #endif
39627f7eb2Smrg 
40627f7eb2Smrg #define F951_OPTIONS        "%(cc1_options) %{J*} \
41627f7eb2Smrg 			     %{!nostdinc:-fintrinsic-modules-path finclude%s}" \
42627f7eb2Smrg 			     TARGET_F951_OPTIONS \
43627f7eb2Smrg 			     "%{!fsyntax-only:%(invoke_as)}"
44627f7eb2Smrg #define F951_SOURCE_FORM    "%{!ffree-form:-ffixed-form}"
45627f7eb2Smrg 
46627f7eb2Smrg 
47627f7eb2Smrg {".F",   "@f77-cpp-input", 0, 0, 0},
48627f7eb2Smrg {".FOR", "@f77-cpp-input", 0, 0, 0},
49627f7eb2Smrg {".FTN", "@f77-cpp-input", 0, 0, 0},
50627f7eb2Smrg {".fpp", "@f77-cpp-input", 0, 0, 0},
51627f7eb2Smrg {".FPP", "@f77-cpp-input", 0, 0, 0},
52627f7eb2Smrg {"@f77-cpp-input",
53627f7eb2Smrg     "f951 %i " F951_SOURCE_FORM " " \
54627f7eb2Smrg 	  F951_CPP_OPTIONS " %{!E:" F951_OPTIONS "}", 0, 0, 0},
55627f7eb2Smrg {".f",   "@f77", 0, 0, 0},
56627f7eb2Smrg {".for", "@f77", 0, 0, 0},
57627f7eb2Smrg {".ftn", "@f77", 0, 0, 0},
58627f7eb2Smrg {"@f77",
59627f7eb2Smrg     "f951 %i " F951_SOURCE_FORM " \
60627f7eb2Smrg           %{E:%{!cpp:%egfortran does not support -E without -cpp}} \
61627f7eb2Smrg           %{cpp:" F951_CPP_OPTIONS ";: " CPP_FORWARD_OPTIONS  "} \
62627f7eb2Smrg 	  %{!E:" F951_OPTIONS "}", 0, 0, 0},
63627f7eb2Smrg {".F90", "@f95-cpp-input", 0, 0, 0},
64627f7eb2Smrg {".F95", "@f95-cpp-input", 0, 0, 0},
65627f7eb2Smrg {".F03", "@f95-cpp-input", 0, 0, 0},
66627f7eb2Smrg {".F08", "@f95-cpp-input", 0, 0, 0},
67627f7eb2Smrg {"@f95-cpp-input",
68627f7eb2Smrg     "f951 %i " F951_CPP_OPTIONS " %{!E:" F951_OPTIONS "}", 0, 0, 0},
69627f7eb2Smrg {".f90", "@f95", 0, 0, 0},
70627f7eb2Smrg {".f95", "@f95", 0, 0, 0},
71627f7eb2Smrg {".f03", "@f95", 0, 0, 0},
72627f7eb2Smrg {".f08", "@f95", 0, 0, 0},
73627f7eb2Smrg {"@f95",
74627f7eb2Smrg     "f951 %i %{E:%{!cpp:%egfortran does not support -E without -cpp}}\
75627f7eb2Smrg 	  %{cpp:" F951_CPP_OPTIONS ";:  " CPP_FORWARD_OPTIONS  "} \
76627f7eb2Smrg 	  %{!E:" F951_OPTIONS "}", 0, 0, 0},
77627f7eb2Smrg 
78627f7eb2Smrg 
79627f7eb2Smrg #undef CPP_ONLY_OPTIONS
80627f7eb2Smrg #undef CPP_FORWARD_OPTIONS
81627f7eb2Smrg #undef F951_SOURCE_FORM
82627f7eb2Smrg #undef F951_CPP_OPTIONS
83627f7eb2Smrg #undef F951_OPTIONS
84