diff options
| author | Mike Pall <mike> | 2019-12-08 18:58:50 +0100 |
|---|---|---|
| committer | Mike Pall <mike> | 2019-12-08 18:58:50 +0100 |
| commit | 6e228a9cb68887153462365b70d54b2fff871050 (patch) | |
| tree | 3f17b8f2fa6a41383345f84b99da31408b67e95e | |
| parent | e45b04f49953b4e0cc2b3cec4dbe4c2c0a2656f3 (diff) | |
| parent | c6c6e3b416635a528a711ed1986b054287a7c491 (diff) | |
| download | luajit-6e228a9cb68887153462365b70d54b2fff871050.tar.gz luajit-6e228a9cb68887153462365b70d54b2fff871050.tar.bz2 luajit-6e228a9cb68887153462365b70d54b2fff871050.zip | |
Merge branch 'master' into v2.1
| -rw-r--r-- | doc/install.html | 45 | ||||
| -rw-r--r-- | src/lj_def.h | 4 | ||||
| -rw-r--r-- | src/msvcbuild.bat | 27 |
3 files changed, 23 insertions, 53 deletions
diff --git a/doc/install.html b/doc/install.html index 8085573b..700d6edf 100644 --- a/doc/install.html +++ b/doc/install.html | |||
| @@ -116,14 +116,14 @@ operating systems, CPUs and compilers: | |||
| 116 | <td class="compatos">GCC 4.2+</td> | 116 | <td class="compatos">GCC 4.2+</td> |
| 117 | <td class="compatos">GCC 4.2+</td> | 117 | <td class="compatos">GCC 4.2+</td> |
| 118 | <td class="compatos">XCode 5.0+<br>Clang</td> | 118 | <td class="compatos">XCode 5.0+<br>Clang</td> |
| 119 | <td class="compatos">MSVC, MSVC/EE<br>WinSDK<br>MinGW, Cygwin</td> | 119 | <td class="compatos">MSVC<br>MinGW, Cygwin</td> |
| 120 | </tr> | 120 | </tr> |
| 121 | <tr class="even"> | 121 | <tr class="even"> |
| 122 | <td class="compatcpu">x64 (64 bit)</td> | 122 | <td class="compatcpu">x64 (64 bit)</td> |
| 123 | <td class="compatos">GCC 4.2+</td> | 123 | <td class="compatos">GCC 4.2+</td> |
| 124 | <td class="compatos">GCC 4.2+<br>ORBIS (<a href="#ps4">PS4</a>)</td> | 124 | <td class="compatos">GCC 4.2+<br>ORBIS (<a href="#ps4">PS4</a>)</td> |
| 125 | <td class="compatos">XCode 5.0+<br>Clang</td> | 125 | <td class="compatos">XCode 5.0+<br>Clang</td> |
| 126 | <td class="compatos">MSVC + SDK v7.0<br>WinSDK v7.0<br>Durango (<a href="#xboxone">Xbox One</a>)</td> | 126 | <td class="compatos">MSVC<br>Durango (<a href="#xboxone">Xbox One</a>)</td> |
| 127 | </tr> | 127 | </tr> |
| 128 | <tr class="odd"> | 128 | <tr class="odd"> |
| 129 | <td class="compatcpu"><a href="#cross2">ARMv5+<br>ARM9E+</a></td> | 129 | <td class="compatcpu"><a href="#cross2">ARMv5+<br>ARM9E+</a></td> |
| @@ -168,7 +168,7 @@ only).</li> | |||
| 168 | <li><tt>src/Makefile</tt> has settings for <b>compiling</b> LuaJIT | 168 | <li><tt>src/Makefile</tt> has settings for <b>compiling</b> LuaJIT |
| 169 | under POSIX, MinGW or Cygwin.</li> | 169 | under POSIX, MinGW or Cygwin.</li> |
| 170 | <li><tt>src/msvcbuild.bat</tt> has settings for compiling LuaJIT with | 170 | <li><tt>src/msvcbuild.bat</tt> has settings for compiling LuaJIT with |
| 171 | MSVC or WinSDK.</li> | 171 | MSVC (Visual Studio).</li> |
| 172 | </ul> | 172 | </ul> |
| 173 | <p> | 173 | <p> |
| 174 | Please read the instructions given in these files, before changing | 174 | Please read the instructions given in these files, before changing |
| @@ -253,17 +253,7 @@ Either install one of the open source SDKs | |||
| 253 | (<a href="http://mingw.org/"><span class="ext">»</span> MinGW</a> or | 253 | (<a href="http://mingw.org/"><span class="ext">»</span> MinGW</a> or |
| 254 | <a href="http://www.cygwin.com/"><span class="ext">»</span> Cygwin</a>), which come with a modified | 254 | <a href="http://www.cygwin.com/"><span class="ext">»</span> Cygwin</a>), which come with a modified |
| 255 | GCC plus the required development headers. | 255 | GCC plus the required development headers. |
| 256 | </p> | 256 | Or install Microsoft's Visual Studio (MSVC). |
| 257 | <p> | ||
| 258 | Or install Microsoft's Visual C++ (MSVC). The freely downloadable | ||
| 259 | <a href="http://www.microsoft.com/Express/VC/"><span class="ext">»</span> Express Edition</a> | ||
| 260 | works just fine, but only contains an x86 compiler. | ||
| 261 | </p> | ||
| 262 | <p> | ||
| 263 | The freely downloadable | ||
| 264 | <a href="http://msdn.microsoft.com/en-us/windowsserver/bb980924.aspx"><span class="ext">»</span> Windows SDK</a> | ||
| 265 | only comes with command line tools, but this is all you need to build LuaJIT. | ||
| 266 | It contains x86 and x64 compilers. | ||
| 267 | </p> | 257 | </p> |
| 268 | <p> | 258 | <p> |
| 269 | Next, download the source package and unpack it using an archive manager | 259 | Next, download the source package and unpack it using an archive manager |
| @@ -271,7 +261,7 @@ Next, download the source package and unpack it using an archive manager | |||
| 271 | </p> | 261 | </p> |
| 272 | <h3>Building with MSVC</h3> | 262 | <h3>Building with MSVC</h3> |
| 273 | <p> | 263 | <p> |
| 274 | Open a "Visual Studio .NET Command Prompt", <tt>cd</tt> to the | 264 | Open a "Visual Studio Command Prompt" (either x86 or x64), <tt>cd</tt> to the |
| 275 | directory where you've unpacked the sources and run these commands: | 265 | directory where you've unpacked the sources and run these commands: |
| 276 | </p> | 266 | </p> |
| 277 | <pre class="code"> | 267 | <pre class="code"> |
| @@ -279,30 +269,7 @@ cd src | |||
| 279 | msvcbuild | 269 | msvcbuild |
| 280 | </pre> | 270 | </pre> |
| 281 | <p> | 271 | <p> |
| 282 | Then follow the installation instructions below. | 272 | Check the <tt>msvcbuild.bat</tt> file for more options. |
| 283 | </p> | ||
| 284 | <h3>Building with the Windows SDK</h3> | ||
| 285 | <p> | ||
| 286 | Open a "Windows SDK Command Shell" and select the x86 compiler: | ||
| 287 | </p> | ||
| 288 | <pre class="code"> | ||
| 289 | setenv /release /x86 | ||
| 290 | </pre> | ||
| 291 | <p> | ||
| 292 | Or select the x64 compiler: | ||
| 293 | </p> | ||
| 294 | <pre class="code"> | ||
| 295 | setenv /release /x64 | ||
| 296 | </pre> | ||
| 297 | <p> | ||
| 298 | Then <tt>cd</tt> to the directory where you've unpacked the sources | ||
| 299 | and run these commands: | ||
| 300 | </p> | ||
| 301 | <pre class="code"> | ||
| 302 | cd src | ||
| 303 | msvcbuild | ||
| 304 | </pre> | ||
| 305 | <p> | ||
| 306 | Then follow the installation instructions below. | 273 | Then follow the installation instructions below. |
| 307 | </p> | 274 | </p> |
| 308 | <h3>Building with MinGW or Cygwin</h3> | 275 | <h3>Building with MinGW or Cygwin</h3> |
diff --git a/src/lj_def.h b/src/lj_def.h index e67bb24c..b1208f6b 100644 --- a/src/lj_def.h +++ b/src/lj_def.h | |||
| @@ -8,8 +8,8 @@ | |||
| 8 | 8 | ||
| 9 | #include "lua.h" | 9 | #include "lua.h" |
| 10 | 10 | ||
| 11 | #if defined(_MSC_VER) | 11 | #if defined(_MSC_VER) && (_MSC_VER < 1700) |
| 12 | /* MSVC is stuck in the last century and doesn't have C99's stdint.h. */ | 12 | /* Old MSVC is stuck in the last century and doesn't have C99's stdint.h. */ |
| 13 | typedef __int8 int8_t; | 13 | typedef __int8 int8_t; |
| 14 | typedef __int16 int16_t; | 14 | typedef __int16 int16_t; |
| 15 | typedef __int32 int32_t; | 15 | typedef __int32 int32_t; |
diff --git a/src/msvcbuild.bat b/src/msvcbuild.bat index 71bde759..4abc461a 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 |
| @@ -23,6 +23,7 @@ | |||
| 23 | @set DASC=vm_x86.dasc | 23 | @set DASC=vm_x86.dasc |
| 24 | @set LJDLLNAME=lua51.dll | 24 | @set LJDLLNAME=lua51.dll |
| 25 | @set LJLIBNAME=lua51.lib | 25 | @set LJLIBNAME=lua51.lib |
| 26 | @set BUILDTYPE=release | ||
| 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 | 27 | @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 |
| 27 | 28 | ||
| 28 | %LJCOMPILE% host\minilua.c | 29 | %LJCOMPILE% host\minilua.c |
| @@ -72,9 +73,11 @@ buildvm -m folddef -o lj_folddef.h lj_opt_fold.c | |||
| 72 | 73 | ||
| 73 | @if "%1" neq "debug" goto :NODEBUG | 74 | @if "%1" neq "debug" goto :NODEBUG |
| 74 | @shift | 75 | @shift |
| 75 | @set LJCOMPILE=%LJCOMPILE% /Zi | 76 | @set BUILDTYPE=debug |
| 76 | @set LJLINK=%LJLINK% /debug /opt:ref /opt:icf /incremental:no | 77 | @set LJCOMPILE=%LJCOMPILE% /Zi %DEBUGCFLAGS% |
| 78 | @set LJLINK=%LJLINK% /opt:ref /opt:icf /incremental:no | ||
| 77 | :NODEBUG | 79 | :NODEBUG |
| 80 | @set LJLINK=%LJLINK% /%BUILDTYPE% | ||
| 78 | @if "%1"=="amalg" goto :AMALGDLL | 81 | @if "%1"=="amalg" goto :AMALGDLL |
| 79 | @if "%1"=="static" goto :STATIC | 82 | @if "%1"=="static" goto :STATIC |
| 80 | %LJCOMPILE% /MD /DLUA_BUILD_AS_DLL lj_*.c lib_*.c | 83 | %LJCOMPILE% /MD /DLUA_BUILD_AS_DLL lj_*.c lib_*.c |
| @@ -118,5 +121,5 @@ if exist luajit.exe.manifest^ | |||
| 118 | @echo ******************************************************* | 121 | @echo ******************************************************* |
| 119 | @goto :END | 122 | @goto :END |
| 120 | :FAIL | 123 | :FAIL |
| 121 | @echo You must open a "Visual Studio .NET Command Prompt" to run this script | 124 | @echo You must open a "Visual Studio Command Prompt" to run this script |
| 122 | :END | 125 | :END |
