summaryrefslogtreecommitdiff
path: root/gcc/gcc.c
diff options
context:
space:
mode:
authorrms <rms@138bc75d-0d04-0410-961f-82ee72b054a4>1993-05-28 22:55:11 +0000
committerrms <rms@138bc75d-0d04-0410-961f-82ee72b054a4>1993-05-28 22:55:11 +0000
commit6c6aff9e39206078113727ff289e306319440be2 (patch)
treea42ff21de8a8e82aa9877895bb4a24c510b02612 /gcc/gcc.c
parent0bb046ab8cb8ac06d041ffbb1dd5b1202d10e814 (diff)
downloadgcc-6c6aff9e39206078113727ff289e306319440be2.tar.gz
(process_command): When GCC_EXEC_PREFIX is defined and
tooldir is relative, add it to search path in addition to standard directory rather than instead of. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@4588 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gcc.c')
-rw-r--r--gcc/gcc.c47
1 files changed, 29 insertions, 18 deletions
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 0913c884ce4..502f13e4086 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -2352,24 +2352,6 @@ process_command (argc, argv)
n_infiles++;
}
- tooldir_prefix = concat (tooldir_base_prefix, spec_machine, "/");
-
- /* If tooldir is relative, base it on exec_prefix. A relative
- tooldir lets us move the installed tree as a unit. */
-
- if (*tooldir_prefix != '/')
- {
- if (gcc_exec_prefix)
- tooldir_prefix = concat (concat (gcc_exec_prefix, spec_machine, "/"),
- concat (spec_version, "/", tooldir_prefix),
- "");
- else
- tooldir_prefix = concat (concat (standard_exec_prefix, spec_machine, "/"),
- concat (spec_version, "/", tooldir_prefix),
- "");
- }
-
-
/* Set up the search paths before we go looking for config files. */
/* These come before the md prefixes so that we will find gcc's subcommands
@@ -2382,6 +2364,35 @@ process_command (argc, argv)
add_prefix (&startfile_prefix, standard_exec_prefix, 0, 1, NULL_PTR);
add_prefix (&startfile_prefix, standard_exec_prefix_1, 0, 1, NULL_PTR);
+ tooldir_prefix = concat (tooldir_base_prefix, spec_machine, "/");
+
+ /* If tooldir is relative, base it on exec_prefix. A relative
+ tooldir lets us move the installed tree as a unit.
+
+ If GCC_EXEC_PREFIX is defined, then we want to add two relative
+ directories, so that we can search both the user specified directory
+ and the standard place. */
+
+ if (*tooldir_prefix != '/')
+ {
+ if (gcc_exec_prefix)
+ {
+ char *gcc_exec_tooldir_prefix
+ = concat (concat (gcc_exec_prefix, spec_machine, "/"),
+ concat (spec_version, "/", tooldir_prefix),
+ "");
+
+ add_prefix (&exec_prefix, concat (gcc_exec_tooldir_prefix, "bin", "/"),
+ 0, 0, NULL_PTR);
+ add_prefix (&startfile_prefix, concat (gcc_exec_tooldir_prefix, "lib", "/"),
+ 0, 0, NULL_PTR);
+ }
+
+ tooldir_prefix = concat (concat (standard_exec_prefix, spec_machine, "/"),
+ concat (spec_version, "/", tooldir_prefix),
+ "");
+ }
+
add_prefix (&exec_prefix, concat (tooldir_prefix, "bin", "/"),
0, 0, NULL_PTR);
add_prefix (&startfile_prefix, concat (tooldir_prefix, "lib", "/"),