2010-06-15 10:49:03 +02:00
|
|
|
open Ocamlbuild_plugin
|
|
|
|
open Ocamlbuild_plugin.Options
|
|
|
|
|
|
|
|
let df = function
|
|
|
|
| After_rules ->
|
|
|
|
(* Tell ocamlbuild about the camlp4 library. *)
|
|
|
|
ocaml_lib ~extern:true ~dir:"+camlp4" "camlp4";
|
|
|
|
|
2010-06-30 16:59:51 +02:00
|
|
|
(* Tell ocamlbuild about Menhir library (needed by --table). *)
|
|
|
|
ocaml_lib ~extern:true ~dir:"+menhirLib" "menhirLib";
|
|
|
|
|
2011-04-19 15:36:00 +02:00
|
|
|
(* Tell ocamlbuild about the ocamlgraph library. *)
|
2011-04-20 15:47:05 +02:00
|
|
|
ocaml_lib ~extern:true ~dir:"+ocamlgraph" "graph";
|
2011-04-19 15:36:00 +02:00
|
|
|
|
2010-06-30 16:59:51 +02:00
|
|
|
(* Menhir does not come with menhirLib.cmxa so we have to manually by-pass
|
|
|
|
OCamlbuild's built-in logic and add the needed menhirLib.cmxa. *)
|
2010-07-05 15:15:24 +02:00
|
|
|
flag ["link"; "native"; "link_menhirLib"] (S [A "-I"; A "+menhirLib";
|
|
|
|
A "menhirLib.cmx"]);
|
|
|
|
flag ["link"; "byte"; "link_menhirLib"] (S [A "-I"; A "+menhirLib";
|
|
|
|
A "menhirLib.cmo"]);
|
|
|
|
|
2010-06-30 16:59:51 +02:00
|
|
|
|
|
|
|
|
2010-06-15 10:49:03 +02:00
|
|
|
(* Add preproc.cmo to the ocaml pre-processor when use_preproc is set *)
|
|
|
|
flag ["ocaml"; "pp"; "use_preproc"] (A "preproc.cmo");
|
2010-06-30 16:59:51 +02:00
|
|
|
|
2010-06-15 10:49:03 +02:00
|
|
|
(* Running ocamldep on ocaml code that is tagged with use_preproc will
|
|
|
|
require the cmo. Note that you only need this declaration when the
|
|
|
|
syntax extension is part of the sources to be compiled with
|
|
|
|
ocamlbuild. *)
|
|
|
|
dep ["ocaml"; "ocamldep"; "use_preproc"] ["preproc.cmo"];
|
|
|
|
|
|
|
|
(* LablGTK use for graphical simulator *)
|
2010-06-27 17:24:31 +02:00
|
|
|
ocaml_lib ~extern:true ~dir:"+lablgtk2" "lablgtk";
|
2011-05-12 10:08:13 +02:00
|
|
|
ocaml_lib ~extern:true "lablgtkthread";
|
2010-06-29 11:18:50 +02:00
|
|
|
|
2010-06-30 16:59:51 +02:00
|
|
|
flag ["ocaml"; "parser" ; "menhir" ; "use_menhir"] (S[A"--explain";
|
|
|
|
A"--table"]);
|
2010-06-29 11:18:50 +02:00
|
|
|
|
2011-04-18 15:47:25 +02:00
|
|
|
flag ["ocaml"; "compile" ] (S[A"-w"; A"Ae"; A"-warn-error"; A"PU"; A"-w"; A"-9"]);
|
2010-09-14 09:39:02 +02:00
|
|
|
|
2010-06-15 10:49:03 +02:00
|
|
|
| _ -> ()
|
|
|
|
|
|
|
|
let _ = dispatch df
|