Changeset 0b749a3 in mainline for tools/toolchain.sh


Ignore:
Timestamp:
2010-11-22T15:39:53Z (13 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0eddb76, aae339e9
Parents:
9a1d8ab (diff), 8cd1aa5e (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge development/ changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/toolchain.sh

    r9a1d8ab r0b749a3  
    1 #!/bin/bash
     1#! /bin/bash
    22
    33#
     
    3333                echo
    3434                echo "Script failed: $2"
     35               
    3536                exit 1
    3637        fi
     
    4546                echo
    4647                echo "Checksum of ${FILE} does not match."
     48               
    4749                exit 2
    4850        fi
     
    6062        echo " ia32       IA-32 (x86, i386)"
    6163        echo " ia64       IA-64 (Itanium)"
    62         echo " mips32     MIPS little-endian"
    63         echo " mips32eb   MIPS big-endian"
     64        echo " mips32     MIPS little-endian 32b"
     65        echo " mips32eb   MIPS big-endian 32b"
     66        echo " mips64     MIPS little-endian 64b"
    6467        echo " ppc32      32-bit PowerPC"
    6568        echo " ppc64      64-bit PowerPC"
     
    7174}
    7275
     76change_title() {
     77        echo -en "\e]0;$1\a"
     78}
     79
     80show_countdown() {
     81        TM="$1"
     82       
     83        if [ "${TM}" -eq 0 ] ; then
     84                echo
     85                return 0
     86        fi
     87       
     88        echo -n "${TM} "
     89        change_title "${TM}"
     90        sleep 1
     91       
     92        TM="`expr "${TM}" - 1`"
     93        show_countdown "${TM}"
     94}
     95
     96show_dependencies() {
     97        echo "IMPORTANT NOTICE:"
     98        echo
     99        echo "For a successful compilation and use of the cross-compiler"
     100        echo "toolchain you need at least the following dependencies."
     101        echo
     102        echo "Please make sure that the dependencies are present in your"
     103        echo "system. Otherwise the compilation process might fail after"
     104        echo "a few seconds or minutes."
     105        echo
     106        echo " - SED, AWK, Flex, Bison, gzip, bzip2, Bourne Shell"
     107        echo " - gettext, zlib, Texinfo, libelf, libgomp"
     108        echo " - GNU Multiple Precision Library (GMP)"
     109        echo " - GNU Make"
     110        echo " - GNU tar"
     111        echo " - GNU Coreutils"
     112        echo " - GNU Sharutils"
     113        echo " - MPFR"
     114        echo " - MPC"
     115        echo " - Parma Polyhedra Library (PPL)"
     116        echo " - ClooG-PPL"
     117        echo " - native C compiler, assembler and linker"
     118        echo " - native C library with headers"
     119        echo
     120       
     121        show_countdown 10
     122}
     123
    73124download_check() {
    74125        SOURCE="$1"
     
    77128       
    78129        if [ ! -f "${FILE}" ]; then
     130                change_title "Downloading ${FILE}"
    79131                wget -c "${SOURCE}${FILE}"
    80132                check_error $? "Error downloading ${FILE}."
     
    88140       
    89141        if [ -d "${DIR}" ]; then
     142                change_title "Removing ${DIR}"
    90143                echo " >>> Removing ${DIR}"
    91144                rm -fr "${DIR}"
     
    97150        DESC="$2"
    98151       
     152        change_title "Creating ${DESC}"
    99153        echo ">>> Creating ${DESC}"
    100154       
     
    108162        DESC="$2"
    109163       
    110         echo " >>> ${DESC}"
     164        change_title "Unpacking ${DESC}"
     165        echo " >>> Unpacking ${DESC}"
    111166       
    112167        tar -xjf "${FILE}"
     
    142197       
    143198        BINUTILS_VERSION="2.20"
    144         GCC_VERSION="4.5.0"
     199        GCC_VERSION="4.5.1"
    145200       
    146201        BINUTILS="binutils-${BINUTILS_VERSION}.tar.bz2"
     
    165220        echo ">>> Downloading tarballs"
    166221        download_check "${BINUTILS_SOURCE}" "${BINUTILS}" "ee2d3e996e9a2d669808713360fa96f8"
    167         download_check "${GCC_SOURCE}" "${GCC_CORE}" "58eda33c3184303628f91c42a7ab15b5"
    168         download_check "${GCC_SOURCE}" "${GCC_OBJC}" "8d8c01b6631b020cc6c167860fde2398"
    169         download_check "${GCC_SOURCE}" "${GCC_CPP}" "5ab93605af40def4844eda09ca769c2d"
     222        download_check "${GCC_SOURCE}" "${GCC_CORE}" "dc8959e31b01a65ce10d269614815054"
     223        download_check "${GCC_SOURCE}" "${GCC_OBJC}" "3c11b7037896e967eddf8178af2ddd98"
     224        download_check "${GCC_SOURCE}" "${GCC_CPP}" "b294953ff0bb2f20c7acb2bf005d832a"
    170225       
    171226        echo ">>> Removing previous content"
     
    184239        unpack_tarball "${GCC_CPP}" "C++"
    185240       
    186         echo ">>> Compiling and installing binutils"
     241        echo ">>> Processing binutils (${PLATFORM})"
    187242        cd "${BINUTILSDIR}"
    188243        check_error $? "Change directory failed."
    189244        patch_binutils "${PLATFORM}"
    190         ./configure "--target=${TARGET}" "--prefix=${PREFIX}" "--program-prefix=${TARGET}-" "--disable-nls"
     245       
     246        change_title "binutils: configure (${PLATFORM})"
     247        ./configure "--target=${TARGET}" "--prefix=${PREFIX}" "--program-prefix=${TARGET}-" --disable-nls
    191248        check_error $? "Error configuring binutils."
     249       
     250        change_title "binutils: make (${PLATFORM})"
    192251        make all install
    193252        check_error $? "Error compiling/installing binutils."
    194253       
    195         echo ">>> Compiling and installing GCC"
     254        echo ">>> Processing GCC (${PLATFORM})"
    196255        cd "${OBJDIR}"
    197256        check_error $? "Change directory failed."
     257       
     258        change_title "GCC: configure (${PLATFORM})"
    198259        "${GCCDIR}/configure" "--target=${TARGET}" "--prefix=${PREFIX}" "--program-prefix=${TARGET}-" --with-gnu-as --with-gnu-ld --disable-nls --disable-threads --enable-languages=c,objc,c++,obj-c++ --disable-multilib --disable-libgcj --without-headers --disable-shared --enable-lto
    199260        check_error $? "Error configuring GCC."
     261       
     262        change_title "GCC: make (${PLATFORM})"
    200263        PATH="${PATH}:${PREFIX}/bin" make all-gcc install-gcc
    201264        check_error $? "Error compiling/installing GCC."
     
    217280fi
    218281
     282show_dependencies
     283
    219284case "$1" in
    220285        "amd64")
     
    238303        "mips32eb")
    239304                build_target "mips32eb" "mips-linux-gnu"
     305                ;;
     306        "mips64")
     307                build_target "mips64" "mips64el-linux-gnu"
    240308                ;;
    241309        "ppc32")
     
    256324                build_target "mips32" "mipsel-linux-gnu"
    257325                build_target "mips32eb" "mips-linux-gnu"
     326                build_target "mips64" "mips64el-linux-gnu"
    258327                build_target "ppc32" "ppc-linux-gnu"
    259328                build_target "ppc64" "ppc64-linux-gnu"
Note: See TracChangeset for help on using the changeset viewer.