diff options
author | Mike Pall <mike> | 2019-12-08 18:52:41 +0100 |
---|---|---|
committer | Mike Pall <mike> | 2019-12-08 18:52:41 +0100 |
commit | c6c6e3b416635a528a711ed1986b054287a7c491 (patch) | |
tree | 729b2904e49fd1a9fc550ca27aed72c6bdf8b903 | |
parent | 3ece3a3e3a448ecc54e317fd5743d1f4c19db28b (diff) | |
download | luajit-c6c6e3b416635a528a711ed1986b054287a7c491.tar.gz luajit-c6c6e3b416635a528a711ed1986b054287a7c491.tar.bz2 luajit-c6c6e3b416635a528a711ed1986b054287a7c491.zip |
Update MSVC build script and docs.
-rw-r--r-- | doc/install.html | 45 | ||||
-rw-r--r-- | src/msvcbuild.bat | 26 |
2 files changed, 20 insertions, 51 deletions
diff --git a/doc/install.html b/doc/install.html index befffa73..58a2a757 100644 --- a/doc/install.html +++ b/doc/install.html | |||
@@ -114,14 +114,14 @@ operating systems, CPUs and compilers: | |||
114 | <td class="compatos">GCC 4.x+<br>GCC 3.4</td> | 114 | <td class="compatos">GCC 4.x+<br>GCC 3.4</td> |
115 | <td class="compatos">GCC 4.x+<br>GCC 3.4</td> | 115 | <td class="compatos">GCC 4.x+<br>GCC 3.4</td> |
116 | <td class="compatos">XCode 5.0+<br>Clang</td> | 116 | <td class="compatos">XCode 5.0+<br>Clang</td> |
117 | <td class="compatos">MSVC, MSVC/EE<br>WinSDK<br>MinGW, Cygwin</td> | 117 | <td class="compatos">MSVC<br>MinGW, Cygwin</td> |
118 | </tr> | 118 | </tr> |
119 | <tr class="even"> | 119 | <tr class="even"> |
120 | <td class="compatcpu">x64 (64 bit)</td> | 120 | <td class="compatcpu">x64 (64 bit)</td> |
121 | <td class="compatos">GCC 4.x+</td> | 121 | <td class="compatos">GCC 4.x+</td> |
122 | <td class="compatos">ORBIS (<a href="#ps4">PS4</a>)</td> | 122 | <td class="compatos">ORBIS (<a href="#ps4">PS4</a>)</td> |
123 | <td class="compatos">XCode 5.0+<br>Clang</td> | 123 | <td class="compatos">XCode 5.0+<br>Clang</td> |
124 | <td class="compatos">MSVC + SDK v7.0<br>WinSDK v7.0</td> | 124 | <td class="compatos">MSVC</td> |
125 | </tr> | 125 | </tr> |
126 | <tr class="odd"> | 126 | <tr class="odd"> |
127 | <td class="compatcpu"><a href="#cross2">ARMv5+<br>ARM9E+</a></td> | 127 | <td class="compatcpu"><a href="#cross2">ARMv5+<br>ARM9E+</a></td> |
@@ -166,7 +166,7 @@ only).</li> | |||
166 | <li><tt>src/Makefile</tt> has settings for <b>compiling</b> LuaJIT | 166 | <li><tt>src/Makefile</tt> has settings for <b>compiling</b> LuaJIT |
167 | under POSIX, MinGW or Cygwin.</li> | 167 | under POSIX, MinGW or Cygwin.</li> |
168 | <li><tt>src/msvcbuild.bat</tt> has settings for compiling LuaJIT with | 168 | <li><tt>src/msvcbuild.bat</tt> has settings for compiling LuaJIT with |
169 | MSVC or WinSDK.</li> | 169 | MSVC (Visual Studio).</li> |
170 | </ul> | 170 | </ul> |
171 | <p> | 171 | <p> |
172 | Please read the instructions given in these files, before changing | 172 | Please read the instructions given in these files, before changing |
@@ -243,17 +243,7 @@ Either install one of the open source SDKs | |||
243 | (<a href="http://mingw.org/"><span class="ext">»</span> MinGW</a> or | 243 | (<a href="http://mingw.org/"><span class="ext">»</span> MinGW</a> or |
244 | <a href="http://www.cygwin.com/"><span class="ext">»</span> Cygwin</a>), which come with a modified | 244 | <a href="http://www.cygwin.com/"><span class="ext">»</span> Cygwin</a>), which come with a modified |
245 | GCC plus the required development headers. | 245 | GCC plus the required development headers. |
246 | </p> | 246 | Or install Microsoft's Visual Studio (MSVC). |
247 | <p> | ||
248 | Or install Microsoft's Visual C++ (MSVC). The freely downloadable | ||
249 | <a href="http://www.microsoft.com/Express/VC/"><span class="ext">»</span> Express Edition</a> | ||
250 | works just fine, but only contains an x86 compiler. | ||
251 | </p> | ||
252 | <p> | ||
253 | The freely downloadable | ||
254 | <a href="http://msdn.microsoft.com/en-us/windowsserver/bb980924.aspx"><span class="ext">»</span> Windows SDK</a> | ||
255 | only comes with command line tools, but this is all you need to build LuaJIT. | ||
256 | It contains x86 and x64 compilers. | ||
257 | </p> | 247 | </p> |
258 | <p> | 248 | <p> |
259 | Next, download the source package and unpack it using an archive manager | 249 | Next, download the source package and unpack it using an archive manager |
@@ -261,7 +251,7 @@ Next, download the source package and unpack it using an archive manager | |||
261 | </p> | 251 | </p> |
262 | <h3>Building with MSVC</h3> | 252 | <h3>Building with MSVC</h3> |
263 | <p> | 253 | <p> |
264 | Open a "Visual Studio .NET Command Prompt", <tt>cd</tt> to the | 254 | Open a "Visual Studio Command Prompt" (either x86 or x64), <tt>cd</tt> to the |
265 | directory where you've unpacked the sources and run these commands: | 255 | directory where you've unpacked the sources and run these commands: |
266 | </p> | 256 | </p> |
267 | <pre class="code"> | 257 | <pre class="code"> |
@@ -269,30 +259,7 @@ cd src | |||
269 | msvcbuild | 259 | msvcbuild |
270 | </pre> | 260 | </pre> |
271 | <p> | 261 | <p> |
272 | Then follow the installation instructions below. | 262 | Check the <tt>msvcbuild.bat</tt> file for more options. |
273 | </p> | ||
274 | <h3>Building with the Windows SDK</h3> | ||
275 | <p> | ||
276 | Open a "Windows SDK Command Shell" and select the x86 compiler: | ||
277 | </p> | ||
278 | <pre class="code"> | ||
279 | setenv /release /x86 | ||
280 | </pre> | ||
281 | <p> | ||
282 | Or select the x64 compiler: | ||
283 | </p> | ||
284 | <pre class="code"> | ||
285 | setenv /release /x64 | ||
286 | </pre> | ||
287 | <p> | ||
288 | Then <tt>cd</tt> to the directory where you've unpacked the sources | ||
289 | and run these commands: | ||
290 | </p> | ||
291 | <pre class="code"> | ||
292 | cd src | ||
293 | msvcbuild | ||
294 | </pre> | ||
295 | <p> | ||
296 | Then follow the installation instructions below. | 263 | Then follow the installation instructions below. |
297 | </p> | 264 | </p> |
298 | <h3>Building with MinGW or Cygwin</h3> | 265 | <h3>Building with MinGW or Cygwin</h3> |
diff --git a/src/msvcbuild.bat b/src/msvcbuild.bat index bd0c4c5f..9db76275 100644 --- a/src/msvcbuild.bat +++ b/src/msvcbuild.bat | |||
@@ -1,19 +1,19 @@ | |||
1 | @rem Script to build LuaJIT with MSVC. | 1 | @rem Script to build LuaJIT with MSVC. |
2 | @rem Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h | 2 | @rem Copyright (C) 2005-2019 Mike Pall. See Copyright Notice in luajit.h |
3 | @rem | 3 | @rem |
4 | @rem Either open a "Visual Studio .NET Command Prompt" | 4 | @rem Open a "Visual Studio Command Prompt" (either x86 or x64). |
5 | @rem (Note that the Express Edition does not contain an x64 compiler) | 5 | @rem Then cd to this directory and run this script. Use the following |
6 | @rem -or- | 6 | @rem options (in order), if needed. The default is a dynamic release build. |
7 | @rem Open a "Windows SDK Command Shell" and set the compiler environment: | ||
8 | @rem setenv /release /x86 | ||
9 | @rem -or- | ||
10 | @rem setenv /release /x64 | ||
11 | @rem | 7 | @rem |
12 | @rem Then cd to this directory and run this script. | 8 | @rem debug emit debug symbols |
9 | @rem amalg amalgamated build | ||
10 | @rem static static linkage | ||
13 | 11 | ||
14 | @if not defined INCLUDE goto :FAIL | 12 | @if not defined INCLUDE goto :FAIL |
15 | 13 | ||
16 | @setlocal | 14 | @setlocal |
15 | @rem Add more debug flags here, e.g. DEBUGCFLAGS=/DLUA_USE_APICHECK | ||
16 | @set DEBUGCFLAGS= | ||
17 | @set LJCOMPILE=cl /nologo /c /O2 /W3 /D_CRT_SECURE_NO_DEPRECATE /D_CRT_STDIO_INLINE=__declspec(dllexport)__inline | 17 | @set LJCOMPILE=cl /nologo /c /O2 /W3 /D_CRT_SECURE_NO_DEPRECATE /D_CRT_STDIO_INLINE=__declspec(dllexport)__inline |
18 | @set LJLINK=link /nologo | 18 | @set LJLINK=link /nologo |
19 | @set LJMT=mt /nologo | 19 | @set LJMT=mt /nologo |
@@ -22,6 +22,7 @@ | |||
22 | @set DASM=%DASMDIR%\dynasm.lua | 22 | @set DASM=%DASMDIR%\dynasm.lua |
23 | @set LJDLLNAME=lua51.dll | 23 | @set LJDLLNAME=lua51.dll |
24 | @set LJLIBNAME=lua51.lib | 24 | @set LJLIBNAME=lua51.lib |
25 | @set BUILDTYPE=release | ||
25 | @set ALL_LIB=lib_base.c lib_math.c lib_bit.c lib_string.c lib_table.c lib_io.c lib_os.c lib_package.c lib_debug.c lib_jit.c lib_ffi.c | 26 | @set ALL_LIB=lib_base.c lib_math.c lib_bit.c lib_string.c lib_table.c lib_io.c lib_os.c lib_package.c lib_debug.c lib_jit.c lib_ffi.c |
26 | 27 | ||
27 | %LJCOMPILE% host\minilua.c | 28 | %LJCOMPILE% host\minilua.c |
@@ -65,9 +66,10 @@ buildvm -m folddef -o lj_folddef.h lj_opt_fold.c | |||
65 | 66 | ||
66 | @if "%1" neq "debug" goto :NODEBUG | 67 | @if "%1" neq "debug" goto :NODEBUG |
67 | @shift | 68 | @shift |
68 | @set LJCOMPILE=%LJCOMPILE% /Zi | 69 | @set BUILDTYPE=debug |
69 | @set LJLINK=%LJLINK% /debug | 70 | @set LJCOMPILE=%LJCOMPILE% /Zi %DEBUGCFLAGS% |
70 | :NODEBUG | 71 | :NODEBUG |
72 | @set LJLINK=%LJLINK% /%BUILDTYPE% | ||
71 | @if "%1"=="amalg" goto :AMALGDLL | 73 | @if "%1"=="amalg" goto :AMALGDLL |
72 | @if "%1"=="static" goto :STATIC | 74 | @if "%1"=="static" goto :STATIC |
73 | %LJCOMPILE% /MD /DLUA_BUILD_AS_DLL lj_*.c lib_*.c | 75 | %LJCOMPILE% /MD /DLUA_BUILD_AS_DLL lj_*.c lib_*.c |
@@ -111,5 +113,5 @@ if exist luajit.exe.manifest^ | |||
111 | @echo ******************************************************* | 113 | @echo ******************************************************* |
112 | @goto :END | 114 | @goto :END |
113 | :FAIL | 115 | :FAIL |
114 | @echo You must open a "Visual Studio .NET Command Prompt" to run this script | 116 | @echo You must open a "Visual Studio Command Prompt" to run this script |
115 | :END | 117 | :END |