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=1.2 required=5.0 tests=AWL,SPF_NEUTRAL autolearn=disabled version=3.1.3 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 09C9BBC0A for ; Tue, 27 Feb 2007 14:28:49 +0100 (CET) Received: from wr-out-0506.google.com (wr-out-0506.google.com [64.233.184.238]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l1RDSkrV022795 for ; Tue, 27 Feb 2007 14:28:47 +0100 Received: by wr-out-0506.google.com with SMTP id i30so1845108wra for ; Tue, 27 Feb 2007 05:28:46 -0800 (PST) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=iNer2BOo5lyIcilREdbJEiJ6bJkj6r3Uznsb352nyppCRRqEz0S8wbzCgj+9NO05NuwOdZPt9MAPObw6zmd14blWVESvkxE/4VW4o4CN/DMi0Hh3OrZ8nCkdfSDzIsXYBMKEc9sfVDIAg68k5gRNY5ErMZRFTGutozfHZP996pM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=oyyiFVW023mne/ibk4QeuKEjoUkd1bl0gLz+F+b9Llm2wKtR8vFeI12QFq9NcLTSPr7pzGAaeYnC2lgmlFCXOlSGwo7Cs7eqAACVQ1U+2VzyD1miL/aJdWh/A37tKISbUIO0ViRJeQ5Tq1pcN1OiAo6vrjJ82ngd4HRKxlvKIXo= Received: by 10.115.17.1 with SMTP id u1mr274668wai.1172582924073; Tue, 27 Feb 2007 05:28:44 -0800 (PST) Received: by 10.114.181.18 with HTTP; Tue, 27 Feb 2007 05:28:44 -0800 (PST) Message-ID: Date: Tue, 27 Feb 2007 14:28:44 +0100 From: "Nicolas Pouillard" To: "Joel Reymont" Subject: Re: [Caml-list] Re: ocamlbuild and the "status bar" Cc: caml-list@inria.fr In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <93A893D4-AE62-4F09-9E78-0F5B1AB674E5@gmail.com> X-j-chkmail-Score: MSGID : 45E4320E.002 on concorde : j-chkmail score : X : 0/20 1 0.000 -> 1 X-Miltered: at concorde with ID 45E4320E.002 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; usr:01 lib:01 ocaml:01 site-lib:01 ocamlfind:01 usr:01 lib:01 ocaml:01 site-lib:01 byte:01 ocamlfind:01 -ocamlc:01 ocamlc:01 -package:01 -linkpkg:01 On 2/27/07, Joel Reymont wrote: > > On Feb 27, 2007, at 11:04 AM, Joel Reymont wrote: > > > I really like this tool but I can't figure out where to get the > > nifty "status bar" functionality described towards the end of the > > slides. > > This is a rather silly question so I retract it. A much better > question is the following... > > How do I integrate ocamlbuild with external libraries? > > I have OUnit installed in /usr/local/lib/ocaml/site-lib/ounit since > it uses ocamlfind during installation. I have to use a longish > command line to make OUnit examples compile, like this: > > ocamlbuild -cflags -I,/usr/local/lib/ocaml/site-lib/ounit -lflags -I,/ > usr/local/lib/ocaml/site-lib/ounit -libs unix,ounit test_list.byte There is many solutions and you get one of them. 1/ Comand line solutions 1.1/ Using ocamlfind: Since it's an ocamlfind package you can use it. ocamlbuild -ocamlc "ocamlfind ocamlc -package ounit" -lfags -linkpkg -lib unix test_list.byte 1.2/ Using the library directly (like you did). 2/ Shell script/Makefile solution Put all your stuffs form the previous solutions in a shell script or a Makefile. 3/ A solution with an Ocamlbuild plugin: $ cat _tags "test_list.byte": use_unix $ cat myocamlbuild.ml open Ocamlbuild_plugin;; open Command;; let packages = "ounit" (* "pkg1,pkg2,..." *);; let ocamlfind cmd = S[A"ocamlfind"; A cmd; A"-package"; A packages];; flag ["ocaml"; "link"] (A"-linkpkg");; dispatch begin function | After_options -> Options.ocamlc := ocamlfind "ocamlc"; Options.ocamlopt := ocamlfind "ocamlopt"; | _ -> () end $ ocamlbuild test_list.byte Finished, 3 targets (2 cached) in 00:00:00. Cheers, -- Nicolas Pouillard