summaryrefslogtreecommitdiff
path: root/gcc/gcc.c
diff options
context:
space:
mode:
authorkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>2001-12-10 23:46:00 +0000
committerkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>2001-12-10 23:46:00 +0000
commitc5025ad664c78fdea631b912b22b0f8bf10c5928 (patch)
tree247214c460bd7b5149211f6082b6aff7647c0fb8 /gcc/gcc.c
parent8a865d8034f32ac9257d580d67a5f03761138f0f (diff)
downloadgcc-c5025ad664c78fdea631b912b22b0f8bf10c5928.tar.gz
* gcc.c (convert_filename): Add do_obj parameter. Don't convert
unless do_obj true. (process_command): Modify calls to convert_filename. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@47857 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gcc.c')
-rw-r--r--gcc/gcc.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/gcc/gcc.c b/gcc/gcc.c
index b65cbb3c388..a6e36bcc7c8 100644
--- 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
/* 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)