]> git.lizzy.rs Git - rust.git/blobdiff - configure
Add support for clang 4.2 (as reported by apple clang) r=graydon
[rust.git] / configure
index 9da652762a741cc802e0bca02ade16078f28387a..9813f0ec6b6f8e56e905b0197ad72f44ee2b1630 100755 (executable)
--- a/configure
+++ b/configure
@@ -114,7 +114,38 @@ probe_need() {
     fi
 }
 
+validate_opt () {
+    for arg in $CFG_CONFIGURE_ARGS
+    do
+        isArgValid=0
+        for option in $BOOL_OPTIONS
+        do
+            if test --disable-$option = $arg
+            then
+                isArgValid=1
+            fi
+            if test --enable-$option = $arg
+            then
+                isArgValid=1
+            fi
+        done
+        for option in $VAL_OPTIONS
+        do
+            if echo "$arg" | grep -q -- "--$option="
+            then
+                isArgValid=1
+            fi
+        done
+        if test $isArgValid -eq 0
+        then
+            err "Option '$arg' is not recognized"
+        fi
+    done
+}
+
 valopt() {
+    VAL_OPTIONS="$VAL_OPTIONS $1"
+
     local OP=$1
     local DEFAULT=$2
     shift
@@ -145,6 +176,8 @@ valopt() {
 }
 
 opt() {
+    BOOL_OPTIONS="$BOOL_OPTIONS $1"
+
     local OP=$1
     local DEFAULT=$2
     shift
@@ -293,6 +326,9 @@ else
     step_msg "processing $CFG_SELF args"
 fi
 
+BOOL_OPTIONS=""
+VAL_OPTIONS=""
+
 opt sharedstd 1 "build libstd as a shared library"
 opt valgrind 0 "run tests with valgrind (memcheck by default)"
 opt helgrind 0 "run tests with helgrind instead of memcheck"
@@ -313,6 +349,10 @@ valopt llvm-root "" "set LLVM root"
 valopt host-triple "${DEFAULT_HOST_TRIPLE}" "LLVM host triple"
 valopt target-triples "${CFG_HOST_TRIPLE}" "LLVM target triples"
 
+# Validate Options
+step_msg "validating $CFG_SELF args"
+validate_opt
+
 if [ $HELP -eq 1 ]
 then
     echo ""
@@ -345,7 +385,6 @@ fi
 probe CFG_CLANG            clang++
 probe CFG_GCC              gcc
 probe CFG_LD               ld
-probe CFG_LLVM_CONFIG      llvm-config
 probe CFG_VALGRIND         valgrind
 probe CFG_PERF             perf
 probe CFG_ISCC             iscc
@@ -432,6 +471,15 @@ then
     fi
 fi
 
+# Force freebsd to build with clang; gcc doesn't like us there
+if [ $CFG_OSTYPE = unknown-freebsd ]
+then
+    step_msg "on FreeBSD, forcing use of clang"
+    CFG_ENABLE_CLANG=1
+    putvar CFG_ENABLE_CLANG
+fi
+
+
 if [ -z "$CFG_ENABLE_CLANG" -a -z "$CFG_GCC" ]
 then
     err "either clang or gcc is required"
@@ -467,7 +515,7 @@ then
                       | cut -d ' ' -f 2)
 
     case $CFG_CLANG_VERSION in
-        (3.0svn | 3.0 | 3.1 | 4.0 | 4.1)
+        (3.0svn | 3.0 | 3.1* | 3.2* | 4.0* | 4.1* | 4.2*)
         step_msg "found ok version of CLANG: $CFG_CLANG_VERSION"
         CFG_C_COMPILER="clang"
         ;;
@@ -529,7 +577,7 @@ for t in $CFG_TARGET_TRIPLES
 do
   make_dir rt/$t
   for i in                                          \
-    isaac bigint sync test arch/i386 arch/x86_64    \
+    isaac linenoise sync test arch/i386 arch/x86_64    \
     libuv libuv/src/ares libuv/src/eio libuv/src/ev
   do
     make_dir rt/$t/$i
@@ -595,7 +643,7 @@ then
     need_ok "git failed"
 
     msg "git: submodule foreach sync"
-    "${CFG_GIT}" submodule --quiet foreach --recursive git submodule sync
+    "${CFG_GIT}" submodule --quiet foreach --recursive 'if test -e .gitmodules; then git submodule sync; fi'
     need_ok "git failed"
 
     msg "git: submodule foreach update"
@@ -668,7 +716,7 @@ do
     then
         msg "configuring LLVM for $t"
 
-        LLVM_TARGETS="--enable-targets=x86,x86_64"
+        LLVM_TARGETS="--enable-targets=x86,x86_64,arm"
         LLVM_BUILD="--build=$t"
         LLVM_HOST="--host=$t"
         LLVM_TARGET="--target=$t"