diff options
Diffstat (limited to 'init')
| -rwxr-xr-x | init | 43 |
1 files changed, 43 insertions, 0 deletions
| @@ -12,8 +12,51 @@ cp /root/libz.a . | |||
| 12 | cp /root/libbz2.a . | 12 | cp /root/libbz2.a . |
| 13 | cd .. | 13 | cd .. |
| 14 | mkdir bin | 14 | mkdir bin |
| 15 | cd bin | ||
| 15 | cp /root/*.exe . | 16 | cp /root/*.exe . |
| 16 | 17 | ||
| 18 | mkdir -p windows-deps-cicd/lib | ||
| 19 | |||
| 17 | cd ../../.. | 20 | cd ../../.. |
| 18 | LUA_BINDIR=binary/build-windows-deps-cicd/bin | 21 | LUA_BINDIR=binary/build-windows-deps-cicd/bin |
| 19 | ./configure --disable-incdir-check --with-lua=binary/build-windows-deps-cicd/bin --with-lua-lib=binary/build-windows-deps/lib | 22 | ./configure --disable-incdir-check --with-lua=binary/build-windows-deps-cicd/bin --with-lua-lib=binary/build-windows-deps/lib |
| 23 | make -f binary/Makefile.windows BUILD_WINDOWS_DEPS_DIR= | ||
| 24 | LUAROCKS_CROSS_COMPILING=1 make binary LUA_DIR=binary/build-windows-deps-cicd/bin CC=gcc NM=nm BINARY_PLATFORM=windows | ||
| 25 | # all_in_one generates a series of files: | ||
| 26 | # dir .. "/luarocks/core/hardcoded.lua" | ||
| 27 | # | ||
| 28 | # SYSTEM = "windows" | ||
| 29 | # PROCESSOR = "x86" | "i686" | ||
| 30 | # FORCE_CONFIG = true | ||
| 31 | # IS_BINARY = true | ||
| 32 | # | ||
| 33 | # --------------------- | ||
| 34 | # Ok this file is actually pretty involved | ||
| 35 | # I think the strategy is to modify all_in_one to not call main(), and instead | ||
| 36 | # call generate() directly. This will output, among other things, luarocks.exe.c, | ||
| 37 | # (and compile it), but we can re-compile with different cflags if we want. | ||
| 38 | # We probably also need a bunch of precompiled windows .a to get it to compile. | ||
| 39 | # TARGET_DIR .. "/" .. program_name .. ".exe.c" | ||
| 40 | # | ||
| 41 | # [[static const char* progname = "<program_name>";]] | ||
| 42 | # <c_preamble> | ||
| 43 | # [[static void load_main(lua_State* L) {]] | ||
| 44 | # <bin2c src/bin/luarocks> | ||
| 45 | # [[if(luaL_loadbuffer(L, code, sizeof(code), "<program_name>") != LUA_OK) {]] | ||
| 46 | # [[ fatal(lua_tostring(L, -1));]] | ||
| 47 | # [[}]] | ||
| 48 | # [[}]] | ||
| 49 | # | ||
| 50 | # ---------------------- | ||
| 51 | # Lets modify all_in_one: delete the last line that calls main() and replace it | ||
| 52 | # with: | ||
| 53 | cfg.init() | ||
| 54 | cfg.variables.LUA_INCDIR_OK = true | ||
| 55 | cfg.variables.LUA_LIBDIR_OK = true | ||
| 56 | fs.init() | ||
| 57 | generate(MAIN_PROGRAM, "src", {EXCLUDE, "^bin/?"}) | ||
| 58 | |||
| 59 | # Make the output directory | ||
| 60 | mkdir build-binary | ||
| 61 | # Then call it like: | ||
| 62 | LUAROCKS_CROSS_COMPILING=1 lua5.4 binary/all_in_one | ||
