csrc/<package>/build-<platf><arch>.sh
.csrc/<package>/WHAT
. Build those first.Use build-mingw32.sh
(that is sh build-mingw32.sh
from the command line). These scripts assume that both MSys and MinGW bin dirs (in this order) are in your PATH. Below is the exact list of MinGW packages used to build the current luapower stack:
Additional tools needed by a few special packages (use them for building for 64bit too):
ragel 6.8 (only for harfbuzz) |
nasm 2.11 (only for libjpeg-turbo) |
cmake 2.8.12.2 (only for libjpeg-turbo) |
Use sh build-mingw64.sh
. These scripts assume that both MSys and MinGW-w64 bin dirs (in this order) are in your PATH. Here's the exact MinGW-w64 package used to build the current luapower stack:
mingw-w64 4.8.1 (64bit, posix threads, SEH exception model) |
MinGW-w64 can be used to cross-compile C libraries for x86_64 from a 32bit Windows machine. But MinGW-w64 cannot be used to cross-compile LuaJIT this way because LuaJIT requires SEH for the x86_64 target, and there's no MinGW-w64 32bit binaries for that.
Note that in MinGW-w64 terminology, host means target and target means host.
Because of that limitation, this is not a supported host/target cross-compling combination.
If you still want to do it, you can download the latest toolchain from mingwbuilds, add mingw32/bin in your PATH and build using build-mingw64-from-win32.sh
where available.
NOTE: This will build libraries with the SJLJ exception model, unlike current luapower binaries which use SEH.
Use build-linux32.sh
on a 32bit host and build-linux64.sh
on a 64bit host. Careful not to mix them up, or you'll get 32bit binaries in the 64bit directory or viceversa.
You need a recent gcc toolchain, which you probably already have.
The current luapower stack is built with gcc 4.7.2 from tinycore 5.2 (see below).
If you are on Windows or OSX and you want to compile for Linux and don't want to mess with a cross-compiler, here is a quick method to build Linux binaries from a Windows or OSX (or even Linux) environment.
$ tce-load -wi git compiletc
$ git clone https://github.com/luapower/luapower-git luapower
$ cd luapower
$ ./clone.sh --all
$ cd csrc
$ ./build.sh --all
$ ./clone.sh --list
$ ./clone.sh foobar
$ cd csrc/foobar
$ ./build-linux32.sh
or ./build-linux64.sh
, depending on what ISO you usedUse build-osx32.sh
to make 32bit x86 binaries and build-osx64.sh
to make 64bit x86 binaries. Clang is a cross-compiler, so you can build for 32bit on a 64bit OSX and viceversa.
Current OSX builds are based on clang 5.0 (clang-500.2.279) which comes with Xcode 5.0.2, and are done on a 64bit OSX 10.9.
The generated binaries are compatible down to OSX 10.6 for both 32bit and 64bit.
NOTE: Clang/OSX doesn't (and will not) support static binding of the standard C++ library nor of libgcc.