Toolchain selection when bootstrapping builds
authorDavid Cock <david.cock@inf.ethz.ch>
Wed, 12 Aug 2015 08:07:03 +0000 (10:07 +0200)
committerDavid Cock <david.cock@inf.ethz.ch>
Wed, 12 Aug 2015 08:07:03 +0000 (10:07 +0200)
Includes build definitions for a variety of ARM tools, both from
gcc-arm-embedded, and linaro.

Signed-off-by: David Cock <david.cock@inf.ethz.ch>

hake/Config.hs.arm-gcc-4.9-2014q4 [copied from hake/Config.hs.template with 95% similarity]
hake/Config.hs.arm-gcc-4.9-2015q1 [copied from hake/Config.hs.template with 95% similarity]
hake/Config.hs.arm-gcc-4.9-2015q2 [copied from hake/Config.hs.template with 95% similarity]
hake/Config.hs.linaro-gcc-4.8-2015.06 [copied from hake/Config.hs.template with 95% similarity]
hake/Config.hs.linaro-gcc-4.9-2014.11 [copied from hake/Config.hs.template with 95% similarity]
hake/Config.hs.linaro-gcc-4.9-2015.02 [copied from hake/Config.hs.template with 95% similarity]
hake/Config.hs.linaro-gcc-4.9-2015.05 [copied from hake/Config.hs.template with 95% similarity]
hake/Config.hs.ubuntu [moved from hake/Config.hs.template with 96% similarity]
hake/hake.sh

similarity index 95%
copy from hake/Config.hs.template
copy to hake/Config.hs.arm-gcc-4.9-2014q4
index 44dc726..045bcbe 100644 (file)
@@ -22,12 +22,16 @@ import Data.List
 --
 -- Toolchain definitions.  By default, these rely on $PATH 
 --
-arm_cc       = "arm-linux-gnueabi-gcc"
-arm_objcopy  = "arm-linux-gnueabi-objcopy"
-arm_objdump  = "arm-linux-gnueabi-objdump"
-arm_ar       = "arm-linux-gnueabi-ar"
-arm_ranlib   = "arm-linux-gnueabi-ranlib"
-arm_cxx      = "arm-linux-gnueabi-g++"
+arm_gcc_path = "/home/netos/tools/gcc-arm-embedded/" ++
+               "gcc-arm-none-eabi-4_9-2014q4" ++
+               "/bin/"
+arm_gcc_prefix = "arm-none-eabi-"
+arm_cc       = arm_gcc_path ++ arm_gcc_prefix ++ "gcc"
+arm_objcopy  = arm_gcc_path ++ arm_gcc_prefix ++ "objcopy"
+arm_objdump  = arm_gcc_path ++ arm_gcc_prefix ++ "objdump"
+arm_ar       = arm_gcc_path ++ arm_gcc_prefix ++ "ar"
+arm_ranlib   = arm_gcc_path ++ arm_gcc_prefix ++ "ranlib"
+arm_cxx      = arm_gcc_path ++ arm_gcc_prefix ++ "g++"
 
 x86_cc       = "gcc"
 x86_cxx      = "g++"
similarity index 95%
copy from hake/Config.hs.template
copy to hake/Config.hs.arm-gcc-4.9-2015q1
index 44dc726..6aa7ad5 100644 (file)
@@ -22,12 +22,16 @@ import Data.List
 --
 -- Toolchain definitions.  By default, these rely on $PATH 
 --
-arm_cc       = "arm-linux-gnueabi-gcc"
-arm_objcopy  = "arm-linux-gnueabi-objcopy"
-arm_objdump  = "arm-linux-gnueabi-objdump"
-arm_ar       = "arm-linux-gnueabi-ar"
-arm_ranlib   = "arm-linux-gnueabi-ranlib"
-arm_cxx      = "arm-linux-gnueabi-g++"
+arm_gcc_path = "/home/netos/tools/gcc-arm-embedded/" ++
+               "gcc-arm-none-eabi-4_9-2015q1" ++
+               "/bin/"
+arm_gcc_prefix = "arm-none-eabi-"
+arm_cc       = arm_gcc_path ++ arm_gcc_prefix ++ "gcc"
+arm_objcopy  = arm_gcc_path ++ arm_gcc_prefix ++ "objcopy"
+arm_objdump  = arm_gcc_path ++ arm_gcc_prefix ++ "objdump"
+arm_ar       = arm_gcc_path ++ arm_gcc_prefix ++ "ar"
+arm_ranlib   = arm_gcc_path ++ arm_gcc_prefix ++ "ranlib"
+arm_cxx      = arm_gcc_path ++ arm_gcc_prefix ++ "g++"
 
 x86_cc       = "gcc"
 x86_cxx      = "g++"
