From 9b89699fa5c6c6a8fb5ff2ae5bbb010853b2d5cb Mon Sep 17 00:00:00 2001 From: Gabriel Kerneis Date: Sun, 24 Aug 2014 09:00:12 +0200 Subject: Use LEM_DIR environment variable if defined LEM_DIR must contain the *absolute* path the Lem directory. If not defined, the previous behaviour is retained: a relative path is used, assuming Lem is in bitbucket/lem. --- src/myocamlbuild.ml | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/myocamlbuild.ml b/src/myocamlbuild.ml index 5ba172cb..f1fa7a88 100644 --- a/src/myocamlbuild.ml +++ b/src/myocamlbuild.ml @@ -16,20 +16,13 @@ let split ch s = go s (* paths relative to _build *) -let lem_dir = "../../../lem" ;; +let lem_dir = + try Sys.getenv "LEM_DIR" (* LEM_DIR must contain an absolute path *) + with Not_found -> "../../../lem" ;; let lem_libdir = lem_dir / "ocaml-lib/_build" ;; let lem_lib = lem_libdir / "extract" ;; let lem = lem_dir / "lem" ;; -(* Order matters - respect dependencies! *) -let lem_deps = List.map ((/) "lem_interp") [ - "interp_ast.lem"; - "interp.lem"; - "interp_lib.lem"; - ] ;; -let lem_opts = List.fold_right (fun s l -> [A "-i"; P s] @ l) lem_deps [] ;; - -(* New library magic: *) (* All -wl ignores should be removed if you want to see the pattern compilation, exhaustive, and unused var warnings *) let lem_opts = [A "-lib"; P "../lem_interp"; A "-wl_pat_comp"; P "ign"; -- cgit v1.2.3