scripts/build/binutils/elf2flt.sh
author Remy Bohmer <linux@bohmer.net>
Thu May 27 23:18:19 2010 +0200 (2010-05-27)
changeset 2060 51e4597b07fc
parent 1755 30d91bfc1f2a
child 2154 250cdcc86441
permissions -rw-r--r--
scripts: add option to strip all toolchain executables

To reduce filesizes of the toolchain and even improve build times
of projects to be build with this toolchain it is usefull to strip
the delivered toolchain executables. Since it is not likely that we
will debug the toolchain executables itself we do not need the
debug information inside the executables itself.

Signed-off-by: Remy Bohmer <linux@bohmer.net>
     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
     5 
     6 # Default: do nothing
     7 do_elf2flt_get()     { :; }
     8 do_elf2flt_extract() { :; }
     9 do_elf2flt()         { :; }
    10 
    11 if [ -n "${CT_ARCH_BINFMT_FLAT}" ]; then
    12 
    13 # Download elf2flt
    14 do_elf2flt_get() {
    15     CT_GetCVS "elf2flt-cvs-${CT_ELF2FLT_VERSION}"           \
    16               ":pserver:anonymous@cvs.uclinux.org:/var/cvs" \
    17               "elf2flt"                                     \
    18               "" \
    19               "elf2flt-cvs-${CT_ELF2FLT_VERSION}"
    20 }
    21 
    22 # Extract elf2flt
    23 do_elf2flt_extract() {
    24     CT_Extract "elf2flt-cvs-${CT_ELF2FLT_VERSION}"
    25     CT_Patch "elf2flt-cvs" "${CT_ELF2FLT_VERSION}"
    26 }
    27 
    28 # Build elf2flt
    29 do_elf2flt() {
    30     mkdir -p "${CT_BUILD_DIR}/build-elf2flt"
    31     cd "${CT_BUILD_DIR}/build-elf2flt"
    32 
    33     CT_DoStep INFO "Installing elf2flt"
    34 
    35     elf2flt_opts=
    36     binutils_bld=${CT_BUILD_DIR}/build-binutils
    37     binutils_src=${CT_SRC_DIR}/binutils-${CT_BINUTILS_VERSION}
    38 
    39     CT_DoLog EXTRA "Configuring elf2flt"
    40     CFLAGS="${CT_CFLAGS_FOR_HOST}"                              \
    41     CT_DoExecLog ALL                                            \
    42     "${CT_SRC_DIR}/elf2flt-cvs-${CT_ELF2FLT_VERSION}/configure" \
    43         --build=${CT_BUILD}                                     \
    44         --host=${CT_HOST}                                       \
    45         --target=${CT_TARGET}                                   \
    46         --prefix=${CT_PREFIX_DIR}                               \
    47         --with-bfd-include-dir=${binutils_bld}/bfd              \
    48         --with-binutils-include-dir=${binutils_src}/include     \
    49         --with-libbfd=${binutils_bld}/bfd/libbfd.a              \
    50         --with-libiberty=${binutils_bld}/libiberty/libiberty.a  \
    51         ${elf2flt_opts}                                         \
    52         ${CT_ELF2FLT_EXTRA_CONFIG}			
    53 
    54     CT_DoLog EXTRA "Building elf2flt"
    55     CT_DoExecLog ALL make ${PARALLELMFLAGS}
    56 
    57     CT_DoLog EXTRA "Installing elf2flt"
    58     CT_DoExecLog ALL make install
    59 
    60     # Make those new tools available to the core C compilers to come.
    61     # Note: some components want the ${TARGET}-{ar,as,ld,strip} commands as
    62     # well. Create that.
    63     mkdir -p "${CT_CC_CORE_STATIC_PREFIX_DIR}/${CT_TARGET}/bin"
    64     mkdir -p "${CT_CC_CORE_STATIC_PREFIX_DIR}/bin"
    65     mkdir -p "${CT_CC_CORE_SHARED_PREFIX_DIR}/${CT_TARGET}/bin"
    66     mkdir -p "${CT_CC_CORE_SHARED_PREFIX_DIR}/bin"
    67     for t in elf2flt flthdr; do
    68         ln -sv "${CT_PREFIX_DIR}/bin/${CT_TARGET}-${t}" "${CT_CC_CORE_STATIC_PREFIX_DIR}/${CT_TARGET}/bin/${t}"
    69         ln -sv "${CT_PREFIX_DIR}/bin/${CT_TARGET}-${t}" "${CT_CC_CORE_STATIC_PREFIX_DIR}/bin/${CT_TARGET}-${t}"
    70         ln -sv "${CT_PREFIX_DIR}/bin/${CT_TARGET}-${t}" "${CT_CC_CORE_SHARED_PREFIX_DIR}/${CT_TARGET}/bin/${t}"
    71         ln -sv "${CT_PREFIX_DIR}/bin/${CT_TARGET}-${t}" "${CT_CC_CORE_SHARED_PREFIX_DIR}/bin/${CT_TARGET}-${t}"
    72     done 2>&1 |CT_DoLog ALL
    73 
    74     CT_EndStep
    75 }
    76 
    77 fi # CT_ARCH_BINFMT_FLAT