similarity index 95%
copy from hake/Config.hs.template
copy to hake/Config.hs.arm-gcc-4.9-2015q2
index 44dc726..093f5b5 100644 (file)
@@ -22,12 +22,16 @@ import Data.List
 --
 -- Toolchain definitions.  By default, these rely on $PATH 
 --
-arm_cc       = "arm-linux-gnueabi-gcc"
-arm_objcopy  = "arm-linux-gnueabi-objcopy"
-arm_objdump  = "arm-linux-gnueabi-objdump"
-arm_ar       = "arm-linux-gnueabi-ar"
-arm_ranlib   = "arm-linux-gnueabi-ranlib"
-arm_cxx      = "arm-linux-gnueabi-g++"
+arm_gcc_path = "/home/netos/tools/gcc-arm-embedded/" ++
+               "gcc-arm-none-eabi-4_9-2015q2" ++
+               "/bin/"
+arm_gcc_prefix = "arm-none-eabi-"
+arm_cc       = arm_gcc_path ++ arm_gcc_prefix ++ "gcc"
+arm_objcopy  = arm_gcc_path ++ arm_gcc_prefix ++ "objcopy"
+arm_objdump  = arm_gcc_path ++ arm_gcc_prefix ++ "objdump"
+arm_ar       = arm_gcc_path ++ arm_gcc_prefix ++ "ar"
+arm_ranlib   = arm_gcc_path ++ arm_gcc_prefix ++ "ranlib"
+arm_cxx      = arm_gcc_path ++ arm_gcc_prefix ++ "g++"
 
 x86_cc       = "gcc"
 x86_cxx      = "g++"
similarity index 95%
copy from hake/Config.hs.template
copy to hake/Config.hs.linaro-gcc-4.8-2015.06
index 44dc726..a37e586 100644 (file)
@@ -22,12 +22,16 @@ import Data.List
 --
 -- Toolchain definitions.  By default, these rely on $PATH 
 --
-arm_cc       = "arm-linux-gnueabi-gcc"
-arm_objcopy  = "arm-linux-gnueabi-objcopy"
-arm_objdump  = "arm-linux-gnueabi-objdump"
-arm_ar       = "arm-linux-gnueabi-ar"
-arm_ranlib   = "arm-linux-gnueabi-ranlib"
-arm_cxx      = "arm-linux-gnueabi-g++"
+arm_gcc_path = "/home/netos/tools/linaro/" ++
+               "gcc-linaro-4.8-2015.06-x86_64_arm-eabi" ++
+               "/bin/"
+arm_gcc_prefix = "arm-eabi-"
+arm_cc       = arm_gcc_path ++ arm_gcc_prefix ++ "gcc"
+arm_objcopy  = arm_gcc_path ++ arm_gcc_prefix ++ "objcopy"
+arm_objdump  = arm_gcc_path ++ arm_gcc_prefix ++ "objdump"
+arm_ar       = arm_gcc_path ++ arm_gcc_prefix ++ "ar"
+arm_ranlib   = arm_gcc_path ++ arm_gcc_prefix ++ "ranlib"
+arm_cxx      = arm_gcc_path ++ arm_gcc_prefix ++ "g++"
 
 x86_cc       = "gcc"
 x86_cxx      = "g++"
similarity index 95%
copy from hake/Config.hs.template
copy to hake/Config.hs.linaro-gcc-4.9-2014.11
index 44dc726..edf6eb2 100644 (file)
@@ -22,12 +22,16 @@ import Data.List
 --
 -- Toolchain definitions.  By default, these rely on $PATH 
 --
