X-Git-Url: http://git.barrelfish.org/?p=barrelfish;a=blobdiff_plain;f=hake%2Fhake.sh;h=3ce5497b7efb037bbbd58fe37cafee8844fe7ebf;hp=36ace55733399b9f40eb47c92f3ce7f894c22bfd;hb=8c286e59ab0913c0827954210ae6daab52c11bf0;hpb=808501ea0229f7e4d515b60a5db388655212ffd1 diff --git a/hake/hake.sh b/hake/hake.sh index 36ace55..3ce5497 100755 --- a/hake/hake.sh +++ b/hake/hake.sh @@ -11,6 +11,8 @@ DFLTARCHS="\"x86_64\"" RUN_HAKE="Yes" +TOOLCHAIN="ubuntu" +HAKEDIR=$(dirname $0) usage() { echo "Usage: $0 " @@ -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 <