From: Per Bothner Date: Tue, 8 Oct 1991 23:18:03 +0000 (+0000) Subject: * ldexp.h, ldlang.h: Change enum boolean -> enum bfd_boolean. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ee17cac9c6c4eade757fb435ca169411ac7e91c8;p=binutils-gdb.git * ldexp.h, ldlang.h: Change enum boolean -> enum bfd_boolean. * ldtemplate: Remove ldfile_add_library_path calls; just use the SEARCH_DIR commands in the script files. * Makefile.in: Add LIB_PATH macro, which if set is used to replace the SEARCH_DIR commands in the scripts (using ugly sed magic). This is primarily intended for cross-linking, where you would place libaries in a different place than native libraries. Also, emulations made from ldtemplate now use $(srcdir). * ldglda29k.sc: Change SEARCH_DIR commands to a conventional form; people can use the Makefile's LIB_PATH to override. --- diff --git a/ld/Makefile.in b/ld/Makefile.in index 29d10366f19..c7c9c366d74 100644 --- a/ld/Makefile.in +++ b/ld/Makefile.in @@ -14,6 +14,12 @@ bindir = $(prefix)/bin libdir = $(prefix)/lib libsubdir = $(libdir)/gcc/$(target)/$(version) +# Seach path to override the default search path for -lfoo libraries. +# If LIB_PATH is empty, the ones in the script (if any) are left alone. +# Otherwise, they are replaced with the ones given in LIB_PATH, +# which may have the form: LIB_PATH=/lib:/usr/local/lib +LIB_PATH = + INSTALL = install -c INSTALL_PROGRAM = $(INSTALL) INSTALL_FILE = $(INSTALL) @@ -68,7 +74,12 @@ SED_REMOVE_CONSTRUCTORS= -e /CONSTRUCTORS/d # Each .sc .scr or .scu script is filtered by mkscript # into a string literal that can be included in a .c program. .sc.x: - ./mkscript < $< >$*.x + if [ "x"$(LIB_PATH) = "x" ]; then ./mkscript < $< >$*.x ; \ + else \ + (sed <$< -e '/SEARCH_DIR(.*)/d' ; \ + echo $(LIB_PATH) | tr ':' ' ' | sed -e 's/\([^ ][^ ]*\)/SEARCH_DIR(\1);/g';) | ./mkscript >$*.x;\ + fi +# ./mkscript < $< >$*.x .scu.xu: ./mkscript < $< >$*.xu .scr.xr: @@ -120,21 +131,21 @@ ldlex.c: ldlex.l lex -t $(VPATH)/ldlex.l >ldlex.c -ldgld.c: ldtemplate +ldgld.c: $(srcdir)/ldtemplate sed -e s/""/ldgld/g -e s/""/m68k/g \ - -e s/""//g -e s/""//g < ldtemplate > ldgld.c -news.c: ldtemplate + -e s/""//g -e s/""//g <$< >$@ +news.c: $(srcdir)/ldtemplate sed -e s/""/news/g -e s/""/m68k/g \ - -e s/""/news/g -e s/""/NEWS/g < ldtemplate > news.c -ldgld68k.c: ldtemplate + -e s/""/news/g -e s/""/NEWS/g <$< >$@ +ldgld68k.c: $(srcdir)/ldtemplate sed -e s/""/ldgld68k/g -e s/""/m68k/g \ - -e s/""/68k/g -e s/""/68K/g < ldtemplate > ldgld68k.c -ldglda29k.c: ldtemplate + -e s/""/68k/g -e s/""/68K/g <$< >$@ +ldglda29k.c: $(srcdir)/ldtemplate sed -e s/""/ldglda29k/g -e s/""/a29k/g \ - -e s/""/29k/g -e s/""/29K/g < ldtemplate > ldglda29k.c -ldm88k.c: ldtemplate + -e s/""/29k/g -e s/""/29K/g <$< >$@ +ldm88k.c: $(srcdir)/ldtemplate sed -e s/""/ldm88k/g -e s/""/m88k/g \ - -e s/""/m88kbcs/g -e s/""/M88KBCS/g < ldtemplate > ldm88k.c + -e s/""/m88kbcs/g -e s/""/M88KBCS/g <$< >$@ # The .c files for these are generated from ldtemplete. ldgld.o: ./mkscript ldgld.x ldgld.xr ldgld.xu diff --git a/ld/ldglda29k.sc b/ld/ldglda29k.sc index 6d7d19aa8ee..ed7544c0c57 100755 --- a/ld/ldglda29k.sc +++ b/ld/ldglda29k.sc @@ -1,8 +1,8 @@ OUTPUT_FORMAT("coff-a29k-big") INPUT(/lab3/u3/sym1/tools/usr/lib/segments.o) /* Has .rstack/.mstack */ -SEARCH_DIR(/lab3/u3/sym1/tools/lib) -SEARCH_DIR(/lab3/u3/sym1/tools/usr/lib) -SEARCH_DIR(/lab3/u3/sym1/tools/usr/local/lib) +SEARCH_DIR(/lib) +SEARCH_DIR(/usr/lib) +SEARCH_DIR(/usr/local/lib) MEMORY { text : ORIGIN = 0x1000000, LENGTH = 0x1000000 talias : ORIGIN = 0x2000000, LENGTH = 0x1000000 diff --git a/ld/ldtemplate b/ld/ldtemplate index 34d2da3d834..b627935a315 100755 --- a/ld/ldtemplate +++ b/ld/ldtemplate @@ -61,9 +61,6 @@ static void gld_before_parse() extern char lprefix; lprefix = '@'; #else - ldfile_add_library_path("/lib"); - ldfile_add_library_path("/usr/lib"); - ldfile_add_library_path("/usr/local/lib"); #ifndef TARGET_ /* I.e., if not generic */ ldfile_output_architecture = bfd_arch_; #endif