@@ -1084,6 +1084,65 @@ do
1084
1084
err " musl libc $CFG_MUSL_ROOT /lib/libc.a not found"
1085
1085
fi
1086
1086
;;
1087
+
1088
+ x86_64-* -msvc)
1089
+ # Currently the build system is not configured to build jemalloc
1090
+ # with MSVC, so we omit this optional dependency.
1091
+ step_msg " targeting MSVC, disabling jemalloc"
1092
+ CFG_DISABLE_JEMALLOC=1
1093
+ putvar CFG_DISABLE_JEMALLOC
1094
+
1095
+ # There are some MSYS python builds which will auto-translate
1096
+ # windows-style paths to MSYS-style paths in Python itself.
1097
+ # Unfortunately this breaks LLVM's build system as somewhere along
1098
+ # the line LLVM prints a path into a file from Python and then CMake
1099
+ # later tries to interpret that path. If Python prints a MSYS path
1100
+ # and CMake tries to use it as a Windows path, you're gonna have a
1101
+ # Bad Time.
1102
+ #
1103
+ # Consequently here we try to detect when that happens and print an
1104
+ # error if it does.
1105
+ if $CFG_PYTHON -c ' import sys; print sys.argv[1]' ` pwd` | grep ' ^/'
1106
+ then
1107
+ err " python is silently translating windows paths to MSYS paths \
1108
+ and the build will fail if this python is used.\n\n \
1109
+ Either an official python install must be used or an \
1110
+ alternative python package in MinGW must be used."
1111
+ fi
1112
+
1113
+ # MSVC requires cmake because that's how we're going to build LLVM
1114
+ probe_need CFG_CMAKE cmake
1115
+
1116
+ # Use the REG program to figure out where VS is installed
1117
+ # We need to figure out where cl.exe and link.exe are, so we do some
1118
+ # munging and some probing here. We also look for the default
1119
+ # INCLUDE and LIB variables for MSVC so we can set those in the
1120
+ # build system as well.
1121
+ install=$( reg QUERY \
1122
+ ' HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\12.0' \
1123
+ -v InstallDir)
1124
+ need_ok " couldn't find visual studio install root"
1125
+ CFG_MSVC_ROOT=$( echo " $install " | grep InstallDir | sed ' s/.*REG_SZ[ ]*//' )
1126
+ CFG_MSVC_ROOT=$( dirname " $CFG_MSVC_ROOT " )
1127
+ CFG_MSVC_ROOT=$( dirname " $CFG_MSVC_ROOT " )
1128
+ CFG_MSVC_CL=" ${CFG_MSVC_ROOT} /VC/bin/amd64/cl.exe"
1129
+ CFG_MSVC_LIB=" ${CFG_MSVC_ROOT} /VC/bin/amd64/lib.exe"
1130
+ CFG_MSVC_LINK=" ${CFG_MSVC_ROOT} /VC/bin/amd64/link.exe"
1131
+
1132
+ vcvarsall=" ${CFG_MSVC_ROOT} /VC/vcvarsall.bat"
1133
+ CFG_MSVC_INCLUDE_PATH=$( cmd /c " \" $vcvarsall \" amd64 && cmd /c echo %INCLUDE%" )
1134
+ need_ok " failed to learn about MSVC's INCLUDE"
1135
+ CFG_MSVC_LIB_PATH=$( cmd /c " \" $vcvarsall \" amd64 && cmd /c echo %LIB%" )
1136
+ need_ok " failed to learn about MSVC's LIB"
1137
+
1138
+ putvar CFG_MSVC_ROOT
1139
+ putvar CFG_MSVC_CL
1140
+ putvar CFG_MSVC_LIB
1141
+ putvar CFG_MSVC_LINK
1142
+ putvar CFG_MSVC_INCLUDE_PATH
1143
+ putvar CFG_MSVC_LIB_PATH
1144
+ ;;
1145
+
1087
1146
* )
1088
1147
;;
1089
1148
esac
1125
1184
do
1126
1185
make_dir $t /rt/stage$s
1127
1186
make_dir $t /rt/jemalloc
1187
+ make_dir $t /rt/compiler-rt
1128
1188
for i in \
1129
1189
isaac sync test \
1130
1190
arch/i386 arch/x86_64 arch/arm arch/aarch64 arch/mips arch/powerpc
@@ -1496,11 +1556,6 @@ do
1496
1556
putvar $CFG_LLVM_INST_DIR
1497
1557
done
1498
1558
1499
- # Munge any paths that appear in config.mk back to posix-y
1500
- cp config.tmp config.tmp.bak
1501
- sed -e ' s@ \([a-zA-Z]\):[/\\]@ /\1/@g;' < config.tmp.bak > config.tmp
1502
- rm -f config.tmp.bak
1503
-
1504
1559
msg
1505
1560
copy_if_changed ${CFG_SRC_DIR} Makefile.in ./Makefile
1506
1561
move_if_changed config.tmp config.mk
0 commit comments