summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Noble <nnoble@blizzard.com>2011-02-16 17:19:21 -0800
committerNicolas Noble <nnoble@blizzard.com>2011-02-16 17:19:21 -0800
commite6e1d29297193d85dd5b98577f4e461fb94c5429 (patch)
tree1457cef875106797a8c2a0cd7a3de6a813def7c4
parent9b020e36b14c7247d9d4217bdd271a2126ef2aef (diff)
Final tweaks to the build script; one shouldn't actually require external library for a portable build script.
-rwxr-xr-xsummon-arm-toolchain160
1 files changed, 18 insertions, 142 deletions
diff --git a/summon-arm-toolchain b/summon-arm-toolchain
index fa086ff..c492a5c 100755
--- a/summon-arm-toolchain
+++ b/summon-arm-toolchain
@@ -18,9 +18,8 @@ set -e
# Settings section
# You probably want to customize those
##############################################################################
-TARGET=arm-none-eabi # Or: TARGET=arm-elf
+TARGET=arm-none-eabi
PREFIX=/usr/local # Install location of your final toolchain
-DARWIN_OPT_PATH=/sw # Path in which MacPorts or Fink is installed
# Set to 'sudo' if you need superuser privileges while installing
SUDO=sudo
# Set to 1 to be quieter while running
@@ -31,8 +30,6 @@ USE_LINARO=1
OOCD_EN=1
# Make the gcc default to Cortex-M3
DEFAULT_TO_CORTEX_M3=1
-# Build for a second host - mingw32
-#SECOND_HOST=i586-mingw32msvc
##############################################################################
# Version and download url settings section
@@ -53,6 +50,9 @@ fi
BINUTILS=binutils-2.20
GDB=gdb-7.2
OOCD=master
+GMP=gmp-4.2.4
+MPFR=mpfr-2.4.2
+MPC=mpc-0.8.2
##############################################################################
# Flags section
@@ -97,7 +97,6 @@ SUMMON_DIR=$(pwd)
SOURCES=${SUMMON_DIR}/sources
STAMPS=${SUMMON_DIR}/stamps
-
##############################################################################
# Tool section
##############################################################################
@@ -114,19 +113,12 @@ case "$(uname)" in
;;
Darwin)
echo "Found Darwin OS."
- GCCFLAGS="${GCCFLAGS} \
- --with-gmp=${DARWIN_OPT_PATH} \
- --with-mpfr=${DARWIN_OPT_PATH} \
- --with-mpc=${DARWIN_OPT_PATH} \
- --with-libiconv-prefix=${DARWIN_OPT_PATH}"
- GCC_CPPFLAGS="-m32"
- GCC_LDFLAGS="-m32"
- OOCD_CFLAGS="-m32 -I${DARWIN_OPT_PATH}/include"
- OOCD_LDFLAGS="-L${DARWIN_OPT_PATH}/lib"
- ;;
- CYGWIN*)
- echo "Found CygWin that means Windows most likely."
;;
+ MINGW32*)
+ echo "Found Mingw32"
+ OOCD_EN=0
+ SUDO=
+ ;;
*)
echo "Found unknown OS. Aborting!"
exit 1
@@ -191,6 +183,9 @@ cd ${SOURCES}
fetch ${BINUTILS} http://ftp.gnu.org/gnu/binutils/${BINUTILS}.tar.bz2
fetch ${GCC} ${GCCURL}
fetch ${GDB} http://ftp.gnu.org/gnu/gdb/${GDB}.tar.bz2
+fetch ${GMP} http://mirrors.kernel.org/gnu/gmp/${GMP}.tar.bz2
+fetch ${MPFR} http://mirrors.kernel.org/gnu/mpfr/${MPFR}.tar.bz2
+fetch ${MPC} http://www.multiprecision.org/mpc/download/${MPC}.tar.gz
if [ ${OOCD_EN} != 0 ]; then
if [ ! -e openocd-${OOCD}.tar.bz2 ]; then
@@ -230,34 +225,14 @@ if [ ! -e ${STAMPS}/${BINUTILS}.build ]; then
fi
cd ${SUMMON_DIR}
-if [ ${SECOND_HOST} != "" ]; then
-if [ ! -e ${STAMPS}/${BINUTILS}.build.${SECOND_HOST} ]; then
- unpack ${BINUTILS}
- rm -rf build-${BINUTILS}.${SECOND_HOST}
- mkdir -p build-${BINUTILS}.${SECOND_HOST}
- cd build-${BINUTILS}.${SECOND_HOST}
- log "Configuring ${BINUTILS}"
- ../${BINUTILS}/configure --target=${TARGET} \
- --host=${SECOND_HOST} \
- --prefix=${PREFIX} \
- --enable-interwork \
- --enable-multilib \
- --with-gnu-as \
- --with-gnu-ld \
- --disable-nls \
- --disable-werror \
- ${BINUTILFLAGS}
- log "Building ${BINUTILS}"
- make ${MAKEFLAGS}
- make install prefix=${SUMMON_DIR}/${SECOND_HOST}
- cd ..
- touch ${STAMPS}/${BINUTILS}.build.${SECOND_HOST}
-fi
-fi
-
-cd ${SUMMON_DIR}
if [ ! -e ${STAMPS}/${GCC}.build ]; then
unpack ${GCC} gcc
+ unpack ${GMP} gmp
+ unpack ${MPFR} mpfr
+ unpack ${MPC} mpc
+ mv ${GMP} ${GCC}/gmp
+ mv ${MPFR} ${GCC}/mpfr
+ mv ${MPC} ${GCC}/mpc
cd ${GCC}
patch -p 1 < ../gcc.patch
rm -rf libstdc++-v3
@@ -277,7 +252,6 @@ if [ ! -e ${STAMPS}/${GCC}.build ]; then
--with-gnu-ld \
--disable-nls \
--disable-werror \
- --with-system-zlib \
--disable-libssp \
--enable-target-optspace \
--disable-threads \
@@ -300,47 +274,6 @@ if [ ! -e ${STAMPS}/${GCC}.build ]; then
fi
cd ${SUMMON_DIR}
-if [ ${SECOND_HOST} != "" ]; then
-if [ ! -e ${STAMPS}/${GCC}.build.${SECOND_HOST} ]; then
- mkdir -p build-${GCC}.${SECOND_HOST}
- cd build-${GCC}.${SECOND_HOST}
- log "Configuring ${GCC}"
- ../${GCC}/configure --target=${TARGET} \
- --host=${SECOND_HOST} \
- --prefix=${PREFIX} \
- --enable-interwork \
- --enable-multilib \
- --enable-languages="c,c++" \
- --with-newlib \
- --without-headers \
- --disable-shared \
- --with-gnu-as \
- --with-gnu-ld \
- --disable-nls \
- --disable-werror \
- --with-system-zlib \
- --disable-libssp \
- --enable-target-optspace \
- --disable-threads \
- --disable-libmudflap \
- --disable-libgomp \
- --disable-libstdcxx-pch \
- --disable-libunwind-exceptions \
- --disable-libffi \
- --enable-extra-sgxxlite-multilibs \
- --enable-libstdcxx-allocator=malloc \
- --disable-lto \
- --enable-cxx-flags="${GCCFLAGS_FOR_TARGET}" \
- ${GCCFLAGS}
- log "Building ${GCC}"
- make ${MAKEFLAGS} CFLAGS_FOR_TARGET="${GCCFLAGS_FOR_TARGET}"
- make install prefix=${SUMMON_DIR}/${SECOND_HOST}
- cd ..
- touch ${STAMPS}/${GCC}.build.${SECOND_HOST}
-fi
-fi
-
-cd ${SUMMON_DIR}
if [ ! -e ${STAMPS}/${GDB}.build ]; then
unpack ${GDB}
mkdir -p build-${GDB}
@@ -359,28 +292,6 @@ if [ ! -e ${STAMPS}/${GDB}.build ]; then
touch ${STAMPS}/${GDB}.build
fi
-cd ${SUMMON_DIR}
-if [ ${SECOND_HOST} != "" ]; then
-if [ ! -e ${STAMPS}/${GDB}.build.${SECOND_HOST} ]; then
- unpack ${GDB}
- mkdir -p build-${GDB}.${SECOND_HOST}
- cd build-${GDB}.${SECOND_HOST}
- log "Configuring ${GDB}"
- ../${GDB}/configure --target=${TARGET} \
- --host=${SECOND_HOST} \
- --prefix=${PREFIX} \
- --enable-interwork \
- --enable-multilib \
- --disable-werror \
- ${GDBFLAGS}
- log "Building ${GDB}"
- make ${MAKEFLAGS}
- make install prefix=${SUMMON_DIR}/${SECOND_HOST}
- cd ..
- touch ${STAMPS}/${GDB}.build.${SECOND_HOST}
-fi
-fi
-
if [ ${OOCD_EN} != 0 ]; then
cd ${SUMMON_DIR}
if [ ! -e ${STAMPS}/openocd-${OOCD}.build ]; then
@@ -414,39 +325,4 @@ if [ ! -e ${STAMPS}/openocd-${OOCD}.build ]; then
cd ..
touch ${STAMPS}/openocd-${OOCD}.build
fi
-
-if [ ${SECOND_HOST} != "" ]; then
-cd ${SUMMON_DIR}
-if [ ! -e ${STAMPS}/openocd-${OOCD}.build.${SECOND_HOST} ]; then
- mkdir build-${OOCD}.${SECOND_HOST}
- cd build-${OOCD}.${SECOND_HOST}
- log "Configuring openocd-${OOCD}"
- CFLAGS="${CFLAGS} ${OOCD_CFLAGS}" \
- LDFLAGS="${LDFLAGS} ${OOCD_LDFLAGS}" \
- ../openocd-${OOCD}/configure --enable-maintainer-mode \
- --host=${SECOND_HOST} \
- --prefix=${PREFIX} \
- --enable-dummy \
- --enable-parport \
- --disable-ft2232_libftdi \
- --disable-usb_blaster_libftdi \
- --enable-amtjtagaccel \
- --disable-zy1000 \
- --enable-ep93xx \
- --enable-at91rm9200 \
- --enable-gw16012 \
- --disable-presto_libftdi \
- --enable-usbprog \
- --enable-jlink \
- --enable-vsllink \
- --enable-rlink \
- --enable-arm-jtag-ew \
- --enable-buspirate
- log "Building openocd-${OOCD}"
- make ${MAKEFLAGS}
- make install prefix=${SUMMON_DIR}/${SECOND_HOST}
- cd ..
- touch ${STAMPS}/openocd-${OOCD}.build.${SECOND_HOST}
-fi
-fi
fi