This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Allow targets to prefer target roots
- From: mrs at apple dot com (Mike Stump)
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 16 Mar 2007 14:48:10 -0700 (PDT)
- Subject: Allow targets to prefer target roots
This allows a target to prefer the target system root over /. This is
useful when the target system /usr/lib should be prefered over
/usr/lib when the installation prefix is /usr.
Ok?
$ cat ~/diffs/gcc-1.diffs
2007-03-16 Mike Stump <mrs@apple.com>
* gcc.c (main): Allow targets to prefer the target system root over /.
Doing diffs in gcc.c.~1~:
--- gcc.c.~1~ 2007-03-12 19:03:08.000000000 -0700
+++ gcc.c 2007-03-16 14:27:49.000000000 -0700
@@ -2720,6 +2720,7 @@ find_a_file (const struct path_prefix *p
enum path_prefix_priority
{
+ PREFIX_PRIORITY_FIRST,
PREFIX_PRIORITY_B_OPT,
PREFIX_PRIORITY_LAST
};
@@ -6283,6 +6284,10 @@ main (int argc, char **argv)
target_sysroot_hdrs_suffix = xstrdup (argbuf[argbuf_index -1]);
}
+#ifndef SYSROOT_PRIORITY
+#define SYSROOT_PRIORITY PREFIX_PRIORITY_LAST
+#endif
+
/* Look for startfiles in the standard places. */
if (*startfile_prefix_spec != 0
&& do_spec_2 (startfile_prefix_spec) == 0
@@ -6291,7 +6296,7 @@ main (int argc, char **argv)
int ndx;
for (ndx = 0; ndx < argbuf_index; ndx++)
add_sysrooted_prefix (&startfile_prefixes, argbuf[ndx], "BINUTILS",
- PREFIX_PRIORITY_LAST, 0, 1);
+ SYSROOT_PRIORITY, 0, 1);
}
/* We should eventually get rid of all these and stick to
startfile_prefix_spec exclusively. */
@@ -6299,11 +6304,11 @@ main (int argc, char **argv)
{
if (*md_startfile_prefix)
add_sysrooted_prefix (&startfile_prefixes, md_startfile_prefix,
- "GCC", PREFIX_PRIORITY_LAST, 0, 1);
+ "GCC", SYSROOT_PRIORITY, 0, 1);
if (*md_startfile_prefix_1)
add_sysrooted_prefix (&startfile_prefixes, md_startfile_prefix_1,
- "GCC", PREFIX_PRIORITY_LAST, 0, 1);
+ "GCC", SYSROOT_PRIORITY, 0, 1);
/* If standard_startfile_prefix is relative, base it on
standard_exec_prefix. This lets us move the installed tree
@@ -6315,7 +6320,7 @@ main (int argc, char **argv)
if (IS_ABSOLUTE_PATH (standard_startfile_prefix))
add_sysrooted_prefix (&startfile_prefixes,
standard_startfile_prefix, "BINUTILS",
- PREFIX_PRIORITY_LAST, 0, 1);
+ SYSROOT_PRIORITY, 0, 1);
else if (*cross_compile == '0')
{
add_prefix (&startfile_prefixes,
@@ -6331,11 +6336,11 @@ main (int argc, char **argv)
if (*standard_startfile_prefix_1)
add_sysrooted_prefix (&startfile_prefixes,
standard_startfile_prefix_1, "BINUTILS",
- PREFIX_PRIORITY_LAST, 0, 1);
+ SYSROOT_PRIORITY, 0, 1);
if (*standard_startfile_prefix_2)
add_sysrooted_prefix (&startfile_prefixes,
standard_startfile_prefix_2, "BINUTILS",
- PREFIX_PRIORITY_LAST, 0, 1);
+ SYSROOT_PRIORITY, 0, 1);
}
/* Process any user specified specs in the order given on the command
--------------