1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/scripts/build/cc_core_gcc.sh Sun Mar 04 12:05:19 2007 +0000
1.3 @@ -0,0 +1,58 @@
1.4 +# This file adds the function to build the core gcc C compiler
1.5 +# Copyright 2007 Yann E. MORIN
1.6 +# Licensed under the GPL v2. See COPYING in the root of this package
1.7 +
1.8 +do_cc_core() {
1.9 + mkdir -p "${CT_BUILD_DIR}/build-cc-core"
1.10 + cd "${CT_BUILD_DIR}/build-cc-core"
1.11 +
1.12 + CT_DoStep INFO "Installing core C compiler"
1.13 +
1.14 + CT_DoLog EXTRA "Copy headers to install area of bootstrap gcc, so it can build libgcc2"
1.15 + mkdir -p "${CT_CC_CORE_PREFIX_DIR}/${CT_TARGET}/include"
1.16 + cp -r "${CT_HEADERS_DIR}"/* "${CT_CC_CORE_PREFIX_DIR}/${CT_TARGET}/include" 2>&1 |CT_DoLog DEBUG
1.17 +
1.18 + CT_DoLog EXTRA "Configuring core C compiler"
1.19 +
1.20 + extra_config=""
1.21 + [ "${CT_ARCH_FLOAT_SW}" = "y" ] && extra_config="${extra_config} --with-float=soft"
1.22 + [ -n "${CT_ARCH_CPU}" ] && extra_config="${extra_config} --with-cpu=${CT_ARCH_CPU}"
1.23 + [ -n "${CT_ARCH_TUNE}" ] && extra_config="${extra_config} --with-tune=${CT_ARCH_TUNE}"
1.24 + [ -n "${CT_ARCH_ARCH}" ] && extra_config="${extra_config} --with-arch=${CT_ARCH_ARCH}"
1.25 + [ -n "${CT_ARCH_FPU}" ] && extra_config="${extra_config} --with-fpu=${CT_ARCH_FPU}"
1.26 +
1.27 + CT_DoLog DEBUG "Extra config passed: \"${extra_config}\""
1.28 +
1.29 + # Use --with-local-prefix so older gccs don't look in /usr/local (http://gcc.gnu.org/PR10532)
1.30 + CFLAGS="${CT_CFLAGS_FOR_HOST}" \
1.31 + "${CT_SRC_DIR}/${CT_CC_CORE_FILE}/configure" \
1.32 + ${CT_CANADIAN_OPT} \
1.33 + --target=${CT_TARGET} \
1.34 + --host=${CT_HOST} \
1.35 + --prefix="${CT_CC_CORE_PREFIX_DIR}" \
1.36 + --with-local-prefix="${CT_SYSROOT_DIR}" \
1.37 + --disable-multilib \
1.38 + --with-newlib \
1.39 + ${CC_CORE_SYSROOT_ARG} \
1.40 + ${extra_config} \
1.41 + --disable-nls \
1.42 + --enable-threads=no \
1.43 + --enable-symvers=gnu \
1.44 + --enable-__cxa_atexit \
1.45 + --enable-languages=c \
1.46 + --disable-shared \
1.47 + ${CT_CC_CORE_EXTRA_CONFIG} 2>&1 |CT_DoLog DEBUG
1.48 +
1.49 + if [ ! "${CT_CANADIAN}" = "y" ]; then
1.50 + CT_DoLog EXTRA "Building libiberty"
1.51 + make ${PARALLELMFLAGS} all-build-libiberty 2>&1 |CT_DoLog DEBUG
1.52 + fi
1.53 +
1.54 + CT_DoLog EXTRA "Building core C compiler"
1.55 + make ${PARALLELMFLAGS} all-gcc 2>&1 |CT_DoLog DEBUG
1.56 +
1.57 + CT_DoLog EXTRA "Installing core C compiler"
1.58 + make install-gcc 2>&1 |CT_DoLog DEBUG
1.59 +
1.60 + CT_EndStep
1.61 +}