This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Specs changes to activate new traditional cpp
- To: gcc-patches at gcc dot gnu dot org
- Subject: Specs changes to activate new traditional cpp
- From: Zack Weinberg <zack at wolery dot cumb dot org>
- Date: Thu, 6 Jul 2000 16:10:34 -0700
This patch makes spec changes so that -traditional will invoke tradcpp
instead of cpp, and the Chill and Fortran drivers will preprocess only
with tradcpp.
This patch has not been committed. It bootstraps successfully on
i386-linux. I hope someone will review it before hell freezes over.
I notice that Chill is always preprocessed, which seems strange to me.
zw
* gcc.c (C specs [!USE_CPPLIB]): Invoke tradcpp if any of
-traditional, -ftraditional, or -traditional-cpp was given.
Do not pass -traditional to the preprocessor.
(.S spec): Likewise. Don't bother defining __ASSEMBLER__, the
preprocessor does it automatically.
* objc/lang-specs.h: Likewise. Don't bother defining __OBJC__.
* ch/lang-specs.h: Always use tradcpp. Do not pass
-traditional, -trigraphs, or -pedantic to the preprocessor.
* f/lang-specs.h (.F spec): Likewise. Don't bother defining
_LANGUAGE_FORTRAN.
===================================================================
Index: gcc.c
--- gcc.c 2000/06/29 10:24:19 1.150
+++ gcc.c 2000/07/06 23:04:02
@@ -660,7 +660,8 @@ static struct compiler default_compilers
%{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}\
%{!pipe:%g.s} %A\n }}}}"
#else /* ! USE_CPPLIB */
- "cpp -lang-c %{ansi:-std=c89} %{std*} %{nostdinc*}\
+ "%{traditional|ftraditional|traditional-cpp:trad}cpp -lang-c \
+ %{ansi:-std=c89} %{std*} %{nostdinc*}\
%{C} %{v} %{A*} %{I*} %{P} %{$} %I\
%{C:%{!E:%eGNU C does not support -C without using -E}}\
%{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG}\
@@ -669,8 +670,6 @@ static struct compiler default_compilers
%c %{Os:-D__OPTIMIZE_SIZE__} %{O*:%{!O0:-D__OPTIMIZE__}}\
%{ffast-math:-D__FAST_MATH__}\
%{fshort-wchar:-D__WCHAR_TYPE__=short\\ unsigned\\ int}\
- %{traditional} %{ftraditional:-traditional}\
- %{traditional-cpp:-traditional}\
%{fshow-column} %{fno-show-column}\
%{fleading-underscore} %{fno-leading-underscore}\
%{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{D*} %{U*} %{i*} %Z\
@@ -689,7 +688,8 @@ static struct compiler default_compilers
#endif /* ! USE_CPPLIB */
}},
{"-",
- {"%{E:cpp -lang-c %{ansi:-std=c89} %{std*} %{nostdinc*}\
+ {"%{E:%{traditional|ftraditional|traditional-cpp:trad}cpp \
+ -lang-c %{ansi:-std=c89} %{std*} %{nostdinc*}\
%{C} %{v} %{A*} %{I*} %{P} %{$} %I\
%{C:%{!E:%eGNU C does not support -C without using -E}}\
%{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG}\
@@ -698,8 +698,6 @@ static struct compiler default_compilers
%c %{Os:-D__OPTIMIZE_SIZE__} %{O*:%{!O0:-D__OPTIMIZE__}}\
%{ffast-math:-D__FAST_MATH__}\
%{fshort-wchar:-D__WCHAR_TYPE__=short\\ unsigned\\ int}\
- %{traditional} %{ftraditional:-traditional}\
- %{traditional-cpp:-traditional}\
%{fshow-column} %{fno-show-column}\
%{fleading-underscore} %{fno-leading-underscore}\
%{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{D*} %{U*} %{i*} %Z\
@@ -708,7 +706,8 @@ static struct compiler default_compilers
{".h", {"@c-header"}},
{"@c-header",
{"%{!E:%eCompilation of header file requested} \
- cpp %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %{$} %I\
+ %{traditional|ftraditional|traditional-cpp:trad}cpp \
+ %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %{$} %I\
%{C:%{!E:%eGNU C does not support -C without using -E}}\
%{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG}\
%{!no-gcc:-D__GNUC__=%v1 -D__GNUC_MINOR__=%v2 -D__GNUC_PATCHLEVEL__=%v3}\
@@ -717,8 +716,6 @@ static struct compiler default_compilers
%{ffast-math:-D__FAST_MATH__}\
%{fshort-wchar:-D__WCHAR_TYPE__=short\\ unsigned\\ int}\
%{fshort-wchar:-D__WCHAR_TYPE__=short\\ unsigned\\ int}\
- %{traditional} %{ftraditional:-traditional}\
- %{traditional-cpp:-traditional}\
%{fshow-column} %{fno-show-column}\
%{fleading-underscore} %{fno-leading-underscore}\
%{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{D*} %{U*} %{i*} %Z\
@@ -741,15 +738,14 @@ static struct compiler default_compilers
%i %A\n }}}}"}},
{".S", {"@assembler-with-cpp"}},
{"@assembler-with-cpp",
- {"cpp -lang-asm %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %{$} %I\
+ {"%{traditional|ftraditional|traditional-cpp:trad}cpp -lang-asm \
+ %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %{$} %I\
%{C:%{!E:%eGNU C does not support -C without using -E}}\
%{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG} %{trigraphs}\
- -$ %{!undef:%p %P} -D__ASSEMBLER__ \
+ -$ %{!undef:%p %P} \
%c %{Os:-D__OPTIMIZE_SIZE__} %{O*:%{!O0:-D__OPTIMIZE__}}\
%{ffast-math:-D__FAST_MATH__}\
%{fshort-wchar:-D__WCHAR_TYPE__=short\\ unsigned\\ int}\
- %{traditional} %{ftraditional:-traditional}\
- %{traditional-cpp:-traditional}\
%{fshow-column} %{fno-show-column}\
%{fleading-underscore} %{fno-leading-underscore}\
%{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{D*} %{U*} %{i*} %Z\
===================================================================
Index: ch/lang-specs.h
--- ch/lang-specs.h 2000/04/03 23:03:15 1.11
+++ ch/lang-specs.h 2000/07/06 23:04:02
@@ -24,13 +24,13 @@ Boston, MA 02111-1307, USA. */
{".ch", {"@chill"}},
{".chi", {"@chill"}},
{"@chill",
- {"cpp -lang-chill %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %{$} %I\
+ {"tradcpp -lang-chill %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %{$} %I\
%{C:%{!E:%eGNU CHILL does not support -C without using -E}}\
%{!no-gcc:-D__GNUCHILL__=%v1 -D__GNUC_MINOR__=%v2 -D__GNUC_PATCHLEVEL__=%v3}\
- %c %{Os:-D__OPTIMIZE_SIZE__} %{O*:-D__OPTIMIZE__} %{traditional} %{ftraditional:-traditional}\
- %{traditional-cpp:-traditional} %{!undef:%{!ansi:%p} %P} %{trigraphs}\
+ %c %{Os:-D__OPTIMIZE_SIZE__} %{O*:-D__OPTIMIZE__} \
+ %{!undef:%{!ansi:%p} %P} \
%{fshow-column} %{fno-show-column}\
- %{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{D*} %{U*} %{i*} %Z\
+ %{g*} %{W*} %{w} %{H} %{d*} %C %{D*} %{U*} %{i*} %Z\
%i %{!E:%g.i}%{E:%W{o*}} \n",
"%{!E:cc1chill %g.i %1 \
%{!Q:-quiet} -dumpbase %b.ch %{d*} %{m*} %{a}\
===================================================================
Index: f/lang-specs.h
--- f/lang-specs.h 2000/04/03 23:03:17 1.20
+++ f/lang-specs.h 2000/07/06 23:04:02
@@ -35,15 +35,13 @@ the Free Software Foundation, 59 Temple
Sun f77, at least) so you test `__unix' rather than `unix'.
-D_LANGUAGE_FORTRAN is used by some compilers like SGI and
might as well be in there. */
- {"cpp -lang-fortran %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %{$} %I\
+ {"tradcpp -lang-fortran %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %{$} %I\
%{C:%{!E:%eGNU C does not support -C without using -E}}\
%{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG}\
%{!no-gcc:-D__GNUC__=%v1 -D__GNUC_MINOR__=%v2 -D__GNUC_PATCHLEVEL__=%v3}\
- %{ansi:-trigraphs -$ -D__STRICT_ANSI__}\
- %{!undef:%P} -D_LANGUAGE_FORTRAN %{trigraphs} \
- %c %{Os:-D__OPTIMIZE_SIZE__} %{O*:%{!O0:-D__OPTIMIZE__}} -traditional\
+ %{!undef:%P} \
+ %c %{Os:-D__OPTIMIZE_SIZE__} %{O*:%{!O0:-D__OPTIMIZE__}} \
%{ffast-math:-D__FAST_MATH__}\
- %{fshow-column} %{fno-show-column}\
%{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{D*} %{U*} %{i*} %Z\
%i %{!M:%{!MM:%{!E:%{!pipe:%g.i}}}}%{E:%W{o*}}%{M:%W{o*}}%{MM:%W{o*}} |\n",
"%{!M:%{!MM:%{!E:f771 %{!pipe:%g.i} %1 %(f771) \
@@ -86,7 +84,7 @@ the Free Software Foundation, 59 Temple
%{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}\
%{!pipe:%g.s} %A\n }}}}"}},
{"@f77-version",
- {"cpp -lang-fortran %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %{$} %I \
+ {"tradcpp -lang-fortran %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %{$} %I \
%{C:%{!E:%eGNU C does not support -C without using -E}} \
%{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG} \
%{!no-gcc:-D__GNUC__=%v1 -D__GNUC_MINOR__=%v2 -D__GNUC_PATCHLEVEL__=%v3} \
===================================================================
Index: objc/lang-specs.h
--- objc/lang-specs.h 2000/04/03 23:03:18 1.11
+++ objc/lang-specs.h 2000/07/06 23:04:02
@@ -57,17 +57,16 @@ Boston, MA 02111-1307, USA. */
%{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}\
%{!pipe:%g.s} %A\n }}}}"}
#else /* ! USE_CPPLIB */
- {"cpp -lang-objc %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %{$} %I\
+ {"%{traditional|ftraditional|traditional-cpp:trad}cpp -lang-objc \
+ %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %{$} %I\
%{C:%{!E:%eGNU C does not support -C without using -E}}\
%{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG}\
- -D__OBJC__ %{!no-gcc:-D__GNUC__=%v1 -D__GNUC_MINOR__=%v2\
+ %{!no-gcc:-D__GNUC__=%v1 -D__GNUC_MINOR__=%v2 \
-D__GNUC_PATCHLEVEL__=%v3}\
- %{ansi:-trigraphs -D__STRICT_ANSI__}\
+ %{ansi:-trigraphs -D__STRICT_ANSI__}\
%{!undef:%{!ansi:%p} %P} %{trigraphs}\
%c %{Os:-D__OPTIMIZE_SIZE__} %{O*:%{!O0:-D__OPTIMIZE__}}\
%{ffast-math:-D__FAST_MATH__}\
- %{traditional} %{ftraditional:-traditional}\
- %{traditional-cpp:-traditional}\
%{fleading-underscore} %{fno-leading-underscore}\
%{fshow-column} %{fno-show-column}\
%{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{D*} %{U*} %{i*} %Z\