On Wed, Sep 5, 2012 at 7:39 AM, theguy <
ashis...@gmail.com> wrote:
> ya, i mean static linking of falcon itself. Even if it is not exposed in
> build system, still what to do to get it done.
Well you need to build and link it as a static library instead of a
dynamic library.
>
> If we are linking a statically linked binary of LUA, then it does not
> disable the module support. It just does not allow externally (dynamically
> linkable) modules , but it still does allow those modules which have been
> themselves statically linked too with that statically linked binary of lua.
> So why we can't make the modules to be statically linked if possible, in
> case of falcon.
To be more specific, the things which wont work for modules if you
statically link them are for the old engine loading of modules and
also that the entry point for when they are DLLs is all named the same
so you would get a link error with them.
In addition in the old engine the module was set up in this entry
point function so to make them statically linkable they would need
some build system support and change the macro to some function of the
module name.
In the new engine the general way to define the module is to define a
module subclass which sets itself up in the constructor, and the DLL
entry point simply creates a module and returns it to the caller.
When statically linking modules into the program the person who is
embedding falcon is responsible for creating the modules and putting
them somewhere where they can be used. In this way it will be more
inconvenient to the embedder than dynamic linking but then I think the
reason you want it is for systems that forbid or don't support dynamic
linking.
Static linking does not prevent the modules from working necessarily,
it just adds a few extra constraints needed, such as having either no
entry point or a uniquely named one and require the user to be able to
inform the engine somehow of the modules, either linking them manually
or by some mechanism informing the module loader of their existence.
Paul