Commit 829407e1 by Richard Stallman

(default_compilers): Define __GNUC_MINOR__, using %v.

(do_spec_1): Implement %v.

From-SVN: r5899
parent 37f2a146
...@@ -244,6 +244,8 @@ or with constant text in a single argument. ...@@ -244,6 +244,8 @@ or with constant text in a single argument.
%x{OPTION} Accumulate an option for %X. %x{OPTION} Accumulate an option for %X.
%X Output the accumulated linker options specified by compilations. %X Output the accumulated linker options specified by compilations.
%Y Output the accumulated assembler options specified by compilations. %Y Output the accumulated assembler options specified by compilations.
%v Substitute the minor version number of GCC.
(For version 2.5.n, this is 5.)
%a process ASM_SPEC as a spec. %a process ASM_SPEC as a spec.
This allows config.h to specify part of the spec for running as. This allows config.h to specify part of the spec for running as.
%A process ASM_FINAL_SPEC as a spec. A capital A is actually %A process ASM_FINAL_SPEC as a spec. A capital A is actually
...@@ -444,7 +446,8 @@ static struct compiler default_compilers[] = ...@@ -444,7 +446,8 @@ static struct compiler default_compilers[] =
"cpp -lang-c %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %I\ "cpp -lang-c %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %I\
%{C:%{!E:%eGNU C does not support -C without using -E}}\ %{C:%{!E:%eGNU C does not support -C without using -E}}\
%{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d}\ %{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d}\
-undef -D__GNUC__=2 %{ansi:-trigraphs -$ -D__STRICT_ANSI__}\ -undef -D__GNUC__=2 -D__GNUC_MINOR__=%v\
%{ansi:-trigraphs -$ -D__STRICT_ANSI__}\
%{!undef:%{!ansi:%p} %P} %{trigraphs} \ %{!undef:%{!ansi:%p} %P} %{trigraphs} \
%c %{O*:%{!O0:-D__OPTIMIZE__}} %{traditional} %{ftraditional:-traditional}\ %c %{O*:%{!O0:-D__OPTIMIZE__}} %{traditional} %{ftraditional:-traditional}\
%{traditional-cpp:-traditional}\ %{traditional-cpp:-traditional}\
...@@ -476,7 +479,8 @@ static struct compiler default_compilers[] = ...@@ -476,7 +479,8 @@ static struct compiler default_compilers[] =
"cpp -lang-objc %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %I\ "cpp -lang-objc %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %I\
%{C:%{!E:%eGNU C does not support -C without using -E}}\ %{C:%{!E:%eGNU C does not support -C without using -E}}\
%{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d}\ %{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d}\
-undef -D__OBJC__ -D__GNUC__=2 %{ansi:-trigraphs -$ -D__STRICT_ANSI__}\ -undef -D__OBJC__ -D__GNUC__=2 -D__GNUC_MINOR__=%v\
%{ansi:-trigraphs -$ -D__STRICT_ANSI__}\
%{!undef:%{!ansi:%p} %P} %{trigraphs}\ %{!undef:%{!ansi:%p} %P} %{trigraphs}\
%c %{O*:%{!O0:-D__OPTIMIZE__}} %{traditional} %{ftraditional:-traditional}\ %c %{O*:%{!O0:-D__OPTIMIZE__}} %{traditional} %{ftraditional:-traditional}\
%{traditional-cpp:-traditional}\ %{traditional-cpp:-traditional}\
...@@ -499,7 +503,8 @@ static struct compiler default_compilers[] = ...@@ -499,7 +503,8 @@ static struct compiler default_compilers[] =
cpp %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %I\ cpp %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %I\
%{C:%{!E:%eGNU C does not support -C without using -E}}\ %{C:%{!E:%eGNU C does not support -C without using -E}}\
%{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} \ %{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} \
-undef -D__GNUC__=2 %{ansi:-trigraphs -$ -D__STRICT_ANSI__}\ -undef -D__GNUC__=2 -D__GNUC_MINOR__=%v\
%{ansi:-trigraphs -$ -D__STRICT_ANSI__}\
%{!undef:%{!ansi:%p} %P} %{trigraphs}\ %{!undef:%{!ansi:%p} %P} %{trigraphs}\
%c %{O*:%{!O0:-D__OPTIMIZE__}} %{traditional} %{ftraditional:-traditional}\ %c %{O*:%{!O0:-D__OPTIMIZE__}} %{traditional} %{ftraditional:-traditional}\
%{traditional-cpp:-traditional}\ %{traditional-cpp:-traditional}\
...@@ -512,7 +517,7 @@ static struct compiler default_compilers[] = ...@@ -512,7 +517,7 @@ static struct compiler default_compilers[] =
"cpp -lang-c++ %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %I\ "cpp -lang-c++ %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %I\
%{C:%{!E:%eGNU C++ does not support -C without using -E}}\ %{C:%{!E:%eGNU C++ does not support -C without using -E}}\
%{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} \ %{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} \
-undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus \ -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -D__GNUC_MINOR__=%v\
%{ansi:-trigraphs -$ -D__STRICT_ANSI__} %{!undef:%{!ansi:%p} %P}\ %{ansi:-trigraphs -$ -D__STRICT_ANSI__} %{!undef:%{!ansi:%p} %P}\
%c %{O*:%{!O0:-D__OPTIMIZE__}} %{traditional} %{ftraditional:-traditional}\ %c %{O*:%{!O0:-D__OPTIMIZE__}} %{traditional} %{ftraditional:-traditional}\
%{traditional-cpp:-traditional} %{trigraphs}\ %{traditional-cpp:-traditional} %{trigraphs}\
...@@ -3345,6 +3350,22 @@ do_spec_1 (spec, inswitch, soft_matched_part) ...@@ -3345,6 +3350,22 @@ do_spec_1 (spec, inswitch, soft_matched_part)
} }
break; break;
case 'v':
{
char *p = version_string;
char *q, *copy;
/* Set P after the first period. */
while (*p != '.') p++;
p++;
/* Set Q at the second period or at the end. */
q = p;
while (*q != '.' && *q != 0) q++;
/* Put that part into the command. */
obstack_grow (&obstack, p, q - p);
arg_going = 1;
}
break;
case '|': case '|':
if (input_from_pipe) if (input_from_pipe)
do_spec_1 ("-", 0, NULL_PTR); do_spec_1 ("-", 0, NULL_PTR);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment