]> git.wh0rd.org Git - elf2flt.git/commitdiff
A small patch to ld-elf2flt.in, that lets an elf2flt-ified toolchain run
authorDavid McCullough <davidm@snapgear.com>
Fri, 19 Mar 2004 00:17:18 +0000 (00:17 +0000)
committerDavid McCullough <davidm@snapgear.com>
Fri, 19 Mar 2004 00:17:18 +0000 (00:17 +0000)
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 <jwilliams@itee.uq.edu.au>

ld-elf2flt.in

index ba9380140460a80d332e5aacb6e4546838a48ca2..ab5d44868beac51d87a9eccf228e3618b23bc98b 100644 (file)
@@ -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