[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: PATCH: Lua5.1-work3 loadlib cleanups
- From: Adrián Pérez <copylight@...>
- Date: Tue, 07 Dec 2004 21:39:20 +0100
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
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
need shared libraries is to use ".so" even on Mac OS X. That way we
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
BTW: I hope /usr/local/lib/lua/5.1/?.so is acceptable on Mac OS X,
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
Description: Mensaje firmado digitalmente