Changes in tools/toolchain.sh [cb15b49c:6ae5e3f] in mainline


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/toolchain.sh

    rcb15b49c r6ae5e3f  
    6161        echo "Syntax:"
    6262        echo " $0 [--no-install] [--non-helenos-target] <platform>"
    63         echo " $0 --test-version [<platform>]"
    6463        echo
    6564        echo "Possible target platforms are:"
     
    9695}
    9796
    98 test_version() {
    99         echo "Cross-compiler toolchain build script"
    100         echo
    101         echo "Start testing the version of the installed software"
    102         echo
    103        
    104         if [ -z "$1" ] || [ "$1" == "all" ] ; then
    105                 PLATFORMS=("amd64" "arm32" "ia32" "ia64" "mips32" "mips32eb" "ppc32" "riscv64" "sparc64")
    106         else
    107                 PLATFORMS=("$1")
    108         fi
    109        
    110        
    111         if [ -z "${CROSS_PREFIX}" ] ; then
    112                 CROSS_PREFIX="/usr/local/cross"
    113         fi
    114 
    115         for i in "${PLATFORMS[@]}"
    116         do
    117                 PLATFORM="$i"
    118                 set_target_from_platform "$PLATFORM"
    119                 PREFIX="${CROSS_PREFIX}/bin/${HELENOS_TARGET}"
    120 
    121                 echo "== $PLATFORM =="
    122                 test_app_version "Binutils" "ld" "GNU\ ld\ \(GNU\ Binutils\)\ ((\.|[0-9])+)" "$BINUTILS_VERSION"
    123                 test_app_version "GCC" "gcc" "gcc\ version\ ((\.|[0-9])+)" "$GCC_VERSION"
    124                 test_app_version "GDB" "gdb" "GNU\ gdb\ \(GDB\)\s+((\.|[0-9])+)" "$GDB_VERSION"
    125         done
    126 
    127         exit
    128 }
    129 
    130 test_app_version() {
    131         PKGNAME="$1"
    132         APPNAME="$2"
    133         REGEX="$3"
    134         INS_VERSION="$4"
    135 
    136 
    137         APP="${PREFIX}-${APPNAME}"
    138         if [ ! -e $APP ]; then
    139                 echo "- $PKGNAME is missing"
    140         else
    141                 {
    142                         OUT=$(${APP} -v 2>&1)
    143                 } &> /dev/null
    144 
    145                 if [[ "$OUT" =~ $REGEX ]]; then
    146                 VERSION="${BASH_REMATCH[1]}"
    147                 if [ "$INS_VERSION" = "$VERSION" ]; then
    148                         echo "+ $PKGNAME is uptodate ($INS_VERSION)"
    149                 else
    150                         echo "- $PKGNAME ($VERSION) is outdated ($INS_VERSION)"
    151                 fi
    152             else
    153                 echo "- $PKGNAME Unexpected output"
    154             fi
    155         fi
    156 }
    157 
    158 
    159 
    16097change_title() {
    16198        echo -en "\e]0;$1\a"
     
    471408while [ "$#" -gt 1 ] ; do
    472409        case "$1" in
    473                 --test-version)
    474                         test_version "$2"
    475                         exit
    476                         ;;
    477410                --no-install)
    478411                        REAL_INSTALL=false
     
    494427
    495428case "$1" in
    496         --test-version)
    497                 test_version
    498                 ;;
    499429        amd64|arm32|ia32|ia64|mips32|mips32eb|ppc32|riscv64|sparc64)
    500430                prepare
Note: See TracChangeset for help on using the changeset viewer.