caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Nicolas Pouillard" <nicolas.pouillard@gmail.com>
To: romain.bardou <romain.bardou@lri.fr>
Cc: Dario Teixeira <darioteixeira@yahoo.com>,
	Caml_mailing list <caml-list@yquem.inria.fr>
Subject: Re: [Caml-list] Ocamlbuild with findlib + camlp4
Date: Tue, 11 Mar 2008 11:41:56 +0100	[thread overview]
Message-ID: <1205231868-sup-8621@ausone.inria.fr> (raw)
In-Reply-To: <47D10A4B.7000904@lri.fr>

[-- Attachment #1: Type: text/plain, Size: 1441 bytes --]

Excerpts from romain.bardou's message of Fri Mar 07 10:26:35 +0100 2008:
> > Anyway, ideally one should be able to specify in the _tags file the findlib
> > packages that each ml file depends upon.
> 
> Well, doesn't the following plugin do what you want?

Just to propagate my fixes...

> ###########################
> open Ocamlbuild_plugin
> open Command
> 
> (* list of packages *)
> let packages = ["nums"; "str"; "unix"]
> 
> (* ocamlfind command *)
> let ocamlfind x = S[A"ocamlfind"; x]
> 
> let _ = dispatch begin function
>    | Before_options ->
>        Options.ocamlc := ocamlfind & A"ocamlc";
>        Options.ocamlopt := ocamlfind & A"ocamlopt";
>        Options.ocamldep := ocamlfind & A"ocamldep";
>        Options.ocamldoc := ocamlfind & A"ocamldoc"
>    | After_rules ->
>        flag ["ocaml"; "link"; "linkpkg"] & A"-linkpkg";

The  linkpkg  tag  is  in the way. This does not really make sense to restrict
the  injection  of  -linkpkg  only when the linkpkg tag is present. We want to
put -linkpkg at every ocaml link command.

>        List.iter
>     (fun pkg -> flag ["ocaml"; "pkg_"^pkg] & S[A"-package"; A pkg])

This  too  much,  you  will inject -package pkg also for preprocessing options
for  instance  (-pp  "-package  ...").  You  need  to  restrict  the  scope by
specifying phases (compile,deps,link,doc).

>     packages
>    | _ -> ()
> end
> ###########################

-- 
Nicolas Pouillard aka Ertai

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 194 bytes --]

      parent reply	other threads:[~2008-03-11 10:43 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-05 13:41 Dario Teixeira
2008-03-05 15:08 ` [Caml-list] " Romain Bardou
2008-03-06 15:31   ` Dario Teixeira
2008-03-06 15:46     ` Pietro Abate
2008-03-06 19:45       ` Dario Teixeira
2008-03-06 22:14         ` Pietro Abate
2008-03-07  9:26     ` Romain Bardou
2008-03-07 14:46       ` Dario Teixeira
2008-03-07 15:01         ` Nicolas Pouillard
2008-03-07 16:12           ` Dario Teixeira
2008-03-08 11:36             ` Nicolas Pouillard
2008-03-10 15:33               ` Dario Teixeira
2008-03-10 16:15                 ` Romain Bardou
2008-03-10 21:13                   ` Dario Teixeira
2008-03-10 19:56                 ` Arnaud Spiwack
2008-03-10 21:15                   ` Dario Teixeira
2008-03-11 10:37                 ` Nicolas Pouillard
2008-03-11 13:49                   ` Romain Bardou
2008-03-11 15:03                     ` Romain Bardou
2008-03-11 17:32                   ` Dario Teixeira
2008-03-11 20:17                     ` Richard Jones
2008-03-11 10:41       ` 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=1205231868-sup-8621@ausone.inria.fr \
    --to=nicolas.pouillard@gmail.com \
    --cc=caml-list@yquem.inria.fr \
    --cc=darioteixeira@yahoo.com \
    --cc=romain.bardou@lri.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).