From: "Nicolas Pouillard" <nicolas.pouillard@gmail.com>
To: Dario Teixeira <darioteixeira@yahoo.com>
Cc: caml-list <caml-list@yquem.inria.fr>
Subject: Re: [Caml-list] Ocamlbuild plugins
Date: Wed, 07 Nov 2007 17:01:26 +0100 [thread overview]
Message-ID: <1194450072-sup-4055@port-ext2.ensta.fr> (raw)
In-Reply-To: <600766.97480.qm@web54604.mail.re2.yahoo.com>
Excerpts from Dario Teixeira's message of Wed Nov 07 14:39:19 +0100 2007:
> Hi,
>
> > (...)
> > Sadly you're right. As always any help/contribution will be appreciated :)
>
> Well, I'll do my part: once I grok Ocamlbuild I'll profusely document
> the myocamlbuild.ml for my project.
>
> Anyway, thanks again for your help. I have at the moment a myocamlbuild.ml
> that can handle almost everything I need; the only bit that isn't working
> is precisely the part that handles camlp4. So, here's the myocamlbuild.ml:
> ______________________________________________________________
>
> open Ocamlbuild_plugin
> open Command
>
> let ocamlfind x =
> let packages = "calendar, ocsigen" in
> S[A "ocamlfind"; x; A "-package"; A packages];;
>
> dispatch begin function
> | Before_options ->
> Options.ocamlc := ocamlfind & A"ocamlc";
> Options.ocamlopt := ocamlfind & A"ocamlopt";
> Options.ocamldep := ocamlfind & A"ocamldep"
> | After_rules ->
> let some_flags = S[A"-package"; A"pgocaml.statements";
> A"-syntax"; A"camlp4o"] in
> flag ["ocaml"; "compile"; "use_pgocaml_statements"]
> some_flags;
> flag ["ocaml"; "ocamldep"; "use_pgocaml_statements"]
> some_flags;
> flag ["ocaml"; "link"] (A"-linkpkg")
> | _ -> ()
> end;;
> ______________________________________________________________
>
> I also have a _tags file with just one line:
> "database.ml": use_pgocaml_statements, thread
>
> And this is the error I get when I run "ocamlbuild database.cmo":
> ______________________________________________________________
>
> + ocamlfind ocamldep -package 'calendar, ocsigen' -package pgocaml.statements
> -syntax camlp4o -pp '-package pgocaml.statements -syntax camlp4o' -modules
> database.ml > database.ml.depends
> Warning: -pp overrides the effect of -syntax partly
> sh: Illegal option -p
> Preprocessing error on file database.ml
> Command exited with code 2.
Arg too bad, that's an ocamlbuild bug. I didn't see it since I always use -pp
and not -syntax of ocamlfind.
You should try to use the .cmo of your syntax extension.
Use these declarations and replace pa_openin.cmo by the cmo of pgocaml.statements.
(* One add pa_openin.cmo to the ocaml pre-processor when use_opening is set *)
flag ["ocaml"; "pp"; "use_openin"] (A"pa_openin.cmo");
(* Running ocamldep on ocaml code that is tagged use_openin will require the cmo *)
dep ["ocaml"; "ocamldep"; "use_openin"] ["pa_openin.cmo"];
Let me know if it works...
--
Nicolas Pouillard aka Ertai
next prev parent reply other threads:[~2007-11-07 16:02 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-05 20:34 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 [this message]
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=1194450072-sup-4055@port-ext2.ensta.fr \
--to=nicolas.pouillard@gmail.com \
--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