lua-users home
lua-l archive

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


On Sun, 21 Jan 2007 15:03:38 -0800
"Wesley Smith" <wesley.hoke@gmail.com> wrote:

> On OSX, bundles [...]
> 
> If I tell lua to read the root directory (which is actually the
> bundle), I get a "this is not a bundle error".  If I tell Lua to read
> mylib.so/Contents/MacOS/mylib, it succedes.  I'm wondering if this is
> how things are supposed to be.  Do people who make binary modules for
> Lua on OSX ever use the typical OSX bundle structure or just provide
> the binary executable?

Lua on MacOSX uses either the dyld API or the usual Unix dlopen/dlsym
mantra in order to load modules. Both sets of APIs do directly load the
binary itself. The APIs which do load bundles are from the Foundation
(and maybe are also available from CoreFoundation) library, more
exactly by means of the NSBundle Objective-C class. Using NSBundle is
more suited for loading stuff containing Objective-C code (AFAIK),and
it would add more compile, link and run-time dependencies to Lua. I
think the current scheme is good, in fact most Unix apps ported to
MacOS X do simply the same as Lua, and at least Apache, Python, Ruby,
Perl and some other do open the binaries directly instead of using
bundles =)

Cheers,

-- 
NetBSD is so clean you could eat off of it.
        -- (Oscar Wilde)

Attachment: signature.asc
Description: PGP signature