1 | /* Contribution to the specs for the GNU Compiler Collection |
2 | from GNU Fortran 95 compiler. |
3 | Copyright (C) 2002-2024 Free Software Foundation, Inc. |
4 | |
5 | This file is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by |
7 | the Free Software Foundation; either version 3 of the License, or |
8 | (at your option) any later version. |
9 | |
10 | This file is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | GNU General Public License for more details. |
14 | |
15 | You should have received a copy of the GNU General Public License |
16 | along with GCC; see the file COPYING3. If not see |
17 | <http://www.gnu.org/licenses/>. */ |
18 | |
19 | /* This is the contribution to the `default_compilers' array in gcc.cc |
20 | for the f95 language. */ |
21 | |
22 | /* Identical to gcc.cc (cpp_options), but omitting %(cpp_unique_options) |
23 | and -fpch-preprocess on -save-temps. */ |
24 | #define CPP_ONLY_OPTIONS "%1 %{m*} %{f*} %{g*:%{!g0:%{g*} \ |
25 | %{!fno-working-directory:-fworking-directory}}} \ |
26 | %{std*&ansi&trigraphs} %{W*&pedantic*} %{w} \ |
27 | %{O*} %{undef}" |
28 | |
29 | /* Options that f951 should know about, even if not preprocessing. */ |
30 | #define CPP_FORWARD_OPTIONS "%{i*} %{I*} %{M*}" |
31 | |
32 | #define F951_CPP_OPTIONS "%{!nocpp: -cpp=%g" F951_CPP_EXTENSION \ |
33 | " %{E} %(cpp_unique_options) \ |
34 | %{E|M|MM:%(cpp_debug_options) " CPP_ONLY_OPTIONS \ |
35 | " -fsyntax-only};: " CPP_FORWARD_OPTIONS "}" |
36 | |
37 | #ifndef TARGET_F951_OPTIONS |
38 | #define TARGET_F951_OPTIONS |
39 | #endif |
40 | |
41 | #define F951_OPTIONS "%(cc1_options) %{J*} \ |
42 | %{!nostdinc:-fintrinsic-modules-path finclude%s}" \ |
43 | TARGET_F951_OPTIONS \ |
44 | "%{!fsyntax-only:%(invoke_as)}" |
45 | #define F951_SOURCE_FORM "%{!ffree-form:-ffixed-form}" |
46 | |
47 | |
48 | #define F951_CPP_EXTENSION ".fi" |
49 | {.suffix: ".F" , .spec: "@f77-cpp-input" , .cpp_spec: 0, .combinable: 0, .needs_preprocessing: 0}, |
50 | {.suffix: ".FOR" , .spec: "@f77-cpp-input" , .cpp_spec: 0, .combinable: 0, .needs_preprocessing: 0}, |
51 | {.suffix: ".FTN" , .spec: "@f77-cpp-input" , .cpp_spec: 0, .combinable: 0, .needs_preprocessing: 0}, |
52 | {.suffix: ".fpp" , .spec: "@f77-cpp-input" , .cpp_spec: 0, .combinable: 0, .needs_preprocessing: 0}, |
53 | {.suffix: ".FPP" , .spec: "@f77-cpp-input" , .cpp_spec: 0, .combinable: 0, .needs_preprocessing: 0}, |
54 | {.suffix: "@f77-cpp-input" , |
55 | .spec: "f951 %i " F951_SOURCE_FORM " " \ |
56 | F951_CPP_OPTIONS " %{!E:" F951_OPTIONS "}" , .cpp_spec: 0, .combinable: 0, .needs_preprocessing: 0}, |
57 | {.suffix: ".f" , .spec: "@f77" , .cpp_spec: 0, .combinable: 0, .needs_preprocessing: 0}, |
58 | {.suffix: ".for" , .spec: "@f77" , .cpp_spec: 0, .combinable: 0, .needs_preprocessing: 0}, |
59 | {.suffix: ".ftn" , .spec: "@f77" , .cpp_spec: 0, .combinable: 0, .needs_preprocessing: 0}, |
60 | {.suffix: ".fi" , .spec: "@f77" , .cpp_spec: 0, .combinable: 0, .needs_preprocessing: 0}, |
61 | {.suffix: "@f77" , |
62 | .spec: "f951 %i " F951_SOURCE_FORM " \ |
63 | %{E:%{!cpp:%egfortran does not support -E without -cpp}} \ |
64 | %{cpp:" F951_CPP_OPTIONS ";: " CPP_FORWARD_OPTIONS "} \ |
65 | %{!E:" F951_OPTIONS "}" , .cpp_spec: 0, .combinable: 0, .needs_preprocessing: 0}, |
66 | |
67 | #undef F951_CPP_EXTENSION |
68 | #define F951_CPP_EXTENSION ".fii" |
69 | {.suffix: ".F90" , .spec: "@f95-cpp-input" , .cpp_spec: 0, .combinable: 0, .needs_preprocessing: 0}, |
70 | {.suffix: ".F95" , .spec: "@f95-cpp-input" , .cpp_spec: 0, .combinable: 0, .needs_preprocessing: 0}, |
71 | {.suffix: ".F03" , .spec: "@f95-cpp-input" , .cpp_spec: 0, .combinable: 0, .needs_preprocessing: 0}, |
72 | {.suffix: ".F08" , .spec: "@f95-cpp-input" , .cpp_spec: 0, .combinable: 0, .needs_preprocessing: 0}, |
73 | {.suffix: "@f95-cpp-input" , |
74 | .spec: "f951 %i " F951_CPP_OPTIONS " %{!E:" F951_OPTIONS "}" , .cpp_spec: 0, .combinable: 0, .needs_preprocessing: 0}, |
75 | {.suffix: ".f90" , .spec: "@f95" , .cpp_spec: 0, .combinable: 0, .needs_preprocessing: 0}, |
76 | {.suffix: ".f95" , .spec: "@f95" , .cpp_spec: 0, .combinable: 0, .needs_preprocessing: 0}, |
77 | {.suffix: ".f03" , .spec: "@f95" , .cpp_spec: 0, .combinable: 0, .needs_preprocessing: 0}, |
78 | {.suffix: ".f08" , .spec: "@f95" , .cpp_spec: 0, .combinable: 0, .needs_preprocessing: 0}, |
79 | {.suffix: ".fii" , .spec: "@f95" , .cpp_spec: 0, .combinable: 0, .needs_preprocessing: 0}, |
80 | {.suffix: "@f95" , |
81 | .spec: "f951 %i %{E:%{!cpp:%egfortran does not support -E without -cpp}}\ |
82 | %{cpp:" F951_CPP_OPTIONS ";: " CPP_FORWARD_OPTIONS "} \ |
83 | %{!E:" F951_OPTIONS "}" , .cpp_spec: 0, .combinable: 0, .needs_preprocessing: 0}, |
84 | |
85 | |
86 | #undef CPP_ONLY_OPTIONS |
87 | #undef CPP_FORWARD_OPTIONS |
88 | #undef F951_SOURCE_FORM |
89 | #undef F951_CPP_EXTENSION |
90 | #undef F951_CPP_OPTIONS |
91 | #undef F951_OPTIONS |
92 | |