scripts/build/cc_core_gcc.sh
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sat Feb 24 11:00:05 2007 +0000 (2007-02-24)
changeset 1 eeea35fbf182
child 20 e238f7fbc941
permissions -rw-r--r--
Add the full crosstool-NG sources to the new repository of its own.
You might just say: 'Yeah! crosstool-NG's got its own repo!".
Unfortunately, that's because the previous repo got damaged beyond repair and I had no backup.
That means I'm putting backups in place in the afternoon.
That also means we've lost history... :-(
     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_CPU}" ]  && extra_config="${extra_config} --with-cpu=${CT_ARCH_CPU}"
    20     [ -n "${CT_ARCH_TUNE}" ] && extra_config="${extra_config} --with-tune=${CT_ARCH_TUNE}"
    21     [ -n "${CT_ARCH_ARCH}" ] && extra_config="${extra_config} --with-arch=${CT_ARCH_ARCH}"
    22     [ -n "${CT_ARCH_FPU}" ] && extra_config="${extra_config} --with-fpu=${CT_ARCH_FPU}"
    23 
    24     CT_DoLog DEBUG "Extra config passed: \"${extra_config}\""
    25 
    26     # Use --with-local-prefix so older gccs don't look in /usr/local (http://gcc.gnu.org/PR10532)
    27     CFLAGS="${CT_CFLAGS_FOR_HOST}"                  \
    28     "${CT_SRC_DIR}/${CT_CC_CORE_FILE}/configure"    \
    29         ${CT_CANADIAN_OPT}                          \
    30         --target=${CT_TARGET}                       \
    31         --host=${CT_HOST}                           \
    32         --prefix="${CT_CC_CORE_PREFIX_DIR}"         \
    33         --with-local-prefix="${CT_SYSROOT_DIR}"     \
    34         --disable-multilib                          \
    35         --with-newlib                               \
    36         ${CC_CORE_SYSROOT_ARG}                      \
    37         ${extra_config}                             \
    38         --disable-nls                               \
    39         --enable-threads=no                         \
    40         --enable-symvers=gnu                        \
    41         --enable-__cxa_atexit                       \
    42         --enable-languages=c                        \
    43         --disable-shared                            \
    44         ${CT_CC_CORE_EXTRA_CONFIG}                  2>&1 |CT_DoLog DEBUG
    45 
    46     if [ ! "${CT_CANADIAN}" = "y" ]; then
    47         CT_DoLog EXTRA "Building libiberty"
    48         make ${PARALLELMFLAGS} all-build-libiberty 2>&1 |CT_DoLog DEBUG
    49     fi
    50 
    51     CT_DoLog EXTRA "Building core C compiler"
    52     make ${PARALLELMFLAGS} all-gcc 2>&1 |CT_DoLog DEBUG
    53 
    54     CT_DoLog EXTRA "Installing core C compiler"
    55     make install-gcc 2>&1 |CT_DoLog DEBUG
    56 
    57     CT_EndStep
    58 }