From: Romain Bardou <Romain.Bardou@lri.fr>
To: Dario Teixeira <darioteixeira@yahoo.com>
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Ocamlbuild with findlib + camlp4
Date: Wed, 05 Mar 2008 16:08:24 +0100 [thread overview]
Message-ID: <47CEB768.10508@lri.fr> (raw)
In-Reply-To: <644528.65296.qm@web54604.mail.re2.yahoo.com>
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
next prev parent reply other threads:[~2008-03-05 15:05 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-05 13:41 Dario Teixeira
2008-03-05 15:08 ` Romain Bardou [this message]
2008-03-06 15:31 ` [Caml-list] " Dario Teixeira
2008-03-06 15:46 ` Pietro Abate
2008-03-06 19:45 ` Dario Teixeira
2008-03-06 22:14 ` Pietro Abate
2008-03-07 9:26 ` Romain Bardou
2008-03-07 14:46 ` Dario Teixeira
2008-03-07 15:01 ` Nicolas Pouillard
2008-03-07 16:12 ` Dario Teixeira
2008-03-08 11:36 ` Nicolas Pouillard
2008-03-10 15:33 ` Dario Teixeira
2008-03-10 16:15 ` Romain Bardou
2008-03-10 21:13 ` Dario Teixeira
2008-03-10 19:56 ` Arnaud Spiwack
2008-03-10 21:15 ` Dario Teixeira
2008-03-11 10:37 ` Nicolas Pouillard
2008-03-11 13:49 ` Romain Bardou
2008-03-11 15:03 ` Romain Bardou
2008-03-11 17:32 ` Dario Teixeira
2008-03-11 20:17 ` Richard Jones
2008-03-11 10:41 ` Nicolas Pouillard
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=47CEB768.10508@lri.fr \
--to=romain.bardou@lri.fr \
--cc=caml-list@yquem.inria.fr \
--cc=darioteixeira@yahoo.com \
/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