Commit 45936a85 by DJ Delorie Committed by DJ Delorie

vms.h: Change OBJECT_SUFFIX and EXECUTABLE_SUFFIX to TARGET_OBJECT_SUFFIX and...

* 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.

From-SVN: r41428
parent 57883c53
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
......
......@@ -652,8 +652,8 @@ find_a_file (pprefix, name)
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);
......@@ -676,11 +676,11 @@ find_a_file (pprefix, name)
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;
......@@ -702,10 +702,10 @@ find_a_file (pprefix, name)
&& 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)
......
......@@ -20,6 +20,9 @@ Boston, MA 02111-1307, USA. */
#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
......
......@@ -76,5 +76,5 @@ Boston, MA 02111-1307, USA. */
#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"
......@@ -26,6 +26,8 @@ Boston, MA 02111-1307, USA. */
#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"
......
......@@ -150,11 +150,6 @@ Boston, MA 02111-1307, USA. */
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.
......@@ -24,6 +24,8 @@ Boston, MA 02111-1307, USA. */
#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. */
......
......@@ -19,7 +19,7 @@ along with GNU CC; see the file COPYING. If not, write to
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.
......@@ -21,7 +21,7 @@ Boston, MA 02111-1307, USA. */
/* 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 '/'
......
......@@ -29,7 +29,7 @@ Boston, MA 02111-1307, USA. */
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.
......@@ -20,6 +20,9 @@ Boston, MA 02111-1307, USA. */
#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
......
......@@ -170,5 +170,5 @@ Boston, MA 02111-1307, USA. */
#pragma message disable (undefescap)
#endif
#define OBJECT_SUFFIX ".obj"
#define EXECUTABLE_SUFFIX ".exe"
#define HOST_EXECUTABLE_SUFFIX ".exe"
#define HOST_OBJECT_SUFFIX ".obj"
......@@ -92,18 +92,26 @@ compilation is specified by a string called a "spec". */
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
......@@ -721,7 +729,7 @@ static struct user_specs *user_specs_head, *user_specs_tail;
#define WORD_SWITCH_TAKES_ARG(STR) DEFAULT_WORD_SWITCH_TAKES_ARG (STR)
#endif
#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')
......@@ -2232,8 +2240,8 @@ make_relative_prefix (progname, bin_prefix, prefix)
}
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
)
{
......@@ -2352,7 +2360,7 @@ find_a_file (pprefix, name, mode)
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;
......@@ -2807,7 +2815,7 @@ static int warn_std;
/* Gives value to pass as "warn" to add_prefix for standard prefixes. */
static int *warn_std_ptr = 0;
#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. */
......@@ -2825,22 +2833,22 @@ convert_filename (name, do_exe)
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--)
......@@ -2852,7 +2860,7 @@ convert_filename (name, do_exe)
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
......@@ -3445,7 +3453,7 @@ process_command (argc, argv)
case 'o':
have_o = 1;
#if defined(HAVE_EXECUTABLE_SUFFIX)
#if defined(HAVE_TARGET_EXECUTABLE_SUFFIX)
if (! have_c)
{
int skip;
......@@ -3474,7 +3482,7 @@ process_command (argc, argv)
}
}
#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
......@@ -3823,7 +3831,7 @@ process_command (argc, argv)
}
else
{
#ifdef HAVE_OBJECT_SUFFIX
#ifdef HAVE_TARGET_OBJECT_SUFFIX
argv[i] = convert_filename (argv[i], 0);
#endif
......@@ -4246,17 +4254,17 @@ do_spec_1 (spec, inswitch, soft_matched_part)
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
......@@ -4335,7 +4343,7 @@ do_spec_1 (spec, inswitch, soft_matched_part)
}
case 'O':
obstack_grow (&obstack, OBJECT_SUFFIX, strlen (OBJECT_SUFFIX));
obstack_grow (&obstack, TARGET_OBJECT_SUFFIX, strlen (TARGET_OBJECT_SUFFIX));
arg_going = 1;
break;
......
......@@ -4116,23 +4116,31 @@ character constant specifying that character. When GCC displays file
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
......
......@@ -56,8 +56,8 @@ static int process_option_with_no PARAMS ((char *,
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
......@@ -408,7 +408,7 @@ init_parse (filename)
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
......@@ -421,7 +421,7 @@ init_parse (filename)
jcf_dependency_set_target (NULL);
else
{
strcpy (buf + (dot - filename), OBJECT_SUFFIX);
strcpy (buf + (dot - filename), TARGET_OBJECT_SUFFIX);
jcf_dependency_set_target (buf);
}
......
......@@ -188,11 +188,11 @@ deps_add_default_target (d, tgt)
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);
......@@ -200,7 +200,7 @@ deps_add_default_target (d, tgt)
suffix = strrchr (o, '.');
if (!suffix)
suffix = o + strlen (o);
strcpy (suffix, OBJECT_SUFFIX);
strcpy (suffix, TARGET_OBJECT_SUFFIX);
deps_add_target (d, o, 1);
}
......
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