scripts/build/binutils/elf2flt.sh
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun Jan 01 17:49:44 2012 +0100 (2012-01-01)
changeset 2924 0eab838768b1
parent 2923 60f5ceb1b413
child 2926 d304c8a7bfa8
permissions -rw-r--r--
cc/gcc: install the core compilers in the build-tools dir

There really is no good reason to install the core compilers in their
own places, one for each pass. We can install them with the other
build tools.

Also, this implies that:
- there are fewer directories to save/restore
- there are fewer symlinks to create for binutils
- the PATH is shorter

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
     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     CT_DoExecLog CFG                                            \
    41     CFLAGS="${CT_CFLAGS_FOR_HOST}"                              \
    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_ARRAY[@]}"
    53 
    54     CT_DoLog EXTRA "Building elf2flt"
    55     CT_DoExecLog ALL make ${JOBSFLAGS}
    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     # Don't do it for canadian or cross-native, because the binutils
    64     # are not executable on the build machine.
    65     case "${CT_TOOLCHAIN_TYPE}" in
    66         cross|native)
    67             mkdir -p "${CT_BUILDTOOLS_PREFIX_DIR}/${CT_TARGET}/bin"
    68             mkdir -p "${CT_BUILDTOOLS_PREFIX_DIR}/bin"
    69             for t in elf2flt flthdr; do
    70                 ln -sv "${CT_PREFIX_DIR}/bin/${CT_TARGET}-${t}" "${CT_BUILDTOOLS_PREFIX_DIR}/${CT_TARGET}/bin/${t}"
    71                 ln -sv "${CT_PREFIX_DIR}/bin/${CT_TARGET}-${t}" "${CT_BUILDTOOLS_PREFIX_DIR}/bin/${CT_TARGET}-${t}"
    72             done 2>&1 |CT_DoLog ALL
    73             ;;
    74         *)  ;;
    75     esac
    76 
    77     CT_EndStep
    78 }
    79 
    80 fi # CT_ARCH_BINFMT_FLAT