X-Git-Url: https://git.gag.com/?p=fw%2Fcortex-toolchain;a=blobdiff_plain;f=summon-arm-toolchain;h=429a8dea5cf64037ac8be05fd28e7e9b5ca3d36f;hp=413a1a152747522121b297b01df3950b3d79e87b;hb=451b5f3bddf0c4bb1e5f086e9cdbf97ff040cf5b;hpb=dfcf062595c857f416e024b35364abe0a1107936 diff --git a/summon-arm-toolchain b/summon-arm-toolchain index 413a1a1..429a8de 100755 --- a/summon-arm-toolchain +++ b/summon-arm-toolchain @@ -1,10 +1,11 @@ -#!/bin/sh +#!/bin/bash # Written by Uwe Hermann , released as public domain. # Modified by Piot Esden-Tempski , released as public domain. TARGET=arm-none-eabi # Or: TARGET=arm-none-eabi -PREFIX=${HOME}/arm-none-eabi # Install location of your final toolchain -PARALLEL="-j 5" # Or: PARALLEL="" +PREFIX=${HOME}/arm-none-eabi # 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 @@ -16,6 +17,25 @@ LIBSTM32USB=v3.0.1-1 export PATH="${PREFIX}/bin:${PATH}" +case "$(uname)" in + Linux) + echo "Found Linux OS." + GCCFLAGS= + GDBFLAGS= + ;; + Darwin) + echo "Found Darwin OS." + GCCFLAGS="--with-gmp=${DARWIN_OPT_PATH} \ + --with-mpfr=${DARWIN_OPT_PATH} \ + -with-libiconv-prefix=${DARWIN_OPT_PATH}" + GDBFLAGS="--disable-werror" + ;; + *) + echo "Found Unknown OS. Aborting!" + exit 1 + ;; +esac + if [ ! -e sources ]; then mkdir sources fi @@ -128,7 +148,8 @@ if [ ! -e .${GCC}-boot.build ]; then --disable-shared \ --with-gnu-as \ --with-gnu-ld \ - --disable-nls || exit + --disable-nls \ + ${GCCFLAGS} || exit echo "******************************************************************" echo "* Building ${GCC}-boot" echo "******************************************************************" @@ -197,7 +218,8 @@ if [ ! -e .${GCC}.build ]; then --disable-shared \ --with-gnu-as \ --with-gnu-ld \ - --disable-nls || exit + --disable-nls \ + ${GCCFLAGS} || exit echo "******************************************************************" echo "* Building ${GCC}" echo "******************************************************************" @@ -226,7 +248,8 @@ if [ ! -e .${GDB}.build ]; then ../${GDB}/configure --target=${TARGET} \ --prefix=${PREFIX} \ --enable-interwork \ - --enable-multilib || exit + --enable-multilib \ + ${GDBFLAGS} || exit echo "******************************************************************" echo "* Building ${GDB}" echo "******************************************************************"