diff options
| author | Robert Norton | 2018-04-26 11:14:11 +0100 |
|---|---|---|
| committer | Robert Norton | 2018-04-26 11:49:57 +0100 |
| commit | 1bd54ce4c7d85b150f2200abeed0dff67087837c (patch) | |
| tree | 9b2a1d727e98317deb2226c5bdb9f0a5fe4f1eb7 /src/process_file.ml | |
| parent | e18d8f85058f50043e600c4a0c32937a24777438 (diff) | |
Opam packaging: add install and uninstall targets and code to find various files in installed location.
Diffstat (limited to 'src/process_file.ml')
| -rw-r--r-- | src/process_file.ml | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/process_file.ml b/src/process_file.ml index 88220841..dd34f49c 100644 --- a/src/process_file.ml +++ b/src/process_file.ml @@ -149,7 +149,12 @@ let rec preprocess = function let file = String.sub file 1 (len - 2) in let sail_dir = try Sys.getenv "SAIL_DIR" with - | Not_found -> (failwith ("Environment variable SAIL_DIR unset. Cannot $include " ^ file)) + | Not_found -> + let lib_dir = Filename.concat Install_directory.d "lib" in + if Sys.is_directory lib_dir then + Install_directory.d + else + (failwith ("Library directory " ^ lib_dir ^ " does not exist. Make sure sail is installed or try setting environment variable SAIL_DIR so that I can find $include " ^ file)) in let file = Filename.concat sail_dir ("lib/" ^ file) in let (Parse_ast.Defs include_defs) = parse_file file in |
