easy_install 762 B

123456789101112131415161718192021222324252627282930
  1. #!/bin/bash
  2. if ! [ -x "$(command -v make)" ]
  3. then
  4. sudo apt-get install build-essential -y
  5. fi
  6. archi=$(uname -m | awk {'print$1'} | head -c3)
  7. if [ $archi = "arm" ]
  8. then
  9. wget -c http://wareck.free.fr/cross_compilation/avr_toolchain/avr_toolchain_arm.tar.xz
  10. tar xvfJ avr_toolchain_arm.tar.xz
  11. sudo cp -r avr /usr/local
  12. rm -r -f avr
  13. rm -f avr_toolchain_arm.tar.xz
  14. else
  15. wget -c http://wareck.free.fr/cross_compilation/avr_toolchain/avr_toolchain.tar.xz
  16. tar xvfJ avr_toolchain.tar.xz
  17. sudo cp -r avr /usr/local
  18. rm -r -f avr
  19. rm avr_toolchain.tar.xz
  20. fi
  21. if ! grep "/usr/local/avr/bin" ~/.bashrc >/dev/null
  22. then
  23. echo "export PATH=XXXXPATH::/usr/local/avr/bin" >> ~/.bashrc
  24. sed -i -e "s/XXXX/$/g" ~/.bashrc
  25. source ~/.bashrc
  26. fi
  27. echo "Done."