X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=configure;h=4fb6cb53bd855c8ddb4d353bd7e38a5863e4aae5;hb=9b5b0cd9b98c3540301ddacdd7882061db31a8ae;hp=60d366100f8c207b38132e07cbebac40dcb9bdb4;hpb=6d43fef3aaf64b2e7df14ca676a3a39b723ed7f3;p=rust.git diff --git a/configure b/configure index 60d366100f8..4fb6cb53bd8 100755 --- a/configure +++ b/configure @@ -632,18 +632,9 @@ putvar CFG_BUILD # Yes, this creates a duplicate entry, but the last one wins. CFG_HOST=$(to_llvm_triple $CFG_HOST) CFG_TARGET=$(to_llvm_triple $CFG_TARGET) -# On windows we just store the libraries in the bin directory because -# there's no rpath. This is where the build system itself puts libraries; -# --libdir is used to configure the installation directory. -# FIXME: This needs to parameterized over target triples. Do it in platform.mk -if [ "$CFG_OSTYPE" = "pc-windows-gnu" ] || [ "$CFG_OSTYPE" = "pc-windows-msvc" ] -then - CFG_LIBDIR_RELATIVE=bin -else - CFG_LIBDIR_RELATIVE=lib -fi - -valopt libdir "${CFG_PREFIX}/${CFG_LIBDIR_RELATIVE}" "install libraries (do not set it on windows platform)" +# On Windows this determines root of the subtree for target libraries. +# Host runtime libs always go to 'bin'. +valopt libdir "${CFG_PREFIX}/lib" "install libraries" case "$CFG_LIBDIR" in "$CFG_PREFIX"/*) CAT_INC=2;; @@ -654,11 +645,6 @@ esac CFG_LIBDIR_RELATIVE=`echo ${CFG_LIBDIR} | cut -c$((${#CFG_PREFIX}+${CAT_INC}))-` -if ( [ "$CFG_OSTYPE" = "pc-windows-gnu" ] || [ "$CFG_OSTYPE" = "pc-windows-msvc" ] ) \ - && [ "$CFG_LIBDIR_RELATIVE" != "bin" ]; then - err "libdir on windows should be set to 'bin'" -fi - if [ $HELP -eq 1 ] then echo @@ -1498,25 +1484,9 @@ do done fi - if [ ${do_reconfigure} -ne 0 ] && [ ${is_msvc} -ne 0 ] + # We need the generator later on for compiler-rt even if LLVM's not built + if [ ${is_msvc} -ne 0 ] then - msg "configuring LLVM for $t with cmake" - - CMAKE_ARGS="-DLLVM_INCLUDE_TESTS=OFF" - if [ -n "$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" case "$CFG_MSVC_ROOT" in *14.0*) generator="Visual Studio 14 2015" @@ -1538,8 +1508,32 @@ do err "can only build LLVM for x86 platforms" ;; esac + CFG_CMAKE_GENERATOR=$generator + putvar CFG_CMAKE_GENERATOR + fi + + if [ ${do_reconfigure} -ne 0 ] && [ ${is_msvc} -ne 0 ] + then + msg "configuring LLVM for $t with cmake" + + CMAKE_ARGS="-DLLVM_INCLUDE_TESTS=OFF" + if [ -n "$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 "$generator" \ + -G "$CFG_CMAKE_GENERATOR" \ $CMAKE_ARGS) need_ok "LLVM cmake configure failed" fi