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.0 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id 83466BBC1 for ; Mon, 3 Mar 2008 09:02:25 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAAo/y0eBrw8En2dsb2JhbACQcAEBAQEBBgQGCQgYmi8 X-IronPort-AV: E=Sophos;i="4.25,436,1199660400"; d="scan'208";a="7923597" Received: from ext.lri.fr ([129.175.15.4]) by mail2-smtp-roc.national.inria.fr with ESMTP; 03 Mar 2008 09:02:25 +0100 Received: from localhost (localhost [127.0.0.1]) by ext.lri.fr (Postfix) with ESMTP id 5366AA45F4; Mon, 3 Mar 2008 09:02:25 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at lri.fr Received: from ext.lri.fr ([127.0.0.1]) by localhost (ext.lri.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dBTRVG7UsbUC; Mon, 3 Mar 2008 09:02:25 +0100 (CET) Received: from smtp.lri.fr (vhost3-23 [129.175.3.23]) by ext.lri.fr (Postfix) with ESMTP id 3A7E1A45E2; Mon, 3 Mar 2008 09:02:25 +0100 (CET) Received: from [129.175.4.107] (lri4-107 [129.175.4.107]) by smtp.lri.fr (Postfix) with ESMTP id 23A7CE0505; Mon, 3 Mar 2008 09:02:25 +0100 (CET) Message-ID: <47CBB144.8020108@lri.fr> Date: Mon, 03 Mar 2008 09:05:24 +0100 From: Romain Bardou User-Agent: Thunderbird 2.0.0.6 (X11/20071022) MIME-Version: 1.0 To: Paolo Donadeo Cc: caml-list caml-list Subject: Re: [Caml-list] How to tell ocamlbuild to pass options to ocamldoc? References: <47C9A4BA.7040504@fmf.uni-lj.si> <4b5157c30803020226i2f84248eh5535985c753f58a@mail.gmail.com> In-Reply-To: <4b5157c30803020226i2f84248eh5535985c753f58a@mail.gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam: no; 0.00; lri:01 ocamldoc:01 -keep-code:01 ocaml:01 interf:01 ocaml:01 -keep-code:01 ocamldoc:01 ocamlfind:01 netcgi:01 netcgi:01 netstring:01 pxp-engine:01 ocamlfind:01 -package:01 I didn't find any tag for the -keep-code flag. So indeed, I guess you need a plugin. I would suggest adding the flag for tags "ocaml" and "doc" (other useful tags are: interf, implem, extension:html, extension:tex and so on, docfile, docdir). Something like this: open Ocamlbuild_plugin;; dispatch begin function | After_rules -> flag ["ocaml"; "doc"] "-keep-code" end I didn't test it though. Romain Bardou Paolo Donadeo a écrit : >> Perhaps I am just blind, but I was unable to figure out after poking >> around for a while, how to tell ocamlbuild that it should pass the >> -keep-code flag to ocamldoc. I suspect I need to put something in _tags, >> but what? (I am an ocamlbuild newbie.) > > I don't know if this is the best way, but I use the myocamlbuild > module to pass arguments to ocamlfind and ocamldoc, it just works. > > An example: > > =============== myocamlbuild.ml =============== > open Ocamlbuild_plugin;; > open Command;; > > let (|>) x f = f x > > let packages = > [ > "cryptokit"; > "extlib"; > "netcgi2"; > "netcgi2-plex"; > "nethttpd"; > "netplex"; > "netstring"; > "oUnit"; > "pxp-engine"; > "pxp-lex-iso88591"; > "str"; > "unix" > ] |> String.concat ",";; > > let ocamlfind cmd = S[A"ocamlfind"; A cmd; A"-package"; A packages];; > > flag ["ocaml"; "link"] (A"-linkpkg");; > > let ocamldoc = > S[A"ocamlfind"; > A"ocamldoc"; > A"-package"; > A packages; > A"-stars"; > A"-colorize-code"; > A"-intro"; A"../documentation/doc_index.txt"; > A"-css-style"; A"../documentation/style.css"; > A"-t"; A"The Ex-nunc System"; > ];; > > dispatch begin function > | After_options -> > Options.ocamldoc := ocamldoc; > Options.ocamlc := ocamlfind "ocamlc"; > Options.ocamlopt := ocamlfind "ocamlopt"; > | _ -> () > end > =========== END OF myocamlbuild.ml ============ > > >