+if [ ${DEFAULT_TO_CORTEX_M3} = 0 ] ; then
+ GCCFLAGS=
+else
+ # To default to the Cortex-M3:
+ GCCFLAGS="--with-arch=armv7-m --with-mode=thumb --with-float=soft"
+fi
+
+# Pull in the local configuration, if any
+if [ -f local.sh ]; then
+ . ./local.sh
+fi
+
+MAKEFLAGS=${PARALLEL}
+TARFLAGS=v
+
+if [ ${QUIET} != 0 ]; then
+ TARFLAGS=
+ MAKEFLAGS="${MAKEFLAGS} -s"
+fi
+
+export PATH="${PREFIX}/bin:${PATH}"
+
+SUMMON_DIR=${WORKDIR}
+SOURCES=${SUMMON_DIR}/sources
+STAMPS=${SUMMON_DIR}/stamps
+
+
+##############################################################################
+# Tool section
+##############################################################################
+TAR=tar
+
+##############################################################################
+# OS and Tooldetection section
+# Detects which tools and flags to use
+##############################################################################
+
+case "$(uname)" in
+ Linux)
+ echo "Found Linux OS."
+ ;;
+ Darwin)
+ echo "Found Darwin OS."
+
+ # darwin dependencies
+ DARWINDEPS="wget mpfr libmpc gmp"
+ DARWINDEPSCOUNT=4
+
+ echo "Installing dependencies ..."
+ if ! which brew > /dev/null; then
+ echo "Homebrew not installed."
+ else
+ 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
+
+ OOCD_CFLAGS="-m32 -I/opt/mine/include -I/opt/local/include"
+ OOCD_LDFLAGS="-L/opt/mine/lib -L/opt/local/lib"
+ ;;
+ CYGWIN*)
+ echo "Found CygWin that means Windows most likely."
+ ;;
+ *)
+ echo "Found unknown OS. Aborting!"
+ exit 1
+ ;;
+esac
+
+##############################################################################
+# Building section
+# You probably don't have to touch anything after this
+##############################################################################
+