Commit a055692a by Rainer Orth Committed by Rainer Orth

Support $SYSROOT for = in -I etc.

	* incpath.c (add_sysroot_to_chain): Allow for $SYSROOT prefix.
	* doc/cppdiropts.texi (-I @var{dir}): Document it.

From-SVN: r249560
parent c8a47c48
2017-06-22 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* incpath.c (add_sysroot_to_chain): Allow for $SYSROOT prefix.
* doc/cppdiropts.texi (-I @var{dir}): Document it.
2016-06-22 Richard Biener <rguenther@suse.de> 2016-06-22 Richard Biener <rguenther@suse.de>
* tree-vect-loop.c (vect_model_reduction_cost): Handle * tree-vect-loop.c (vect_model_reduction_cost): Handle
......
...@@ -22,8 +22,9 @@ for header files during preprocessing. ...@@ -22,8 +22,9 @@ for header files during preprocessing.
@ifset cppmanual @ifset cppmanual
@xref{Search Path}. @xref{Search Path}.
@end ifset @end ifset
If @var{dir} begins with @samp{=}, then the @samp{=} is replaced If @var{dir} begins with @samp{=} or @code{$SYSROOT}, then the @samp{=}
by the sysroot prefix; see @option{--sysroot} and @option{-isysroot}. or @code{$SYSROOT} is replaced by the sysroot prefix; see
@option{--sysroot} and @option{-isysroot}.
Directories specified with @option{-iquote} apply only to the quote Directories specified with @option{-iquote} apply only to the quote
form of the directive, @code{@w{#include "@var{file}"}}. form of the directive, @code{@w{#include "@var{file}"}}.
......
...@@ -314,7 +314,7 @@ remove_duplicates (cpp_reader *pfile, struct cpp_dir *head, ...@@ -314,7 +314,7 @@ remove_duplicates (cpp_reader *pfile, struct cpp_dir *head,
} }
/* Add SYSROOT to any user-supplied paths in CHAIN starting with /* Add SYSROOT to any user-supplied paths in CHAIN starting with
"=". */ "=" or "$SYSROOT". */
static void static void
add_sysroot_to_chain (const char *sysroot, int chain) add_sysroot_to_chain (const char *sysroot, int chain)
...@@ -322,8 +322,15 @@ add_sysroot_to_chain (const char *sysroot, int chain) ...@@ -322,8 +322,15 @@ add_sysroot_to_chain (const char *sysroot, int chain)
struct cpp_dir *p; struct cpp_dir *p;
for (p = heads[chain]; p != NULL; p = p->next) for (p = heads[chain]; p != NULL; p = p->next)
if (p->name[0] == '=' && p->user_supplied_p) {
p->name = concat (sysroot, p->name + 1, NULL); if (p->user_supplied_p)
{
if (p->name[0] == '=')
p->name = concat (sysroot, p->name + 1, NULL);
if (strncmp (p->name, "$SYSROOT", strlen ("$SYSROOT")) == 0)
p->name = concat (sysroot, p->name + strlen ("$SYSROOT"), NULL);
}
}
} }
/* Merge the four include chains together in the order quote, bracket, /* Merge the four include chains together in the order quote, bracket,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment