From bf088b28503e3f4903456c2c60b75f359d692f00 Mon Sep 17 00:00:00 2001 From: David McCullough Date: Tue, 17 Jan 2006 23:12:08 +0000 Subject: [PATCH] Patch to add configure option: --with-binutils-ldscript-dir to allow the user to change the location of the elf2flt.ld script. Mike Frysinger --- configure.in | 13 +++++++++++++ ld-elf2flt.in | 4 ++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index b0335d7..ae5dd27 100644 --- a/configure.in +++ b/configure.in @@ -25,6 +25,12 @@ AC_ARG_WITH(binutils-include-dir, [ ac_binutils_include_dir=NONE ] ) +AC_ARG_WITH(binutils-ldscript-dir, + [ --with-binutils-ldscript-dir= path to install elf2flt.ld ], + [ ac_binutils_ldscript_dir=$withval ], + [ ac_binutils_ldscript_dir=NONE ] +) + AC_ARG_ENABLE(got-check, [ --disable-got-check - disable check for GOT (needed on H8) ], [ got_check=$enableval ], @@ -62,6 +68,12 @@ if test "$ac_binutils_include_dir" != "NONE"; then binutils_include_dir="-I$ac_binutils_include_dir" fi +binutils_ldscript_dir= +if test "$ac_binutils_ldscript_dir" = "NONE"; then + ac_binutils_ldscript_dir="\${TOOLDIR}/../${target_alias}/lib" +fi +binutils_ldscript_dir="$ac_binutils_ldscript_dir" + if test "$ac_libbfd" = "NONE" -o "$ac_libiberty" = "NONE" ; then echo echo "You need to specify the location of the libfd.a and libiberty.a" @@ -108,6 +120,7 @@ AC_SUBST(target_os) AC_SUBST(target_vendor) AC_SUBST(bfd_include_dir) AC_SUBST(binutils_include_dir) +AC_SUBST(binutils_ldscript_dir) AC_SUBST(got_check) AC_OUTPUT(Makefile ld-elf2flt) diff --git a/ld-elf2flt.in b/ld-elf2flt.in index 140b4f9..613dcbf 100644 --- a/ld-elf2flt.in +++ b/ld-elf2flt.in @@ -15,12 +15,12 @@ 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 +LDSCRIPTPATH="@binutils_ldscript_dir@" # and the scripts SHARED_ID="" NEWLDSCRIPT="" # check TOOLDIR from prefix/bin/ or prefix/target-alias/bin/ -[ -d "${TOOLDIR}/../@target_alias@/lib" ] || LDSCRIPTPATH="${TOOLDIR}/../lib" +[ -d "${LDSCRIPTPATH}" ] || LDSCRIPTPATH="${TOOLDIR}/../lib" # # if we have the elf2flt options, run it -- 2.39.5