scripts/build/cc_core_gcc.sh
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Tue May 01 16:49:15 2007 +0000 (2007-05-01)
changeset 56 07a6a48962b7
parent 20 e238f7fbc941
child 63 89b41dbffe8d
permissions -rw-r--r--
Merge patches sent by Robert P. J. Day <rpjday@mindspring.com>.
Warning: the buildroot folks purposedly removed the skip-comment patch but didn't really said why. Keeping it for the sake of having it in svn just in case (removing it will be easier thant not having it at all).
     1 # This file adds the function to build the core gcc C compiler
     2 # Copyright 2007 Yann E. MORIN
     3 # Licensed under the GPL v2. See COPYING in the root of this package
     4 
     5 do_cc_core() {
     6     mkdir -p "${CT_BUILD_DIR}/build-cc-core"
     7     cd "${CT_BUILD_DIR}/build-cc-core"
     8 
     9     CT_DoStep INFO "Installing core C compiler"
    10 
    11     CT_DoLog EXTRA "Copy headers to install area of bootstrap gcc, so it can build libgcc2"
    12     mkdir -p "${CT_CC_CORE_PREFIX_DIR}/${CT_TARGET}/include"
    13     cp -r "${CT_HEADERS_DIR}"/* "${CT_CC_CORE_PREFIX_DIR}/${CT_TARGET}/include" 2>&1 |CT_DoLog DEBUG
    14 
    15     CT_DoLog EXTRA "Configuring core C compiler"
    16 
    17     extra_config=""
    18     [ "${CT_ARCH_FLOAT_SW}" = "y" ] && extra_config="${extra_config} --with-float=soft"
    19     [ -n "${CT_ARCH_ABI}" ]  && extra_config="${extra_config} --with-abi=${CT_ARCH_ABI}"
    20     [ -n "${CT_ARCH_CPU}" ]  && extra_config="${extra_config} --with-cpu=${CT_ARCH_CPU}"
    21     [ -n "${CT_ARCH_TUNE}" ] && extra_config="${extra_config} --with-tune=${CT_ARCH_TUNE}"
    22     [ -n "${CT_ARCH_ARCH}" ] && extra_config="${extra_config} --with-arch=${CT_ARCH_ARCH}"
    23     [ -n "${CT_ARCH_FPU}" ] && extra_config="${extra_config} --with-fpu=${CT_ARCH_FPU}"
    24     [ "${CT_CC_CXA_ATEXIT}" == "y" ] && extra_config="${extra_config} --enable-__cxa_atexit"
    25 
    26     CT_DoLog DEBUG "Extra config passed: \"${extra_config}\""
    27 
    28     # Use --with-local-prefix so older gccs don't look in /usr/local (http://gcc.gnu.org/PR10532)
    29     CFLAGS="${CT_CFLAGS_FOR_HOST}"                  \
    30     "${CT_SRC_DIR}/${CT_CC_CORE_FILE}/configure"    \
    31         ${CT_CANADIAN_OPT}                          \
    32         --target=${CT_TARGET}                       \
    33         --host=${CT_HOST}                           \
    34         --prefix="${CT_CC_CORE_PREFIX_DIR}"         \
    35         --with-local-prefix="${CT_SYSROOT_DIR}"     \
    36         --disable-multilib                          \
    37         --with-newlib                               \
    38         ${CC_CORE_SYSROOT_ARG}                      \
    39         ${extra_config}                             \
    40         --disable-nls                               \
    41         --enable-threads=no                         \
    42         --enable-symvers=gnu                        \
    43         --enable-languages=c                        \
    44         --disable-shared                            \
    45         ${CT_CC_CORE_EXTRA_CONFIG}                  2>&1 |CT_DoLog DEBUG
    46 
    47     if [ ! "${CT_CANADIAN}" = "y" ]; then
    48         CT_DoLog EXTRA "Building libiberty"
    49         make ${PARALLELMFLAGS} all-build-libiberty 2>&1 |CT_DoLog DEBUG
    50     fi
    51 
    52     CT_DoLog EXTRA "Building core C compiler"
    53     make ${PARALLELMFLAGS} all-gcc 2>&1 |CT_DoLog DEBUG
    54 
    55     CT_DoLog EXTRA "Installing core C compiler"
    56     make install-gcc 2>&1 |CT_DoLog DEBUG
    57 
    58     CT_EndStep
    59 }