diff options
author | Piotr Esden-Tempski <piotr@esden.net> | 2010-10-26 17:04:31 -0700 |
---|---|---|
committer | Piotr Esden-Tempski <piotr@esden.net> | 2010-10-26 17:04:31 -0700 |
commit | 80aef786420f17ccf6edbcf1a707a7474e5bc0b2 (patch) | |
tree | b1b14ce801a27a900a95f057a4381fd4d10f816d | |
parent | f191ef3092b06deed9278b3fe062f75c8725a6f7 (diff) |
Added proper detection of tar utility. We need gnutar on OS X.
-rwxr-xr-x | summon-arm-toolchain | 50 |
1 files changed, 32 insertions, 18 deletions
diff --git a/summon-arm-toolchain b/summon-arm-toolchain index 2a70d09..760522c 100755 --- a/summon-arm-toolchain +++ b/summon-arm-toolchain @@ -92,6 +92,37 @@ 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} |