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.4 required=5.0 tests=DNS_FROM_RFC_ABUSE, DNS_FROM_RFC_WHOIS autolearn=disabled version=3.1.3 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 D0074BC6B for ; Mon, 5 Nov 2007 21:34:10 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAI4ML0fOvjGwoWdsb2JhbACOegEBAQECBQQGCQgBFw X-IronPort-AV: E=Sophos;i="4.21,374,1188770400"; d="scan'208";a="3926732" Received: from web54606.mail.re2.yahoo.com ([206.190.49.176]) by mail2-smtp-roc.national.inria.fr with SMTP; 05 Nov 2007 21:34:09 +0100 Received: (qmail 8064 invoked by uid 60001); 5 Nov 2007 20:34:09 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=VGzlgO4yktFBM6sH3vTd9C+OnzM+SlP/fddxBjaqUy68NneqzGJZlCFsSEQLm/re8SJGM12hBa+elzpeRszNKoI5yps4BOs96apvjGpNaLDRF5+p2BIVY1JxIHl3c93tCIuFh/kDD6hZF9BsRmCXtjH+3i/Flr4pXtQ4vBva89w=; X-YMail-OSG: 26.pYygVM1nsP.kxObKXd5zAM_YYOWQpIRhQ.QwMSrn.B_TaSpo8WERo.zBC6k2nTvkZGBe6obOYIe60kHoAwQxchE1ZmGCicp5t8qC6WX_czhc_9PYBUybOa5dY4SRhuuFAygJiGuAPPvRRR0ntngVi7A-- Received: from [85.240.88.109] by web54606.mail.re2.yahoo.com via HTTP; Mon, 05 Nov 2007 20:34:09 GMT Date: Mon, 5 Nov 2007 20:34:09 +0000 (GMT) From: Dario Teixeira Subject: Ocamlbuild plugins To: caml-list@yquem.inria.fr MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Message-ID: <195667.6858.qm@web54606.mail.re2.yahoo.com> X-Spam: no; 0.00; wiki:01 wiki:01 makefile:01 notation:01 findlib:01 cmo:01 ocamlfind:01 ocamlc:01 -package:01 camlp:01 -thread:01 compiler:01 findlib:01 camlp:01 cheers:01 Hi, (I sent a similar message to this ocaml-beginner's list, but I have the feeling this will require the assistance of some heavy-weights...) First, -- and sorry if the answer is obvious -- I still haven't been able to find Ocamlbuild's documentation about the construction of plugins. All I discovered about Ocamlbuild is a brief presentation, the (incomplete) user manual, and the wiki, which are found at the following addresses: http://gallium.inria.fr/~pouillar/ocamlbuild/ocamlbuild-presentation.html http://gallium.inria.fr/~pouillar/ocamlbuild/ocamlbuild-user-guide.html http://brion.inria.fr/gallium/index.php/Ocamlbuild Now, the wiki has a few example plugins, and I've tried to dissect them, but I still have this nagging feeling there must be somewhere some documentation that introduces how these plugins work. I've been cursing at google for a while now, so I am asking directly on this list -- where are those missing pieces? (It's okay if they're not in English) Anyway, what I intend to do is actually very simple. In "classic" makefile notation it is expressed as follows: (note the use of findlib) database.cmo: database.ml PGDATABASE=lambdium ocamlfind ocamlc -package threads,pgocaml.statements -syntax camlp4o -thread -c $< So basically I declare an environment variable PGDATABASE, and invoke the compiler (via findlib) with a Camlp4 preprocessing stage. (The pgocaml.statements package instructs findlib about the module to use for Camlp4; the contents of findlib's META file are listed at the end of this message). I've been looking at how to encode this in Ocamlbuild but I've tripped over some basic problems. First, how are plugins invoked? Second, I cannot find the "Ocamlbuild_plugin" module that is opened by all the examples (I am using GODI). Third, how do I even start to implement the Ocamlbuild code to compile the code above? Thanks in advance for your help! Cheers, Dario Teixeira ________________________________________________________________________________ name="pgocaml" version="1.0" description="PG'OCaml is a set of OCaml bindings for the PostgreSQL database." requires="unix,extlib,csv,pcre,calendar" archive(byte)="pgocaml.cma" archive(native)="pgocaml.cmxa" package "statements" ( requires = "pgocaml,camlp4" version = "1.0" description = "Syntax extension: PostgreSQL statements checked at compile-time" archive(syntax,preprocessor) = "pa_pgsql.cmo" archive(syntax,toploop) = "pa_pgsql.cmo" ) ___________________________________________________________ Yahoo! Answers - Got a question? Someone out there knows the answer. Try it now. http://uk.answers.yahoo.com/