-arm_cc       = "arm-linux-gnueabi-gcc"
-arm_objcopy  = "arm-linux-gnueabi-objcopy"
-arm_objdump  = "arm-linux-gnueabi-objdump"
-arm_ar       = "arm-linux-gnueabi-ar"
-arm_ranlib   = "arm-linux-gnueabi-ranlib"
-arm_cxx      = "arm-linux-gnueabi-g++"
+arm_gcc_path = "/home/netos/tools/linaro/" ++
+               "gcc-linaro-4.9-2014.11-x86_64_arm-eabi" ++
+               "/bin/"
+arm_gcc_prefix = "arm-none-eabi-"
+arm_cc       = arm_gcc_path ++ arm_gcc_prefix ++ "gcc"
+arm_objcopy  = arm_gcc_path ++ arm_gcc_prefix ++ "objcopy"
+arm_objdump  = arm_gcc_path ++ arm_gcc_prefix ++ "objdump"
+arm_ar       = arm_gcc_path ++ arm_gcc_prefix ++ "ar"
+arm_ranlib   = arm_gcc_path ++ arm_gcc_prefix ++ "ranlib"
+arm_cxx      = arm_gcc_path ++ arm_gcc_prefix ++ "g++"
 
 x86_cc       = "gcc"
 x86_cxx      = "g++"
similarity index 95%
copy from hake/Config.hs.template
copy to hake/Config.hs.linaro-gcc-4.9-2015.02
index 44dc726..1760ab2 100644 (file)
@@ -22,12 +22,16 @@ import Data.List
 --
 -- Toolchain definitions.  By default, these rely on $PATH 
 --
-arm_cc       = "arm-linux-gnueabi-gcc"
-arm_objcopy  = "arm-linux-gnueabi-objcopy"
-arm_objdump  = "arm-linux-gnueabi-objdump"
-arm_ar       = "arm-linux-gnueabi-ar"
-arm_ranlib   = "arm-linux-gnueabi-ranlib"
-arm_cxx      = "arm-linux-gnueabi-g++"
+arm_gcc_path = "/home/netos/tools/linaro/" ++
+               "gcc-linaro-4.9-2015.02-3-x86_64_arm-eabi" ++
+               "/bin/"
+arm_gcc_prefix = "arm-eabi-"
+arm_cc       = arm_gcc_path ++ arm_gcc_prefix ++ "gcc"
+arm_objcopy  = arm_gcc_path ++ arm_gcc_prefix ++ "objcopy"
+arm_objdump  = arm_gcc_path ++ arm_gcc_prefix ++ "objdump"
+arm_ar       = arm_gcc_path ++ arm_gcc_prefix ++ "ar"
+arm_ranlib   = arm_gcc_path ++ arm_gcc_prefix ++ "ranlib"
+arm_cxx      = arm_gcc_path ++ arm_gcc_prefix ++ "g++"
 
 x86_cc       = "gcc"
 x86_cxx      = "g++"
similarity index 95%
copy from hake/Config.hs.template
copy to hake/Config.hs.linaro-gcc-4.9-2015.05
index 44dc726..d461e74 100644 (file)
@@ -22,12 +22,16 @@ import Data.List
 --
 -- Toolchain definitions.  By default, these rely on $PATH 
 --
-arm_cc       = "arm-linux-gnueabi-gcc"
-arm_objcopy  = "arm-linux-gnueabi-objcopy"
-arm_objdump  = "arm-linux-gnueabi-objdump"
-arm_ar       = "arm-linux-gnueabi-ar"
-arm_ranlib   = "arm-linux-gnueabi-ranlib"
-arm_cxx      = "arm-linux-gnueabi-g++"
+arm_gcc_path = "/home/netos/tools/linaro/" ++
+               "gcc-linaro-4.9-2015.05-x86_64_arm-eabi" ++
+               "/bin/"
+arm_gcc_prefix = "arm-eabi-"
+arm_cc       = arm_gcc_path ++ arm_gcc_prefix ++ "gcc"
+arm_objcopy  = arm_gcc_path ++ arm_gcc_prefix ++ "objcopy"
+arm_objdump  = arm_gcc_path ++ arm_gcc_prefix ++ "objdump"
+arm_ar       = arm_gcc_path ++ arm_gcc_prefix ++ "ar"
+arm_ranlib   = arm_gcc_path ++ arm_gcc_prefix ++ "ranlib"
+arm_cxx      = arm_gcc_path ++ arm_gcc_prefix ++ "g++"
 
 x86_cc       = "gcc"
 x86_cxx      = "g++"
similarity index 96%
rename from hake/Config.hs.template
rename to hake/Config.hs.ubuntu
index 44dc726..218f6d4 100644 (file)
@@ -22,12 +22,14 @@ import Data.List
 --
 -- Toolchain definitions.  By default, these rely on $PATH 
 --
