aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron W. LaFramboise <aaronraolete36@aaronwl.com>2004-07-01 23:55:22 +0000
committerDanny Smith <dannysmith@gcc.gnu.org>2004-07-01 23:55:22 +0000
commit656c7a3a1a533d467f9564259cb0d76ed62f029b (patch)
treec9d8a4ff46096ac1b499e243563c19c59274b028
parent78cc4167bcd0392c21b3db4682415245bfead558 (diff)
downloadgcc-656c7a3a1a533d467f9564259cb0d76ed62f029b.zip
gcc-656c7a3a1a533d467f9564259cb0d76ed62f029b.tar.gz
gcc-656c7a3a1a533d467f9564259cb0d76ed62f029b.tar.bz2
gcc.c (STANDARD_STARTFILE_PREFIX_1): Define.
2004-07-02 Aaron W. LaFramboise <aaronraolete36@aaronwl.com> * gcc.c (STANDARD_STARTFILE_PREFIX_1): Define. (STANDARD_STARTFILE_PREFIX_2): Define. (standard_startfile_prefix_1): Initialize to STANDARD_STARTFILE_PREFIX_1. (standard_startfile_prefix_2): Initialize to STANDARD_STARTFILE_PREFIX_2. * config/i386/mingw32.h (MD_STARTFILE_PREFIX): Remove. (STANDARD_STARTFILE_PREFIX_1): Define. (STANDARD_STARTFILE_PREFIX_2): Define. * doc/tm.texi (STANDARD_STARTFILE_PREFIX_1): Document. (STANDARD_STARTFILE_PREFIX_2): Document. From-SVN: r84002
-rw-r--r--gcc/ChangeLog14
-rw-r--r--gcc/config/i386/mingw32.h10
-rw-r--r--gcc/doc/tm.texi16
-rw-r--r--gcc/gcc.c25
4 files changed, 56 insertions, 9 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index c251288..1628676 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,17 @@
+2004-07-02 Aaron W. LaFramboise <aaronraolete36@aaronwl.com>
+
+ * gcc.c (STANDARD_STARTFILE_PREFIX_1): Define.
+ (STANDARD_STARTFILE_PREFIX_2): Define.
+ (standard_startfile_prefix_1): Initialize to
+ STANDARD_STARTFILE_PREFIX_1.
+ (standard_startfile_prefix_2): Initialize to
+ STANDARD_STARTFILE_PREFIX_2.
+ * config/i386/mingw32.h (MD_STARTFILE_PREFIX): Remove.
+ (STANDARD_STARTFILE_PREFIX_1): Define.
+ (STANDARD_STARTFILE_PREFIX_2): Define.
+ * doc/tm.texi (STANDARD_STARTFILE_PREFIX_1): Document.
+ (STANDARD_STARTFILE_PREFIX_2): Document.
+
2004-07-01 Richard Henderson <rth@redhat.com>
* tree-sra.c (sra_walk_expr): Don't maybe_lookup_element_for_expr
diff --git a/gcc/config/i386/mingw32.h b/gcc/config/i386/mingw32.h
index 4bf0dda..bdd8da2 100644
--- a/gcc/config/i386/mingw32.h
+++ b/gcc/config/i386/mingw32.h
@@ -69,9 +69,13 @@ Boston, MA 02111-1307, USA. */
#define STARTFILE_SPEC "%{shared|mdll:dllcrt2%O%s} \
%{!shared:%{!mdll:crt2%O%s}} %{pg:gcrt2%O%s}"
-/* An additional prefix to try after the standard prefixes. */
-#undef MD_STARTFILE_PREFIX
-#define MD_STARTFILE_PREFIX "/mingw/lib/"
+/* Override startfile prefix defaults. */
+#ifndef STANDARD_STARTFILE_PREFIX_1
+#define STANDARD_STARTFILE_PREFIX_1 "/mingw/lib/"
+#endif
+#ifndef STANDARD_STARTFILE_PREFIX_2
+#define STANDARD_STARTFILE_PREFIX_2 ""
+#endif
/* Output STRING, a string representing a filename, to FILE.
We canonicalize it to be in Unix format (backslashes are replaced
diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi
index b196ac4..1b5de1b 100644
--- a/gcc/doc/tm.texi
+++ b/gcc/doc/tm.texi
@@ -469,6 +469,22 @@ try when searching for startup files such as @file{crt0.o}.
is built as a cross compiler.
@end defmac
+@defmac STANDARD_STARTFILE_PREFIX_1
+Define this macro as a C string constant if you wish to override the
+standard choice of @code{/lib} as a prefix to try after the default prefix
+when searching for startup files such as @file{crt0.o}.
+@code{STANDARD_STARTFILE_PREFIX_1} is not searched when the compiler
+is built as a cross compiler.
+@end defmac
+
+@defmac STANDARD_STARTFILE_PREFIX_2
+Define this macro as a C string constant if you wish to override the
+standard choice of @code{/lib} as yet another prefix to try after the
+default prefix when searching for startup files such as @file{crt0.o}.
+@code{STANDARD_STARTFILE_PREFIX_2} is not searched when the compiler
+is built as a cross compiler.
+@end defmac
+
@defmac MD_STARTFILE_PREFIX
If defined, this macro supplies an additional prefix to try after the
standard prefixes. @code{MD_EXEC_PREFIX} is not searched when the
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 677d9e7..74d043f 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -1429,6 +1429,13 @@ static const char *gcc_libexec_prefix;
/* Default prefixes to attach to command names. */
+#ifndef STANDARD_STARTFILE_PREFIX_1
+#define STANDARD_STARTFILE_PREFIX_1 "/lib/"
+#endif
+#ifndef STANDARD_STARTFILE_PREFIX_2
+#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib/"
+#endif
+
#ifdef CROSS_COMPILE /* Don't use these prefixes for a cross compiler. */
#undef MD_EXEC_PREFIX
#undef MD_STARTFILE_PREFIX
@@ -1454,8 +1461,10 @@ static const char *md_exec_prefix = MD_EXEC_PREFIX;
static const char *md_startfile_prefix = MD_STARTFILE_PREFIX;
static const char *md_startfile_prefix_1 = MD_STARTFILE_PREFIX_1;
static const char *const standard_startfile_prefix = STANDARD_STARTFILE_PREFIX;
-static const char *const standard_startfile_prefix_1 = "/lib/";
-static const char *const standard_startfile_prefix_2 = "/usr/lib/";
+static const char *const standard_startfile_prefix_1
+ = STANDARD_STARTFILE_PREFIX_1;
+static const char *const standard_startfile_prefix_2
+ = STANDARD_STARTFILE_PREFIX_2;
static const char *const tooldir_base_prefix = TOOLDIR_BASE_PREFIX;
static const char *tooldir_prefix;
@@ -6231,10 +6240,14 @@ main (int argc, const char **argv)
NULL, PREFIX_PRIORITY_LAST, 0, NULL, 1);
}
- add_sysrooted_prefix (&startfile_prefixes, standard_startfile_prefix_1,
- "BINUTILS", PREFIX_PRIORITY_LAST, 0, NULL, 1);
- add_sysrooted_prefix (&startfile_prefixes, standard_startfile_prefix_2,
- "BINUTILS", PREFIX_PRIORITY_LAST, 0, NULL, 1);
+ if (*standard_startfile_prefix_1)
+ add_sysrooted_prefix (&startfile_prefixes,
+ standard_startfile_prefix_1, "BINUTILS",
+ PREFIX_PRIORITY_LAST, 0, NULL, 1);
+ if (*standard_startfile_prefix_2)
+ add_sysrooted_prefix (&startfile_prefixes,
+ standard_startfile_prefix_2, "BINUTILS",
+ PREFIX_PRIORITY_LAST, 0, NULL, 1);
#if 0 /* Can cause surprises, and one can use -B./ instead. */
add_prefix (&startfile_prefixes, "./", NULL,
PREFIX_PRIORITY_LAST, 1, NULL, 0);