aboutsummaryrefslogtreecommitdiff
path: root/gcc/gcc.c
diff options
context:
space:
mode:
authorJason Merrill <jason@gcc.gnu.org>2000-01-12 19:37:06 -0500
committerJason Merrill <jason@gcc.gnu.org>2000-01-12 19:37:06 -0500
commit512b62fb1bdb3e758207b6bf72eb1024848e8ec6 (patch)
treed3dff74afbeffac820b068280d9d819772186d74 /gcc/gcc.c
parent6bb88f3be6ef0f0ad8b7a3819ddefafa63283e76 (diff)
downloadgcc-512b62fb1bdb3e758207b6bf72eb1024848e8ec6.zip
gcc-512b62fb1bdb3e758207b6bf72eb1024848e8ec6.tar.gz
gcc-512b62fb1bdb3e758207b6bf72eb1024848e8ec6.tar.bz2
configure.in (i?86-*-beos{pe,elf,}*): Recognize.
* configure.in (i?86-*-beos{pe,elf,}*): Recognize. * i386/t-beos, i386/x-beos, i386/xm-beos.h: New files. * i386/beos-elf.h, i386/beos-pe.h: New files. * Makefile.in (CROSS_SYSTEM_HEADER_DIR): New. * cross-make (SYSTEM_HEADER_DIR): Define using CROSS_SYSTEM_HEADER_DIR. * gcc.c (LIBRARY_PATH_ENV): Provide default. (process_command): Use it. (main): Likewise. Kill trailing = from env vars. (build_search_list): Put it back. * collect2.c (main): Use LIBRARY_PATH_ENV. * configure.in (GCC_NEED_DECLARATIONS): Add environ. * toplev.c: Use NEED_DECLARATION_ENVIRON. * tm.texi (Frame Layout): Document SMALL_STACK. * c-common.c (c_common_nodes_and_builtins): Check it. * system.h: Undef alloca after including glibc's <stdlib.h>, if USE_C_ALLOCA is defined. * gcc.c (set_input): New fn. (main): After all input files are compiled, reset the input file info to the first. * aclocal.m4 (rindex, index): If already defined, don't attempt to redefine. * ginclude/varargs.h: (__va_list__): Define ifndef. * ginclude/stdarg.h: Likewise. * ginclude/stddef.h (__WCHAR_TYPE__) [BEOS]: Use int instead of unsigned char. * hash.h (true, false, boolean): Undef before enum. From-SVN: r31366
Diffstat (limited to 'gcc/gcc.c')
-rw-r--r--gcc/gcc.c72
1 files changed, 48 insertions, 24 deletions
diff --git a/gcc/gcc.c b/gcc/gcc.c
index b65d6e8..8f81369d 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -82,6 +82,11 @@ static char dir_separator_str[] = {DIR_SEPARATOR, 0};
#define GET_ENV_PATH_LIST(VAR,NAME) do { (VAR) = getenv (NAME); } while (0)
#endif
+/* Most every one is fine with LIBRARY_PATH. For some, it conflicts. */
+#ifndef LIBRARY_PATH_ENV
+#define LIBRARY_PATH_ENV "LIBRARY_PATH"
+#endif
+
#ifndef HAVE_KILL
#define kill(p,s) raise(s)
#endif
@@ -240,6 +245,7 @@ static int execute PROTO ((void));
static void unused_prefix_warnings PROTO ((struct path_prefix *));
static void clear_args PROTO ((void));
static void fatal_error PROTO ((int));
+static void set_input PROTO ((const char *));
/* Specs are strings containing lines, each of which (if not blank)
is made up of a program name, and arguments separated by spaces.
@@ -1892,6 +1898,7 @@ build_search_list (paths, prefix, check_dir_p)
struct prefix_list *pprefix;
obstack_grow (&collect_obstack, prefix, strlen (prefix));
+ obstack_1grow (&collect_obstack, '=');
for (pprefix = paths->plist; pprefix != 0; pprefix = pprefix->next)
{
@@ -2941,7 +2948,7 @@ process_command (argc, argv)
}
}
- GET_ENV_PATH_LIST (temp, "LIBRARY_PATH");
+ GET_ENV_PATH_LIST (temp, LIBRARY_PATH_ENV);
if (temp && *cross_compile == '0')
{
const char *startp, *endp;
@@ -4935,6 +4942,37 @@ is_directory (path1, path2, linker)
return (stat (path, &st) >= 0 && S_ISDIR (st.st_mode));
}
+
+/* Set up the various global variables to indicate that we're processing
+ the input file named FILENAME. */
+
+static void
+set_input (filename)
+ const char *filename;
+{
+ register const char *p;
+
+ input_filename = filename;
+ input_filename_length = strlen (input_filename);
+
+ input_basename = input_filename;
+ for (p = input_filename; *p; p++)
+ if (IS_DIR_SEPARATOR (*p))
+ input_basename = p + 1;
+
+ /* Find a suffix starting with the last period,
+ and set basename_length to exclude that suffix. */
+ basename_length = strlen (input_basename);
+ p = input_basename + basename_length;
+ while (p != input_basename && *p != '.') --p;
+ if (*p == '.' && p != input_basename)
+ {
+ basename_length = p - input_basename;
+ input_suffix = p + 1;
+ }
+ else
+ input_suffix = "";
+}
/* On fatal signals, delete all the temporary files. */
@@ -5335,9 +5373,8 @@ main (argc, argv)
/* Tell do_spec what to substitute for %i. */
- input_filename = infiles[i].name;
- input_filename_length = strlen (input_filename);
input_file_number = i;
+ set_input (infiles[i].name);
/* Use the same thing in %o, unless cp->spec says otherwise. */
@@ -5352,31 +5389,12 @@ main (argc, argv)
{
/* Ok, we found an applicable compiler. Run its spec. */
/* First say how much of input_filename to substitute for %b */
- register const char *p;
int len;
if (cp->spec[0][0] == '#')
error ("%s: %s compiler not installed on this system",
input_filename, &cp->spec[0][1]);
- input_basename = input_filename;
- for (p = input_filename; *p; p++)
- if (IS_DIR_SEPARATOR (*p))
- input_basename = p + 1;
-
- /* Find a suffix starting with the last period,
- and set basename_length to exclude that suffix. */
- basename_length = strlen (input_basename);
- p = input_basename + basename_length;
- while (p != input_basename && *p != '.') --p;
- if (*p == '.' && p != input_basename)
- {
- basename_length = p - input_basename;
- input_suffix = p + 1;
- }
- else
- input_suffix = "";
-
len = 0;
for (j = 0; j < sizeof cp->spec / sizeof cp->spec[0]; j++)
if (cp->spec[j])
@@ -5418,6 +5436,12 @@ main (argc, argv)
clear_failure_queue ();
}
+ /* Reset the output file name to the first input file name, for use
+ with %b in LINK_SPEC on a target that prefers not to emit a.out
+ by default. */
+ if (n_infiles > 0)
+ set_input (infiles[0].name);
+
if (error_count == 0)
{
/* Make sure INPUT_FILE_NUMBER points to first available open
@@ -5442,8 +5466,8 @@ main (argc, argv)
}
/* Rebuild the COMPILER_PATH and LIBRARY_PATH environment variables
for collect. */
- putenv_from_prefixes (&exec_prefixes, "COMPILER_PATH=");
- putenv_from_prefixes (&startfile_prefixes, "LIBRARY_PATH=");
+ putenv_from_prefixes (&exec_prefixes, "COMPILER_PATH");
+ putenv_from_prefixes (&startfile_prefixes, LIBRARY_PATH_ENV);
value = do_spec (link_command_spec);
if (value < 0)