build-avr-libc 842 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #!/bin/bash
  2. # http://www.nongnu.org/avr-libc/user-manual/install_tools.html
  3. # Stop on errors
  4. set -e
  5. source avr-file-names
  6. TIME_START=$(date +%s)
  7. makeDir()
  8. {
  9. rm -rf "$1/"
  10. mkdir -p "$1"
  11. }
  12. echo "Downloading sources..."
  13. if [ ! -f $NAME_LIBC.tar.bz2 ]; then
  14. wget https://ftp.mirrorservice.org/sites/download.savannah.gnu.org/releases/avr-libc/$NAME_LIBC.tar.bz2
  15. fi
  16. # Make AVR-libc
  17. NAME_LIBC_BLD=${NAME_LIBC}_bld
  18. echo "Making AVR-LIBC in $NAME_LIBC_BLD..."
  19. echo "Extracting..."
  20. rm -rf $NAME_LIBC/
  21. tar xjf $NAME_LIBC.tar.bz2
  22. makeDir $NAME_LIBC_BLD
  23. cd $NAME_LIBC_BLD
  24. ../$NAME_LIBC/configure --prefix=$PREFIX --build=$(../$NAME_LIBC/config.guess) --host=avr
  25. make -j $JOBCOUNT
  26. sudo env "PATH=$PATH" make install-strip
  27. cd ..
  28. TIME_END=$(date +%s)
  29. TIME_RUN=$(($TIME_END - $TIME_START))
  30. echo ""
  31. echo "Done in $TIME_RUN seconds"
  32. exit 0