scripts/build/binutils.sh
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Mon May 07 21:45:31 2007 +0000 (2007-05-07)
changeset 66 c77d59891a0d
parent 1 eeea35fbf182
child 78 c3868084d81a
permissions -rw-r--r--
Simplify kernel config file need.
Don't build a default config file when not needed.
     1 # This file adds functions to build binutils
     2 # Copyright 2007 Yann E. MORIN
     3 # Licensed under the GPL v2. See COPYING in the root of this package
     4 
     5 # Download binutils
     6 do_binutils_get() {
     7     CT_GetFile "${CT_BINUTILS_FILE}"                            \
     8                ftp://ftp.gnu.org/gnu/binutils                   \
     9                ftp://ftp.kernel.org/pub/linux/devel/binutils
    10 }
    11 
    12 # Extract binutils
    13 do_binutils_extract() {
    14     CT_ExtractAndPatch "${CT_BINUTILS_FILE}"
    15 }
    16 
    17 # Build binutils
    18 do_binutils() {
    19     mkdir -p "${CT_BUILD_DIR}/build-binutils"
    20     cd "${CT_BUILD_DIR}/build-binutils"
    21 
    22     CT_DoStep INFO "Installing binutils"
    23 
    24     CT_DoLog EXTRA "Configuring binutils"
    25     CFLAGS="${CT_CFLAGS_FOR_HOST}"                  \
    26     "${CT_SRC_DIR}/${CT_BINUTILS_FILE}/configure"   \
    27         ${CT_CANADIAN_OPT}                          \
    28         --target=${CT_TARGET}                       \
    29         --host=${CT_HOST}                           \
    30         --prefix=${CT_PREFIX_DIR}                   \
    31         --disable-nls                               \
    32         ${CT_BINUTILS_EXTRA_CONFIG}                 \
    33         ${BINUTILS_SYSROOT_ARG}                     2>&1 |CT_DoLog DEBUG
    34 
    35     CT_DoLog EXTRA "Building binutils"
    36     make ${PARALLELMFLAGS}  2>&1 |CT_DoLog DEBUG
    37 
    38     CT_DoLog EXTRA "Installing binutils"
    39     make install            2>&1 |CT_DoLog DEBUG
    40 
    41     # Make those new tools available to the core C compiler to come:
    42     # Note: some components want the ${TARGET}-{ar,as,ld,strip} commands as
    43     # well. Create that (libfloat is one such sucker).
    44     mkdir -p "${CT_CC_CORE_PREFIX_DIR}/${CT_TARGET}/bin"
    45     mkdir -p "${CT_CC_CORE_PREFIX_DIR}/bin"
    46     for t in ar as ld strip; do
    47         ln -sv "${CT_PREFIX_DIR}/bin/${CT_TARGET}-${t}" "${CT_CC_CORE_PREFIX_DIR}/${CT_TARGET}/bin/${t}"
    48         ln -sv "${CT_PREFIX_DIR}/bin/${CT_TARGET}-${t}" "${CT_CC_CORE_PREFIX_DIR}/bin/${CT_TARGET}-${t}"
    49     done |CT_DoLog DEBUG
    50 
    51     CT_EndStep
    52 }