projects
/
summon-arm-toolchain.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use set -e to stop on any error, including downloads.
[summon-arm-toolchain.git]
/
summon-arm-toolchain
diff --git
a/summon-arm-toolchain
b/summon-arm-toolchain
index a8da63f276dcf016f24ffac70342a7ce7477259f..c8c29d54456a4c0d2306a0c59ddd3096b78a8dc0 100755
(executable)
--- a/
summon-arm-toolchain
+++ b/
summon-arm-toolchain
@@
-9,9
+9,12
@@
# libmpc-dev autoconf texinfo build-essential
#
# libmpc-dev autoconf texinfo build-essential
#
+# Stop if any command fails
+set -e
+
TARGET=arm-none-eabi # Or: TARGET=arm-elf
PREFIX=${HOME}/arm-none-eabi # Install location of your final toolchain
TARGET=arm-none-eabi # Or: TARGET=arm-elf
PREFIX=${HOME}/arm-none-eabi # Install location of your final toolchain
-PARALLEL=
""
# Or: PARALLEL="-j 5" for 4 CPUs
+PARALLEL=
# Or: PARALLEL="-j 5" for 4 CPUs
DARWIN_OPT_PATH=/opt/local # Path in which MacPorts or Fink is installed
BINUTILS=binutils-2.20
DARWIN_OPT_PATH=/opt/local # Path in which MacPorts or Fink is installed
BINUTILS=binutils-2.20
@@
-51,13
+54,20
@@
function log {
echo "******************************************************************"
}
echo "******************************************************************"
}
+# Unpack an archive
+function unpack {
+ # Use 'auto' mode decompression. Replace with a switch if tar doesn't support -a
+ tar xvaf $1
+}
+
case "$(uname)" in
Linux)
echo "Found Linux OS."
;;
Darwin)
echo "Found Darwin OS."
case "$(uname)" in
Linux)
echo "Found Linux OS."
;;
Darwin)
echo "Found Darwin OS."
- GCCFLAGS="--with-gmp=${DARWIN_OPT_PATH} \
+ GCCFLAGS="${GCCFLAGS} \
+ --with-gmp=${DARWIN_OPT_PATH} \
--with-mpfr=${DARWIN_OPT_PATH} \
--with-mpc=${DARWIN_OPT_PATH} \
-with-libiconv-prefix=${DARWIN_OPT_PATH}"
--with-mpfr=${DARWIN_OPT_PATH} \
--with-mpc=${DARWIN_OPT_PATH} \
-with-libiconv-prefix=${DARWIN_OPT_PATH}"
@@
-129,7
+139,7
@@
fi
if [ ! -e ${STAMPS}/${BINUTILS}.build ]; then
log "Unpacking ${BINUTILS}"
if [ ! -e ${STAMPS}/${BINUTILS}.build ]; then
log "Unpacking ${BINUTILS}"
-
tar xfvj
${SOURCES}/${BINUTILS}.tar.bz2
+
unpack
${SOURCES}/${BINUTILS}.tar.bz2
cd build
log "Configuring ${BINUTILS}"
../${BINUTILS}/configure --target=${TARGET} \
cd build
log "Configuring ${BINUTILS}"
../${BINUTILS}/configure --target=${TARGET} \
@@
-140,11
+150,11
@@
if [ ! -e ${STAMPS}/${BINUTILS}.build ]; then
--with-gnu-ld \
--disable-nls \
--disable-werror \
--with-gnu-ld \
--disable-nls \
--disable-werror \
- ${BINUTILFLAGS}
|| exit
+ ${BINUTILFLAGS}
log "Building ${BINUTILS}"
log "Building ${BINUTILS}"
- make ${PARALLEL}
|| exit
+ make ${PARALLEL}
log "Installing ${BINUTILS}"
log "Installing ${BINUTILS}"
- make install
|| exit
+ make install
cd ..
log "Cleaning up ${BINUTILS}"
touch ${STAMPS}/${BINUTILS}.build
cd ..
log "Cleaning up ${BINUTILS}"
touch ${STAMPS}/${BINUTILS}.build
@@
-153,7
+163,7
@@
fi
if [ ! -e ${STAMPS}/${GCC}-boot.build ]; then
log "Unpacking ${GCC}-boot"
if [ ! -e ${STAMPS}/${GCC}-boot.build ]; then
log "Unpacking ${GCC}-boot"
-
tar xfvj
${SOURCES}/${GCC}.tar.bz2
+
unpack
${SOURCES}/${GCC}.tar.bz2
cd build
log "Configuring ${GCC}-boot"
../${GCC}/configure --target=${TARGET} \
cd build
log "Configuring ${GCC}-boot"
../${GCC}/configure --target=${TARGET} \
@@
-168,11
+178,11
@@
if [ ! -e ${STAMPS}/${GCC}-boot.build ]; then
--with-gnu-ld \
--disable-nls \
--disable-werror \
--with-gnu-ld \
--disable-nls \
--disable-werror \
- ${GCCFLAGS}
|| exit
+ ${GCCFLAGS}
log "Building ${GCC}-boot"
log "Building ${GCC}-boot"
- make ${PARALLEL} all-gcc
|| exit
+ make ${PARALLEL} all-gcc
log "Installing ${GCC}-boot"
log "Installing ${GCC}-boot"
- make install-gcc
|| exit
+ make install-gcc
cd ..
log "Cleaning up ${GCC}-boot"
touch ${STAMPS}/${GCC}-boot.build
cd ..
log "Cleaning up ${GCC}-boot"
touch ${STAMPS}/${GCC}-boot.build
@@
-181,7
+191,7
@@
fi
if [ ! -e ${STAMPS}/${NEWLIB}.build ]; then
log "Unpacking ${NEWLIB}"
if [ ! -e ${STAMPS}/${NEWLIB}.build ]; then
log "Unpacking ${NEWLIB}"
-
tar xfvz
${SOURCES}/${NEWLIB}.tar.gz
+
unpack
${SOURCES}/${NEWLIB}.tar.gz
cd build
log "Configuring ${NEWLIB}"
../${NEWLIB}/configure --target=${TARGET} \
cd build
log "Configuring ${NEWLIB}"
../${NEWLIB}/configure --target=${TARGET} \
@@
-192,11
+202,11
@@
if [ ! -e ${STAMPS}/${NEWLIB}.build ]; then
--with-gnu-ld \
--disable-nls \
--disable-werror \
--with-gnu-ld \
--disable-nls \
--disable-werror \
- --disable-newlib-supplied-syscalls
|| exit
+ --disable-newlib-supplied-syscalls
log "Building ${NEWLIB}"
log "Building ${NEWLIB}"
- make ${PARALLEL}
|| exit
+ make ${PARALLEL}
log "Installing ${NEWLIB}"
log "Installing ${NEWLIB}"
- make install
|| exit
+ make install
cd ..
log "Cleaning up ${NEWLIB}"
touch ${STAMPS}/${NEWLIB}.build
cd ..
log "Cleaning up ${NEWLIB}"
touch ${STAMPS}/${NEWLIB}.build
@@
-206,7
+216,7
@@
fi
# Yes, you need to build gcc again!
if [ ! -e ${STAMPS}/${GCC}.build ]; then
log "Unpacking ${GCC}"
# Yes, you need to build gcc again!
if [ ! -e ${STAMPS}/${GCC}.build ]; then
log "Unpacking ${GCC}"
-
tar xfvj
${SOURCES}/${GCC}.tar.bz2
+
unpack
${SOURCES}/${GCC}.tar.bz2
cd build
log "Configuring ${GCC}"
../${GCC}/configure --target=${TARGET} \
cd build
log "Configuring ${GCC}"
../${GCC}/configure --target=${TARGET} \
@@
-220,11
+230,11
@@
if [ ! -e ${STAMPS}/${GCC}.build ]; then
--with-gnu-ld \
--disable-nls \
--disable-werror \
--with-gnu-ld \
--disable-nls \
--disable-werror \
- ${GCCFLAGS}
|| exit
+ ${GCCFLAGS}
log "Building ${GCC}"
log "Building ${GCC}"
- make ${PARALLEL}
|| exit
+ make ${PARALLEL}
log "Installing ${GCC}"
log "Installing ${GCC}"
- make install
|| exit
+ make install
cd ..
log "Cleaning up ${GCC}"
touch ${STAMPS}/${GCC}.build
cd ..
log "Cleaning up ${GCC}"
touch ${STAMPS}/${GCC}.build
@@
-233,7
+243,7
@@
fi
if [ ! -e ${STAMPS}/${GDB}.build ]; then
log "Unpacking ${GDB}"
if [ ! -e ${STAMPS}/${GDB}.build ]; then
log "Unpacking ${GDB}"
-
tar xfvj
${SOURCES}/${GDB}.tar.bz2
+
unpack
${SOURCES}/${GDB}.tar.bz2
cd build
log "Configuring ${GDB}"
../${GDB}/configure --target=${TARGET} \
cd build
log "Configuring ${GDB}"
../${GDB}/configure --target=${TARGET} \
@@
-241,11
+251,11
@@
if [ ! -e ${STAMPS}/${GDB}.build ]; then
--enable-interwork \
--enable-multilib \
--disable-werror \
--enable-interwork \
--enable-multilib \
--disable-werror \
- ${GDBFLAGS}
|| exit
+ ${GDBFLAGS}
log "Building ${GDB}"
log "Building ${GDB}"
- make ${PARALLEL}
|| exit
+ make ${PARALLEL}
log "Installing ${GDB}"
log "Installing ${GDB}"
- make install
|| exit
+ make install
cd ..
log "Cleaning up ${GDB}"
touch ${STAMPS}/${GDB}.build
cd ..
log "Cleaning up ${GDB}"
touch ${STAMPS}/${GDB}.build
@@
-255,12
+265,12
@@
fi
if [ ${LIBSTM32_EN} != 0 ]; then
if [ ! -e .libcmsis-${LIBCMSIS}.build ]; then
log "Unpacking libcmsis-${LIBCMSIS}"
if [ ${LIBSTM32_EN} != 0 ]; then
if [ ! -e .libcmsis-${LIBCMSIS}.build ]; then
log "Unpacking libcmsis-${LIBCMSIS}"
-
tar xfvj
${SOURCES}/libcmsis-${LIBCMSIS}.tar.bz2
+
unpack
${SOURCES}/libcmsis-${LIBCMSIS}.tar.bz2
cd libcmsis-${LIBCMSIS}
log "Building libcmsis-${LIBCMSIS}"
cd libcmsis-${LIBCMSIS}
log "Building libcmsis-${LIBCMSIS}"
- make arch_prefix=${TARGET} prefix=${PREFIX}
|| exit
+ make arch_prefix=${TARGET} prefix=${PREFIX}
log "Installing libcmsis-${LIBCMSIS}"
log "Installing libcmsis-${LIBCMSIS}"
- make arch_prefix=${TARGET} prefix=${PREFIX} install
|| exit
+ make arch_prefix=${TARGET} prefix=${PREFIX} install
cd ..
log "Cleaning up libcmsis-${LIBCMSIS}"
touch .libcmsis-${LIBCMSIS}.build
cd ..
log "Cleaning up libcmsis-${LIBCMSIS}"
touch .libcmsis-${LIBCMSIS}.build
@@
-269,12
+279,12
@@
fi
if [ ! -e .libstm32-${LIBSTM32}.build ]; then
log "Unpacking libstm32-${LIBSTM32}"
if [ ! -e .libstm32-${LIBSTM32}.build ]; then
log "Unpacking libstm32-${LIBSTM32}"
-
tar xfvj
${SOURCES}/libstm32-${LIBSTM32}.tar.bz2
+
unpack
${SOURCES}/libstm32-${LIBSTM32}.tar.bz2
cd libstm32-${LIBSTM32}
log "Building libstm32-${LIBSTM32}"
cd libstm32-${LIBSTM32}
log "Building libstm32-${LIBSTM32}"
- make arch_prefix=${TARGET} prefix=${PREFIX}
|| exit
+ make arch_prefix=${TARGET} prefix=${PREFIX}
log "Installing libstm32-${LIBSTM32}"
log "Installing libstm32-${LIBSTM32}"
- make arch_prefix=${TARGET} prefix=${PREFIX} install
|| exit
+ make arch_prefix=${TARGET} prefix=${PREFIX} install
cd ..
log "Cleaning up libstm32-${LIBSTM32}"
touch .libstm32-${LIBSTM32}.build
cd ..
log "Cleaning up libstm32-${LIBSTM32}"
touch .libstm32-${LIBSTM32}.build
@@
-283,12
+293,12
@@
fi
if [ ! -e .libstm32usb-${LIBSTM32USB}.build ]; then
log "Unpacking libstm32usb-${LIBSTM32USB}"
if [ ! -e .libstm32usb-${LIBSTM32USB}.build ]; then
log "Unpacking libstm32usb-${LIBSTM32USB}"
-
tar xfvj
${SOURCES}/libstm32usb-${LIBSTM32USB}.tar.bz2
+
unpack
${SOURCES}/libstm32usb-${LIBSTM32USB}.tar.bz2
cd libstm32usb-${LIBSTM32USB}
log "Building libstm32usb-${LIBSTM32USB}"
cd libstm32usb-${LIBSTM32USB}
log "Building libstm32usb-${LIBSTM32USB}"
- make arch_prefix=${TARGET} prefix=${PREFIX}
|| exit
+ make arch_prefix=${TARGET} prefix=${PREFIX}
log "Installing libstm32usb-${LIBSTM32USB}"
log "Installing libstm32usb-${LIBSTM32USB}"
- make arch_prefix=${TARGET} prefix=${PREFIX} install
|| exit
+ make arch_prefix=${TARGET} prefix=${PREFIX} install
cd ..
log "Cleaning up libstm32usb-${LIBSTM32USB}"
touch .libstm32usb-${LIBSTM32USB}.build
cd ..
log "Cleaning up libstm32usb-${LIBSTM32USB}"
touch .libstm32usb-${LIBSTM32USB}.build
@@
-298,12
+308,12
@@
fi
if [ $LIBOPENSTM32_EN != 0 ]; then
log "Unpacking libopenstm32-${LIBOPENSTM32}"
if [ $LIBOPENSTM32_EN != 0 ]; then
log "Unpacking libopenstm32-${LIBOPENSTM32}"
-
tar xfvj
${SOURCES}/libopenstm32-${LIBOPENSTM32}.tar.bz2
+
unpack
${SOURCES}/libopenstm32-${LIBOPENSTM32}.tar.bz2
cd libopenstm32-${LIBOPENSTM32}
log "Building libopenstm32-${LIBOPENSTM32}"
cd libopenstm32-${LIBOPENSTM32}
log "Building libopenstm32-${LIBOPENSTM32}"
- make PREFIX=${TARGET} DESTDIR=${PREFIX}
|| exit
+ make PREFIX=${TARGET} DESTDIR=${PREFIX}
log "Installing libopenstm32-${LIBOPENSTM32}"
log "Installing libopenstm32-${LIBOPENSTM32}"
- make PREFIX=${TARGET} DESTDIR=${PREFIX} install
|| exit
+ make PREFIX=${TARGET} DESTDIR=${PREFIX} install
cd ..
log "Cleaning up libopenstm32-${LIBOPENSTM32}"
touch .libopenstm32-${LIBOPENSTM32}.build
cd ..
log "Cleaning up libopenstm32-${LIBOPENSTM32}"
touch .libopenstm32-${LIBOPENSTM32}.build