lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

On Mar 22, 2005, at 05:18, Peter Colson wrote:

Are there particular options I need to be aware of when building the dynamic library to allow it to load and expose it's init function (I saw something about prepending function names with '_c' or similar).

Mike Pall provided the following incantation to compile modules on Mac OS X:

local CompileCommand = "gcc -O2 -fno-common -c -o"
local LinkCommand = "gcc -bundle -undefined dynamic_lookup -o"

Works like a charm.

Here is a little Lua script I use instead of make to compile stuff on Mac OS X:

The script expects to find a "lubfile" in the directory you are compiling. The "lubfile" is a Lua table with two keys:

"" = the name of the module to build
"object.names" = the source files to compile and link

Attached is an example "lubfile" to compile zlib with its lzlib bindings.

Attachment: lubfile
Description: Binary data


PA, Onnay Equitursay