projects
/
summon-arm-toolchain.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added ability to have a local config that overrides the script.
[summon-arm-toolchain.git]
/
summon-arm-toolchain
diff --git
a/summon-arm-toolchain
b/summon-arm-toolchain
index 222f4fe1e7fe479181fc96bab29fc4aac5b7eb19..7972c1ba301e2cb67e8b897c56add3f18b2484a1 100755
(executable)
--- a/
summon-arm-toolchain
+++ b/
summon-arm-toolchain
@@
-16,6
+16,10
@@
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
DARWIN_OPT_PATH=/opt/local # Path in which MacPorts or Fink is installed
PREFIX=${HOME}/arm-none-eabi # Install location of your final toolchain
PARALLEL= # Or: PARALLEL="-j 5" for 4 CPUs
DARWIN_OPT_PATH=/opt/local # Path in which MacPorts or Fink is installed
+# Set to 'sudo' if you need superuser privileges while installing
+SUDO=
+# Set to 1 to be quieter while running
+QUIET=0
# For FSF GCC:
GCCVERSION=4.5.1
# For FSF GCC:
GCCVERSION=4.5.1
@@
-37,7
+41,6
@@
LIBOPENSTM32=master
LIBSTM32_EN=0
LIBOPENSTM32_EN=0
LIBSTM32_EN=0
LIBOPENSTM32_EN=0
-SUDO=
SUMMON_DIR=$(pwd)
SOURCES=${SUMMON_DIR}/sources
STAMPS=${SUMMON_DIR}/stamps
SUMMON_DIR=$(pwd)
SOURCES=${SUMMON_DIR}/sources
STAMPS=${SUMMON_DIR}/stamps
@@
-51,10
+54,23
@@
BINUTILFLAGS=
# To default to the Cortex-M3:
# GCCFLAGS="--with-arch=armv7-m --with-mode=thumb"
# To default to the Cortex-M3:
# GCCFLAGS="--with-arch=armv7-m --with-mode=thumb"
+# Pull in the local configuration, if any
+if [ -f local.sh ]; then
+ . ./local.sh
+fi
+
+MAKEFLAGS=${PARALLEL}
+TARFLAGS=v
+
+if [ ${QUIET} != 0 ]; then
+ TARFLAGS=
+ MAKEFLAGS="${MAKEFLAGS} -s"
+fi
+
# Fetch a versioned file from a URL
function fetch {
if [ ! -e ${STAMPS}/$1.fetch ]; then
# Fetch a versioned file from a URL
function fetch {
if [ ! -e ${STAMPS}/$1.fetch ]; then
-
echo
"Downloading $1 sources..."
+
log
"Downloading $1 sources..."
wget -c --no-passive-ftp $2
touch ${STAMPS}/$1.fetch
fi
wget -c --no-passive-ftp $2
touch ${STAMPS}/$1.fetch
fi
@@
-71,13
+87,13
@@
function log {
function unpack {
log Unpacking $*
# Use 'auto' mode decompression. Replace with a switch if tar doesn't support -a
function unpack {
log Unpacking $*
# Use 'auto' mode decompression. Replace with a switch if tar doesn't support -a
- tar x
vaf
${SOURCES}/$1.tar.*
+ tar x
af${TARFLAGS}
${SOURCES}/$1.tar.*
}
# Install a build
function install {
log $1
}
# Install a build
function install {
log $1
- ${SUDO} make ${
PARALLEL
} $2 $3 $4 $5 $6 $7 $8
+ ${SUDO} make ${
MAKEFLAGS
} $2 $3 $4 $5 $6 $7 $8
}
case "$(uname)" in
}
case "$(uname)" in
@@
-109,7
+125,7
@@
fetch ${GDB} http://ftp.gnu.org/gnu/gdb/${GDB}.tar.bz2
if [ ${LIBSTM32_EN} != 0 ]; then
if [ ! -e libcmsis-${LIBCMSIS}.tar.bz2 ]; then
if [ ${LIBSTM32_EN} != 0 ]; then
if [ ! -e libcmsis-${LIBCMSIS}.tar.bz2 ]; then
-
echo
"Cloning libcmsis sources..."
+
log
"Cloning libcmsis sources..."
git clone git://git.open-bldc.org/libcmsis.git
cd libcmsis
git archive --format=tar --prefix=libcmsis-${LIBCMSIS}/ ${LIBCMSIS} | \
git clone git://git.open-bldc.org/libcmsis.git
cd libcmsis
git archive --format=tar --prefix=libcmsis-${LIBCMSIS}/ ${LIBCMSIS} | \
@@
-119,7
+135,7
@@
if [ ! -e libcmsis-${LIBCMSIS}.tar.bz2 ]; then
fi
if [ ! -e libstm32-${LIBSTM32}.tar.bz2 ]; then
fi
if [ ! -e libstm32-${LIBSTM32}.tar.bz2 ]; then
-
echo
"Cloning libstm32 sources..."
+
log
"Cloning libstm32 sources..."
git clone git://git.open-bldc.org/libstm32.git
cd libstm32
git archive --format=tar --prefix=libstm32-${LIBSTM32}/ ${LIBSTM32} | \
git clone git://git.open-bldc.org/libstm32.git
cd libstm32
git archive --format=tar --prefix=libstm32-${LIBSTM32}/ ${LIBSTM32} | \
@@
-129,7
+145,7
@@
if [ ! -e libstm32-${LIBSTM32}.tar.bz2 ]; then
fi
if [ ! -e libstm32usb-${LIBSTM32USB}.tar.bz2 ]; then
fi
if [ ! -e libstm32usb-${LIBSTM32USB}.tar.bz2 ]; then
-
echo
"Cloning libstm32usb sources..."
+
log
"Cloning libstm32usb sources..."
git clone git://git.open-bldc.org/libstm32usb.git
cd libstm32usb
git archive --format=tar --prefix=libstm32usb-${LIBSTM32USB}/ ${LIBSTM32USB} | \
git clone git://git.open-bldc.org/libstm32usb.git
cd libstm32usb
git archive --format=tar --prefix=libstm32usb-${LIBSTM32USB}/ ${LIBSTM32USB} | \
@@
-141,7
+157,7
@@
fi
if [ ${LIBOPENSTM32_EN} != 0 ]; then
if [ ! -e libopenstm32-${LIBOPENSTM32}.tar.bz2 ]; then
if [ ${LIBOPENSTM32_EN} != 0 ]; then
if [ ! -e libopenstm32-${LIBOPENSTM32}.tar.bz2 ]; then
-
echo
"Cloning libopenstm32 sources..."
+
log
"Cloning libopenstm32 sources..."
git clone git://libopenstm32.git.sourceforge.net/gitroot/libopenstm32/libopenstm32
cd libopenstm32
git archive --format=tar --prefix=libopenstm32-${LIBOPENSTM32}/ ${LIBOPENSTM32} | \
git clone git://libopenstm32.git.sourceforge.net/gitroot/libopenstm32/libopenstm32
cd libopenstm32
git archive --format=tar --prefix=libopenstm32-${LIBOPENSTM32}/ ${LIBOPENSTM32} | \
@@
-171,7
+187,7
@@
if [ ! -e ${STAMPS}/${BINUTILS}.build ]; then
--disable-werror \
${BINUTILFLAGS}
log "Building ${BINUTILS}"
--disable-werror \
${BINUTILFLAGS}
log "Building ${BINUTILS}"
- make ${
PARALLEL
}
+ make ${
MAKEFLAGS
}
install ${BINUTILS} install
cd ..
log "Cleaning up ${BINUTILS}"
install ${BINUTILS} install
cd ..
log "Cleaning up ${BINUTILS}"
@@
-197,7
+213,7
@@
if [ ! -e ${STAMPS}/${GCC}-boot.build ]; then
--disable-werror \
${GCCFLAGS}
log "Building ${GCC}-boot"
--disable-werror \
${GCCFLAGS}
log "Building ${GCC}-boot"
- make ${
PARALLEL
} all-gcc
+ make ${
MAKEFLAGS
} all-gcc
install ${GCC}-boot install-gcc
cd ..
log "Cleaning up ${GCC}-boot"
install ${GCC}-boot install-gcc
cd ..
log "Cleaning up ${GCC}-boot"
@@
-219,7
+235,7
@@
if [ ! -e ${STAMPS}/${NEWLIB}.build ]; then
--disable-werror \
--disable-newlib-supplied-syscalls
log "Building ${NEWLIB}"
--disable-werror \
--disable-newlib-supplied-syscalls
log "Building ${NEWLIB}"
- make ${
PARALLEL
}
+ make ${
MAKEFLAGS
}
install ${NEWLIB} install
cd ..
log "Cleaning up ${NEWLIB}"
install ${NEWLIB} install
cd ..
log "Cleaning up ${NEWLIB}"
@@
-245,7
+261,7
@@
if [ ! -e ${STAMPS}/${GCC}.build ]; then
--disable-werror \
${GCCFLAGS}
log "Building ${GCC}"
--disable-werror \
${GCCFLAGS}
log "Building ${GCC}"
- make ${
PARALLEL
}
+ make ${
MAKEFLAGS
}
install ${GCC} install
cd ..
log "Cleaning up ${GCC}"
install ${GCC} install
cd ..
log "Cleaning up ${GCC}"
@@
-264,7
+280,7
@@
if [ ! -e ${STAMPS}/${GDB}.build ]; then
--disable-werror \
${GDBFLAGS}
log "Building ${GDB}"
--disable-werror \
${GDBFLAGS}
log "Building ${GDB}"
- make ${
PARALLEL
}
+ make ${
MAKEFLAGS
}
install ${GDB} install
cd ..
log "Cleaning up ${GDB}"
install ${GDB} install
cd ..
log "Cleaning up ${GDB}"