# 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
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
SOURCES=${SUMMON_DIR}/sources
STAMPS=${SUMMON_DIR}/stamps
+
+##############################################################################
+# Tool section
+##############################################################################
+TAR=tar
+
##############################################################################
# OS and Tooldetection section
-# Detects which tools to use
+# Detects which tools and flags to use
##############################################################################
case "$(uname)" in
Linux)
echo "Found Linux OS."
- TAR=tar
;;
Darwin)
echo "Found Darwin OS."
--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!"
function unpack {
log Unpacking $*
# Use 'auto' mode decompression. Replace with a switch if tar doesn't support -a
- ${TAR} xaf${TARFLAGS} ${SOURCES}/$1.tar.*
+ ARCHIVE=$(ls ${SOURCES}/$1.tar.*)
+ case ${ARCHIVE} in
+ *.bz2)
+ echo "archive type bz2"
+ TYPE=j
+ ;;
+ *.gz)
+ echo "archive type gz"
+ TYPE=z
+ ;;
+ *)
+ echo "Unknown archive type of $1"
+ echo ${ARCHIVE}
+ exit 1
+ ;;
+ esac
+ ${TAR} xf${TYPE}${TARFLAGS} ${SOURCES}/$1.tar.*
}
# Install a build
--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}"
fi
if [ ${LIBSTM32_EN} != 0 ]; then
-if [ ! -e .libcmsis-${LIBCMSIS}.build ]; then
+if [ ! -e ${STAMPS}/libcmsis-${LIBCMSIS}.build ]; then
unpack libcmsis-${LIBCMSIS}
cd libcmsis-${LIBCMSIS}
log "Building libcmsis-${LIBCMSIS}"
install libcmsis-${LIBCMSIS} arch_prefix=${TARGET} prefix=${PREFIX} install
cd ..
log "Cleaning up libcmsis-${LIBCMSIS}"
- touch .libcmsis-${LIBCMSIS}.build
+ touch ${STAMPS}/libcmsis-${LIBCMSIS}.build
rm -rf libcmsis-${LIBCMSIS}
fi
-if [ ! -e .libstm32-${LIBSTM32}.build ]; then
+if [ ! -e ${STAMPS}/libstm32-${LIBSTM32}.build ]; then
unpack libstm32-${LIBSTM32}
cd libstm32-${LIBSTM32}
log "Building libstm32-${LIBSTM32}"
install libstm32-${LIBSTM32} arch_prefix=${TARGET} prefix=${PREFIX} install
cd ..
log "Cleaning up libstm32-${LIBSTM32}"
- touch .libstm32-${LIBSTM32}.build
+ touch ${STAMPS}/libstm32-${LIBSTM32}.build
rm -rf libstm32-${LIBSTM32}
fi
-if [ ! -e .libstm32usb-${LIBSTM32USB}.build ]; then
+if [ ! -e ${STAMPS}/libstm32usb-${LIBSTM32USB}.build ]; then
unpack libstm32usb-${LIBSTM32USB}
cd libstm32usb-${LIBSTM32USB}
log "Building libstm32usb-${LIBSTM32USB}"
install libstm32usb-${LIBSTM32USB} arch_prefix=${TARGET} prefix=${PREFIX} install
cd ..
log "Cleaning up libstm32usb-${LIBSTM32USB}"
- touch .libstm32usb-${LIBSTM32USB}.build
+ touch ${STAMPS}/libstm32usb-${LIBSTM32USB}.build
rm -rf libstm32usb-${LIBSTM32USB}
fi
fi
if [ $LIBOPENSTM32_EN != 0 ]; then
+if [ ! -e ${STAMPS}/libopenstm32-${LIBOPENSTM32}.build ]; then
unpack libopenstm32-${LIBOPENSTM32}
cd libopenstm32-${LIBOPENSTM32}
log "Building libopenstm32-${LIBOPENSTM32}"
install libopenstm32-${LIBOPENSTM32} PREFIX=${TARGET} DESTDIR=${PREFIX} install
cd ..
log "Cleaning up libopenstm32-${LIBOPENSTM32}"
- touch .libopenstm32-${LIBOPENSTM32}.build
+ touch ${STAMPS}/libopenstm32-${LIBOPENSTM32}.build
rm -rf libopenstm32-${LIBOPENSTM32}
fi
+fi