diff options
Diffstat (limited to 'scripts/build/cc')
-rw-r--r-- | scripts/build/cc/gcc.sh | 61 |
1 files changed, 39 insertions, 22 deletions
diff --git a/scripts/build/cc/gcc.sh b/scripts/build/cc/gcc.sh index c7e1712b..e1f5d25c 100644 --- a/scripts/build/cc/gcc.sh +++ b/scripts/build/cc/gcc.sh @@ -4,18 +4,16 @@ # Download gcc do_cc_get() { - local version="${CT_CC_VERSION}${CT_CC_GCC_4_4_snapshot_date}" - # Ah! gcc folks are kind of 'different': they store the tarballs in # subdirectories of the same name! That's because gcc is such /crap/ that # it is such /big/ that it needs being splitted for distribution! Sad. :-( # Arrgghh! Some of those versions does not follow this convention: # gcc-3.3.3 lives in releases/gcc-3.3.3, while gcc-2.95.* isn't in a # subdirectory! You bastard! - CT_GetFile "gcc-${version}" \ - {ftp,http}://ftp.gnu.org/gnu/gcc{,{,/releases}/gcc-${version}} \ - ftp://ftp.irisa.fr/pub/mirrors/gcc.gnu.org/gcc/releases/gcc-${version} \ - ftp://ftp.uvsq.fr/pub/gcc/snapshots/${version} + CT_GetFile "gcc-${CT_CC_VERSION}" \ + {ftp,http}://ftp.gnu.org/gnu/gcc{,{,/releases}/gcc-${CT_CC_VERSION}} \ + ftp://ftp.irisa.fr/pub/mirrors/gcc.gnu.org/gcc/releases/gcc-${CT_CC_VERSION} \ + ftp://ftp.uvsq.fr/pub/gcc/snapshots/${CT_CC_VERSION} # Starting with GCC 4.3, ecj is used for Java, and will only be # built if the configure script finds ecj.jar at the top of the @@ -29,22 +27,24 @@ do_cc_get() { # Extract gcc do_cc_extract() { - local version="${CT_CC_VERSION}${CT_CC_GCC_4_4_snapshot_date}" - - CT_Extract "gcc-${version}" - CT_Patch "gcc-${version}" + CT_Extract "gcc-${CT_CC_VERSION}" + CT_Patch "gcc-${CT_CC_VERSION}" # Copy ecj-latest.jar to ecj.jar at the top of the GCC source tree - if [ "${CT_CC_LANG_JAVA_USE_ECJ}" = "y" \ - -a ! -f "${CT_SRC_DIR}/gcc-${version}/ecj.jar" \ + if [ "${CT_CC_LANG_JAVA_USE_ECJ}" = "y" \ + -a ! -f "${CT_SRC_DIR}/gcc-${CT_CC_VERSION}/ecj.jar" \ ]; then - CT_DoExecLog ALL cp -v "${CT_TARBALLS_DIR}/ecj-latest.jar" "${CT_SRC_DIR}/gcc-${version}/ecj.jar" + CT_DoExecLog ALL cp -v "${CT_TARBALLS_DIR}/ecj-latest.jar" "${CT_SRC_DIR}/gcc-${CT_CC_VERSION}/ecj.jar" fi } #------------------------------------------------------------------------------ # Core gcc pass 1 do_cc_core_pass_1() { + # If we're building a canadian compiler no use to build the CC + # core compiler, we're not using it + [ -n "${CT_CANADIAN}" ] && return 0 + # If we're building for bare metal, build the static core gcc, # with libgcc. # In case we're not bare metal, and we're NPTL, build the static core gcc. @@ -58,6 +58,10 @@ do_cc_core_pass_1() { # Core gcc pass 2 do_cc_core_pass_2() { + # If we're building a canadian compiler no use to build the CC + # core compiler, we're not using it + [ -n "${CT_CANADIAN}" ] && return 0 + # In case we're building for bare metal, do nothing, we already have # our compiler. # In case we're NPTL, build the shared core gcc and the target libgcc. @@ -90,7 +94,6 @@ do_cc_core() { local core_prefix_dir local extra_config local lang_opt - local version="${CT_CC_VERSION}${CT_CC_GCC_4_4_snapshot_date}" eval $1 eval $2 @@ -137,12 +140,20 @@ do_cc_core() { extra_config="${extra_config} ${CT_ARCH_WITH_TUNE}" extra_config="${extra_config} ${CT_ARCH_WITH_FPU}" extra_config="${extra_config} ${CT_ARCH_WITH_FLOAT}" - [ "${CT_GMP_MPFR}" = "y" ] && extra_config="${extra_config} --with-gmp=${CT_PREFIX_DIR} --with-mpfr=${CT_PREFIX_DIR}" if [ "${CT_CC_CXA_ATEXIT}" = "y" ]; then extra_config="${extra_config} --enable-__cxa_atexit" else extra_config="${extra_config} --disable-__cxa_atexit" fi + if [ "${CT_GMP_MPFR}" = "y" ]; then + extra_config="${extra_config} --with-gmp=${CT_PREFIX_DIR}" + extra_config="${extra_config} --with-mpfr=${CT_PREFIX_DIR}" + fi + if [ "${CT_PPL_CLOOG_MPC}" = "y" ]; then + extra_config="${extra_config} --with-ppl=${CT_PREFIX_DIR}" + extra_config="${extra_config} --with-cloog=${CT_PREFIX_DIR}" + extra_config="${extra_config} --with-mpc=${CT_PREFIX_DIR}" + fi CT_DoLog DEBUG "Extra config passed: '${extra_config}'" @@ -150,7 +161,7 @@ do_cc_core() { CC_FOR_BUILD="${CT_BUILD}-gcc" \ CFLAGS="${CT_CFLAGS_FOR_HOST}" \ CT_DoExecLog ALL \ - "${CT_SRC_DIR}/gcc-${version}/configure" \ + "${CT_SRC_DIR}/gcc-${CT_CC_VERSION}/configure" \ --build=${CT_BUILD} \ --host=${CT_HOST} \ --target=${CT_TARGET} \ @@ -182,7 +193,7 @@ do_cc_core() { # so we configure then build it. # Next we have to configure gcc, create libgcc.mk then edit it... # So much easier if we just edit the source tree, but hey... - if [ ! -f "${CT_SRC_DIR}/gcc-${version}/gcc/BASE-VER" ]; then + if [ ! -f "${CT_SRC_DIR}/gcc-${CT_CC_VERSION}/gcc/BASE-VER" ]; then CT_DoExecLog ALL make configure-libiberty CT_DoExecLog ALL make ${PARALLELMFLAGS} -C libiberty libiberty.a CT_DoExecLog ALL make configure-gcc configure-libcpp @@ -192,7 +203,7 @@ do_cc_core() { CT_DoExecLog ALL make ${PARALLELMFLAGS} all-libcpp all-build-libiberty fi # HACK: gcc-4.2 uses libdecnumber to build libgcc.mk, so build it here. - if [ -d "${CT_SRC_DIR}/gcc-${version}/libdecnumber" ]; then + if [ -d "${CT_SRC_DIR}/gcc-${CT_CC_VERSION}/libdecnumber" ]; then CT_DoExecLog ALL make configure-libdecnumber CT_DoExecLog ALL make ${PARALLELMFLAGS} -C libdecnumber libdecnumber.a fi @@ -238,8 +249,6 @@ do_cc_core() { #------------------------------------------------------------------------------ # Build final gcc do_cc() { - local version="${CT_CC_VERSION}${CT_CC_GCC_4_4_snapshot_date}" - # If building for bare metal, nothing to be done here, the static core conpiler is enough! [ "${CT_BARE_METAL}" = "y" ] && return 0 @@ -273,7 +282,6 @@ do_cc() { extra_config="${extra_config} ${CT_ARCH_WITH_FPU}" extra_config="${extra_config} ${CT_ARCH_WITH_FLOAT}" [ "${CT_SHARED_LIBS}" = "y" ] || extra_config="${extra_config} --disable-shared" - [ "${CT_GMP_MPFR}" = "y" ] && extra_config="${extra_config} --with-gmp=${CT_PREFIX_DIR} --with-mpfr=${CT_PREFIX_DIR}" [ -n "${CT_CC_PKGVERSION}" ] && extra_config="${extra_config} --with-pkgversion=${CT_CC_PKGVERSION}" [ -n "${CT_CC_BUGURL}" ] && extra_config="${extra_config} --with-bugurl=${CT_CC_BUGURL}" [ "${CT_CC_SJLJ_EXCEPTIONS_USE}" = "y" ] && extra_config="${extra_config} --enable-sjlj-exceptions" @@ -283,6 +291,15 @@ do_cc() { else extra_config="${extra_config} --disable-__cxa_atexit" fi + if [ "${CT_GMP_MPFR}" = "y" ]; then + extra_config="${extra_config} --with-gmp=${CT_PREFIX_DIR}" + extra_config="${extra_config} --with-mpfr=${CT_PREFIX_DIR}" + fi + if [ "${CT_PPL_CLOOG_MPC}" = "y" ]; then + extra_config="${extra_config} --with-ppl=${CT_PREFIX_DIR}" + extra_config="${extra_config} --with-cloog=${CT_PREFIX_DIR}" + extra_config="${extra_config} --with-mpc=${CT_PREFIX_DIR}" + fi CT_DoLog DEBUG "Extra config passed: '${extra_config}'" @@ -296,7 +313,7 @@ do_cc() { CXXFLAGS_FOR_TARGET="${CT_TARGET_CFLAGS}" \ LDFLAGS_FOR_TARGET="${CT_TARGET_LDFLAGS}" \ CT_DoExecLog ALL \ - "${CT_SRC_DIR}/gcc-${version}/configure" \ + "${CT_SRC_DIR}/gcc-${CT_CC_VERSION}/configure" \ --build=${CT_BUILD} \ --host=${CT_HOST} \ --target=${CT_TARGET} \ |