summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1996-09-18 06:45:17 +0000
committerpeter <peter@FreeBSD.org>1996-09-18 06:45:17 +0000
commit30f62fbc36b35af55fe44890f18e888d5562b300 (patch)
tree3df746d1a44a5eef2a8e48ad041f40a5baeff5a9
parent0d2830f018c2f80889461624f8e3d59d1d78a15f (diff)
downloadFreeBSD-src-30f62fbc36b35af55fe44890f18e888d5562b300.zip
FreeBSD-src-30f62fbc36b35af55fe44890f18e888d5562b300.tar.gz
When running native on freebsd (ie: in /usr/bin, /usr/libexec, not the
gnu-style /usr/local/lib/gcc* layout), only search the paths that exist for the modules (cc1, cc1plus , cc1obj etc) Also, update an error message.
-rw-r--r--contrib/gcc/gcc.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/contrib/gcc/gcc.c b/contrib/gcc/gcc.c
index 7622771..b4340ba 100644
--- a/contrib/gcc/gcc.c
+++ b/contrib/gcc/gcc.c
@@ -32,6 +32,7 @@ Once it knows which kind of compilation to perform, the procedure for
compilation is specified by a string called a "spec". */
#include <sys/types.h>
+#include <sys/wait.h>
#include <ctype.h>
#include <signal.h>
#include <sys/stat.h>
@@ -53,6 +54,9 @@ int __spawnvp ();
#include <varargs.h>
#endif
#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
/* Include multi-lib information. */
#include "multilib.h"
@@ -1620,7 +1624,6 @@ putenv (str)
char **envp;
int num_envs = 0;
int name_len = 1;
- int str_len = strlen (str);
char *p = str;
int ch;
@@ -2703,6 +2706,10 @@ process_command (argc, argv)
(such as cpp) rather than those of the host system. */
/* Use 2 as fourth arg meaning try just the machine as a suffix,
as well as trying the machine and the version. */
+#ifdef FREEBSD_NATIVE
+ add_prefix (&exec_prefixes, "/usr/libexec/", 0, 0, NULL_PTR);
+ add_prefix (&exec_prefixes, "/usr/bin/", 0, 0, NULL_PTR);
+#else /* not FREEBSD_NATIVE */
#ifndef OS2
add_prefix (&exec_prefixes, standard_exec_prefix, 0, 2, NULL_PTR);
add_prefix (&exec_prefixes, standard_exec_prefix_1, 0, 2, NULL_PTR);
@@ -2710,6 +2717,7 @@ process_command (argc, argv)
add_prefix (&startfile_prefixes, standard_exec_prefix, 0, 1, NULL_PTR);
add_prefix (&startfile_prefixes, standard_exec_prefix_1, 0, 1, NULL_PTR);
+#endif /* FREEBSD_NATIVE */
tooldir_prefix = concat3 (tooldir_base_prefix, spec_machine,
dir_separator_str);
@@ -2744,12 +2752,14 @@ process_command (argc, argv)
dir_separator_str, tooldir_prefix);
}
+#ifndef FREEBSD_NATIVE
add_prefix (&exec_prefixes,
concat3 (tooldir_prefix, "bin", dir_separator_str),
0, 0, NULL_PTR);
add_prefix (&startfile_prefixes,
concat3 (tooldir_prefix, "lib", dir_separator_str),
0, 0, NULL_PTR);
+#endif /* FREEBSD_NATIVE */
/* More prefixes are enabled in main, after we read the specs file
and determine whether this is cross-compilation or not. */
@@ -3770,7 +3780,7 @@ do_spec_1 (spec, inswitch, soft_matched_part)
{
int c1 = *p++; /* Select first or second version number. */
char *v = compiler_version;
- char *q, *copy;
+ char *q;
/* If desired, advance to second version number. */
if (c1 == '2')
{
@@ -4266,9 +4276,11 @@ main (argc, argv)
/* Read specs from a file if there is one. */
+#ifndef FREEBSD_NATIVE
machine_suffix = concat4 (spec_machine, dir_separator_str,
spec_version, dir_separator_str);
just_machine_suffix = concat (spec_machine, dir_separator_str);
+#endif
specs_file = find_a_file (&startfile_prefixes, "specs", R_OK);
/* Read the specs file unless it is a default one. */
@@ -4316,6 +4328,7 @@ main (argc, argv)
0, 0, NULL_PTR);
}
+#ifndef FREEBSD_NATIVE
add_prefix (&startfile_prefixes, standard_startfile_prefix_1, 0, 0,
NULL_PTR);
add_prefix (&startfile_prefixes, standard_startfile_prefix_2, 0, 0,
@@ -4323,6 +4336,8 @@ main (argc, argv)
#if 0 /* Can cause surprises, and one can use -B./ instead. */
add_prefix (&startfile_prefixes, "./", 0, 1, NULL_PTR);
#endif
+#endif /* FREEBSD_NATIVE */
+
}
else
{
@@ -4413,7 +4428,7 @@ main (argc, argv)
}
if (n_infiles == 0)
- fatal ("No input files");
+ fatal ("No input files specified");
/* Make a place to record the compiler output file names
that correspond to the input files. */
OpenPOWER on IntegriCloud