caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Eric Cooper <ecc@cmu.edu>
To: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Ocamlbuild for project with C portion
Date: Mon, 21 Sep 2009 13:47:58 -0400	[thread overview]
Message-ID: <20090921174758.GE2012@localhost> (raw)
In-Reply-To: <177439.58068.qm@web111515.mail.gq1.yahoo.com>

On Mon, Sep 21, 2009 at 09:05:42AM -0700, Dario Teixeira wrote:
> The Ocamlbuild manual begins by stating that the tool has builtin support
> for projects with C stubs, but unfortunately is subsequently mute on the
> subject.  So, I have a foobar.ml module that declares an external function
> "stuff" which is defined in foobar_lowlevel.c.  What is the Ocamlbuild
> tagging wizardry that allows this programme to compile?

There is an example in
  http://brion.inria.fr/gallium/index.php/Ocamlbuild_example_with_C_stubs 

The key is to create a file with the extension ".clib" that contains
the list of .o files that should be compiled from your C
stubs. Ocamlbuild will then build these into a libary (foo.clib will
result in foo.a).  You then add rules in myocamlbuild.ml that define
tags for depending on and linking with that library, and add these to
your _tags file.

-- 
Eric Cooper             e c c @ c m u . e d u


  reply	other threads:[~2009-09-21 17:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-21 16:05 Dario Teixeira
2009-09-21 17:47 ` Eric Cooper [this message]
2009-09-22 14:44   ` [Caml-list] " Dario Teixeira

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=20090921174758.GE2012@localhost \
    --to=ecc@cmu.edu \
    --cc=caml-list@yquem.inria.fr \
    /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;
as well as URLs for NNTP newsgroup(s).