aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJim Wilson <wilson@gcc.gnu.org>1994-03-18 12:35:42 -0800
committerJim Wilson <wilson@gcc.gnu.org>1994-03-18 12:35:42 -0800
commitb0866c745a3ef927f56b37fd500f302e5619264c (patch)
tree183b0fd1746139914fad85c2ba29c9b6b9500bd7 /gcc
parent5ea7a4ae88ef6b3400d0c4163647bf89eefef396 (diff)
downloadgcc-b0866c745a3ef927f56b37fd500f302e5619264c.zip
gcc-b0866c745a3ef927f56b37fd500f302e5619264c.tar.gz
gcc-b0866c745a3ef927f56b37fd500f302e5619264c.tar.bz2
(before_system, last_before_system): New variables.
(main): Handle -isystem option. Insert -isystem directories in search chain at first_system_include. From-SVN: r6812
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cccp.c29
1 files changed, 28 insertions, 1 deletions
diff --git a/gcc/cccp.c b/gcc/cccp.c
index 6a6b9f1..5066273 100644
--- a/gcc/cccp.c
+++ b/gcc/cccp.c
@@ -619,6 +619,10 @@ static struct file_name_list *last_include = 0; /* Last in chain */
static struct file_name_list *after_include = 0;
static struct file_name_list *last_after_include = 0; /* Last in chain */
+/* Chain to put at the start of the system include files. */
+static struct file_name_list *before_system = 0;
+static struct file_name_list *last_before_system = 0; /* Last in chain */
+
/* List of included files that contained #pragma once. */
static struct file_name_list *dont_repeat_files = 0;
@@ -1177,6 +1181,27 @@ main (argc, argv)
else
include_prefix = argv[++i];
}
+ if (!strcmp (argv[i], "-isystem")) {
+ struct file_name_list *dirtmp;
+
+ if (i + 1 == argc)
+ fatal ("Filename missing after `-isystem' option");
+
+ dirtmp = (struct file_name_list *)
+ xmalloc (sizeof (struct file_name_list));
+ dirtmp->next = 0;
+ dirtmp->control_macro = 0;
+ dirtmp->c_system_include_path = 1;
+ dirtmp->fname = (char *) xmalloc (strlen (argv[i+1]) + 1);
+ strcpy (dirtmp->fname, argv[++i]);
+ dirtmp->got_name_map = 0;
+
+ if (before_system == 0)
+ before_system = dirtmp;
+ else
+ last_before_system->next = dirtmp;
+ last_before_system = dirtmp; /* Tail follows the last one */
+ }
/* Add directory to end of path for includes,
with the default prefix at the front of its name. */
if (!strcmp (argv[i], "-iwithprefix")) {
@@ -1733,7 +1758,9 @@ main (argc, argv)
}
}
- first_system_include = 0;
+ append_include_chain (before_system, last_before_system);
+ first_system_include = before_system;
+
/* Unless -fnostdinc,
tack on the standard include file dirs to the specified list */
if (!no_standard_includes) {