From fd91580f2d8860d044bbb2237ecc9e6ec0fa0124 Mon Sep 17 00:00:00 2001 From: Alexander M Pickering Date: Mon, 23 Sep 2024 10:06:19 -0500 Subject: Reorder dependencies to include lua --- init | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'init') diff --git a/init b/init index 8aa8d04..26b3428 100755 --- a/init +++ b/init @@ -12,8 +12,51 @@ cp /root/libz.a . cp /root/libbz2.a . cd .. mkdir bin +cd bin cp /root/*.exe . +mkdir -p windows-deps-cicd/lib + cd ../../.. LUA_BINDIR=binary/build-windows-deps-cicd/bin ./configure --disable-incdir-check --with-lua=binary/build-windows-deps-cicd/bin --with-lua-lib=binary/build-windows-deps/lib +make -f binary/Makefile.windows BUILD_WINDOWS_DEPS_DIR= +LUAROCKS_CROSS_COMPILING=1 make binary LUA_DIR=binary/build-windows-deps-cicd/bin CC=gcc NM=nm BINARY_PLATFORM=windows +# all_in_one generates a series of files: +# dir .. "/luarocks/core/hardcoded.lua" +# +# SYSTEM = "windows" +# PROCESSOR = "x86" | "i686" +# FORCE_CONFIG = true +# IS_BINARY = true +# +# --------------------- +# Ok this file is actually pretty involved +# I think the strategy is to modify all_in_one to not call main(), and instead +# call generate() directly. This will output, among other things, luarocks.exe.c, +# (and compile it), but we can re-compile with different cflags if we want. +# We probably also need a bunch of precompiled windows .a to get it to compile. +# TARGET_DIR .. "/" .. program_name .. ".exe.c" +# +# [[static const char* progname = "";]] +# +# [[static void load_main(lua_State* L) {]] +# +# [[if(luaL_loadbuffer(L, code, sizeof(code), "") != LUA_OK) {]] +# [[ fatal(lua_tostring(L, -1));]] +# [[}]] +# [[}]] +# +# ---------------------- +# Lets modify all_in_one: delete the last line that calls main() and replace it +# with: +cfg.init() +cfg.variables.LUA_INCDIR_OK = true +cfg.variables.LUA_LIBDIR_OK = true +fs.init() +generate(MAIN_PROGRAM, "src", {EXCLUDE, "^bin/?"}) + +# Make the output directory +mkdir build-binary +# Then call it like: +LUAROCKS_CROSS_COMPILING=1 lua5.4 binary/all_in_one -- cgit v1.2.3-55-g6feb