[Ecls-list] Building shared libraries

Julian Stecklina der_julian at web.de
Thu Dec 2 07:46:06 UTC 2004


Juan Jose Garcia Ripoll <lisp at arrakis.es> writes:

> Hmm, I see you have been a bad boy and tried to guess the mechanism for library initialization :-) I would rather advice you to
> stay away from it and use C::BUILD-SHARED-LIBRARY and the :PROLOGUE-CODE and :EPILOGUE-CODE if you need to have some special C
> code that has to be executed before or after the lisp part is initialized.

What I need is an "entry" function that I can call. The functionality
provided by build-shared-library is of no use to me. My code looks
something like:

void init_plugin(...)
{
        cl_boot(...);

        /* Initialise wrapper functions */
        /* and some variables */
        wrap_functions();

        /* Load the definitions from the lisp object */
        init_list_part();

        return;
}

The main problem is that init_plugin is the entry function that is
called when the shared library is loaded. 
Looking over the code I guess one could add a :init-function keyword
parameter to the builder function and have it construct a function
that I can call whenever it suits me. 

> This mechanism is not documented because it is prone to change and because, as I told you, there's a higher level interface that
> takes care of all this stuff.

I understand, but I do not believe that it is usable for shared
libraries as is. 

Regards,
-- 
                    ____________________________
 Julian Stecklina  /  _________________________/
  ________________/  /
  \_________________/  LISP - truly beautiful





More information about the ecl-devel mailing list