Allow Maciej to select weird --libdir options and still select
authorAlan Modra <amodra@gmail.com>
Mon, 22 Jan 2001 13:50:17 +0000 (13:50 +0000)
committerAlan Modra <amodra@gmail.com>
Mon, 22 Jan 2001 13:50:17 +0000 (13:50 +0000)
tooldir correctly.

ld/ChangeLog
ld/Makefile.am
ld/Makefile.in
ld/genscripts.sh

index 4d4fa767c715c6de850725420380c55b8be8aa82..49ec5e4140dee76e87ffd7865b2ac8284c74beb0 100644 (file)
@@ -1,3 +1,10 @@
+2001-01-22  Alan Modra  <alan@linuxcare.com.au>
+
+       * Makefile.am (GENSCRIPTS): Pass exec_prefix.
+       * Makefile.in: Regenerate.
+       * genscripts.sh: Use exec_prefix parameter to specify tool lib.
+       Check for null tool_dir.
+
 2001-01-16  Jim Wilson  <wilson@redhat.com>
 
        * emulparams/elf64_ia64.sh (OTHER_READONLY_SECTIONS): Add IA_64.unwind
index 75d74aa8a679e16c7d45617dc20bf952b36307e1..0b6d10ced169cc19264a5b9b6cf480ff53260bcb 100644 (file)
@@ -302,7 +302,7 @@ stringify.sed: ${srcdir}/emultempl/$(STRINGIFY)
 
 # These all start with e so 'make clean' can find them.
 
-GENSCRIPTS = $(SHELL) $(srcdir)/genscripts.sh ${srcdir} ${libdir} @host@ @target@ @target_alias@ "@EMULATION_LIBPATH@" "@NATIVE_LIB_DIRS@"
+GENSCRIPTS = $(SHELL) $(srcdir)/genscripts.sh ${srcdir} ${libdir} ${exec_prefix} @host@ @target@ @target_alias@ "@EMULATION_LIBPATH@" "@NATIVE_LIB_DIRS@"
 GEN_DEPENDS = $(srcdir)/genscripts.sh stringify.sed
 @TDIRS@
 
index 79be0172f0512e507d9b05b669c7b556d7979e02..705963c53ccbf8352714f5a662016e0f876afe92 100644 (file)
@@ -391,7 +391,7 @@ POTFILES = $(CFILES) $(HFILES) $(EMULATION_FILES)
 
 # These all start with e so 'make clean' can find them.
 
-GENSCRIPTS = $(SHELL) $(srcdir)/genscripts.sh ${srcdir} ${libdir} @host@ @target@ @target_alias@ "@EMULATION_LIBPATH@" "@NATIVE_LIB_DIRS@"
+GENSCRIPTS = $(SHELL) $(srcdir)/genscripts.sh ${srcdir} ${libdir} ${exec_prefix} @host@ @target@ @target_alias@ "@EMULATION_LIBPATH@" "@NATIVE_LIB_DIRS@"
 GEN_DEPENDS = $(srcdir)/genscripts.sh stringify.sed
 
 # We need this for automake to use YLWRAP.
index 8294af7068eafa39af5715a2788b853504bb360a..f6a29703d4b9163f534a4455f384ca5f16f89989 100755 (executable)
@@ -1,23 +1,32 @@
 #!/bin/sh
 # genscripts.sh - generate the ld-emulation-target specific files
 #
-# Usage: genscripts.sh srcdir libdir host target target_alias \
-# default_emulation native_lib_dirs this_emulation tool_dir
+# Usage: genscripts.sh srcdir libdir exec_prefix \
+#        host target target_alias default_emulation \
+#        native_lib_dirs this_emulation tool_dir
 #
 # Sample usage:
-# genscripts.sh /djm/ld-devo/devo/ld /usr/local/lib sparc-sun-sunos4.1.3 \
-# sparc-sun-sunos4.1.3 sparc-sun-sunos4.1.3 sun4 "" sun3 sparc-sun-sunos4.1.3
+# genscripts.sh /djm/ld-devo/devo/ld /usr/local/lib /usr/local \
+#  sparc-sun-sunos4.1.3 sparc-sun-sunos4.1.3 sparc-sun-sunos4.1.3 sun4 \
+#  "" sun3 sparc-sun-sunos4.1.3
 # produces sun3.x sun3.xbn sun3.xn sun3.xr sun3.xu em_sun3.c
 
 srcdir=$1
 libdir=$2
-host=$3
-target=$4
-target_alias=$5
-EMULATION_LIBPATH=$6
-NATIVE_LIB_DIRS=$7
-EMULATION_NAME=$8
-tool_lib=`echo ${libdir} | sed -e 's|/lib$||'`/${9-$target_alias}/lib
+exec_prefix=$3
+host=$4
+target=$5
+target_alias=$6
+EMULATION_LIBPATH=$7
+NATIVE_LIB_DIRS=$8
+EMULATION_NAME=$9
+shift 9
+# Can't use ${1:-$target_alias} here due to an Ultrix shell bug.
+if [ "x$1" = "x" ] ; then
+  tool_lib=${exec_prefix}/${target_alias}/lib
+else
+  tool_lib=${exec_prefix}/$1/lib
+fi
 
 # Include the emulation-specific parameters:
 . ${srcdir}/emulparams/${EMULATION_NAME}.sh