Added support for toolchain building on Mac OS X.
authorPiotr Esden-Tempski <piotr@esden.net>
Tue, 19 May 2009 22:32:13 +0000 (00:32 +0200)
committerPiotr Esden-Tempski <piotr@esden.net>
Tue, 19 May 2009 22:39:29 +0000 (00:39 +0200)
README
summon-arm-toolchain

diff --git a/README b/README
index 640bdcc..f50c1c5 100644 (file)
--- a/README
+++ b/README
@@ -1,10 +1,24 @@
+REMEMBER!
+---------
+THE RESULTING TOOLCHAIN IS FOR BARE BONE ARM PROCESSOR SOFTWARE. NOT FOR USE
+WITH GLIBC OR THE LINUX KERNEL. DO NOT EVEN BOTHER TO ASK FOR THAT!
+
 To compile the arm toolchain for barebone arm devices:
+------------------------------------------------------
 * Edit the shellscript header to match your environment
 * Run it
 * Profit
 
-Currently tested and know to work target platforms:
+Currently tested and known to work target platforms:
+----------------------------------------------------
 * STM32F10x (Olimex STM32-H103 eval board)
 
-THE RESULTING TOOLCHAIN IS FOR BARE BONE ARM PROCESSOR SOFTWARE, NOT FOR USE
-WITH GLIBC OR THE LINUX KERNEL SO DO NOT EVEN BOTHER TO ASK FOR THAT!
+Currently tested and known to work host platforms:
+--------------------------------------------------
+* Linux 64bit (Debian Unstable)
+* Mac OS X Leopard with MacPorts
+
+Notes for Mac OS X users:
+-------------------------
+You need to install gmp, mpfr and libiconv packages using MacPorts, DarwinPorts
+or fink. GCC-4.4.0 requires them.
index 413a1a1..ba688e5 100755 (executable)
@@ -1,10 +1,11 @@
-#!/bin/sh
+#!/bin/bash
 # Written by Uwe Hermann <uwe@hermann-uwe.de>, released as public domain.
 # Modified by Piot Esden-Tempski <piotr@esden.net>, released as public domain.
 
 TARGET=arm-none-eabi                    # Or: TARGET=arm-none-eabi
-PREFIX=${HOME}/arm-none-eabi # Install location of your final toolchain
-PARALLEL="-j 5"                         # Or: PARALLEL=""
+PREFIX=${HOME}/arm-none-eabi             # Install location of your final toolchain
+PARALLEL=""                             # Or: PARALLEL="-j 5" for 4 CPU's
+DARWIN_OPT_PATH=/opt/local               # Path in which MacPorts or Fink is installed
 
 BINUTILS=binutils-2.19.1
 GCC=gcc-4.4.0
@@ -16,6 +17,23 @@ LIBSTM32USB=v3.0.1-1
 
 export PATH="${PREFIX}/bin:${PATH}"
 
+case "$(uname)" in
+       Linux)
+       echo "Found Linux OS."
+       GCCFLAGS=
+       ;;
+       Darwin)
+       echo "Found Darwin OS."
+       GCCFLAGS="--with-gmp=${DARWIN_OPT_PATH} \
+                 --with-mpfr=${DARWIN_OPT_PATH} \
+                 -with-libiconv-prefix=${DARWIN_OPT_PATH}"
+       ;;
+       *)
+       echo "Found Unknown OS. Aborting!"
+       exit 1
+       ;;
+esac
+
 if [ ! -e sources ]; then
     mkdir sources
 fi
@@ -128,7 +146,8 @@ if [ ! -e .${GCC}-boot.build ]; then
                       --disable-shared \
                       --with-gnu-as \
                       --with-gnu-ld \
-                      --disable-nls || exit
+                      --disable-nls \
+                     ${GCCFLAGS} || exit
     echo "******************************************************************"
     echo "* Building ${GCC}-boot"
     echo "******************************************************************"
@@ -197,7 +216,8 @@ if [ ! -e .${GCC}.build ]; then
                       --disable-shared \
                       --with-gnu-as \
                       --with-gnu-ld \
-                     --disable-nls || exit
+                     --disable-nls \
+                     ${GCCFLAGS} || exit
     echo "******************************************************************"
     echo "* Building ${GCC}"
     echo "******************************************************************"