Changeset 4687a26c in mainline for tools/toolchain.sh


Ignore:
Timestamp:
2010-11-02T18:29:01Z (14 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
4f35b9ff
Parents:
76e1121f (diff), 28f4adb (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 mainline changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/toolchain.sh

    r76e1121f r4687a26c  
    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
     
    7173}
    7274
     75change_title() {
     76        echo -en "\e]0;$1\a"
     77}
     78
     79show_countdown() {
     80        TM="$1"
     81       
     82        if [ "${TM}" -eq 0 ] ; then
     83                echo
     84                return 0
     85        fi
     86       
     87        echo -n "${TM} "
     88        change_title "${TM}"
     89        sleep 1
     90       
     91        TM="`expr "${TM}" - 1`"
     92        show_countdown "${TM}"
     93}
     94
     95show_dependencies() {
     96        echo "IMPORTANT NOTICE:"
     97        echo
     98        echo "For a successful compilation and use of the cross-compiler"
     99        echo "toolchain you need at least the following dependencies."
     100        echo
     101        echo "Please make sure that the dependencies are present in your"
     102        echo "system. Otherwise the compilation process might fail after"
     103        echo "a few seconds or minutes."
     104        echo
     105        echo " - SED, AWK, Flex, Bison, gzip, bzip2, Bourne Shell"
     106        echo " - gettext, zlib, Texinfo, libelf, libgomp"
     107        echo " - GNU Multiple Precision Library (GMP)"
     108        echo " - GNU Make"
     109        echo " - GNU tar"
     110        echo " - GNU Coreutils"
     111        echo " - GNU Sharutils"
     112        echo " - MPFR"
     113        echo " - MPC"
     114        echo " - Parma Polyhedra Library (PPL)"
     115        echo " - ClooG-PPL"
     116        echo " - native C compiler, assembler and linker"
     117        echo " - native C library with headers"
     118        echo
     119       
     120        show_countdown 10
     121}
     122
    73123download_check() {
    74124        SOURCE="$1"
     
    77127       
    78128        if [ ! -f "${FILE}" ]; then
     129                change_title "Downloading ${FILE}"
    79130                wget -c "${SOURCE}${FILE}"
    80131                check_error $? "Error downloading ${FILE}."
     
    88139       
    89140        if [ -d "${DIR}" ]; then
     141                change_title "Removing ${DIR}"
    90142                echo " >>> Removing ${DIR}"
    91143                rm -fr "${DIR}"
     
    97149        DESC="$2"
    98150       
     151        change_title "Creating ${DESC}"
    99152        echo ">>> Creating ${DESC}"
    100153       
     
    108161        DESC="$2"
    109162       
    110         echo " >>> ${DESC}"
     163        change_title "Unpacking ${DESC}"
     164        echo " >>> Unpacking ${DESC}"
    111165       
    112166        tar -xjf "${FILE}"
     
    142196       
    143197        BINUTILS_VERSION="2.20"
    144         GCC_VERSION="4.5.0"
     198        GCC_VERSION="4.5.1"
    145199       
    146200        BINUTILS="binutils-${BINUTILS_VERSION}.tar.bz2"
     
    165219        echo ">>> Downloading tarballs"
    166220        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"
     221        download_check "${GCC_SOURCE}" "${GCC_CORE}" "dc8959e31b01a65ce10d269614815054"
     222        download_check "${GCC_SOURCE}" "${GCC_OBJC}" "3c11b7037896e967eddf8178af2ddd98"
     223        download_check "${GCC_SOURCE}" "${GCC_CPP}" "b294953ff0bb2f20c7acb2bf005d832a"
    170224       
    171225        echo ">>> Removing previous content"
     
    184238        unpack_tarball "${GCC_CPP}" "C++"
    185239       
    186         echo ">>> Compiling and installing binutils"
     240        echo ">>> Processing binutils (${PLATFORM})"
    187241        cd "${BINUTILSDIR}"
    188242        check_error $? "Change directory failed."
    189243        patch_binutils "${PLATFORM}"
    190         ./configure "--target=${TARGET}" "--prefix=${PREFIX}" "--program-prefix=${TARGET}-" "--disable-nls"
     244       
     245        change_title "binutils: configure (${PLATFORM})"
     246        ./configure "--target=${TARGET}" "--prefix=${PREFIX}" "--program-prefix=${TARGET}-" --disable-nls
    191247        check_error $? "Error configuring binutils."
     248       
     249        change_title "binutils: make (${PLATFORM})"
    192250        make all install
    193251        check_error $? "Error compiling/installing binutils."
    194252       
    195         echo ">>> Compiling and installing GCC"
     253        echo ">>> Processing GCC (${PLATFORM})"
    196254        cd "${OBJDIR}"
    197255        check_error $? "Change directory failed."
     256       
     257        change_title "GCC: configure (${PLATFORM})"
    198258        "${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
    199259        check_error $? "Error configuring GCC."
     260       
     261        change_title "GCC: make (${PLATFORM})"
    200262        PATH="${PATH}:${PREFIX}/bin" make all-gcc install-gcc
    201263        check_error $? "Error compiling/installing GCC."
     
    216278        show_usage
    217279fi
     280
     281show_dependencies
    218282
    219283case "$1" in
Note: See TracChangeset for help on using the changeset viewer.