Commit ed7dae04 by Richard Kenner

(specs): Use %O instead of "o" for object file suffix.

(do_spec_1, case 'O'): New option.

From-SVN: r8908
parent c40f7b33
...@@ -144,6 +144,11 @@ compilation is specified by a string called a "spec". */ ...@@ -144,6 +144,11 @@ compilation is specified by a string called a "spec". */
#define EXECUTABLE_SUFFIX "" #define EXECUTABLE_SUFFIX ""
#endif #endif
/* By default, the suffix for object files is the letter "o". */
#ifndef OBJECT_SUFFIX
#define OBJECT_SUFFIX "o"
#endif
/* By default, colon separates directories in a path. */ /* By default, colon separates directories in a path. */
#ifndef PATH_SEPARATOR #ifndef PATH_SEPARATOR
#define PATH_SEPARATOR ':' #define PATH_SEPARATOR ':'
...@@ -334,6 +339,7 @@ or with constant text in a single argument. ...@@ -334,6 +339,7 @@ or with constant text in a single argument.
Input files whose names have no recognized suffix are not compiled Input files whose names have no recognized suffix are not compiled
at all, but they are included among the output files, so they will at all, but they are included among the output files, so they will
be linked. be linked.
%O substitutes the suffix for object files.
%p substitutes the standard macro predefinitions for the %p substitutes the standard macro predefinitions for the
current target machine. Use this when running cpp. current target machine. Use this when running cpp.
%P like %p, but puts `__' before and after the name of each macro. %P like %p, but puts `__' before and after the name of each macro.
...@@ -476,7 +482,7 @@ proper position among the other output files. */ ...@@ -476,7 +482,7 @@ proper position among the other output files. */
/* config.h can define STARTFILE_SPEC to override the default crt0 files. */ /* config.h can define STARTFILE_SPEC to override the default crt0 files. */
#ifndef STARTFILE_SPEC #ifndef STARTFILE_SPEC
#define STARTFILE_SPEC \ #define STARTFILE_SPEC \
"%{!shared:%{pg:gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}}}" "%{!shared:%{pg:gcrt0.%O%s}%{!pg:%{p:mcrt0.%O%s}%{!p:crt0.%O%s}}}"
#endif #endif
/* config.h can define SWITCHES_NEED_SPACES to control passing -o and -L. /* config.h can define SWITCHES_NEED_SPACES to control passing -o and -L.
...@@ -597,7 +603,7 @@ static struct compiler default_compilers[] = ...@@ -597,7 +603,7 @@ static struct compiler default_compilers[] =
%{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\ %{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\
%{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\ %{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\
%{!S:as %{R} %{j} %{J} %{h} %{d2} %a %Y\ %{!S:as %{R} %{j} %{J} %{h} %{d2} %a %Y\
%{c:%W{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%u.o}\ %{c:%W{o*}%{!o*:-o %w%b.%O}}%{!c:-o %d%w%u.%O}\
%{!pipe:%g.s} %A\n }}}}"}, %{!pipe:%g.s} %A\n }}}}"},
{"-", {"-",
"%{E:cpp -lang-c %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %I\ "%{E:cpp -lang-c %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %I\
...@@ -632,7 +638,7 @@ static struct compiler default_compilers[] = ...@@ -632,7 +638,7 @@ static struct compiler default_compilers[] =
%{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\ %{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\
%{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\ %{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\
%{!S:as %{R} %{j} %{J} %{h} %{d2} %a %Y\ %{!S:as %{R} %{j} %{J} %{h} %{d2} %a %Y\
%{c:%W{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%u.o}\ %{c:%W{o*}%{!o*:-o %w%b.%O}}%{!c:-o %d%w%u.%O}\
%{!pipe:%g.s} %A\n }}}}"}, %{!pipe:%g.s} %A\n }}}}"},
{".h", "@c-header"}, {".h", "@c-header"},
{"@c-header", {"@c-header",
...@@ -690,7 +696,7 @@ static struct compiler default_compilers[] = ...@@ -690,7 +696,7 @@ static struct compiler default_compilers[] =
%{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\ %{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\
%{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}}|\n\ %{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}}|\n\
%{!S:as %{R} %{j} %{J} %{h} %{d2} %a %Y\ %{!S:as %{R} %{j} %{J} %{h} %{d2} %a %Y\
%{c:%W{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%u.o}\ %{c:%W{o*}%{!o*:-o %w%b.%O}}%{!c:-o %d%w%u.%O}\
%{!pipe:%g.s} %A\n }}}}"}, %{!pipe:%g.s} %A\n }}}}"},
{".i", "@cpp-output"}, {".i", "@cpp-output"},
{"@cpp-output", {"@cpp-output",
...@@ -701,7 +707,7 @@ static struct compiler default_compilers[] = ...@@ -701,7 +707,7 @@ static struct compiler default_compilers[] =
%{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\ %{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\
%{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\ %{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\
%{!S:as %{R} %{j} %{J} %{h} %{d2} %a %Y\ %{!S:as %{R} %{j} %{J} %{h} %{d2} %a %Y\
%{c:%W{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%u.o}\ %{c:%W{o*}%{!o*:-o %w%b.%O}}%{!c:-o %d%w%u.%O}\
%{!pipe:%g.s} %A\n }}}}"}, %{!pipe:%g.s} %A\n }}}}"},
{".ii", "@c++-cpp-output"}, {".ii", "@c++-cpp-output"},
{"@c++-cpp-output", {"@c++-cpp-output",
...@@ -712,12 +718,12 @@ static struct compiler default_compilers[] = ...@@ -712,12 +718,12 @@ static struct compiler default_compilers[] =
%{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\ %{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\
%{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\ %{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\
%{!S:as %{R} %{j} %{J} %{h} %{d2} %a %Y\ %{!S:as %{R} %{j} %{J} %{h} %{d2} %a %Y\
%{c:%W{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%u.o}\ %{c:%W{o*}%{!o*:-o %w%b.%O}}%{!c:-o %d%w%u.%O}\
%{!pipe:%g.s} %A\n }}}}"}, %{!pipe:%g.s} %A\n }}}}"},
{".s", "@assembler"}, {".s", "@assembler"},
{"@assembler", {"@assembler",
"%{!M:%{!MM:%{!E:%{!S:as %{R} %{j} %{J} %{h} %{d2} %a %Y\ "%{!M:%{!MM:%{!E:%{!S:as %{R} %{j} %{J} %{h} %{d2} %a %Y\
%{c:%W{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%u.o}\ %{c:%W{o*}%{!o*:-o %w%b.%O}}%{!c:-o %d%w%u.%O}\
%i %A\n }}}}"}, %i %A\n }}}}"},
{".S", "@assembler-with-cpp"}, {".S", "@assembler-with-cpp"},
{"@assembler-with-cpp", {"@assembler-with-cpp",
...@@ -730,7 +736,7 @@ static struct compiler default_compilers[] = ...@@ -730,7 +736,7 @@ static struct compiler default_compilers[] =
%{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{D*} %{U*} %{i*} %Z\ %{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{D*} %{U*} %{i*} %Z\
%i %{!M:%{!MM:%{!E:%{!pipe:%g.s}}}}%{E:%W{o*}}%{M:%W{o*}}%{MM:%W{o*}} |\n", %i %{!M:%{!MM:%{!E:%{!pipe:%g.s}}}}%{E:%W{o*}}%{M:%W{o*}}%{MM:%W{o*}} |\n",
"%{!M:%{!MM:%{!E:%{!S:as %{R} %{j} %{J} %{h} %{d2} %a %Y\ "%{!M:%{!MM:%{!E:%{!S:as %{R} %{j} %{J} %{h} %{d2} %a %Y\
%{c:%W{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%u.o}\ %{c:%W{o*}%{!o*:-o %w%b.%O}}%{!c:-o %d%w%u.%O}\
%{!pipe:%g.s} %A\n }}}}"}, %{!pipe:%g.s} %A\n }}}}"},
{".ads", "@ada"}, {".ads", "@ada"},
{".adb", "@ada"}, {".adb", "@ada"},
...@@ -742,8 +748,8 @@ static struct compiler default_compilers[] = ...@@ -742,8 +748,8 @@ static struct compiler default_compilers[] =
%{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\ %{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\
%i %{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\ %i %{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\
%{!S:%{!gnatc:%{!gnats:as %{R} %{j} %{J} %{h} %{d2} %a %Y\ %{!S:%{!gnatc:%{!gnats:as %{R} %{j} %{J} %{h} %{d2} %a %Y\
%{c:%W{o*}%{!o*:-o %w%b.o}}\ %{c:%W{o*}%{!o*:-o %w%b.%O}}\
%{!c:-o %d%w%u.o} %{!pipe:%g.s} %A\n}}}}}} "}, %{!c:-o %d%w%u.%O} %{!pipe:%g.s} %A\n}}}}}} "},
/* Mark end of table */ /* Mark end of table */
{0, 0} {0, 0}
}; };
...@@ -3387,6 +3393,11 @@ do_spec_1 (spec, inswitch, soft_matched_part) ...@@ -3387,6 +3393,11 @@ do_spec_1 (spec, inswitch, soft_matched_part)
} }
break; break;
case 'O':
obstack_grow (&obstack, OBJECT_SUFFIX, strlen (OBJECT_SUFFIX));
arg_going = 1;
break;
case 's': case 's':
this_is_library_file = 1; this_is_library_file = 1;
break; break;
......
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