Advertisement
Guest User

Untitled

a guest
Feb 10th, 2016
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
OCaml 0.90 KB | None | 0 0
  1. (* Myocamlbuild *)
  2.  
  3. open Ocamlbuild_pack
  4. open Ocamlbuild_plugin
  5. open Command
  6. open Ocaml_specific
  7.  
  8. let system_lib_dir = "/usr/lib"
  9.  
  10. let ocamlfind_query pkg =
  11.  let cmd = Printf.sprintf "ocamlfind query %s" (Filename.quote pkg) in
  12.  My_unix.run_and_open cmd (fun ic ->
  13.    Log.dprintf 5 "Getting Ocaml directory from command %s" cmd;
  14.    input_line ic)
  15.  
  16. let dirs =
  17.   [
  18.   ]
  19.  
  20. let _ = dispatch begin fun x ->
  21.   match x with
  22.   | After_options -> Options.include_dirs := dirs @ !Options.include_dirs
  23.   | After_rules ->
  24.       begin
  25.         let sexplib_dir = ocamlfind_query "sexplib" in
  26.         let type_conv_dir = ocamlfind_query "type-conv" in
  27.         ocaml_lib ~extern:true ~dir:sexplib_dir "sexplib";
  28.  
  29.         flag
  30.           ["ocaml"; "pp"; "use_sexplib.syntax"] &
  31.           S[A"-I"; A type_conv_dir; A"-I"; A sexplib_dir; A"pa_type_conv.cmo"; A"pa_sexp_conv.cmo"];
  32.       end
  33.   | _ -> ()
  34.   end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement