From 518a1ff137ed5e1a2c3251d4672549985c0cc2d5 Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN\"" Date: Sun, 24 Jul 2011 23:52:28 +0200 Subject: binutils: add frontends for building to run on the build machine In canadian-cross, we need binutils running on the build machine to be able to build the target C library. Signed-off-by: "Yann E. MORIN" diff --git a/scripts/build/binutils/binutils.sh b/scripts/build/binutils/binutils.sh index 3a9afac..dab3af4 100644 --- a/scripts/build/binutils/binutils.sh +++ b/scripts/build/binutils/binutils.sh @@ -15,6 +15,26 @@ do_binutils_extract() { CT_Patch "binutils" "${CT_BINUTILS_VERSION}" } +# Build binutils for build -> target +do_binutils_for_build() { + local -a binutils_opts + + case "${CT_TOOLCHAIN_TYPE}" in + native|cross) return 0;; + esac + + CT_DoStep INFO "Installing binutils for build" + CT_mkdir_pushd "${CT_BUILD_DIR}/build-binutils-build-${CT_BUILD}" + + binutils_opts+=( "host=${CT_BUILD}" ) + binutils_opts+=( "prefix=${CT_BUILDTOOLS_PREFIX_DIR}" ) + + do_binutils_backend "${binutils_opts[@]}" + + CT_Popd + CT_EndStep +} + # Build binutils for host -> target do_binutils_for_host() { local -a binutils_tools diff --git a/scripts/build/binutils/elf2flt.sh b/scripts/build/binutils/elf2flt.sh index f203bba..89fc6c7 100644 --- a/scripts/build/binutils/elf2flt.sh +++ b/scripts/build/binutils/elf2flt.sh @@ -6,6 +6,7 @@ # Default: do nothing do_elf2flt_get() { :; } do_elf2flt_extract() { :; } +do_elf2flt_for_build() { :; } do_elf2flt_for_host() { :; } if [ -n "${CT_ARCH_BINFMT_FLAT}" ]; then @@ -25,6 +26,27 @@ do_elf2flt_extract() { CT_Patch "elf2flt-cvs" "${CT_ELF2FLT_VERSION}" } +# Build elf2flt for build -> target +do_elf2flt_for_build() { + local -a elf2flt_opts + + case "${CT_TOOLCHAIN_TYPE}" in + native|cross) return 0;; + esac + + CT_DoStep INFO "Installing elf2flt for build" + CT_mkdir_pushd "${CT_BUILD_DIR}/build-elf2flt-build-${CT_BUILD}" + + elf2flt_opts+=( "host=${CT_BUILD}" ) + elf2flt_opts+=( "prefix=${CT_BUILDTOOLS_PREFIX_DIR}" ) + elf2flt_opts+=( "binutils_bld=${CT_BUILD_DIR}/build-binutils-build-${CT_HOST}" ) + + do_elf2flt_backend "${elf2flt_opts[@]}" + + CT_Popd + CT_EndStep +} + # Build elf2flt for host -> target do_elf2flt_for_host() { local -a elf2flt_opts @@ -36,6 +58,7 @@ do_elf2flt_for_host() { elf2flt_opts+=( "prefix=${CT_PREFIX_DIR}" ) elf2flt_opts+=( "static_build=${CT_STATIC_TOOLCHAIN}" ) elf2flt_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" ) + elf2flt_opts+=( "binutils_bld=${CT_BUILD_DIR}/build-binutils-host-${CT_HOST}" ) do_elf2flt_backend "${elf2flt_opts[@]}" @@ -75,14 +98,14 @@ do_elf2flt_backend() { local prefix local static_build local cflags + local binutils_bld + local binutils_src local arg for arg in "$@"; do eval "${arg// /\\ }" done - elf2flt_opts= - binutils_bld="${CT_BUILD_DIR}/build-binutils-host-${CT_HOST}" binutils_src="${CT_SRC_DIR}/binutils-${CT_BINUTILS_VERSION}" CT_DoLog EXTRA "Configuring elf2flt" -- cgit v0.10.2-6-g49f6