From 5bac91a34bc24e79b3fdb84315a08d54b628132a Mon Sep 17 00:00:00 2001 From: Elly Jones Date: Wed, 2 Nov 2011 18:58:21 -0400 Subject: [PATCH 1/2] configure: add support for --prefix= Signed-off-by: Elly Jones --- configure | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/configure b/configure index 34861581283f3..8b568eabb3408 100755 --- a/configure +++ b/configure @@ -77,6 +77,32 @@ probe_need() { fi } +valopt() { + local OP=$1 + local DEFAULT=$2 + shift + shift + local DOC="$*" + if [ $HELP -eq 0 ] + then + local UOP=$(echo $OP | tr 'a-z-' 'A-Z_') + local V="CFG_${UOP}" + eval $V="$DEFAULT" + for arg in $CFG_CONFIGURE_ARGS + do + if echo "$arg" | grep -q -- "--$OP=" + then + val=$(echo "$arg" | cut -f2 -d=) + eval $V=$val + fi + done + putvar $V + else + local OPDEF="${OP}=[${DEFAULT}]" + printf " --%-30s %s\n" "$OPDEF" "$DOC" + fi +} + opt() { local OP=$1 local DEFAULT=$2 @@ -219,7 +245,7 @@ opt valgrind 1 "run tests with valgrind" opt docs 1 "build documentation" opt optimize 1 "build optimized rust code" opt mingw-cross 0 "cross-compile for win32 using mingw" - +valopt prefix "/usr/local" "set installation prefix" if [ $HELP -eq 1 ] then From 4efdf560148740b0da41718acc5c01eee74adf0d Mon Sep 17 00:00:00 2001 From: Elly Jones Date: Wed, 2 Nov 2011 19:03:34 -0400 Subject: [PATCH 2/2] configure: add --llvm-root Signed-off-by: Elly Jones --- configure | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/configure b/configure index 8b568eabb3408..9919aa1d75858 100755 --- a/configure +++ b/configure @@ -85,9 +85,9 @@ valopt() { local DOC="$*" if [ $HELP -eq 0 ] then - local UOP=$(echo $OP | tr 'a-z-' 'A-Z_') - local V="CFG_${UOP}" - eval $V="$DEFAULT" + local UOP=$(echo $OP | tr 'a-z-' 'A-Z_') + local V="CFG_${UOP}" + eval $V="$DEFAULT" for arg in $CFG_CONFIGURE_ARGS do if echo "$arg" | grep -q -- "--$OP=" @@ -98,8 +98,12 @@ valopt() { done putvar $V else - local OPDEF="${OP}=[${DEFAULT}]" - printf " --%-30s %s\n" "$OPDEF" "$DOC" + if [ -z "$DEFAULT" ] + then + DEFAULT="" + fi + OP="${OP}=[${DEFAULT}]" + printf " --%-30s %s\n" "$OP" "$DOC" fi } @@ -246,14 +250,13 @@ opt docs 1 "build documentation" opt optimize 1 "build optimized rust code" opt mingw-cross 0 "cross-compile for win32 using mingw" valopt prefix "/usr/local" "set installation prefix" +valopt llvm-root "" "set llvm root" if [ $HELP -eq 1 ] then echo "" echo "Useful environment variables:" echo "" - printf " %-32s %s\n" "CFG_LLVM_ROOT" "The host LLVM install" - printf " %-32s %s\n" "CFG_PREFIX" "The installation prefix" printf " %-32s %s\n" "CFG_ONLY_GCC" "Prefer gcc to clang for building the runtime" printf " %-32s %s\n" "CFG_TARGET_TRIPLES" "LLVM target triples" echo ""