X-Git-Url: https://git.gag.com/?p=fw%2Fcortex-toolchain;a=blobdiff_plain;f=summon-arm-toolchain;h=0d6385d3761f456d32b94bd5796af9965f2b88f7;hp=f1ddff04fa21a80dcc6e93ee49873c8aafe77851;hb=d6c345c10750661f5002441db6378f14b3a19df5;hpb=97d03426e4ac528d0b30d70bc40db54f903d8194 diff --git a/summon-arm-toolchain b/summon-arm-toolchain index f1ddff0..0d6385d 100755 --- a/summon-arm-toolchain +++ b/summon-arm-toolchain @@ -19,7 +19,7 @@ set -e # You probably want to customize those ############################################################################## TARGET=arm-none-eabi # Or: TARGET=arm-elf -PREFIX=${HOME}/arm-none-eabi # Install location of your final toolchain +PREFIX=${HOME}/sat # 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 @@ -91,6 +91,37 @@ SUMMON_DIR=$(pwd) SOURCES=${SUMMON_DIR}/sources STAMPS=${SUMMON_DIR}/stamps +############################################################################## +# OS and Tooldetection section +# Detects which tools to use +############################################################################## + +case "$(uname)" in + Linux) + echo "Found Linux OS." + TAR=tar + ;; + 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}" + if ! which gnutar > /dev/null ; then + echo "ERROR: GNU tar not found! (try 'sudo port install gnutar')" + exit 1 + else + echo "GNU tar found!" + TAR=gnutar + fi + ;; + *) + echo "Found unknown OS. Aborting!" + exit 1 + ;; +esac + ############################################################################## # Building section # You probably don't have to touch anything after this @@ -116,7 +147,7 @@ function log { function unpack { log Unpacking $* # Use 'auto' mode decompression. Replace with a switch if tar doesn't support -a - tar xaf${TARFLAGS} ${SOURCES}/$1.tar.* + ${TAR} xaf${TARFLAGS} ${SOURCES}/$1.tar.* } # Install a build @@ -125,23 +156,6 @@ function install { ${SUDO} make ${MAKEFLAGS} $2 $3 $4 $5 $6 $7 $8 } -case "$(uname)" in - Linux) - echo "Found Linux OS." - ;; - 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}" - ;; - *) - echo "Found unknown OS. Aborting!" - exit 1 - ;; -esac mkdir -p ${STAMPS} ${SOURCES} @@ -240,6 +254,7 @@ if [ ! -e ${STAMPS}/${GCC}-boot.build ]; then --with-gnu-ld \ --disable-nls \ --disable-werror \ + --with-system-zlib \ ${GCCFLAGS} log "Building ${GCC}-boot" make ${MAKEFLAGS} all-gcc @@ -288,6 +303,7 @@ if [ ! -e ${STAMPS}/${GCC}.build ]; then --with-gnu-ld \ --disable-nls \ --disable-werror \ + --with-system-zlib \ ${GCCFLAGS} log "Building ${GCC}" make ${MAKEFLAGS}