Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: "Nicolas Pouillard" <nicolas.pouillard@gmail.com>
To: "Christian Sternagel" <christian.sternagel@uibk.ac.at>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] documentation for building C++ libraries with ocamlbuild
Date: Sun, 25 Mar 2007 11:17:28 +0100	[thread overview]
Message-ID: <cd67f63a0703250317j4a626cffl1e509865d07784fb@mail.gmail.com> (raw)
In-Reply-To: <20070324185823.GA10280@pc6197-c703.uibk.ac.at>

Sorry, my first mail is unfinished...

On 3/24/07, Christian Sternagel <christian.sternagel@uibk.ac.at> wrote:
> Is there some documentation or at least a tutorial for how to setup ocamlbuild in order to build a lib<name>.a file from a bunch of *.c, *.C, and *.h files?

Roughly...

$ cat libfoo.clib
foo1.o
bar2.o
...

$ ocamlbuild libfoo.a

> And after having done that, how to tell ocamlbuild that some ocmal-program which is build depends on lib<name>.a.

$ cat _tags
<myocamprog.{byte,native}: use_foo

$ cat myocamlbuild.ml
open Ocamlbuild_plugin;;
open Command;;
dispatch begin function
| After_rules ->
    flag ["ocaml"; "link"; "use_foo"]
            (S[A"-cc"; A"g++"; A"-ccopt"; A"-Lfoo"; A"-custom";
A"-cclib"; A"-Ifoo"]);
    dep ["ocaml"; "link"; "use_foo") ["libfoo.a"]
end;;

Some `flag' declaration might be useful in order to tweak the C/C++ compilation.

-- 
Nicolas Pouillard


      parent reply	other threads:[~2007-03-25 10:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-24 18:58 Christian Sternagel
2007-03-25 10:13 ` [Caml-list] " Nicolas Pouillard
2007-03-25 10:17 ` Nicolas Pouillard [this message]

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=cd67f63a0703250317j4a626cffl1e509865d07784fb@mail.gmail.com \
    --to=nicolas.pouillard@gmail.com \
    --cc=caml-list@inria.fr \
    --cc=christian.sternagel@uibk.ac.at \
    /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