+##############################################################################
+# 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
+