1 # This file adds functions to build elf2flt
2 # Copyright 2009 John Williams
3 # Copyright 2007 Yann E. MORIN
4 # Licensed under the GPL v2. See COPYING in the root of this package
7 do_elf2flt_get() { :; }
8 do_elf2flt_extract() { :; }
9 do_elf2flt_for_host() { :; }
11 if [ -n "${CT_ARCH_BINFMT_FLAT}" ]; then
15 CT_GetCVS "elf2flt-cvs-${CT_ELF2FLT_VERSION}" \
16 ":pserver:anonymous@cvs.uclinux.org:/var/cvs" \
19 "elf2flt-cvs-${CT_ELF2FLT_VERSION}"
23 do_elf2flt_extract() {
24 CT_Extract "elf2flt-cvs-${CT_ELF2FLT_VERSION}"
25 CT_Patch "elf2flt-cvs" "${CT_ELF2FLT_VERSION}"
28 # Build elf2flt for host -> target
29 do_elf2flt_for_host() {
32 CT_DoStep INFO "Installing elf2flt for host"
33 CT_mkdir_pushd "${CT_BUILD_DIR}/build-elf2flt-host-${CT_HOST}"
35 elf2flt_opts+=( "host=${CT_HOST}" )
36 elf2flt_opts+=( "prefix=${CT_PREFIX_DIR}" )
37 elf2flt_opts+=( "static_build=${CT_STATIC_TOOLCHAIN}" )
38 elf2flt_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" )
40 do_elf2flt_backend "${elf2flt_opts[@]}"
42 # Make those new tools available to the core C compilers to come.
43 # Note: some components want the ${TARGET}-{ar,as,ld,strip} commands as
45 # Don't do it for canadian or cross-native, because the binutils
46 # are not executable on the build machine.
47 case "${CT_TOOLCHAIN_TYPE}" in
49 mkdir -p "${CT_BUILDTOOLS_PREFIX_DIR}/${CT_TARGET}/bin"
50 mkdir -p "${CT_BUILDTOOLS_PREFIX_DIR}/bin"
51 for t in elf2flt flthdr; do
52 CT_DoExecLog ALL ln -sv \
53 "${CT_PREFIX_DIR}/bin/${CT_TARGET}-${t}" \
54 "${CT_BUILDTOOLS_PREFIX_DIR}/${CT_TARGET}/bin/${t}"
55 CT_DoExecLog ALL ln -sv \
56 "${CT_PREFIX_DIR}/bin/${CT_TARGET}-${t}" \
57 "${CT_BUILDTOOLS_PREFIX_DIR}/bin/${CT_TARGET}-${t}"
67 # Build elf2flt for X -> target
68 # Parameter : description : type : default
69 # host : machine to run on : tuple : (none)
70 # prefix : prefix to install into : dir : (none)
71 # static_build : build statcially : bool : no
72 # cflags : host cflags to use : string : (empty)
73 do_elf2flt_backend() {
85 binutils_bld="${CT_BUILD_DIR}/build-binutils-host-${CT_HOST}"
86 binutils_src="${CT_SRC_DIR}/binutils-${CT_BINUTILS_VERSION}"
88 CT_DoLog EXTRA "Configuring elf2flt"
90 CFLAGS="${host_cflags}" \
91 "${CT_SRC_DIR}/elf2flt-cvs-${CT_ELF2FLT_VERSION}/configure" \
94 --target=${CT_TARGET} \
96 --with-bfd-include-dir=${binutils_bld}/bfd \
97 --with-binutils-include-dir=${binutils_src}/include \
98 --with-libbfd=${binutils_bld}/bfd/libbfd.a \
99 --with-libiberty=${binutils_bld}/libiberty/libiberty.a \
101 "${CT_ELF2FLT_EXTRA_CONFIG_ARRAY[@]}"
103 CT_DoLog EXTRA "Building elf2flt"
104 CT_DoExecLog ALL make ${JOBSFLAGS}
106 CT_DoLog EXTRA "Installing elf2flt"
107 CT_DoExecLog ALL make install
110 fi # CT_ARCH_BINFMT_FLAT