[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: shared module chain under linux
- From: Gaspard Bucher <gaspard@...>
- Date: Thu, 23 Feb 2012 23:25:20 +0100
On Thu, Feb 23, 2012 at 10:46 PM, Michal Kottman <email@example.com>
This is what I was suspecting. First I wanted to bundle the "loader"
On 23 February 2012 22:36, Roberto Ierusalimschy <firstname.lastname@example.org
> It must be opened with '*' first. Lua keeps the result of the first
> 'dlopen' for a library and reuses it for other calls. But it may be
> a good idea to separate those auxiliary functions into a C library
> that has no Lua function (and no 'luaopen_' function), so it is never
functions in the shared library itself, but finally I realized that
the only really working way is to have a pure shared library
(liblqt.so), and a "loader" Lua script - lqt.lua, which will handle
things like dependencies between modules. This way "require 'lqt'"
would still work as I imagined.
Thanks everyone for the pointers. I will first try to externalize dependencies in Lua (like move msgpack encoding from inside zeromq socket to Lua wrapper) but if this does not work for some libraries, I will probably end up doing the same as Michal.
Michal, please let us know if you implement this chained loading and how you solve it.