From 1bd54ce4c7d85b150f2200abeed0dff67087837c Mon Sep 17 00:00:00 2001 From: Robert Norton Date: Thu, 26 Apr 2018 11:14:11 +0100 Subject: Opam packaging: add install and uninstall targets and code to find various files in installed location. --- src/process_file.ml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/process_file.ml') 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 -- cgit v1.2.3