Fix wget invokation so that restarting downloads via -c works.
[fw/cortex-toolchain] / summon-arm-toolchain
index 58ae6891051c46382dc699852213c451771b2b0d..95da9dbc3ab346f07b08fdbcef3ec71e7f26b496 100755 (executable)
@@ -1,11 +1,11 @@
 #!/bin/bash
 # Written by Uwe Hermann <uwe@hermann-uwe.de>, released as public domain.
-# Modified by Piot Esden-Tempski <piotr@esden.net>, released as public domain.
+# Modified by Piotr Esden-Tempski <piotr@esden.net>, released as public domain.
 
-TARGET=arm-elf                          # Or: TARGET=arm-none-eabi
-PREFIX=${HOME}/arm-elf                   # Install location of your final toolchain
-PARALLEL=""                             # Or: PARALLEL="-j 5" for 4 CPU's
-DARWIN_OPT_PATH=/opt/local               # Path in which MacPorts or Fink is installed
+TARGET=arm-elf                 # Or: TARGET=arm-none-eabi
+PREFIX=${HOME}/arm-elf         # Install location of your final toolchain
+PARALLEL=""                    # Or: PARALLEL="-j 5" for 4 CPU's
+DARWIN_OPT_PATH=/opt/local     # Path in which MacPorts or Fink is installed
 
 BINUTILS=binutils-2.19.1
 GCC=gcc-4.4.0
@@ -34,7 +34,7 @@ case "$(uname)" in
         GDBFLAGS="--disable-werror"
        ;;
        *)
-       echo "Found Unknown OS. Aborting!"
+       echo "Found unknown OS. Aborting!"
        exit 1
        ;;
 esac
@@ -44,25 +44,18 @@ if [ ! -e sources ]; then
 fi
 
 cd sources
-if [ ! -e ${BINUTILS}.tar.bz2 ]; then
-       echo "Downloading binutils sources..."
-       wget -c http://ftp.gnu.org/gnu/binutils/${BINUTILS}.tar.bz2
-fi
 
-if [ ! -e ${GCC}.tar.bz2 ]; then
-       echo "Downloading gcc sources..."
-       wget -c ftp://ftp.gnu.org/gnu/gcc/${GCC}/${GCC}.tar.bz2
-fi
+echo "Downloading binutils sources..."
+wget -c http://ftp.gnu.org/gnu/binutils/${BINUTILS}.tar.bz2
 
-if [ ! -e ${NEWLIB}.tar.gz ]; then
-       echo "Downloading newlib sources..."
-       wget -c ftp://sources.redhat.com/pub/newlib/${NEWLIB}.tar.gz
-fi
+echo "Downloading gcc sources..."
+wget -c ftp://ftp.gnu.org/gnu/gcc/${GCC}/${GCC}.tar.bz2
 
-if [ ! -e ${GDB}.tar.bz2 ]; then
-       echo "Downloading gdb sources..."
-       wget -c ftp://ftp.gnu.org/gnu/gdb/${GDB}.tar.bz2
-fi
+echo "Downloading newlib sources..."
+wget -c ftp://sources.redhat.com/pub/newlib/${NEWLIB}.tar.gz
+
+echo "Downloading gdb sources..."
+wget -c ftp://ftp.gnu.org/gnu/gdb/${GDB}.tar.bz2
 
 if [ ${LIBSTM32_EN} != 0 ]; then
 if [ ! -e libcmsis-${LIBCMSIS}.tar.bz2 ]; then
@@ -99,7 +92,7 @@ fi
 if [ ${LIBOPENSTM32_EN} != 0 ]; then
 if [ ! -e libopenstm32-${LIBOPENSTM32}.tar.bz2 ]; then
        echo "Cloning libopenstm32 sources..."
-       git clone git://libopenstm32.git.sourceforge.net/gitroot/libopenstm32
+       git clone git://libopenstm32.git.sourceforge.net/gitroot/libopenstm32/libopenstm32
         cd libopenstm32
         git archive --format=tar --prefix=libopenstm32-${LIBOPENSTM32}/ ${LIBOPENSTM32} | \
             bzip2 --stdout > ../libopenstm32-${LIBOPENSTM32}.tar.bz2