Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
extraneous -pp options with myocamlbuild
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-06-25 (16:06)
From: Andrew Warshaver <awarshaver@j...>
Subject: extraneous -pp options with myocamlbuild
Hi Folks,

I'm trying to use a myocamlbuild file with ocamlbuild.  It appears to me 
that by my specifying a -pp option, an extra -pp option gets thrown in 
and I'm not sure why.  Here is my (which I stole mostly 
from another email):

$ cat
open Ocamlbuild_plugin;;
open Command;;

let packages = "pcre,netstring,jane,lbm"

let pp = "camlp4o /home/awarshaver/multi-oc/lib/pa_type_conv.cmo 

let ocamlfind cmd =
S [A "ocamlfind"; A cmd; A "-thread"; A "-package"; A packages];;

flag ["ocaml"] (S[A "-pp"; A pp]);;
flag ["ocaml"; "link"] (A"-linkpkg");;

dispatch begin function
   | After_options ->
       Options.ocamlc := ocamlfind "c";
       Options.ocamlopt := ocamlfind "opt";
   | _ -> ()

And here is what happens at the terminal...

$ ./
+ /usr/local/home/godi310/godi/bin/ocamldep.opt -pp 'camlp4o 
/home/awarshaver/multi-oc/lib/pa_sexp_conv.cmo' -pp '-pp '\''camlp4o 
/home/awarshaver/multi-oc/lib/pa_sexp_conv.cmo'\''' -modules >
sh: - : invalid option

As you can see, after the first -pp '..' there is another -pp, and then 
another '-pp ...', completely unexpected.