lua-users home
lua-l archive

Re: Mac OS X dynamic loading and Lua5.0.2

[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:
http://dev.alt.textdrive.com/file/lu/lub.lua
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 bindings.

Attachment: lubfile
Description: Binary data

Cheers
--
PA, Onnay Equitursay
http://alt.textdrive.com/

AltStyle によって変換されたページ (->オリジナル) /