summaryrefslogtreecommitdiff
path: root/gcc/fortran/lang-specs.h
diff options
context:
space:
mode:
authordfranke <dfranke@138bc75d-0d04-0410-961f-82ee72b054a4>2008-05-25 22:37:41 +0000
committerdfranke <dfranke@138bc75d-0d04-0410-961f-82ee72b054a4>2008-05-25 22:37:41 +0000
commit2ecc6bc5131880ba6c464152d56fb1a301cc2d4f (patch)
tree9d6609dea095d4ea5b2bebb6f1ba50daa94929f5 /gcc/fortran/lang-specs.h
parenteba15a754cd9bb1181e8ae6bec719f799f77e8ff (diff)
downloadgcc-2ecc6bc5131880ba6c464152d56fb1a301cc2d4f.tar.gz
gcc:
2008-05-26 Daniel Franke <franke.daniel@gmail.com> PR fortran/18428 * c.opt: Removed undocumented option '-lang-fortran'. * c-common.h: Removed global variable 'lang_fortran'. * c-opts.c (c_common_handle_option): Removed code to handle option '-lang-fortran'. Updated includes. * c-cppbuiltin.c (c_cpp_builtins): Removed conditional definition of '__GFORTRAN__'. (define__GNUC__): Reimplemented to use BASEVER and cpp_define_formatted. (builtin_define_with_value_n): Removed. * c-incpath.h: Renamed to ... * incpath.h: ... this. * c-incpath.c: Renamed to ... * incpath.c: ... this. Updated includes. * fix-header.c: Updated includes. * Makefile.in: Replaced c-incpath.[ch] by incpath.[ch]. (c-cppbuiltin.o): Added dependency on and definition of BASEVER. (OBJ-archive): Added cppdefault.o, incpath.o and prefix.o. gcc/cp: 2008-05-26 Daniel Franke <franke.daniel@gmail.com> * Makefile.in: Adjusted dependencies on c-incpath.o. gcc/fortran: 2008-05-26 Daniel Franke <franke.daniel@gmail.com> PR fortran/18428 * lang.opt (A, C, CC, D, E, H, P, U, cpp, d, fworking-directory, imultilib, iprefix, iquote, isysroot, isystem, nocpp, nostdinc, o, undef, v): New options. * options.c (gfc_init_options): Also initialize preprocessor options. (gfc_post_options): Also handle post-initialization of preprocessor options. (gfc_handle_option): Check if option is a preprocessor option. If yes, let gfc_cpp_handle_option() handle the option. * lang-specs.h: Reorganized to handle new options. * scanner.c (gfc_new_file): Read temporary file instead of input source if preprocessing is enabled. * f95-lang.c (gfc_init): Initialize preprocessor. (gfc_finish): Clean up preprocessor. * cpp.c: New. * cpp.h: New. * Make-lang.in: Added new objects and dependencies. * gfortran.texi: Updated section "Preprocessing and conditional compilation". * invoke.texi: Added new section "Preprocessing Options", listed and documented the preprocessing options handled by gfortran. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@135882 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/lang-specs.h')
-rw-r--r--gcc/fortran/lang-specs.h44
1 files changed, 27 insertions, 17 deletions
diff --git a/gcc/fortran/lang-specs.h b/gcc/fortran/lang-specs.h
index e5c54ae0011..e4bd0509c8b 100644
--- a/gcc/fortran/lang-specs.h
+++ b/gcc/fortran/lang-specs.h
@@ -20,35 +20,45 @@
/* This is the contribution to the `default_compilers' array in gcc.c
for the f95 language. */
+
+#define F951_CPP_OPTIONS "%{!nocpp: -cpp %g.f90 %(cpp_options)\
+ %{E|M|MM:%(cpp_debug_options) -fsyntax-only} %{E}}"
+#define F951_OPTIONS "%(cc1_options) %{J*} %{I*}\
+ %{!nostdinc:-fintrinsic-modules-path finclude%s}\
+ %{!fsyntax-only:%(invoke_as)}"
+#define F951_SOURCE_FORM "%{!ffree-form:-ffixed-form}"
+
+
{".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",
- "cc1 -E -lang-fortran -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*}\
- -fpreprocessed %{!nostdinc:-fintrinsic-modules-path finclude%s} %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},
+ "f951 %i " F951_SOURCE_FORM " " \
+ F951_CPP_OPTIONS " %{!E:" F951_OPTIONS "}", 0, 0, 0},
+{".f", "@f77", 0, 0, 0},
+{".for", "@f77", 0, 0, 0},
+{".ftn", "@f77", 0, 0, 0},
+{"@f77",
+ "f951 %i " F951_SOURCE_FORM " \
+ %{E:%{!cpp:%egfortran does not support -E without -cpp}} \
+ %{cpp:" F951_CPP_OPTIONS "} %{!E:" F951_OPTIONS "}", 0, 0, 0},
{".F90", "@f95-cpp-input", 0, 0, 0},
{".F95", "@f95-cpp-input", 0, 0, 0},
{".F03", "@f95-cpp-input", 0, 0, 0},
{".F08", "@f95-cpp-input", 0, 0, 0},
{"@f95-cpp-input",
- "cc1 -E -lang-fortran -traditional-cpp -D_LANGUAGE_FORTRAN %(cpp_options) \
- %{E|M|MM:%(cpp_debug_options)}\
- %{!M:%{!MM:%{!E: -o %|.f95 |\n\
- f951 %|.f95 %{!ffixed-form:-ffree-form} %(cc1_options) %{J*} %{I*}\
- -fpreprocessed %{!nostdinc:-fintrinsic-modules-path finclude%s} %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},
+ "f951 %i " F951_CPP_OPTIONS " %{!E:" F951_OPTIONS "}", 0, 0, 0},
{".f90", "@f95", 0, 0, 0},
{".f95", "@f95", 0, 0, 0},
{".f03", "@f95", 0, 0, 0},
{".f08", "@f95", 0, 0, 0},
-{"@f95", "%{!E:f951 %i %(cc1_options) %{J*} %{I*}\
- %{!nostdinc:-fintrinsic-modules-path finclude%s} %{!fsyntax-only:%(invoke_as)}}", 0, 0, 0},
-{".f", "@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},
+{"@f95",
+ "f951 %i %{E:%{!cpp:%egfortran does not support -E without -cpp}}\
+ %{cpp:" F951_CPP_OPTIONS "} %{!E:" F951_OPTIONS "}", 0, 0, 0},
+
+
+#undef F951_SOURCE_FORM
+#undef F951_CPP_OPTIONS
+#undef F951_OPTIONS