aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2003-01-04 20:40:28 +0000
committerDaniel Jacobowitz <drow@false.org>2003-01-04 20:40:28 +0000
commitcdc0d45e155d8b66e3f73b39f8e47e0fd8b0c8da (patch)
treec579288adbe3dd54a9dd61b082402eec730680ce
parentbfd260bb5cd5c17b599e3e094175a82f1e8fcbff (diff)
downloadgdb-cdc0d45e155d8b66e3f73b39f8e47e0fd8b0c8da.zip
gdb-cdc0d45e155d8b66e3f73b39f8e47e0fd8b0c8da.tar.gz
gdb-cdc0d45e155d8b66e3f73b39f8e47e0fd8b0c8da.tar.bz2
* Makefile.am (ldmain.o): Pass BINDIR.
* Makefile.in: Regenerated. * ldmain.c (set_scripts_dir): Use make_relative_prefix for the first search path.
-rw-r--r--ld/ChangeLog7
-rw-r--r--ld/Makefile.am2
-rw-r--r--ld/Makefile.in2
-rw-r--r--ld/ldmain.c15
4 files changed, 22 insertions, 4 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 33cc77a..6254e80 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,10 @@
+2003-01-04 Daniel Jacobowitz <drow@mvista.com>
+
+ * Makefile.am (ldmain.o): Pass BINDIR.
+ * Makefile.in: Regenerated.
+ * ldmain.c (set_scripts_dir): Use make_relative_prefix for the first
+ search path.
+
2003-01-02 Ben Elliston <bje@redhat.com>
* Makefile.am (ALL_EMULATIONS): Add eelf32iq2000.o.
diff --git a/ld/Makefile.am b/ld/Makefile.am
index d70cc0e..94df72a 100644
--- a/ld/Makefile.am
+++ b/ld/Makefile.am
@@ -393,7 +393,7 @@ po/POTFILES.in: @MAINT@ Makefile
&& mv tmp $(srcdir)/po/POTFILES.in
ldmain.o: ldmain.c config.status
- $(COMPILE) -c -DDEFAULT_EMULATION='"$(EMUL)"' -DSCRIPTDIR='"$(scriptdir)"' -DTARGET='"@target@"' $(srcdir)/ldmain.c
+ $(COMPILE) -c -DDEFAULT_EMULATION='"$(EMUL)"' -DSCRIPTDIR='"$(scriptdir)"' -DBINDIR='"$(bindir)"' -DTARGET='"@target@"' $(srcdir)/ldmain.c
ldemul-list.h: Makefile
(echo "/* This file is automatically generated. DO NOT EDIT! */";\
diff --git a/ld/Makefile.in b/ld/Makefile.in
index 5aa4dc9..c3459a6 100644
--- a/ld/Makefile.in
+++ b/ld/Makefile.in
@@ -1121,7 +1121,7 @@ po/POTFILES.in: @MAINT@ Makefile
&& mv tmp $(srcdir)/po/POTFILES.in
ldmain.o: ldmain.c config.status
- $(COMPILE) -c -DDEFAULT_EMULATION='"$(EMUL)"' -DSCRIPTDIR='"$(scriptdir)"' -DTARGET='"@target@"' $(srcdir)/ldmain.c
+ $(COMPILE) -c -DDEFAULT_EMULATION='"$(EMUL)"' -DSCRIPTDIR='"$(scriptdir)"' -DBINDIR='"$(bindir)"' -DTARGET='"@target@"' $(srcdir)/ldmain.c
ldemul-list.h: Makefile
(echo "/* This file is automatically generated. DO NOT EDIT! */";\
diff --git a/ld/ldmain.c b/ld/ldmain.c
index c90cb66..3185bef 100644
--- a/ld/ldmain.c
+++ b/ld/ldmain.c
@@ -1,6 +1,6 @@
/* Main program of GNU linker.
Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
- 2002
+ 2002, 2003
Free Software Foundation, Inc.
Written by Steve Chamberlain steve@cygnus.com
@@ -612,8 +612,11 @@ check_for_scripts_dir (dir)
We look for the "ldscripts" directory in:
SCRIPTDIR (passed from Makefile)
+ (adjusted according to the current location of the binary)
+ SCRIPTDIR (passed from Makefile)
the dir where this program is (for using it from the build tree)
- the dir where this program is/../lib (for installing the tool suite elsewhere) */
+ the dir where this program is/../lib
+ (for installing the tool suite elsewhere) */
static void
set_scripts_dir ()
@@ -621,6 +624,14 @@ set_scripts_dir ()
char *end, *dir;
size_t dirlen;
+ dir = make_relative_prefix (program_name, BINDIR, SCRIPTDIR);
+ if (dir && check_for_scripts_dir (dir))
+ /* Success. Don't free dir. */
+ return;
+
+ if (dir)
+ free (dir);
+
if (check_for_scripts_dir (SCRIPTDIR))
/* We've been installed normally. */
return;