From 226df12b0ddf9aeaa6121fd7ef3e2c0a1519e57e Mon Sep 17 00:00:00 2001 From: Devan Lai Date: Tue, 27 Feb 2018 21:25:34 -0800 Subject: [PATCH] Update toolchain install script Output the toolchain source and current version --- util/install-toolchain.sh | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/util/install-toolchain.sh b/util/install-toolchain.sh index 14b95e1..bdf7310 100755 --- a/util/install-toolchain.sh +++ b/util/install-toolchain.sh @@ -1,8 +1,17 @@ #!/bin/bash +set -eo pipefail URL=https://launchpad.net/gcc-arm-embedded/5.0/5-2015-q4-major/+download/gcc-arm-none-eabi-5_2-2015q4-20151219-linux.tar.bz2 TOOLCHAIN=gcc-arm-none-eabi-5_2-2015q4 -if [[ ! -d "$HOME/toolchains/gcc-arm-embedded" ]]; then - mkdir -p ~/toolchains - wget -qO- $URL | tar xj -C ~/toolchains/ - ln -s $TOOLCHAIN ~/toolchains/gcc-arm-embedded +TOOLCHAINS=$HOME/toolchains +if [[ ! -d "${TOOLCHAINS}/gcc-arm-embedded" ]]; then + echo "Installing $TOOLCHAIN from $URL to ${TOOLCHAINS}" + mkdir -p ${TOOLCHAINS} + wget -qO- $URL | tar xj -C ${TOOLCHAINS} + ln -s $TOOLCHAIN ${TOOLCHAINS}/gcc-arm-embedded fi; + +EXISTING_TOOLCHAIN=`readlink -f "${TOOLCHAINS}/gcc-arm-embedded"` +echo "Current toolchain is $EXISTING_TOOLCHAIN" + +TOOLCHAIN_VER=`${TOOLCHAINS}/gcc-arm-embedded/bin/arm-none-eabi-gcc --version | head -n 1` +echo "Installed toolchain version is $TOOLCHAIN_VER"