lua-users home
lua-l archive

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

El 07/12/2004, a las 17:11, Asko Kauppi escribió:

7.12.2004 kello 11:46, Mike Pall kirjoitti:

And yes, you're right: OS X 'bundles' is what you want to have.

Thank you for clearing this up.

(Side tech note: In fact there *is* a way to load dylibs as well as bundles at runtime, but as dylibs were not designed as plugins, you can't unload them thereafter; as far as I understand the docs, the linker does not guarantee that they will be unloaded when your program ends even if nobody else uses them! -- so maybe it's a really crude hack).

MacOS X version 10.3.4 (or newer) includes the "dlcompat" library, that provides the well-known dlopen/dlfcn/dlclose incterface implemented on top of the native APIs of the linker. But, if you want to support older versions you may either statically link "dlcompat" to your code, instruct the user to install it, or use the native linker APIs. I think the latter is the better one, and it covers the needs of Lua without some of the overhead added by "dlcompat".

I think the established convention for most cross-platform packages that need shared libraries is to use ".so" even on Mac OS X. That way we don't have to provide yet another variant of the package path in luaconf.h ...

Nearly everybody is using ".so" under OSX for ported projects, mainly because GNU libtool (used to link loadable modules) works under OSX and recommends using ".so" by default. There's one more reason: who wants to maintain more Makefile rules if one can uso ".so" as in other Unixes?

BTW: I hope /usr/local/lib/lua/5.1/?.so is acceptable on Mac OS X, too?

If it's acceptable under other Unixes, it's ok for OSX, too ;-).

Still, I'd place shared objects under /usr/local/share/.

I don't think so. As far as I know, "/usr/share" (or "/usr/local/share") is intended for data used by programs, not for the code of the programs. Executable code goes under "*/bin" for programs and "*/lib" for libraries, so using a particular subdir under "*/lib" seems appropiate. That's the way the vast majority of software is built.


Attachment: PGP.sig
Description: Mensaje firmado digitalmente