diff options
author | meissner <meissner@138bc75d-0d04-0410-961f-82ee72b054a4> | 1998-03-27 14:20:40 +0000 |
---|---|---|
committer | meissner <meissner@138bc75d-0d04-0410-961f-82ee72b054a4> | 1998-03-27 14:20:40 +0000 |
commit | 055237ef6e56039d5402c8b69d46ee5b6bbfbb23 (patch) | |
tree | f06b6290931d772238b161a0ba2613657a9e454e /gcc/gcc.c | |
parent | 55d6e079c79f511f927b52cb449084c56a654527 (diff) | |
download | gcc-055237ef6e56039d5402c8b69d46ee5b6bbfbb23.tar.gz |
Make GCC_EXEC_PREFIX work again
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@18856 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gcc.c')
-rw-r--r-- | gcc/gcc.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/gcc.c b/gcc/gcc.c index ab376553a6e..d68f404b273 100644 --- a/gcc/gcc.c +++ b/gcc/gcc.c @@ -51,6 +51,7 @@ extern int pexecute PROTO ((const char *, char * const *, const char *, const char *, char **, char **, int)); extern int pwait PROTO ((int, int *, int)); extern char *update_path PROTO((char *, char *)); +extern void set_std_prefix PROTO((char *, int)); /* Flag arguments to pexecute. */ #define PEXECUTE_FIRST 1 #define PEXECUTE_LAST 2 @@ -2378,6 +2379,20 @@ process_command (argc, argv) if (gcc_exec_prefix) { + int len = strlen (gcc_exec_prefix); + if (len > sizeof ("/lib/gcc-lib/")-1 + && (gcc_exec_prefix[len-1] == '/' + || gcc_exec_prefix[len-1] == DIR_SEPARATOR)) + { + temp = gcc_exec_prefix + len - sizeof ("/lib/gcc-lib/") + 1; + if ((*temp == '/' || *temp == DIR_SEPARATOR) + && strncmp (temp+1, "lib", 3) == 0 + && (temp[4] == '/' || temp[4] == DIR_SEPARATOR) + && strncmp (temp+5, "gcc-lib", 7) == 0) + len -= sizeof ("/lib/gcc-lib/") - 1; + } + + set_std_prefix (gcc_exec_prefix, len); add_prefix (&exec_prefixes, gcc_exec_prefix, "GCC", 0, 0, NULL_PTR); add_prefix (&startfile_prefixes, gcc_exec_prefix, "GCC", 0, 0, NULL_PTR); } |