How to compile Lua scripts into a single executable, while still gaining the fast LuaJIT compiler?
Translate all of the Lua source code files to object files and put them in a static library: for f in *.lua; do luajit -b $f `basename $f .lua`.o done ar rcus libmyluafiles.a *.o Then link the libmyluafiles.a library into your main program using -Wl,–whole-archive -lmyluafiles -Wl,–no-whole-archive -Wl,-E. This line forces the linker to include … Read more