+2001-04-19 DJ Delorie <dj@redhat.com>
+
+ * config/alpha/vms.h: Change OBJECT_SUFFIX and EXECUTABLE_SUFFIX
+ to TARGET_OBJECT_SUFFIX and TARGET_EXECUTABLE_SUFFIX.
+ * config/i386/cygwin.h: Likewise.
+ * config/i386/mingw32.h: Likewise.
+ * config/vax/vms.h: Likewise.
+ * config/i386/djgpp.h: Remove NO_AUTO_EXE_SUFFIX.
+
+ * config/alpha/xm-vms.h: Change OBJECT_SUFFIX and EXECUTABLE_SUFFIX
+ to HOST_OBJECT_SUFFIX and HOST_EXECUTABLE_SUFFIX.
+ * config/i386/xm-cygwin.h: Likewise.
+ * config/i386/xm-djgpp.h: Likewise.
+ * config/i386/xm-mingw32.h: Likewise.
+ * config/vax/xm-vms.h: Likewise.
+
+ * mkdeps.c (deps_add_default_target): Use TARGET_OBJECT_SUFFIX
+ instead of OBJECT_SUFFIX.
+ * collect2.c (find_a_file): Look for files matching the extension
+ HOST_EXECUTABLE_SUFFIX instead of EXECUTABLE_SUFFIX.
+ * gcc.c (DEFAULT_SWITCH_CURTAILS_COMPILATION): Depend on
+ TARGET_EXECUTABLE_SUFFIX.
+ (find_a_file): Use HOST_EXECUTABLE_SUFFIX.
+ (make_relative_prefix): Likewise.
+ (convert_filename): Use TARGET_ suffixes throughout. Remove
+ NO_AUTO_EXE_SUFFIX.
+ (process_command): Likewise.
+ (do_spec_1): Likewise.
+ * java/lang.c (init_parse): Likewise.
+
+ * gcc.texi : Document four new options matching the pattern
+ (HOST|TARGET)_(OBJECT|EXECUTABLE)_SUFFIX. Remove documentation
+ for deleted macros OBJECT_SUFFIX and EXECUTABLE_SUFFIX. Remove
+ documentation for NO_AUTO_EXE_SUFFIX.
+
2001-04-19 Mark Mitchell <mark@codesourcery.com>
* toplev.h (struct lang_hooks): Allow decode_option to indicate
if (debug)
fprintf (stderr, "Looking for '%s'\n", name);
-#ifdef EXECUTABLE_SUFFIX
- len += strlen (EXECUTABLE_SUFFIX);
+#ifdef HOST_EXECUTABLE_SUFFIX
+ len += strlen (HOST_EXECUTABLE_SUFFIX);
#endif
temp = xmalloc (len);
return temp;
}
-#ifdef EXECUTABLE_SUFFIX
+#ifdef HOST_EXECUTABLE_SUFFIX
/* Some systems have a suffix for executable files.
So try appending that. */
strcpy (temp, name);
- strcat (temp, EXECUTABLE_SUFFIX);
+ strcat (temp, HOST_EXECUTABLE_SUFFIX);
if (access (temp, X_OK) == 0)
return temp;
&& access (temp, X_OK) == 0)
return temp;
-#ifdef EXECUTABLE_SUFFIX
+#ifdef HOST_EXECUTABLE_SUFFIX
/* Some systems have a suffix for executable files.
So try appending that. */
- strcat (temp, EXECUTABLE_SUFFIX);
+ strcat (temp, HOST_EXECUTABLE_SUFFIX);
if (stat (temp, &st) >= 0
&& ! S_ISDIR (st.st_mode)
#define OPEN_VMS 1
+#define TARGET_OBJECT_SUFFIX ".obj"
+#define TARGET_EXECUTABLE_SUFFIX ".exe"
+
/* This enables certain macros in alpha.h, which will make an indirect
reference to an external symbol an invalid address. This needs to be
defined before we include alpha.h, since it determines which macros
#define STDC_HEADERS 1
#define HAVE_STRINGIZE 1
-#define OBJECT_SUFFIX ".obj"
-#define EXECUTABLE_SUFFIX ".exe"
+#define HOST_EXECUTABLE_SUFFIX ".exe"
+#define HOST_OBJECT_SUFFIX ".obj"
#define SDB_DEBUGGING_INFO
#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
+#define TARGET_EXECUTABLE_SUFFIX ".exe"
+
#include <stdio.h>
#include "i386/gas.h"
#include "dbxcoff.h"
unless user explicitly requests it. */
#undef LOCAL_INCLUDE_DIR
-/* Do not make only .exe if no executable file suffix was specified. */
-/* Let the linker handle that. */
-#undef NO_AUTO_EXE_SUFFIX
-#define NO_AUTO_EXE_SUFFIX
-
#undef EXTRA_SECTIONS
#define EXTRA_SECTIONS in_ctor, in_dtor
/* Operating system specific defines to be used when targeting GCC for
hosting on Windows32, using GNU tools and the Windows32 API Library.
- Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
This file is part of GNU CC.
#include "i386/cygwin.h"
+#define TARGET_EXECUTABLE_SUFFIX ".exe"
+
/* Please keep changes to CPP_PREDEFINES in sync with i386/crtdll. The
only difference between the two should be __MSVCRT__ needed to
distinguish MSVC from CRTDLL runtime in mingw headers. */
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#define EXECUTABLE_SUFFIX ".exe"
+#define HOST_EXECUTABLE_SUFFIX ".exe"
/* Even though Cygwin tries to hide the DOS based filesystem, it
still shows though at times. */
/* Configuration for GNU C-compiler for Intel 80386 running DJGPP.
- Copyright (C) 1988, 1996, 1998, 1999, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1988, 1996, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
This file is part of GNU CC.
/* Use semicolons to separate elements of a path. */
#define PATH_SEPARATOR ';'
-#define EXECUTABLE_SUFFIX ".exe"
+#define HOST_EXECUTABLE_SUFFIX ".exe"
/* Even though we support "/", allow "\" since everybody tests both. */
#define DIR_SEPARATOR '/'
like Cygwin does. */
#define HAVE_DOS_BASED_FILE_SYSTEM
-#define EXECUTABLE_SUFFIX ".exe"
+#define HOST_EXECUTABLE_SUFFIX ".exe"
#undef PATH_SEPARATOR
#define PATH_SEPARATOR ';'
/* Output variables, constants and external declarations, for GNU compiler.
- Copyright (C) 1988, 1994, 1995, 1996, 1997, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1988, 1994, 1995, 1996, 1997, 1999, 2001 Free Software Foundation, Inc.
This file is part of GNU CC.
#define VMS_TARGET
+#define TARGET_EXECUTABLE_SUFFIX ".exe"
+#define TARGET_OBJECT_SUFFIX ".obj"
+
/* This enables certain macros in vax.h, which will make an indirect
reference to an external symbol an invalid address. This needs to be
defined before we include vax.h, since it determines which macros
#pragma message disable (undefescap)
#endif
-#define OBJECT_SUFFIX ".obj"
-#define EXECUTABLE_SUFFIX ".exe"
+#define HOST_EXECUTABLE_SUFFIX ".exe"
+#define HOST_OBJECT_SUFFIX ".obj"
extern int getrusage PARAMS ((int, struct rusage *));
#endif
-/* By default there is no special suffix for executables. */
-#ifdef EXECUTABLE_SUFFIX
-#define HAVE_EXECUTABLE_SUFFIX
+/* By default there is no special suffix for target executables. */
+/* FIXME: when autoconf is fixed, remove the host check - dj */
+#if defined(TARGET_EXECUTABLE_SUFFIX) && defined(HOST_EXECUTABLE_SUFFIX)
+#define HAVE_TARGET_EXECUTABLE_SUFFIX
#else
-#define EXECUTABLE_SUFFIX ""
+#define TARGET_EXECUTABLE_SUFFIX ""
#endif
-/* By default, the suffix for object files is ".o". */
-#ifdef OBJECT_SUFFIX
-#define HAVE_OBJECT_SUFFIX
+/* By default there is no special suffix for host executables. */
+#ifdef HOST_EXECUTABLE_SUFFIX
+#define HAVE_HOST_EXECUTABLE_SUFFIX
#else
-#define OBJECT_SUFFIX ".o"
+#define HOST_EXECUTABLE_SUFFIX ""
+#endif
+
+/* By default, the suffix for target object files is ".o". */
+#ifdef TARGET_OBJECT_SUFFIX
+#define HAVE_TARGET_OBJECT_SUFFIX
+#else
+#define TARGET_OBJECT_SUFFIX ".o"
#endif
#ifndef VMS
#define WORD_SWITCH_TAKES_ARG(STR) DEFAULT_WORD_SWITCH_TAKES_ARG (STR)
#endif
\f
-#ifdef HAVE_EXECUTABLE_SUFFIX
+#ifdef HAVE_TARGET_EXECUTABLE_SUFFIX
/* This defines which switches stop a full compilation. */
#define DEFAULT_SWITCH_CURTAILS_COMPILATION(CHAR) \
((CHAR) == 'c' || (CHAR) == 'S')
}
strcat (nstore, progname);
if (! access (nstore, X_OK)
-#ifdef HAVE_EXECUTABLE_SUFFIX
- || ! access (strcat (nstore, EXECUTABLE_SUFFIX), X_OK)
+#ifdef HAVE_HOST_EXECUTABLE_SUFFIX
+ || ! access (strcat (nstore, HOST_EXECUTABLE_SUFFIX), X_OK)
#endif
)
{
int mode;
{
char *temp;
- const char *file_suffix = ((mode & X_OK) != 0 ? EXECUTABLE_SUFFIX : "");
+ const char *file_suffix = ((mode & X_OK) != 0 ? HOST_EXECUTABLE_SUFFIX : "");
struct prefix_list *pl;
int len = pprefix->max_len + strlen (name) + strlen (file_suffix) + 1;
/* Gives value to pass as "warn" to add_prefix for standard prefixes. */
static int *warn_std_ptr = 0;
\f
-#if defined(HAVE_OBJECT_SUFFIX) || defined(HAVE_EXECUTABLE_SUFFIX)
+#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. */
len = strlen (name);
-#ifdef HAVE_OBJECT_SUFFIX
- /* Convert x.o to x.obj if OBJECT_SUFFIX is ".obj". */
+#ifdef HAVE_TARGET_OBJECT_SUFFIX
+ /* Convert x.o to x.obj if TARGET_OBJECT_SUFFIX is ".obj". */
if (len > 2
&& name[len - 2] == '.'
&& name[len - 1] == 'o')
{
obstack_grow (&obstack, name, len - 2);
- obstack_grow0 (&obstack, OBJECT_SUFFIX, strlen (OBJECT_SUFFIX));
+ obstack_grow0 (&obstack, TARGET_OBJECT_SUFFIX, strlen (TARGET_OBJECT_SUFFIX));
name = obstack_finish (&obstack);
}
#endif
-#if defined(HAVE_EXECUTABLE_SUFFIX) && !defined(NO_AUTO_EXE_SUFFIX)
+#if defined(HAVE_TARGET_EXECUTABLE_SUFFIX)
/* If there is no filetype, make it the executable suffix (which includes
the "."). But don't get confused if we have just "-o". */
- if (! do_exe || EXECUTABLE_SUFFIX[0] == 0 || (len == 2 && name[0] == '-'))
+ if (! do_exe || TARGET_EXECUTABLE_SUFFIX[0] == 0 || (len == 2 && name[0] == '-'))
return name;
for (i = len - 1; i >= 0; i--)
return name;
obstack_grow (&obstack, name, len);
- obstack_grow0 (&obstack, EXECUTABLE_SUFFIX, strlen (EXECUTABLE_SUFFIX));
+ obstack_grow0 (&obstack, TARGET_EXECUTABLE_SUFFIX, strlen (TARGET_EXECUTABLE_SUFFIX));
name = obstack_finish (&obstack);
#endif
case 'o':
have_o = 1;
-#if defined(HAVE_EXECUTABLE_SUFFIX)
+#if defined(HAVE_TARGET_EXECUTABLE_SUFFIX)
if (! have_c)
{
int skip;
}
}
#endif
-#if defined(HAVE_EXECUTABLE_SUFFIX) || defined(HAVE_OBJECT_SUFFIX)
+#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);
else
}
else
{
-#ifdef HAVE_OBJECT_SUFFIX
+#ifdef HAVE_TARGET_OBJECT_SUFFIX
argv[i] = convert_filename (argv[i], 0);
#endif
if (*p == '.' || ISALPHA ((unsigned char) *p))
abort ();
if (suffix_length == 0)
- suffix = OBJECT_SUFFIX;
+ suffix = TARGET_OBJECT_SUFFIX;
else
{
saved_suffix
= (char *) xmalloc (suffix_length
- + strlen (OBJECT_SUFFIX));
+ + strlen (TARGET_OBJECT_SUFFIX));
strncpy (saved_suffix, suffix, suffix_length);
strcpy (saved_suffix + suffix_length,
- OBJECT_SUFFIX);
+ TARGET_OBJECT_SUFFIX);
}
- suffix_length += strlen (OBJECT_SUFFIX);
+ suffix_length += strlen (TARGET_OBJECT_SUFFIX);
}
/* See if we already have an association of %g/%u/%U and
}
case 'O':
- obstack_grow (&obstack, OBJECT_SUFFIX, strlen (OBJECT_SUFFIX));
+ obstack_grow (&obstack, TARGET_OBJECT_SUFFIX, strlen (TARGET_OBJECT_SUFFIX));
arg_going = 1;
break;
names, the character you specify will be used. GCC will test for
both slash and the character you specify when parsing filenames.
-@findex OBJECT_SUFFIX
-@item OBJECT_SUFFIX
+@findex TARGET_OBJECT_SUFFIX
+@item TARGET_OBJECT_SUFFIX
Define this macro to be a C string representing the suffix for object
-files on your machine. If you do not define this macro, GCC will use
-@samp{.o} as the suffix for object files.
-
-@findex EXECUTABLE_SUFFIX
-@item EXECUTABLE_SUFFIX
-Define this macro to be a C string representing the suffix for executable
-files on your machine. If you do not define this macro, GCC will use
-the null string as the suffix for object files.
-
-@findex NO_AUTO_EXE_SUFFIX
-@item NO_AUTO_EXE_SUFFIX
-Define this macro if executable files on your machine have a suffix, but
-the compiler driver should not automatically append it to the output file
-name, if user hasn't specified one.
+files on your target machine. If you do not define this macro, GCC will
+use @samp{.o} as the suffix for object files.
+
+@findex TARGET_EXECUTABLE_SUFFIX
+@item TARGET_EXECUTABLE_SUFFIX
+Define this macro to be a C string representing the suffix to be
+automatically added to executable files on your target machine. If you
+do not define this macro, GCC will use the null string as the suffix for
+executable files.
+
+@findex HOST_OBJECT_SUFFIX
+@item HOST_OBJECT_SUFFIX
+Define this macro to be a C string representing the suffix for object
+files on your host machine (@samp{xm-*.h}). If you do not define this
+macro, GCC will use @samp{.o} as the suffix for object files.
+
+@findex HOST_EXECUTABLE_SUFFIX
+@item HOST_EXECUTABLE_SUFFIX
+Define this macro to be a C string representing the suffix for
+executable files on your host machine (@samp{xm-*.h}). If you do not
+define this macro, GCC will use the null string as the suffix for
+executable files.
@findex HOST_BIT_BUCKET
@item HOST_BIT_BUCKET
struct string_option *,
int));
-#ifndef OBJECT_SUFFIX
-# define OBJECT_SUFFIX ".o"
+#ifndef TARGET_OBJECT_SUFFIX
+# define TARGET_OBJECT_SUFFIX ".o"
#endif
/* Table indexed by tree code giving a string containing a character
else
{
char *buf = (char *) xmalloc (dot - filename +
- 3 + sizeof (OBJECT_SUFFIX));
+ 3 + sizeof (TARGET_OBJECT_SUFFIX));
strncpy (buf, filename, dot - filename);
/* If emitting class files, we might have multiple
jcf_dependency_set_target (NULL);
else
{
- strcpy (buf + (dot - filename), OBJECT_SUFFIX);
+ strcpy (buf + (dot - filename), TARGET_OBJECT_SUFFIX);
jcf_dependency_set_target (buf);
}
deps_add_target (d, "-", 1);
else
{
-#ifndef OBJECT_SUFFIX
-# define OBJECT_SUFFIX ".o"
+#ifndef TARGET_OBJECT_SUFFIX
+# define TARGET_OBJECT_SUFFIX ".o"
#endif
char *start = lbasename (tgt);
- char *o = (char *) alloca (strlen (start) + strlen (OBJECT_SUFFIX) + 1);
+ char *o = (char *) alloca (strlen (start) + strlen (TARGET_OBJECT_SUFFIX) + 1);
char *suffix;
strcpy (o, start);
suffix = strrchr (o, '.');
if (!suffix)
suffix = o + strlen (o);
- strcpy (suffix, OBJECT_SUFFIX);
+ strcpy (suffix, TARGET_OBJECT_SUFFIX);
deps_add_target (d, o, 1);
}