aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJim Wilson <wilson@gcc.gnu.org>1994-03-18 12:37:22 -0800
committerJim Wilson <wilson@gcc.gnu.org>1994-03-18 12:37:22 -0800
commit2d879387e284d5a11d58b6c6b5c65db7904208f0 (patch)
tree72be0551f19e9bdfb67e2070d5558da9dba4e261 /gcc
parentb0866c745a3ef927f56b37fd500f302e5619264c (diff)
downloadgcc-2d879387e284d5a11d58b6c6b5c65db7904208f0.zip
gcc-2d879387e284d5a11d58b6c6b5c65db7904208f0.tar.gz
gcc-2d879387e284d5a11d58b6c6b5c65db7904208f0.tar.bz2
(include_prefix): New variable.
(process_command): Add path/include to include_prefix when see a -Bpath option. (do_spec_1, case 'I'): Pass include_prefix directories to cpp with the -isystem option. From-SVN: r6813
Diffstat (limited to 'gcc')
-rw-r--r--gcc/gcc.c35
1 files changed, 27 insertions, 8 deletions
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 6517c7f..74e0014 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -1183,6 +1183,10 @@ static struct path_prefix exec_prefix = { 0, 0, "exec" };
static struct path_prefix startfile_prefix = { 0, 0, "startfile" };
+/* List of prefixes to try when looking for include files. */
+
+static struct path_prefix include_prefix = { 0, 0, "include" };
+
/* Suffix to attach to directories searched for commands.
This looks like `MACHINE/VERSION/'. */
@@ -2425,6 +2429,8 @@ process_command (argc, argv)
value = p + 1;
add_prefix (&exec_prefix, value, 1, 0, temp);
add_prefix (&startfile_prefix, value, 1, 0, temp);
+ add_prefix (&include_prefix, concat (value, "include", ""),
+ 1, 0, 0);
}
break;
@@ -3012,14 +3018,27 @@ do_spec_1 (spec, inswitch, soft_matched_part)
break;
case 'I':
- if (gcc_exec_prefix)
- {
- do_spec_1 ("-iprefix", 1, NULL_PTR);
- /* Make this a separate argument. */
- do_spec_1 (" ", 0, NULL_PTR);
- do_spec_1 (gcc_exec_prefix, 1, NULL_PTR);
- do_spec_1 (" ", 0, NULL_PTR);
- }
+ {
+ struct prefix_list *pl = include_prefix.plist;
+
+ if (gcc_exec_prefix)
+ {
+ do_spec_1 ("-iprefix", 1, NULL_PTR);
+ /* Make this a separate argument. */
+ do_spec_1 (" ", 0, NULL_PTR);
+ do_spec_1 (gcc_exec_prefix, 1, NULL_PTR);
+ do_spec_1 (" ", 0, NULL_PTR);
+ }
+
+ for (; pl; pl = pl->next)
+ {
+ do_spec_1 ("-isystem", 1, NULL_PTR);
+ /* Make this a separate argument. */
+ do_spec_1 (" ", 0, NULL_PTR);
+ do_spec_1 (pl->prefix, 1, NULL_PTR);
+ do_spec_1 (" ", 0, NULL_PTR);
+ }
+ }
break;
case 'o':