(specs): Use %O instead of "o" for object file suffix.
authorRichard Kenner <kenner@gcc.gnu.org>
Sat, 11 Feb 1995 21:08:02 +0000 (16:08 -0500)
committerRichard Kenner <kenner@gcc.gnu.org>
Sat, 11 Feb 1995 21:08:02 +0000 (16:08 -0500)
(do_spec_1, case 'O'): New option.

From-SVN: r8908

gcc/gcc.c

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