Mercurial > hg > CbC > CbC_gcc
comparison gcc/incpath.c @ 55:77e2b8dfacca gcc-4.4.5
update it from 4.4.3 to 4.5.0
author | ryoma <e075725@ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 12 Feb 2010 23:39:51 +0900 |
parents | a06113de4d67 |
children | f6334be47118 |
comparison
equal
deleted
inserted
replaced
52:c156f1bd5cd9 | 55:77e2b8dfacca |
---|---|
169 str = concat (sysroot, p->fname, NULL); | 169 str = concat (sysroot, p->fname, NULL); |
170 else if (!p->add_sysroot && relocated | 170 else if (!p->add_sysroot && relocated |
171 && strncmp (p->fname, cpp_PREFIX, cpp_PREFIX_len) == 0) | 171 && strncmp (p->fname, cpp_PREFIX, cpp_PREFIX_len) == 0) |
172 { | 172 { |
173 static const char *relocated_prefix; | 173 static const char *relocated_prefix; |
174 /* If this path starts with the configure-time prefix, | 174 /* If this path starts with the configure-time prefix, |
175 but the compiler has been relocated, replace it | 175 but the compiler has been relocated, replace it |
176 with the run-time prefix. The run-time exec prefix | 176 with the run-time prefix. The run-time exec prefix |
177 is GCC_EXEC_PREFIX. Compute the path from there back | 177 is GCC_EXEC_PREFIX. Compute the path from there back |
178 to the toplevel prefix. */ | 178 to the toplevel prefix. */ |
179 if (!relocated_prefix) | 179 if (!relocated_prefix) |
180 { | 180 { |
181 char *dummy; | 181 char *dummy; |
182 /* Make relative prefix expects the first argument | 182 /* Make relative prefix expects the first argument |
183 to be a program, not a directory. */ | 183 to be a program, not a directory. */ |
184 dummy = concat (gcc_exec_prefix, "dummy", NULL); | 184 dummy = concat (gcc_exec_prefix, "dummy", NULL); |
185 relocated_prefix | 185 relocated_prefix |
186 = make_relative_prefix (dummy, | 186 = make_relative_prefix (dummy, |
187 cpp_EXEC_PREFIX, | 187 cpp_EXEC_PREFIX, |
188 cpp_PREFIX); | 188 cpp_PREFIX); |
189 } | 189 } |
190 str = concat (relocated_prefix, | 190 str = concat (relocated_prefix, |
191 p->fname + cpp_PREFIX_len, | 191 p->fname + cpp_PREFIX_len, |
192 NULL); | 192 NULL); |
193 str = update_path (str, p->component); | 193 str = update_path (str, p->component); |
194 } | 194 } |
195 else | 195 else |
196 str = update_path (p->fname, p->component); | 196 str = update_path (p->fname, p->component); |
397 where it is obligatory. */ | 397 where it is obligatory. */ |
398 int pathlen = strlen (path); | 398 int pathlen = strlen (path); |
399 char* end = path + pathlen - 1; | 399 char* end = path + pathlen - 1; |
400 /* Preserve the lead '/' or lead "c:/". */ | 400 /* Preserve the lead '/' or lead "c:/". */ |
401 char* start = path + (pathlen > 2 && path[1] == ':' ? 3 : 1); | 401 char* start = path + (pathlen > 2 && path[1] == ':' ? 3 : 1); |
402 | 402 |
403 for (; end > start && IS_DIR_SEPARATOR (*end); end--) | 403 for (; end > start && IS_DIR_SEPARATOR (*end); end--) |
404 *end = 0; | 404 *end = 0; |
405 #endif | 405 #endif |
406 | 406 |
407 p = XNEW (cpp_dir); | 407 p = XNEW (cpp_dir); |