- dirtmp->next = 0; /* New one goes on the end */
- dirtmp->control_macro = 0;
- dirtmp->c_system_include_path = FALSE;
-
- /* This copy is necessary...but shouldn't be? */
- /*@-onlytrans@*/
- dirtmp->fname = cstring_copy (dir);
- /*@=onlytrans@*/
-
- dirtmp->got_name_map = FALSE;
- cppReader_addIncludeChain (&g_cppState, dirtmp);
+ if (cstring_equalLit (dir, "-I-"))
+ {
+ struct cppOptions *opts = CPPOPTIONS (&g_cppState);
+ opts->ignore_srcdir = TRUE;
+ }
+ else
+ {
+ /* -I option (Add directory to include path) */
+ struct file_name_list *dirtmp = (struct file_name_list *) dmalloc (sizeof (*dirtmp));
+
+ llassert (cstring_firstChar (dir) == 'I');
+ dir = cstring_suffix (dir, 1);
+
+ DPRINTF (("Add include: %s", dir));
+
+ dirtmp->next = 0; /* New one goes on the end */
+ dirtmp->control_macro = 0;
+ dirtmp->c_system_include_path = FALSE;
+
+ /* This copy is necessary...but shouldn't be? */
+ /*@-onlytrans@*/
+ dirtmp->fname = cstring_copy (dir);
+ /*@=onlytrans@*/
+
+ dirtmp->got_name_map = FALSE;
+ cppReader_addIncludeChain (&g_cppState, dirtmp);
+ }