From: David McCullough Date: Fri, 19 Mar 2004 00:17:18 +0000 (+0000) Subject: A small patch to ld-elf2flt.in, that lets an elf2flt-ified toolchain run X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=4514b68c7cc742b3c4a5c001cfcf2e9286a1aec6;p=elf2flt.git A small patch to ld-elf2flt.in, that lets an elf2flt-ified toolchain run from a directory other than that specifed in the original ./configure. Helpful if you distribute toolchains and can't control where people install them! :) Also helpful if you are testing toolchains and need to move them around after the elf2flt "make install". John Williams --- diff --git a/ld-elf2flt.in b/ld-elf2flt.in index ba93801..ab5d448 100644 --- a/ld-elf2flt.in +++ b/ld-elf2flt.in @@ -13,6 +13,7 @@ LINKER="$0.real" # the original renamed-linker ELF2FLT="`expr $0 : '\(.*\)ld'`elf2flt" TOOLDIR="`dirname $0`" # let gcc find the tools for us +LDSCRIPTPATH="${TOOLDIR}/../@target_alias@/lib" # and the scripts SHARED_ID="" NEWLDSCRIPT="" @@ -115,18 +116,18 @@ then fi # provide a default linker script, we usually need one - [ -z "$LDSCRIPT" ] && LDSCRIPT="@prefix@/@target_alias@/lib/elf2flt.ld" + [ -z "$LDSCRIPT" ] && LDSCRIPT="${LDSCRIPTPATH}/elf2flt.ld" # if we can find the linker script we preprocess it, otherwise # we assume the user knows what they are doing if [ -f "$LDSCRIPT" ]; then sed $SEDOP < "$LDSCRIPT" > "$NEWLDSCRIPT" LDSCRIPT="$NEWLDSCRIPT" - elif [ -f "@prefix@/@target_alias@/lib/$LDSCRIPT" ]; then - sed $SEDOP < "@prefix@/@target_alias@/lib/$LDSCRIPT" > "$NEWLDSCRIPT" + elif [ -f "${LDSCRIPTPATH}/$LDSCRIPT" ]; then + sed $SEDOP < "${LDSCRIPTPATH}/$LDSCRIPT" > "$NEWLDSCRIPT" LDSCRIPT="$NEWLDSCRIPT" - elif [ -f "@prefix@/@target_alias@/lib/ldscripts/$LDSCRIPT" ]; then - sed $SEDOP < "@prefix@/@target_alias@/lib/ldscripts/$LDSCRIPT" > "$NEWLDSCRIPT" + elif [ -f "${LDSCRIPTPATH}/ldscripts/$LDSCRIPT" ]; then + sed $SEDOP < "${LDSCRIPTPATH}/ldscripts/$LDSCRIPT" > "$NEWLDSCRIPT" LDSCRIPT="$NEWLDSCRIPT" fi