Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Fetching contributors…
Cannot retrieve contributors at this time
70 lines (56 sloc) 2.43 KB
Copyright © 2011 MLstate
This file is part of OPA.
OPA is free software: you can redistribute it and/or modify it under the
terms of the GNU Affero General Public License, version 3, as published by
the Free Software Foundation.
OPA is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
more details.
You should have received a copy of the GNU Affero General Public License
along with OPA. If not, see <>.
(* -- Preprocessing -- *)
let extern_on_windows = false in
(* pp_script *)
let mlstate_debug, mlstate_nodebug, pa_ulex =
if windows_mode then
let pp_script s=
let win_exists s = try ignore(Unix.stat s);true with _ -> false in (* under cygwin, Unix.*link* does not work *)
let location = (Sys.getenv "LIBQML")^"/preprocessing/" in
location ^ s ^ ".bat"
(* pre-defined wrapper scripts to workaround the "no space in ppdebug string" bug on windows *)
(* (they do the same as the commands below) *)
P (pp_script "mlstate_debug"),
P (pp_script "mlstate_nodebug"),
P (pp_script "pa_ulex")
P (Pathname.pwd/"utils"/""),
S [ P (Pathname.pwd/"utils"/""); A "-r" ],
S [ P Config.camlp4o;
(match Config.Libdir.ulex with
| Some dir -> S [A "-I"; P dir]
| None -> N);
P "pa_ulex.cma"; P "pr_o.cmo" ]
flag ["ocaml"; "pp"; "with_mlstate_debug"]
(if List.mem "release" !Options.tags then mlstate_nodebug else mlstate_debug);
(** Ulex *)
flag ["ocaml"; "pp"; "use_ulex_pp"] pa_ulex;
(* This additional rule needs to be after the rule for plugins in
opa. Hence its presence here *)
(* This rule can probably be improved *)
rule "ocaml shared object: cmx -> cmxs"
~dep: "%.cmx"
~prod: "%.cmxs"
(fun env build ->
T(tags_of_pathname (env "%.cmx"));T(tags_of_pathname (env "%.cmxs"));
A"-shared";A"-o";P(env "%.cmxs");P(env "%.cmx")]));
(try set_tool ~internal:false "trx" (Sys.getenv "TRX_OVERRIDE")
with Not_found -> ());
| _ -> ()
Jump to Line
Something went wrong with that request. Please try again.