binutils: add frontends for building to run on the build machine
author"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun Jul 24 23:52:28 2011 +0200 (2011-07-24)
changeset 29283f70dd642d34
parent 2927 ddaae597fd7c
child 2929 22e495b7bee8
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" <yann.morin.1998@anciens.enib.fr>
scripts/build/binutils/binutils.sh
scripts/build/binutils/elf2flt.sh
     1.1 --- a/scripts/build/binutils/binutils.sh	Sun Jul 17 18:56:30 2011 +0200
     1.2 +++ b/scripts/build/binutils/binutils.sh	Sun Jul 24 23:52:28 2011 +0200
     1.3 @@ -15,6 +15,26 @@
     1.4      CT_Patch "binutils" "${CT_BINUTILS_VERSION}"
     1.5  }
     1.6  
     1.7 +# Build binutils for build -> target
     1.8 +do_binutils_for_build() {
     1.9 +    local -a binutils_opts
    1.10 +
    1.11 +    case "${CT_TOOLCHAIN_TYPE}" in
    1.12 +        native|cross)   return 0;;
    1.13 +    esac
    1.14 +
    1.15 +    CT_DoStep INFO "Installing binutils for build"
    1.16 +    CT_mkdir_pushd "${CT_BUILD_DIR}/build-binutils-build-${CT_BUILD}"
    1.17 +
    1.18 +    binutils_opts+=( "host=${CT_BUILD}" )
    1.19 +    binutils_opts+=( "prefix=${CT_BUILDTOOLS_PREFIX_DIR}" )
    1.20 +
    1.21 +    do_binutils_backend "${binutils_opts[@]}"
    1.22 +
    1.23 +    CT_Popd
    1.24 +    CT_EndStep
    1.25 +}
    1.26 +
    1.27  # Build binutils for host -> target
    1.28  do_binutils_for_host() {
    1.29      local -a binutils_tools
     2.1 --- a/scripts/build/binutils/elf2flt.sh	Sun Jul 17 18:56:30 2011 +0200
     2.2 +++ b/scripts/build/binutils/elf2flt.sh	Sun Jul 24 23:52:28 2011 +0200
     2.3 @@ -6,6 +6,7 @@
     2.4  # Default: do nothing
     2.5  do_elf2flt_get()        { :; }
     2.6  do_elf2flt_extract()    { :; }
     2.7 +do_elf2flt_for_build()  { :; }
     2.8  do_elf2flt_for_host()   { :; }
     2.9  
    2.10  if [ -n "${CT_ARCH_BINFMT_FLAT}" ]; then
    2.11 @@ -25,6 +26,27 @@
    2.12      CT_Patch "elf2flt-cvs" "${CT_ELF2FLT_VERSION}"
    2.13  }
    2.14  
    2.15 +# Build elf2flt for build -> target
    2.16 +do_elf2flt_for_build() {
    2.17 +    local -a elf2flt_opts
    2.18 +
    2.19 +    case "${CT_TOOLCHAIN_TYPE}" in
    2.20 +        native|cross)   return 0;;
    2.21 +    esac
    2.22 +
    2.23 +    CT_DoStep INFO "Installing elf2flt for build"
    2.24 +    CT_mkdir_pushd "${CT_BUILD_DIR}/build-elf2flt-build-${CT_BUILD}"
    2.25 +
    2.26 +    elf2flt_opts+=( "host=${CT_BUILD}" )
    2.27 +    elf2flt_opts+=( "prefix=${CT_BUILDTOOLS_PREFIX_DIR}" )
    2.28 +    elf2flt_opts+=( "binutils_bld=${CT_BUILD_DIR}/build-binutils-build-${CT_HOST}" )
    2.29 +
    2.30 +    do_elf2flt_backend "${elf2flt_opts[@]}"
    2.31 +
    2.32 +    CT_Popd
    2.33 +    CT_EndStep
    2.34 +}
    2.35 +
    2.36  # Build elf2flt for host -> target
    2.37  do_elf2flt_for_host() {
    2.38      local -a elf2flt_opts
    2.39 @@ -36,6 +58,7 @@
    2.40      elf2flt_opts+=( "prefix=${CT_PREFIX_DIR}" )
    2.41      elf2flt_opts+=( "static_build=${CT_STATIC_TOOLCHAIN}" )
    2.42      elf2flt_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" )
    2.43 +    elf2flt_opts+=( "binutils_bld=${CT_BUILD_DIR}/build-binutils-host-${CT_HOST}" )
    2.44  
    2.45      do_elf2flt_backend "${elf2flt_opts[@]}"
    2.46  
    2.47 @@ -75,14 +98,14 @@
    2.48      local prefix
    2.49      local static_build
    2.50      local cflags
    2.51 +    local binutils_bld
    2.52 +    local binutils_src
    2.53      local arg
    2.54  
    2.55      for arg in "$@"; do
    2.56          eval "${arg// /\\ }"
    2.57      done
    2.58  
    2.59 -    elf2flt_opts=
    2.60 -    binutils_bld="${CT_BUILD_DIR}/build-binutils-host-${CT_HOST}"
    2.61      binutils_src="${CT_SRC_DIR}/binutils-${CT_BINUTILS_VERSION}"
    2.62  
    2.63      CT_DoLog EXTRA "Configuring elf2flt"