From 76bd0d3e184f77ff89f9db2274574093f78e49ca Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Tue, 11 Jul 2017 17:18:24 +0300 Subject: [PATCH] Install arm toolchain --- util/msys2_install.sh | 35 ++++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/util/msys2_install.sh b/util/msys2_install.sh index 1b99806b5e..0bb75f94ce 100644 --- a/util/msys2_install.sh +++ b/util/msys2_install.sh @@ -3,12 +3,11 @@ dir=$(cd -P -- "$(dirname -- "$0")" && pwd -P) download_dir=~/qmk_utils avrtools=avr8-gnu-toolchain +armtools=gcc-arm-none-eabi echo "Installing dependencies needed for the installation (quazip)" pacman --needed -S msys/unzip msys/p7zip - - source "$dir/win_shared_install.sh" function install_avr { @@ -18,8 +17,13 @@ function install_avr { rm avr8-gnu-toolchain-installer-3.5.4.91-win32.any.x86.exe } -pushd "$download_dir" +function install_arm { + wget -O gcc-arm-none-eabi.zip "https://developer.arm.com/-/media/Files/downloads/gnu-rm/6-2017q2/gcc-arm-none-eabi-6-2017-q2-update-win32.zip?product=GNU%20ARM%20Embedded%20Toolchain,ZIP,,Windows,6-2017-q2-update" + unzip -d gcc-arm-none-eabi gcc-arm-none-eabi.zip + rm gcc-arm-none-eabi.zip +} +pushd "$download_dir" if [ ! -d "$avrtools" ]; then while true; do @@ -45,6 +49,31 @@ else esac done fi + +if [ ! -d "$armtools" ]; then + while true; do + echo + echo "The ARM toolchain is not installed." + echo "This is needed for building ARM based keboards." + read -p "Do you want to install it? (Y/N) " res + case $res in + [Yy]* ) install_arm; break;; + [Nn]* ) break;; + * ) echo "Invalid answer";; + esac + done +else + while true; do + echo + echo "The ARM toolchain is already installed" + read -p "Do you want to reinstall? (Y/N) " res + case $res in + [Yy]* ) install_arm; break;; + [Nn]* ) break;; + * ) echo "Invalid answer";; + esac + done +fi popd echo