scripts/build/binutils/elf2flt.sh
changeset 2928 3f70dd642d34
parent 2926 d304c8a7bfa8
child 3090 a221c86d9b33
     1.1 --- a/scripts/build/binutils/elf2flt.sh	Sun Jul 17 18:29:35 2011 +0200
     1.2 +++ b/scripts/build/binutils/elf2flt.sh	Sun Jul 24 23:52:28 2011 +0200
     1.3 @@ -6,6 +6,7 @@
     1.4  # Default: do nothing
     1.5  do_elf2flt_get()        { :; }
     1.6  do_elf2flt_extract()    { :; }
     1.7 +do_elf2flt_for_build()  { :; }
     1.8  do_elf2flt_for_host()   { :; }
     1.9  
    1.10  if [ -n "${CT_ARCH_BINFMT_FLAT}" ]; then
    1.11 @@ -25,6 +26,27 @@
    1.12      CT_Patch "elf2flt-cvs" "${CT_ELF2FLT_VERSION}"
    1.13  }
    1.14  
    1.15 +# Build elf2flt for build -> target
    1.16 +do_elf2flt_for_build() {
    1.17 +    local -a elf2flt_opts
    1.18 +
    1.19 +    case "${CT_TOOLCHAIN_TYPE}" in
    1.20 +        native|cross)   return 0;;
    1.21 +    esac
    1.22 +
    1.23 +    CT_DoStep INFO "Installing elf2flt for build"
    1.24 +    CT_mkdir_pushd "${CT_BUILD_DIR}/build-elf2flt-build-${CT_BUILD}"
    1.25 +
    1.26 +    elf2flt_opts+=( "host=${CT_BUILD}" )
    1.27 +    elf2flt_opts+=( "prefix=${CT_BUILDTOOLS_PREFIX_DIR}" )
    1.28 +    elf2flt_opts+=( "binutils_bld=${CT_BUILD_DIR}/build-binutils-build-${CT_HOST}" )
    1.29 +
    1.30 +    do_elf2flt_backend "${elf2flt_opts[@]}"
    1.31 +
    1.32 +    CT_Popd
    1.33 +    CT_EndStep
    1.34 +}
    1.35 +
    1.36  # Build elf2flt for host -> target
    1.37  do_elf2flt_for_host() {
    1.38      local -a elf2flt_opts
    1.39 @@ -36,6 +58,7 @@
    1.40      elf2flt_opts+=( "prefix=${CT_PREFIX_DIR}" )
    1.41      elf2flt_opts+=( "static_build=${CT_STATIC_TOOLCHAIN}" )
    1.42      elf2flt_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" )
    1.43 +    elf2flt_opts+=( "binutils_bld=${CT_BUILD_DIR}/build-binutils-host-${CT_HOST}" )
    1.44  
    1.45      do_elf2flt_backend "${elf2flt_opts[@]}"
    1.46  
    1.47 @@ -75,14 +98,14 @@
    1.48      local prefix
    1.49      local static_build
    1.50      local cflags
    1.51 +    local binutils_bld
    1.52 +    local binutils_src
    1.53      local arg
    1.54  
    1.55      for arg in "$@"; do
    1.56          eval "${arg// /\\ }"
    1.57      done
    1.58  
    1.59 -    elf2flt_opts=
    1.60 -    binutils_bld="${CT_BUILD_DIR}/build-binutils-host-${CT_HOST}"
    1.61      binutils_src="${CT_SRC_DIR}/binutils-${CT_BINUTILS_VERSION}"
    1.62  
    1.63      CT_DoLog EXTRA "Configuring elf2flt"