]> git.lizzy.rs Git - rust.git/blobdiff - configure
doc: fix Windows test failure
[rust.git] / configure
index b57a2f0fbefe480c6d16bc107f068ad174e35de4..4f3375b866817556c418a12632b35e6bf9af6611 100755 (executable)
--- a/configure
+++ b/configure
@@ -106,8 +106,8 @@ probe() {
         T=$(command -v $P 2>&1)
         if [ $? -eq 0 ]
         then
-            VER0=$($P --version 2>/dev/null | head -1 \
-                |  sed -e 's/[^0-9]*\([vV]\?[0-9.]\+[^ ]*\).*/\1/' )
+            VER0=$($P --version 2>/dev/null \
+                |  grep -o '[vV]\?[0-9][0-9.][a-z0-9.-]*' | head -1 )
             if [ $? -eq 0 -a "x${VER0}" != "x" ]
             then
               VER="($VER0)"
@@ -712,6 +712,20 @@ else
     probe_need CFG_GIT     git
 fi
 
+# Use `md5sum` on GNU platforms, or `md5 -q` on BSD
+probe CFG_MD5              md5
+probe CFG_MD5SUM           md5sum
+if [ -n "$CFG_MD5" ]
+then
+    CFG_HASH_COMMAND="$CFG_MD5 -q | head -c 8"
+elif [ -n "$CFG_MD5SUM" ]
+then
+    CFG_HASH_COMMAND="$CFG_MD5SUM | head -c 8"
+else
+    err 'could not find one of: md5 md5sum'
+fi
+putvar CFG_HASH_COMMAND
+
 probe CFG_CLANG            clang++
 probe CFG_CCACHE           ccache
 probe CFG_GCC              gcc
@@ -1348,7 +1362,39 @@ do
         done
     fi
 
-    if [ ${do_reconfigure} -ne 0 ]
+    use_cmake=0
+    case "$t" in
+        (*-msvc)
+        use_cmake=1
+        ;;
+    esac
+
+    if [ ${do_reconfigure} -ne 0 ] && [ ${use_cmake} -ne 0 ]
+    then
+        msg "configuring LLVM for $t with cmake"
+
+        CMAKE_ARGS="-DLLVM_INCLUDE_TESTS=OFF"
+        if [ ! -z "$CFG_DISABLE_OPTIMIZE_LLVM" ]; then
+            CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_BUILD_TYPE=Debug"
+        else
+            CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_BUILD_TYPE=Release"
+        fi
+        if [ -z "$CFG_ENABLE_LLVM_ASSERTIONS" ]
+        then
+            CMAKE_ARGS="$CMAKE_ARGS -DLLVM_ENABLE_ASSERTIONS=OFF"
+        else
+            CMAKE_ARGS="$CMAKE_ARGS -DLLVM_ENABLE_ASSERTIONS=ON"
+        fi
+
+        msg "configuring LLVM with:"
+        msg "$CMAKE_ARGS"
+        (cd $LLVM_BUILD_DIR && "$CFG_CMAKE" $CFG_LLVM_SRC_DIR \
+                                            -G "Visual Studio 12 2013 Win64" \
+                                            $CMAKE_ARGS)
+        need_ok "LLVM cmake configure failed"
+    fi
+
+    if [ ${do_reconfigure} -ne 0 ] && [ ${use_cmake} -eq 0 ]
     then
         # LLVM's configure doesn't recognize the new Windows triples yet
         gnu_t=$(to_gnu_triple $t)