summaryrefslogtreecommitdiff
path: root/src/process_file.ml
diff options
context:
space:
mode:
Diffstat (limited to 'src/process_file.ml')
-rw-r--r--src/process_file.ml7
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