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 mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 00762BBC1 for ; Wed, 5 Mar 2008 16:05:18 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAC9FzkeBrw8En2dsb2JhbACQcgEBAQEBBgoJIJpM X-IronPort-AV: E=Sophos;i="4.25,450,1199660400"; d="scan'208";a="9914037" Received: from ext.lri.fr ([129.175.15.4]) by mail3-smtp-sop.national.inria.fr with ESMTP; 05 Mar 2008 16:05:20 +0100 Received: from localhost (localhost [127.0.0.1]) by ext.lri.fr (Postfix) with ESMTP id 64542A46AC; Wed, 5 Mar 2008 16:05:18 +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 R0mfgdbDVzhZ; Wed, 5 Mar 2008 16:05:18 +0100 (CET) Received: from smtp.lri.fr (vhost3-23 [129.175.3.23]) by ext.lri.fr (Postfix) with ESMTP id 4C961A4692; Wed, 5 Mar 2008 16:05:18 +0100 (CET) Received: from [129.175.4.107] (lri4-107 [129.175.4.107]) by smtp.lri.fr (Postfix) with ESMTP id 50EEFE04F9; Wed, 5 Mar 2008 16:05:18 +0100 (CET) Message-ID: <47CEB768.10508@lri.fr> Date: Wed, 05 Mar 2008 16:08:24 +0100 From: Romain Bardou User-Agent: Thunderbird 2.0.0.12 (X11/20080227) MIME-Version: 1.0 To: Dario Teixeira Cc: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Ocamlbuild with findlib + camlp4 References: <644528.65296.qm@web54604.mail.re2.yahoo.com> In-Reply-To: <644528.65296.qm@web54604.mail.re2.yahoo.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; lri:01 findlib:01 camlp:01 lib:01 ocaml:01 pcre:01 pcre:01 site-lib:01 site-lib:01 cmo:01 ocaml:01 ocamlfind:01 ocamlc:01 ocamlopt:01 ocamldep:01 Hello, > let root = "/home/dario/.godi/lib/ocaml/" in > let str = root ^ "std-lib/str.cma" > and pcre = root ^ "pkg-lib/pcre/pcre.cma" > and extlib = root ^ "pkg-lib/extlib/extLib.cma" > and calendar = root ^ "pkg-lib/calendar/calendar.cma" > and csv = root ^ "pkg-lib/csv/csv.cma" > and pgocaml = root ^ "site-lib/pgocaml/pgocaml.cma" > and pa_pgsql = root ^ "site-lib/pgocaml/pa_pgsql.cmo" in > flag ["ocaml"; "pp"; "use_pgsql"] (S[A str; A pcre; A extlib; A > calendar; A csv; A pgocaml; A pa_pgsql]) It seems to me that this lines are useless if you use ocamlfind, because you: - changed the ocamlc, ocamlopt and ocamldep variables - added the -linkpkg option when linking So normally you shouldn't even have to deal with cma files. Well, at least if they have META files. Moreover, these lines mean that packages str and so on will only be used when your files are tagged with use_pgsql. Is it really what you want? You did nothing to add the "-syntax camlp4o" option. I have no experience of ocamlbuild with camlp4 extensions but I guess in your case I would list all packages correctly in the "let packages = ..." definition (unless you don't want to add the -package option for every file?), tag my files which use the camlp4 extension with "use_pgsql", and add a flag such as: flag ["ocaml"; "use_pgsql"] (S[A "-syntax"; A "camlp4o"]) You could also add the package pgocaml.statements only when using this flag: flag ["ocaml"; "use_pgsql"] (S[A "-package"; A "pgocaml.statements"]) If you do this you don't have to add the pgocaml.statements package in the "let packages = ..." definition of your plugin. Basically I think what you need is a combination of the two following examples from the Wiki: http://brion.inria.fr/gallium/index.php/A_plugin_for_camlp4_syntax_extension_%28pa_openin%29 http://brion.inria.fr/gallium/index.php/Using_ocamlfind_with_ocamlbuild -- Romain Bardou