PARALLEL flag is now being set automatically based on available host cpu's.
[fw/cortex-toolchain] / summon-arm-toolchain
index afbcbe4a3485db4683a1e63f392fa1b3bd51ce19..fe9e58ad4049f248c2e9b743ff79f943efdd2704 100755 (executable)
@@ -20,7 +20,6 @@ set -e
 ##############################################################################
 TARGET=arm-none-eabi           # Or: TARGET=arm-elf
 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
 SUDO=
@@ -62,6 +61,10 @@ LIBOPENSTM32=master
 # Flags section
 ##############################################################################
 
+CPUS=$(getconf _NPROCESSORS_ONLN)
+PARALLEL=-j$((CPUS + 1))
+echo "${CPUS} cpu's detected running make with '${PARALLEL}' flag"
+
 GDBFLAGS=
 BINUTILFLAGS=
 
@@ -69,7 +72,7 @@ if [ ${DEFAULT_TO_CORTEX_M3} == 0 ] ; then
        GCCFLAGS=
 else
        # To default to the Cortex-M3:
-       GCCFLAGS="--with-arch=armv7-m --with-mode=thumb"
+       GCCFLAGS="--with-arch=armv7-m --with-mode=thumb --with-float=soft"
 fi
 
 # Pull in the local configuration, if any
@@ -291,9 +294,10 @@ if [ ! -e ${STAMPS}/${NEWLIB}.build ]; then
                          --with-gnu-ld \
                          --disable-nls \
                          --disable-werror \
-                         --disable-newlib-supplied-syscalls
+                         --disable-newlib-supplied-syscalls \
+                        --with-float=soft
     log "Building ${NEWLIB}"
-    make ${MAKEFLAGS}
+    make ${MAKEFLAGS} CFLAGS_FOR_TARGET="-msoft-float" CCASFLAGS="-msoft-float"
     install ${NEWLIB} install
     cd ..
     log "Cleaning up ${NEWLIB}"