From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.4 required=5.0 tests=AWL autolearn=disabled version=3.1.3 Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 94142BBC1 for ; Tue, 11 Mar 2008 11:43:09 +0100 (CET) X-IronPort-AV: E=Sophos;i="4.25,479,1199660400"; d="asc'?scan'208";a="10126146" Received: from peray.inria.fr (HELO ausone.inria.fr) ([128.93.8.98]) by mail3-relais-sop.national.inria.fr with SMTP; 11 Mar 2008 11:43:09 +0100 Received: by ausone.inria.fr (sSMTP sendmail emulation); Tue, _d Mar 2008 11:41:56 +0100 From: "Nicolas Pouillard" Cc: Dario Teixeira , Caml_mailing list Subject: Re: [Caml-list] Ocamlbuild with findlib + camlp4 To: romain.bardou References: <318509.18876.qm@web54603.mail.re2.yahoo.com> <47D10A4B.7000904@lri.fr> In-Reply-To: <47D10A4B.7000904@lri.fr> Date: Tue, 11 Mar 2008 11:41:56 +0100 Message-Id: <1205231868-sup-8621@ausone.inria.fr> User-Agent: Sup/git Content-Type: multipart/signed; protocol="application/pgp-signature"; boundary="=-1205232116-977636-71945-3133-2-="; micalg="pgp-sha1" MIME-Version: 1.0 X-Spam: no; 0.00; findlib:01 camlp:01 findlib:01 ocamlfind:01 ocamlfind:01 ocamlc:01 ocamlc:01 ocamlopt:01 ocamlopt:01 ocamldep:01 ocamldep:01 ocamldoc:01 ocamldoc:01 ocaml:01 -linkpkg:01 X-Attachments: cset="UTF-8" type="application/pgp-signature" name="signature.asc" name="signature.asc" --=-1205232116-977636-71945-3133-2-= Content-Type: text/plain; charset=UTF-8 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 --=-1205232116-977636-71945-3133-2-= Content-Disposition: attachment; filename="signature.asc" Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) iEYEARECAAYFAkfWYfQACgkQj+FCNw9dwLl9wACeIR/ZvPeUrW59fz/Skf+J6774 n70An1bOWzL8Y41TZQ2FrM3STQOmZUSU =k7Hb -----END PGP SIGNATURE----- --=-1205232116-977636-71945-3133-2-=--