Hello,
Luiz Henrique de Figueiredo once published a tool - srglue, srlua - to convert a Lua script to an executable binary.
This is a miraculous few-lines piece of code that I adapted to a Lua fork, Agena.
The adapations to LHF's code are:
- Due to unknown reasons, command-line options passed to the generated executable often got corrupted, at least on
Windows (argv corruption). This has been fixed by passing them in a wholy different way internally, on all platforms.
- On the command-line, the Windows executables generated can be run without giving the `.exe' suffix explicitly.
- On Windows, both srglue and sr(lua) can be called without the full absolute path if the respective executables
are somewhere in your path.
- During generation of the executable, some status information will be printed to stderr.
The fix works successfully on Solaris, Linux, Mac OS X and Windows.
You can download the modified source code from:
https://sourceforge.net/projects/agena/files/Packages/sragena-102.zip/download
If you are interested, I may adapt the sources to work with Lua 5.1.
Alex
I find LHF's tool magic. It works beautifully fine for me. And yes, I spent my whole weekend on getting it done on Windows.
-----Original-Nachricht-----
Betreff: Re: LHF's Lua script-to-binary executable utility
Datum: 2025-06-09T22:24:45+0200
Von: "blog...@gmail.com" <blog...@gmail.com>
An: "lua-l" <lu...@googlegroups.com>