-arm_cc       = "arm-linux-gnueabi-gcc"
-arm_objcopy  = "arm-linux-gnueabi-objcopy"
-arm_objdump  = "arm-linux-gnueabi-objdump"
-arm_ar       = "arm-linux-gnueabi-ar"
-arm_ranlib   = "arm-linux-gnueabi-ranlib"
-arm_cxx      = "arm-linux-gnueabi-g++"
+arm_gcc_path = ""
+arm_gcc_prefix = "arm-linux-gnueabi-"
+arm_cc       = arm_gcc_path ++ arm_gcc_prefix ++ "gcc"
+arm_objcopy  = arm_gcc_path ++ arm_gcc_prefix ++ "objcopy"
+arm_objdump  = arm_gcc_path ++ arm_gcc_prefix ++ "objdump"
+arm_ar       = arm_gcc_path ++ arm_gcc_prefix ++ "ar"
+arm_ranlib   = arm_gcc_path ++ arm_gcc_prefix ++ "ranlib"
+arm_cxx      = arm_gcc_path ++ arm_gcc_prefix ++ "g++"
 
 x86_cc       = "gcc"
 x86_cxx      = "g++"
index 36ace55..04ecc04 100755 (executable)
@@ -11,6 +11,8 @@
 
 DFLTARCHS="\"x86_64\""
 RUN_HAKE="Yes"
+TOOLCHAIN="ubuntu"
+HAKEDIR=$(dirname $0)
 
 usage() { 
     echo "Usage: $0 <options>"
@@ -21,6 +23,8 @@ usage() {
     echo "       $DFLTARCHS"
     echo "   -n|--no-hake: just rebuild hake itself, don't run it (only useful"
     echo "       for debugging hake)"
+    echo "   -t|--toolchain: toolchain to use when bootstrapping a new"
+    echo "       build tree (-t list for available options)."
     echo ""
     echo "  The way you use this script is to create a new directory for your"
     echo "  build tree, cd into it, and run this script with the --source-dir"
@@ -31,6 +35,15 @@ usage() {
     exit 1;
 }
 
+toolchains() {
+    TOOLCHAINS=$(ls ${HAKEDIR}/Config.hs.* | sed s/.*Config\.hs\.//)
+    echo "Available toolchains:"
+    for tc in ${TOOLCHAINS}; do
+        echo "   $tc"
+    done
+    exit 1
+}
+
 #
 # Legacy compatibility to avoid breaking the harness...
 #
@@ -48,25 +61,38 @@ while [ $# -ne 0 ]; do
     case $1 in
        "-a"|"--architecture") 
            if [ -z "$NEWARCHS" ] ; then
-               NEWARCHS="\"$2\""
+                   NEWARCHS="\"$2\""
            else
-               NEWARCHS="$NEWARCHS, \"$2\""
+                   NEWARCHS="$NEWARCHS, \"$2\""
            fi
+        shift 
            ;;
        "-i"|"--install-dir")
            INSTALLDIR="$2"
+        shift 
            ;;
        "-s"|"--source-dir")
            SRCDIR="$2"
+        shift 
            ;;
        "-n"|"--no-hake")
            RUN_HAKE="No"
            ;;
+    "-t"|"--toolchain")
+        TOOLCHAIN="$2"
+        shift
+        if [ "${TOOLCHAIN}" == "list" ]; then
+            toolchains
+        fi
+        if [ ! -f ${HAKEDIR}/Config.hs.${TOOLCHAIN} ]; then
+            echo "Unknown toolchain \"${TOOLCHAIN}\""
+            exit 1
+        fi
+        ;;
        *) 
            usage
            ;;
     esac
-    shift 
     shift
 done
 
@@ -104,7 +130,8 @@ fi
 
 echo "Setting up hake build directory..."
 if [ ! -f hake/Config.hs ]; then
-    cp $SRCDIR/hake/Config.hs.template hake/Config.hs
+    echo "Bootstrapping with toolchain \"${TOOLCHAIN}\""
+    cp $SRCDIR/hake/Config.hs.${TOOLCHAIN} hake/Config.hs
     cat >> hake/Config.hs <<EOF
 
 -- Automatically added by hake.sh. Do NOT copy these definitions to the defaults