diff options
author | Daniel Jacobowitz <dan@debian.org> | 2003-01-04 20:40:28 +0000 |
---|---|---|
committer | Daniel Jacobowitz <dan@debian.org> | 2003-01-04 20:40:28 +0000 |
commit | 366247f168b9af51fa080379e96b2e8476701c44 (patch) | |
tree | f61d5c0d69015ebdeb62fd9bdc1101fe903c47e7 /ld/ldmain.c | |
parent | 8b1e4281aa0d4f33227ca7a4128821549afaba47 (diff) | |
download | binutils-redhat-366247f168b9af51fa080379e96b2e8476701c44.tar.gz |
* Makefile.am (ldmain.o): Pass BINDIR.
* Makefile.in: Regenerated.
* ldmain.c (set_scripts_dir): Use make_relative_prefix for the first
search path.
Diffstat (limited to 'ld/ldmain.c')
-rw-r--r-- | ld/ldmain.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/ld/ldmain.c b/ld/ldmain.c index c90cb66537..3185befcc0 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; |