[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Mac OS X dynamic loading and Lua5.0.2
- From: PA <petite.abeille@...>
- Date: Tue, 22 Mar 2005 10:56:24 +0100
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
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:
"module.name" = 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
Description: Binary data
PA, Onnay Equitursay