Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
* Ocamlbuild plugins
@ 2007-11-05 20:34 Dario Teixeira
  2007-11-06 14:23 ` [Caml-list] " Nicolas Pouillard
  0 siblings, 1 reply; 7+ messages in thread
From: Dario Teixeira @ 2007-11-05 20:34 UTC (permalink / raw)
  To: caml-list

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/ 


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2007-11-07 16:07 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-05 20:34 Ocamlbuild plugins Dario Teixeira
2007-11-06 14:23 ` [Caml-list] " Nicolas Pouillard
2007-11-06 16:23   ` Dario Teixeira
2007-11-06 19:29     ` Nicolas Pouillard
2007-11-07 13:39       ` Dario Teixeira
2007-11-07 16:01         ` Nicolas Pouillard
2007-11-07 16:07       ` Alan Falloon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox