]> git.donarmstrong.com Git - qmk_firmware.git/commitdiff
Install arm toolchain
authorFred Sundvik <fsundvik@gmail.com>
Tue, 11 Jul 2017 14:18:24 +0000 (17:18 +0300)
committerFred Sundvik <fsundvik@gmail.com>
Tue, 11 Jul 2017 14:18:24 +0000 (17:18 +0300)
util/msys2_install.sh

index 1b99806b5ef0b0ca2330ffe354ae64a68e2f4b1e..0bb75f94ce25ba98075742023ea4a93f396aa885 100644 (file)
@@ -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