Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Alain Frisch <alain@frisch.fr>
To: viktor tron <viktor.tron.ml@gmail.com>
Cc: Caml Mailing List <caml-list@yquem.inria.fr>
Subject: Re: [Caml-list] C libs from Ocaml libs
Date: Wed, 21 Nov 2007 18:33:23 +0100	[thread overview]
Message-ID: <47446BE3.4070606@frisch.fr> (raw)
In-Reply-To: <8cc3d8520711210906k2c8ed0abg6f4305b275cddbf3@mail.gmail.com>

viktor tron wrote:
> This is super! how is this on MacOS, I recall one of your comment earlier (on this list?)
> that it doesn't work or something. 

Everything should work fine under Mac OS X x86. For PowerPC, I believe 
that "ocamlc -output-obj -o XXX.so" should be ok but that "ocamlopt 
-output-obj -o XXX.so" does not work.

> well, I tried.
> ar -rs foo_caml.o foo_stub.o
 > gcc -o foo_test.native foo_test.c -L. -lchainfreq_native -L/sw/lib/ocaml

What is the name of the library you want to produce?

>      > * how do I create dynamic libs, dlls for windows?
> 
>     What do you want to put in your dynamic libs? If you want to create a
>     "stand-alone" dll with the OCaml runtime + arbitrary OCaml and C code,
>     the new behavior of "-output-obj -o XXX.{so,dll}" is/will be what
>     you want. 
> 
> 
> and not standalone ones?

So, you want the OCaml code, but not the OCaml runtime?  You can either 
use the -shared option to produce a .cmxs plugin (that must be 
explicitly loaded by the main program, using the OCaml Dynlink module), 
or -output-obj to produce a .o containing the OCaml code and the startup 
code for the OCaml side of your application.

-- Alain


  reply	other threads:[~2007-11-21 17:33 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-21  7:43 viktor tron
2007-11-21  9:45 ` [Caml-list] " Alain Frisch
2007-11-21 11:21   ` Matthieu Dubuget
2007-11-21 12:05     ` Alain Frisch
2007-11-21 19:48       ` Jon Harrop
2007-11-21 17:06   ` viktor tron
2007-11-21 17:33     ` Alain Frisch [this message]
2007-11-21 18:35       ` viktor tron
2007-11-22 17:21         ` Alain Frisch
2007-11-26 17:20         ` Alain Frisch
2007-11-22 16:41 RABIH.ELCHAAR

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47446BE3.4070606@frisch.fr \
    --to=alain@frisch.fr \
    --cc=caml-list@yquem.inria.fr \
    --cc=viktor.tron.ml@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox