caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Pietro Abate <Pietro.Abate@pps.univ-paris-diderot.fr>
To: caml-list@inria.fr
Subject: [Caml-list] pre-process myocamlbuild.ml with ocamlbuild ...
Date: Tue, 30 Jun 2015 19:08:00 +0200	[thread overview]
Message-ID: <20150630170800.GA30250@pps.univ-paris-diderot.fr> (raw)

Hi all,

maybe, not the best subject of the week, I know . I'd like to
pre-process the file myocamlbuild.ml with cppo before building it. The
reason is that I have a few unused ocamlbuild tags in my _tags file
(that is auto generated by a script ...), and I'd like to remove all
warnings using 

#ifdef OCAML4022
Ocamlbuild_pack.Flags.mark_tag_used "use_" ;;
Ocamlbuild_pack.Flags.mark_tag_used "pkg_" ;;
Ocamlbuild_pack.Flags.mark_tag_used "link_" ;;
#endif

The problem is that Ocamlbuild_pack.Flags.mark_tag_used exists only 
with ocamlbuild < 4.02 .

my naive idea is to pass ocamlbuild a preprocessing tag of the form
-plugin-tag "pp(cppo)" and then let it handle the rest.

But apparently this does not work. How can I convince ocamlbuild to 
build my plugin using a preprocessing step ?

Instead of this :
e$ocamlbuild
+ /usr/bin/ocamlopt.opt unix.cmxa -I /usr/lib/ocaml/ocamlbuild /usr/lib/ocaml/ocamlbuild/ocamlbuildlib.cmxa myocamlbuild.ml /usr/lib/ocaml/ocamlbuild/ocamlbuild.cmx -o myocamlbuild
File "myocamlbuild.ml", line 5, characters 0-1:
Error: Syntax error

I'd like to build it as : 
$/usr/bin/ocamlopt.opt unix.cmxa -I /usr/lib/ocaml/ocamlbuild /usr/lib/ocaml/ocamlbuild/ocamlbuildlib.cmxa -pp "cppo" myocamlbuild.ml /usr/lib/ocaml/ocamlbuild/ocamlbuild.cmx -o myocamlbuild

what is the magic ocamlbuild incantation ? Or alternatively, Do you
see another solution to my small problem ?

thanks,
p

             reply	other threads:[~2015-06-30 17:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-30 17:08 Pietro Abate [this message]
2015-06-30 18:03 ` ygrek
2015-06-30 20:12   ` Pietro Abate
2015-06-30 20:20     ` ygrek

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=20150630170800.GA30250@pps.univ-paris-diderot.fr \
    --to=pietro.abate@pps.univ-paris-diderot.fr \
    --cc=caml-list@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;
as well as URLs for NNTP newsgroup(s).