gcc.c (convert_filename): Add do_obj parameter.
authorDouglas B Rupp <rupp@gnat.com>
Mon, 10 Dec 2001 23:46:00 +0000 (18:46 -0500)
committerRichard Kenner <kenner@gcc.gnu.org>
Mon, 10 Dec 2001 23:46:00 +0000 (18:46 -0500)
* gcc.c (convert_filename): Add do_obj parameter. Don't convert
unless do_obj true.
(process_command): Modify calls to convert_filename.

From-SVN: r47857

gcc/ChangeLog
gcc/gcc.c

index 04e0107a757ea44420aae5cfbd75b77ae0d9c5b8..c0360aef3b013e2ff1b97f9349f93a0f2b260255 100644 (file)
@@ -1,3 +1,9 @@
+Mon Dec 10 18:37:31 2001  Douglas B. Rupp  <rupp@gnat.com>
+
+       * gcc.c (convert_filename): Add do_obj parameter. Don't convert
+       unless do_obj true.
+       (process_command): Modify calls to convert_filename.
+
 2001-12-11  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
 
        * config/sparc/sol2-sld-64.h: Include dbxelf.h again.
index b65cbb3c388b86f4925cebbdec7b185e12f0a243..a6e36bcc7c85f01182687b33dbc3a878dcec9f12 100644 (file)
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -320,7 +320,7 @@ static void init_gcc_specs              PARAMS ((struct obstack *,
                                                 const char *));
 #endif
 #if defined(HAVE_TARGET_OBJECT_SUFFIX) || defined(HAVE_TARGET_EXECUTABLE_SUFFIX)
-static const char *convert_filename    PARAMS ((const char *, int));
+static const char *convert_filename    PARAMS ((const char *, int, int));
 #endif
 \f
 /* The Specs Language
@@ -2927,12 +2927,14 @@ static int *warn_std_ptr = 0;
 #if defined(HAVE_TARGET_OBJECT_SUFFIX) || defined(HAVE_TARGET_EXECUTABLE_SUFFIX)
 
 /* Convert NAME to a new name if it is the standard suffix.  DO_EXE
-   is true if we should look for an executable suffix as well.  */
+   is true if we should look for an executable suffix.  DO_OBJ
+   is true if we should look for an object suffix.  */
 
 static const char *
-convert_filename (name, do_exe)
+convert_filename (name, do_exe, do_obj)
      const char *name;
      int do_exe ATTRIBUTE_UNUSED;
+     int do_obj ATTRIBUTE_UNUSED;
 {
 #if defined(HAVE_TARGET_EXECUTABLE_SUFFIX)
   int i;
@@ -2946,7 +2948,7 @@ convert_filename (name, do_exe)
 
 #ifdef HAVE_TARGET_OBJECT_SUFFIX
   /* Convert x.o to x.obj if TARGET_OBJECT_SUFFIX is ".obj".  */
-  if (len > 2
+  if (do_obj && len > 2
       && name[len - 2] == '.'
       && name[len - 1] == 'o')
     {
@@ -3627,9 +3629,9 @@ process_command (argc, argv)
 #endif
 #if defined(HAVE_TARGET_EXECUTABLE_SUFFIX) || defined(HAVE_TARGET_OBJECT_SUFFIX)
              if (p[1] == 0)
-               argv[i + 1] = convert_filename (argv[i + 1], ! have_c);
+               argv[i + 1] = convert_filename (argv[i + 1], ! have_c, 0);
              else
-               argv[i] = convert_filename (argv[i], ! have_c);
+               argv[i] = convert_filename (argv[i], ! have_c, 0);
 #endif
              goto normal_switch;
 
@@ -3948,7 +3950,7 @@ process_command (argc, argv)
       else
        {
 #ifdef HAVE_TARGET_OBJECT_SUFFIX
-         argv[i] = convert_filename (argv[i], 0);
+         argv[i] = convert_filename (argv[i], 0, access (argv[i], F_OK));
 #endif
 
          if (strcmp (argv[i], "-") != 0 && access (argv[i], F_OK) < 0)