Merge first shot from the MIPS branch.
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
6 mkdir -p "${CT_BUILD_DIR}/build-cc-core"
7 cd "${CT_BUILD_DIR}/build-cc-core"
9 CT_DoStep INFO "Installing core C compiler"
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
15 CT_DoLog EXTRA "Configuring core C compiler"
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"
26 CT_DoLog DEBUG "Extra config passed: \"${extra_config}\""
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" \
32 --target=${CT_TARGET} \
34 --prefix="${CT_CC_CORE_PREFIX_DIR}" \
35 --with-local-prefix="${CT_SYSROOT_DIR}" \
38 ${CC_CORE_SYSROOT_ARG} \
42 --enable-symvers=gnu \
43 --enable-languages=c \
45 ${CT_CC_CORE_EXTRA_CONFIG} 2>&1 |CT_DoLog DEBUG
47 if [ ! "${CT_CANADIAN}" = "y" ]; then
48 CT_DoLog EXTRA "Building libiberty"
49 make ${PARALLELMFLAGS} all-build-libiberty 2>&1 |CT_DoLog DEBUG
52 CT_DoLog EXTRA "Building core C compiler"
53 make ${PARALLELMFLAGS} all-gcc 2>&1 |CT_DoLog DEBUG
55 CT_DoLog EXTRA "Installing core C compiler"
56 make install-gcc 2>&1 |CT_DoLog DEBUG