From: Dario Teixeira <darioteixeira@yahoo.com>
To: caml-list@yquem.inria.fr
Subject: Ocamlbuild plugins
Date: Mon, 5 Nov 2007 20:34:09 +0000 (GMT) [thread overview]
Message-ID: <195667.6858.qm@web54606.mail.re2.yahoo.com> (raw)
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/
next reply other threads:[~2007-11-05 20:34 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-05 20:34 Dario Teixeira [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=195667.6858.qm@web54606.mail.re2.yahoo.com \
--to=darioteixeira@yahoo.com \
--cc=caml-list@yquem.inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox