summaryrefslogtreecommitdiff
path: root/scripts/build/binutils/elf2flt.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/build/binutils/elf2flt.sh')
-rw-r--r--scripts/build/binutils/elf2flt.sh27
1 files changed, 25 insertions, 2 deletions
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"