X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=summon-arm-toolchain;h=dd5d6ea931dd9bccab5a206000c8b2a3fa7cafa6;hb=b8a70633ee506d75339fcc302bdc361ec304bd1f;hp=7e2b69acbc43aca910fa868203e1a46b7c07a316;hpb=e6f8e7e99e202076206c1ad551634a5f15cb1a55;p=summon-arm-toolchain.git diff --git a/summon-arm-toolchain b/summon-arm-toolchain index 7e2b69a..dd5d6ea 100755 --- a/summon-arm-toolchain +++ b/summon-arm-toolchain @@ -47,7 +47,7 @@ if [ ${USE_LINARO} = 0 ] ; then GCC=gcc-${GCCVERSION} GCCDIR=${GCC} fi - GCCURL=http://ftp.gnu.org/gnu/gcc/${GCCDIR}/${GCC}.tar.gz + GCCURL=http://ftp.gnu.org/gnu/gcc/${GCCDIR}/${GCC}.tar.bz2 else # For the Linaro GCC: GCCRELEASE=4.6-2011.07 @@ -65,6 +65,9 @@ LIBCMSIS=v1.10-2 LIBSTM32=v3.0.0-1 LIBSTM32USB=v3.0.1-1 LIBOPENSTM32=master +GMP=gmp-5.0.2 +MPFR=mpfr-3.0.1 +MPC=mpc-0.9 ############################################################################## # Flags section @@ -126,8 +129,7 @@ case "$(uname)" in echo "Found Darwin OS." # darwin dependencies - DARWINDEPS="wget mpfr libmpc gmp" - DARWINDEPSCOUNT=4 + DARWINDEPS="wget" echo "Installing dependencies ..." if ! which brew > /dev/null; then @@ -136,13 +138,7 @@ case "$(uname)" in brew install ${DARWINDEPS} | (grep -v '^Warning: Formula already installed: ' || true) fi - GCCFLAGS="${GCCFLAGS} \ - --with-gmp=$(brew --prefix gmp) \ - --with-mpfr=$(brew --prefix mpfr) \ - --with-mpc=$(brew --prefix mpc) - -with-libiconv-prefix=$(brew --prefix libiconv)" - - TAR=gnutar + TAR=gnutar OOCD_CFLAGS="-m32 -I/opt/mine/include -I/opt/local/include" OOCD_LDFLAGS="-L/opt/mine/lib -L/opt/local/lib" @@ -193,8 +189,8 @@ unpack() { ;; *) echo "Unknown archive type of $1" - echo ${ARCHIVE} - exit 1 + echo "leaving the decision to tar" + TYPE= ;; esac ${TAR} xf${TYPE}${TARFLAGS} ${SOURCES}/$1.tar.* @@ -220,6 +216,9 @@ fetch ${BINUTILS} http://ftp.gnu.org/gnu/binutils/${BINUTILS}.tar.bz2 fetch ${GCC} ${GCCURL} fetch ${NEWLIB} ftp://sources.redhat.com/pub/newlib/${NEWLIB}.tar.gz fetch ${GDB} http://ftp.gnu.org/gnu/gdb/${GDB}.tar.bz2 +fetch ${GMP} ftp://ftp.gmplib.org/pub/${GMP}/${GMP}.tar.bz2 +fetch ${MPFR} http://www.mpfr.org/${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 @@ -309,6 +308,12 @@ fi if [ ! -e ${STAMPS}/${GCC}-boot.build ]; then unpack ${GCC} boot + unpack ${GMP} + mv ${GMP} ${GCCDIR}/gmp + unpack ${MPFR} + mv ${MPFR} ${GCCDIR}/mpfr + unpack ${MPC} + mv ${MPC} ${GCCDIR}/mpc cd build log "Configuring ${GCC}-boot" ../${GCCDIR}/configure --target=${TARGET} \ @@ -338,6 +343,8 @@ if [ ! -e ${STAMPS}/${NEWLIB}.build ]; then unpack ${NEWLIB} cd build log "Configuring ${NEWLIB}" + # configuration options and flags partially + # from https://github.com/jsnyder/arm-eabi-toolchain ../${NEWLIB}/configure --target=${TARGET} \ --prefix=${PREFIX} \ --enable-interwork \ @@ -347,9 +354,13 @@ if [ ! -e ${STAMPS}/${NEWLIB}.build ]; then --disable-nls \ --disable-werror \ --disable-newlib-supplied-syscalls \ + --disable-shared \ + --disable-nls \ + --disable-libgloss \ --with-float=soft log "Building ${NEWLIB}" - make ${MAKEFLAGS} CFLAGS_FOR_TARGET="-msoft-float" CCASFLAGS="-msoft-float" + NEWLIB_FLAGS="-ffunction-sections -fdata-sections -DPREFER_SIZE_OVER_SPEED -D__OPTIMIZE_SIZE__ -Os -fomit-frame-pointer -fno-unroll-loops -D__BUFSIZ__=256 -mabi=aapcs" + make ${MAKEFLAGS} CFLAGS_FOR_TARGET="${NEWLIB_FLAGS}" CCASFLAGS="${NEWLIB_FLAGS}" install ${NEWLIB} install cd .. log "Cleaning up ${NEWLIB}" @@ -360,6 +371,12 @@ fi # Yes, you need to build gcc again! if [ ! -e ${STAMPS}/${GCC}.build ]; then unpack ${GCC} + unpack ${GMP} + mv ${GMP} ${GCCDIR}/gmp + unpack ${MPFR} + mv ${MPFR} ${GCCDIR}/mpfr + unpack ${MPC} + mv ${MPC} ${GCCDIR}/mpc cd build log "Configuring ${GCC}" [ ${USE_CPP} = 1 ] && GCCFLAGS="--enable-languages='c,c++' ${GCCFLAGS}"