summaryrefslogtreecommitdiff
path: root/gcc/c-incpath.c
diff options
context:
space:
mode:
authoramodra <amodra@138bc75d-0d04-0410-961f-82ee72b054a4>2003-03-25 23:23:23 +0000
committeramodra <amodra@138bc75d-0d04-0410-961f-82ee72b054a4>2003-03-25 23:23:23 +0000
commit59e3c9d787f56177e3ee79f1ab7329a02bbc8cfa (patch)
tree94d2a6fe6464db5a0f0fc7b4f2eb92e669194577 /gcc/c-incpath.c
parent44f6214e606cf188c832776fcb28462e07553035 (diff)
downloadgcc-59e3c9d787f56177e3ee79f1ab7329a02bbc8cfa.tar.gz
* c-incpath.c (add_standard_paths): Add both "translated" and
non-translated header paths. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@64872 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-incpath.c')
-rw-r--r--gcc/c-incpath.c31
1 files changed, 23 insertions, 8 deletions
diff --git a/gcc/c-incpath.c b/gcc/c-incpath.c
index 06c9346eded..abd738c027e 100644
--- a/gcc/c-incpath.c
+++ b/gcc/c-incpath.c
@@ -127,10 +127,30 @@ add_standard_paths (sysroot, iprefix, cxx_stdinc)
int cxx_stdinc;
{
const struct default_include *p;
- size_t len = 0;
+ size_t len;
- if (iprefix)
- len = cpp_GCC_INCLUDE_DIR_len;
+ if (iprefix && (len = cpp_GCC_INCLUDE_DIR_len) != 0)
+ {
+ /* Look for directories that start with the standard prefix.
+ "Translate" them, ie. replace /usr/local/lib/gcc... with
+ IPREFIX and search them first. */
+ for (p = cpp_include_defaults; p->fname; p++)
+ {
+ if (!p->cplusplus || cxx_stdinc)
+ {
+ /* Should we be translating sysrooted dirs too? Assume
+ that iprefix and sysroot are mutually exclusive, for
+ now. */
+ if (sysroot && p->add_sysroot)
+ continue;
+ if (!strncmp (p->fname, cpp_GCC_INCLUDE_DIR, len))
+ {
+ char *str = concat (iprefix, p->fname + len, NULL);
+ add_path (str, SYSTEM, p->cxx_aware);
+ }
+ }
+ }
+ }
for (p = cpp_include_defaults; p->fname; p++)
{
@@ -141,11 +161,6 @@ add_standard_paths (sysroot, iprefix, cxx_stdinc)
/* Should this directory start with the sysroot? */
if (sysroot && p->add_sysroot)
str = concat (sysroot, p->fname, NULL);
- /* Does this directory start with the prefix? If so, search
- "translated" versions of GNU directories. These have
- /usr/local/lib/gcc... replaced by iprefix. */
- else if (len && !strncmp (p->fname, cpp_GCC_INCLUDE_DIR, len))
- str = concat (iprefix, p->fname + len, NULL);
else
str = update_path (p->fname, p->component);