scripts/build/cc/gcc.sh
branchnewlib
changeset 1365 c4d124ed9f8e
parent 1359 877d3d97f806
     1.1 --- a/scripts/build/cc/gcc.sh	Sun Mar 22 22:46:35 2009 +0000
     1.2 +++ b/scripts/build/cc/gcc.sh	Sun Apr 19 16:17:11 2009 +0000
     1.3 @@ -4,15 +4,19 @@
     1.4  
     1.5  # Download gcc
     1.6  do_cc_get() {
     1.7 +    local version="${CT_CC_VERSION}${CT_CC_GCC_4_4_snapshot_date}"
     1.8 +
     1.9      # Ah! gcc folks are kind of 'different': they store the tarballs in
    1.10      # subdirectories of the same name! That's because gcc is such /crap/ that
    1.11      # it is such /big/ that it needs being splitted for distribution! Sad. :-(
    1.12      # Arrgghh! Some of those versions does not follow this convention:
    1.13      # gcc-3.3.3 lives in releases/gcc-3.3.3, while gcc-2.95.* isn't in a
    1.14      # subdirectory! You bastard!
    1.15 -    CT_GetFile "gcc-${CT_CC_VERSION}"   \
    1.16 -               {ftp,http}://ftp.gnu.org/gnu/gcc{,{,/releases}/gcc-${CT_CC_VERSION}}     \
    1.17 -               ftp://ftp.irisa.fr/pub/mirrors/gcc.gnu.org/gcc/releases/gcc-${CT_CC_VERSION}
    1.18 +    CT_GetFile "gcc-${version}"                                                         \
    1.19 +               {ftp,http}://ftp.gnu.org/gnu/gcc{,{,/releases}/gcc-${version}}           \
    1.20 +               ftp://ftp.irisa.fr/pub/mirrors/gcc.gnu.org/gcc/releases/gcc-${version}   \
    1.21 +               ftp://ftp.uvsq.fr/pub/gcc/snapshots/${version}
    1.22 +
    1.23      # Starting with GCC 4.3, ecj is used for Java, and will only be
    1.24      # built if the configure script finds ecj.jar at the top of the
    1.25      # GCC source tree, which will not be there unless we get it and
    1.26 @@ -25,13 +29,16 @@
    1.27  
    1.28  # Extract gcc
    1.29  do_cc_extract() {
    1.30 -    CT_Extract "gcc-${CT_CC_VERSION}"
    1.31 -    CT_Patch "gcc-${CT_CC_VERSION}"
    1.32 +    local version="${CT_CC_VERSION}${CT_CC_GCC_4_4_snapshot_date}"
    1.33 +
    1.34 +    CT_Extract "gcc-${version}"
    1.35 +    CT_Patch "gcc-${version}"
    1.36 +
    1.37      # Copy ecj-latest.jar to ecj.jar at the top of the GCC source tree
    1.38 -    if [ "${CT_CC_LANG_JAVA_USE_ECJ}" = "y"                     \
    1.39 -         -a ! -f "${CT_SRC_DIR}/gcc-${CT_CC_VERSION}/ecj.jar"   \
    1.40 +    if [ "${CT_CC_LANG_JAVA_USE_ECJ}" = "y"             \
    1.41 +         -a ! -f "${CT_SRC_DIR}/gcc-${version}/ecj.jar" \
    1.42         ]; then
    1.43 -        CT_DoExecLog ALL cp -v "${CT_TARBALLS_DIR}/ecj-latest.jar" "${CT_SRC_DIR}/gcc-${CT_CC_VERSION}/ecj.jar"
    1.44 +        CT_DoExecLog ALL cp -v "${CT_TARBALLS_DIR}/ecj-latest.jar" "${CT_SRC_DIR}/gcc-${version}/ecj.jar"
    1.45      fi
    1.46  }
    1.47  
    1.48 @@ -83,6 +90,7 @@
    1.49      local core_prefix_dir
    1.50      local extra_config
    1.51      local lang_opt
    1.52 +    local version="${CT_CC_VERSION}${CT_CC_GCC_4_4_snapshot_date}"
    1.53  
    1.54      eval $1
    1.55      eval $2
    1.56 @@ -142,7 +150,7 @@
    1.57      CC_FOR_BUILD="${CT_BUILD}-gcc"                  \
    1.58      CFLAGS="${CT_CFLAGS_FOR_HOST}"                  \
    1.59      CT_DoExecLog ALL                                \
    1.60 -    "${CT_SRC_DIR}/gcc-${CT_CC_VERSION}/configure"  \
    1.61 +    "${CT_SRC_DIR}/gcc-${version}/configure"        \
    1.62          --build=${CT_BUILD}                         \
    1.63          --host=${CT_HOST}                           \
    1.64          --target=${CT_TARGET}                       \
    1.65 @@ -174,7 +182,7 @@
    1.66          # so we configure then build it.
    1.67          # Next we have to configure gcc, create libgcc.mk then edit it...
    1.68          # So much easier if we just edit the source tree, but hey...
    1.69 -        if [ ! -f "${CT_SRC_DIR}/gcc-${CT_CC_VERSION}/gcc/BASE-VER" ]; then
    1.70 +        if [ ! -f "${CT_SRC_DIR}/gcc-${version}/gcc/BASE-VER" ]; then
    1.71              CT_DoExecLog ALL make configure-libiberty
    1.72              CT_DoExecLog ALL make ${PARALLELMFLAGS} -C libiberty libiberty.a
    1.73              CT_DoExecLog ALL make configure-gcc configure-libcpp
    1.74 @@ -184,7 +192,7 @@
    1.75              CT_DoExecLog ALL make ${PARALLELMFLAGS} all-libcpp all-build-libiberty
    1.76          fi
    1.77          # HACK: gcc-4.2 uses libdecnumber to build libgcc.mk, so build it here.
    1.78 -        if [ -d "${CT_SRC_DIR}/gcc-${CT_CC_VERSION}/libdecnumber" ]; then
    1.79 +        if [ -d "${CT_SRC_DIR}/gcc-${version}/libdecnumber" ]; then
    1.80              CT_DoExecLog ALL make configure-libdecnumber
    1.81              CT_DoExecLog ALL make ${PARALLELMFLAGS} -C libdecnumber libdecnumber.a
    1.82          fi
    1.83 @@ -230,6 +238,8 @@
    1.84  #------------------------------------------------------------------------------
    1.85  # Build final gcc
    1.86  do_cc() {
    1.87 +    local version="${CT_CC_VERSION}${CT_CC_GCC_4_4_snapshot_date}"
    1.88 +
    1.89      # If building for bare metal, nothing to be done here, the static core conpiler is enough!
    1.90      [ "${CT_BARE_METAL}" = "y" ] && return 0
    1.91  
    1.92 @@ -286,7 +296,7 @@
    1.93      CXXFLAGS_FOR_TARGET="${CT_TARGET_CFLAGS}"       \
    1.94      LDFLAGS_FOR_TARGET="${CT_TARGET_LDFLAGS}"       \
    1.95      CT_DoExecLog ALL                                \
    1.96 -    "${CT_SRC_DIR}/gcc-${CT_CC_VERSION}/configure"  \
    1.97 +    "${CT_SRC_DIR}/gcc-${version}/configure"        \
    1.98          --build=${CT_BUILD}                         \
    1.99          --host=${CT_HOST}                           \
   1.100          --target=${CT_TARGET}                       \