[Ecls-list] Building shared libraries

Juan Jose Garcia Ripoll lisp at arrakis.es
Tue Nov 30 00:37:01 UTC 2004


Julian Stecklina wrote:

>If I compile a lisp source file via ecl -compile -s in order to link
>it together with a C stub to produce a shared library, I have to
>initialize the lisp part.
>After some investigation I found out that I have to call 
>read_VV(OBJNULL, init_SYSTEM); 
>to make the definitions in system.lisp become effective.  Is this
>documented somewhere or am I wrong?
>
>  
>
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.

If you definitively cannot do this then you might try to mimic the 
output of BUILD-SHARED-LIBRARY, which is based on the template 
+lisp-program-init+ and in turn uses read_VV. The first argument to 
read_VV is a codeblock object, that keeps information about the module 
you are building: i.e., what the data of the library is, its text 
representation, the file it comes from, etc. If you supply OBJNULL to 
read_VV, such an object is created for you.

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.

Regards,

Juanjo




More information about the ecl-devel mailing list