Changes in tools/toolchain.sh [3666d38:3f7efa79] in mainline


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/toolchain.sh

    r3666d38 r3f7efa79  
    5252#endif
    5353EOF
    54 
    55 BINUTILS_VERSION="2.21"
    56 GCC_VERSION="4.6.1"
    57 GDB_VERSION="7.2"
    58 
    59 BASEDIR="`pwd`"
    60 BINUTILS="binutils-${BINUTILS_VERSION}.tar.bz2"
    61 GCC_CORE="gcc-core-${GCC_VERSION}.tar.bz2"
    62 GCC_OBJC="gcc-objc-${GCC_VERSION}.tar.bz2"
    63 GCC_CPP="gcc-g++-${GCC_VERSION}.tar.bz2"
    64 GDB="gdb-${GDB_VERSION}.tar.bz2"
    6554
    6655#
     
    150139        echo " sparc64    SPARC V9"
    151140        echo " all        build all targets"
    152         echo " parallel   same as 'all', but in parallel"
    153141        echo
    154142        echo "The toolchain will be installed to the directory specified by"
    155143        echo "the CROSS_PREFIX environment variable. If the variable is not"
    156         echo "defined, /usr/local/cross will be used by default."
     144        echo "defined, /usr/local will be used by default."
    157145        echo
    158146       
     
    206194}
    207195
    208 download_fetch() {
     196download_check() {
    209197        SOURCE="$1"
    210198        FILE="$2"
     
    220208}
    221209
    222 source_check() {
    223         FILE="$1"
    224        
    225         if [ ! -f "${FILE}" ]; then
    226                 echo
    227                 echo "File ${FILE} not found."
    228                
    229                 exit 4
    230         fi
    231 }
    232 
    233210cleanup_dir() {
    234211        DIR="$1"
     
    264241}
    265242
    266 prepare() {
    267         show_dependencies
    268         check_dependecies
    269         show_countdown 10
    270        
    271         BINUTILS_SOURCE="ftp://ftp.gnu.org/gnu/binutils/"
    272         GCC_SOURCE="ftp://ftp.gnu.org/gnu/gcc/gcc-${GCC_VERSION}/"
    273         GDB_SOURCE="ftp://ftp.gnu.org/gnu/gdb/"
    274        
    275         download_fetch "${BINUTILS_SOURCE}" "${BINUTILS}" "c84c5acc9d266f1a7044b51c85a823f5"
    276         download_fetch "${GCC_SOURCE}" "${GCC_CORE}" "0c0e7e35d2215e19de9c97efba507553"
    277         download_fetch "${GCC_SOURCE}" "${GCC_OBJC}" "cbf0d4b701827922cf37ba6a4ace0079"
    278         download_fetch "${GCC_SOURCE}" "${GCC_CPP}" "0d75ca7ca35b1e7f252223f9d23a6ad1"
    279         download_fetch "${GDB_SOURCE}" "${GDB}" "64260e6c56979ee750a01055f16091a5"
     243patch_binutils() {
     244        PLATFORM="$1"
     245       
     246        if [ "${PLATFORM}" == "arm32" ] ; then
     247                patch -p1 <<EOF
     248diff -Naur binutils-2.20.orig/gas/config/tc-arm.c binutils-2.20/gas/config/tc-arm.c
     249--- binutils-2.20.orig/gas/config/tc-arm.c      2009-08-30 00:10:59.000000000 +0200
     250+++ binutils-2.20/gas/config/tc-arm.c   2009-11-02 14:25:11.000000000 +0100
     251@@ -2485,8 +2485,9 @@
     252       know (frag->tc_frag_data.first_map == NULL);
     253       frag->tc_frag_data.first_map = symbolP;
     254     }
     255-  if (frag->tc_frag_data.last_map != NULL)
     256+  if (frag->tc_frag_data.last_map != NULL) {
     257     know (S_GET_VALUE (frag->tc_frag_data.last_map) < S_GET_VALUE (symbolP));
     258+  }
     259   frag->tc_frag_data.last_map = symbolP;
     260 }
     261EOF
     262                check_error $? "Error patching binutils"
     263        fi
    280264}
    281265
     
    284268        TARGET="$2"
    285269       
    286         WORKDIR="${BASEDIR}/${PLATFORM}"
     270        BINUTILS_VERSION="2.20"
     271        GCC_VERSION="4.5.1"
     272       
     273        BINUTILS="binutils-${BINUTILS_VERSION}.tar.bz2"
     274        GCC_CORE="gcc-core-${GCC_VERSION}.tar.bz2"
     275        GCC_OBJC="gcc-objc-${GCC_VERSION}.tar.bz2"
     276        GCC_CPP="gcc-g++-${GCC_VERSION}.tar.bz2"
     277       
     278        BINUTILS_SOURCE="ftp://ftp.gnu.org/gnu/binutils/"
     279        GCC_SOURCE="ftp://ftp.gnu.org/gnu/gcc/gcc-${GCC_VERSION}/"
     280       
     281        WORKDIR="`pwd`"
    287282        BINUTILSDIR="${WORKDIR}/binutils-${BINUTILS_VERSION}"
    288283        GCCDIR="${WORKDIR}/gcc-${GCC_VERSION}"
    289284        OBJDIR="${WORKDIR}/gcc-obj"
    290         GDBDIR="${WORKDIR}/gdb-${GDB_VERSION}"
    291285       
    292286        if [ -z "${CROSS_PREFIX}" ] ; then
    293                 CROSS_PREFIX="/usr/local/cross"
     287                CROSS_PREFIX="/usr/local"
    294288        fi
    295289       
     
    297291       
    298292        echo ">>> Downloading tarballs"
    299         source_check "${BASEDIR}/${BINUTILS}"
    300         source_check "${BASEDIR}/${GCC_CORE}"
    301         source_check "${BASEDIR}/${GCC_OBJC}"
    302         source_check "${BASEDIR}/${GCC_CPP}"
    303         source_check "${BASEDIR}/${GDB}"
     293        download_check "${BINUTILS_SOURCE}" "${BINUTILS}" "ee2d3e996e9a2d669808713360fa96f8"
     294        download_check "${GCC_SOURCE}" "${GCC_CORE}" "dc8959e31b01a65ce10d269614815054"
     295        download_check "${GCC_SOURCE}" "${GCC_OBJC}" "3c11b7037896e967eddf8178af2ddd98"
     296        download_check "${GCC_SOURCE}" "${GCC_CPP}" "b294953ff0bb2f20c7acb2bf005d832a"
    304297       
    305298        echo ">>> Removing previous content"
    306299        cleanup_dir "${PREFIX}"
    307         cleanup_dir "${WORKDIR}"
     300        cleanup_dir "${OBJDIR}"
     301        cleanup_dir "${BINUTILSDIR}"
     302        cleanup_dir "${GCCDIR}"
    308303       
    309304        create_dir "${PREFIX}" "destination directory"
     
    311306       
    312307        echo ">>> Unpacking tarballs"
    313         cd "${WORKDIR}"
    314         check_error $? "Change directory failed."
    315        
    316         unpack_tarball "${BASEDIR}/${BINUTILS}" "binutils"
    317         unpack_tarball "${BASEDIR}/${GCC_CORE}" "GCC Core"
    318         unpack_tarball "${BASEDIR}/${GCC_OBJC}" "Objective C"
    319         unpack_tarball "${BASEDIR}/${GCC_CPP}" "C++"
    320         unpack_tarball "${BASEDIR}/${GDB}" "GDB"
     308        unpack_tarball "${BINUTILS}" "binutils"
     309        unpack_tarball "${GCC_CORE}" "GCC Core"
     310        unpack_tarball "${GCC_OBJC}" "Objective C"
     311        unpack_tarball "${GCC_CPP}" "C++"
    321312       
    322313        echo ">>> Processing binutils (${PLATFORM})"
    323314        cd "${BINUTILSDIR}"
    324315        check_error $? "Change directory failed."
     316        patch_binutils "${PLATFORM}"
    325317       
    326318        change_title "binutils: configure (${PLATFORM})"
    327         CFLAGS=-Wno-error ./configure "--target=${TARGET}" "--prefix=${PREFIX}" "--program-prefix=${TARGET}-" --disable-nls
     319        ./configure "--target=${TARGET}" "--prefix=${PREFIX}" "--program-prefix=${TARGET}-" --disable-nls
    328320        check_error $? "Error configuring binutils."
    329321       
     
    344336        check_error $? "Error compiling/installing GCC."
    345337       
    346         echo ">>> Processing GDB (${PLATFORM})"
    347         cd "${GDBDIR}"
     338        cd "${WORKDIR}"
    348339        check_error $? "Change directory failed."
    349340       
    350         change_title "GDB: configure (${PLATFORM})"
    351         ./configure "--target=${TARGET}" "--prefix=${PREFIX}" "--program-prefix=${TARGET}-"
    352         check_error $? "Error configuring GDB."
    353        
    354         change_title "GDB: make (${PLATFORM})"
    355         make all install
    356         check_error $? "Error compiling/installing GDB."
    357        
    358         cd "${BASEDIR}"
    359         check_error $? "Change directory failed."
    360        
    361341        echo ">>> Cleaning up"
    362         cleanup_dir "${WORKDIR}"
     342        cleanup_dir "${OBJDIR}"
     343        cleanup_dir "${BINUTILSDIR}"
     344        cleanup_dir "${GCCDIR}"
    363345       
    364346        echo
     
    370352fi
    371353
     354show_dependencies
     355check_dependecies
     356show_countdown 10
     357
    372358case "$1" in
    373359        "amd64")
    374                 prepare
    375360                build_target "amd64" "amd64-linux-gnu"
    376361                ;;
    377362        "arm32")
    378                 prepare
    379363                build_target "arm32" "arm-linux-gnu"
    380364                ;;
    381365        "ia32")
    382                 prepare
    383366                build_target "ia32" "i686-pc-linux-gnu"
    384367                ;;
    385368        "ia64")
    386                 prepare
    387369                build_target "ia64" "ia64-pc-linux-gnu"
    388370                ;;
     371        "ia64")
     372                build_target "ia64" "ia64-pc-linux-gnu"
     373                ;;
    389374        "mips32")
    390                 prepare
    391375                build_target "mips32" "mipsel-linux-gnu"
    392376                ;;
    393377        "mips32eb")
    394                 prepare
    395378                build_target "mips32eb" "mips-linux-gnu"
    396379                ;;
    397380        "mips64")
    398                 prepare
    399381                build_target "mips64" "mips64el-linux-gnu"
    400382                ;;
    401383        "ppc32")
    402                 prepare
    403384                build_target "ppc32" "ppc-linux-gnu"
    404385                ;;
    405386        "ppc64")
    406                 prepare
    407387                build_target "ppc64" "ppc64-linux-gnu"
    408388                ;;
    409389        "sparc64")
    410                 prepare
    411390                build_target "sparc64" "sparc64-linux-gnu"
    412391                ;;
    413392        "all")
    414                 prepare
    415393                build_target "amd64" "amd64-linux-gnu"
    416394                build_target "arm32" "arm-linux-gnu"
    417395                build_target "ia32" "i686-pc-linux-gnu"
     396                build_target "ia64" "ia64-pc-linux-gnu"
    418397                build_target "ia64" "ia64-pc-linux-gnu"
    419398                build_target "mips32" "mipsel-linux-gnu"
     
    424403                build_target "sparc64" "sparc64-linux-gnu"
    425404                ;;
    426         "parallel")
    427                 prepare
    428                 build_target "amd64" "amd64-linux-gnu" &
    429                 build_target "arm32" "arm-linux-gnu" &
    430                 build_target "ia32" "i686-pc-linux-gnu" &
    431                 build_target "ia64" "ia64-pc-linux-gnu" &
    432                 build_target "mips32" "mipsel-linux-gnu" &
    433                 build_target "mips32eb" "mips-linux-gnu" &
    434                 build_target "mips64" "mips64el-linux-gnu" &
    435                 build_target "ppc32" "ppc-linux-gnu" &
    436                 build_target "ppc64" "ppc64-linux-gnu" &
    437                 build_target "sparc64" "sparc64-linux-gnu" &
    438                 wait
    439                 ;;
    440405        *)
    441406                show_usage
Note: See TracChangeset for help on using the changeset viewer.