just my 2c,
a couple of weeks ago, i posted a little about the path that i followed  to make a shared library with ocaml code, with links to readings that i had found useful to do so

http://caml.inria.fr/pub/ml-archives/caml-list/2007/03/72f8409732a3aeb7a9d449c438bbff0e.fr.html
As Matthieu, nothing automatic.

2007/6/21, Matthieu Dubuget <matthieu.dubuget@gmail.com>:


2007/6/21, Jon Harrop <jon@ffconsultancy.com>:
On Thursday 21 June 2007 11:15:39 Matthieu Dubuget wrote:
> 2007/6/21, Joel Reymont <joelr1@gmail.com>:
> > I tried to build a shared library for use with Ruby once and failed
> > miserably.
>
> Could you please elaborate about this? Maybe not on this thread.
>
> I ask this, because almost all my OCaml code is use as shared libraries...

I think a lot of people (myself included) would benefit enormously if you
could explain in words of one syllable exactly how you can compile an OCaml
program into a DLL (.so on Linux) and call it from C.


Not an  OCaml "program". I simply write C DLLs embedding my Caml code as described in

18.7.5  Embedding the Caml code in the C code

http://caml.inria.fr/pub/docs/manual-ocaml/manual032.html#htoc238
 
Nothing automatic. I manually write all C functions, have them call OCaml callbacks, etc.
If this is actually what you have in mind, I can write and post one minimalistic example.

It is possible to have a tool to turn one OCaml library (CMA/CMXA) into one shared library.
See ODLL, from N. Canasse in the hump.

Salutations

Matt



_______________________________________________
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs




--
Pablo Polvorin