aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/envars.ml
diff options
context:
space:
mode:
authorGravatar pboutill <pboutill@85f007b7-540e-0410-9357-904b9bb8a0f7>2011-04-29 06:14:00 +0000
committerGravatar pboutill <pboutill@85f007b7-540e-0410-9357-904b9bb8a0f7>2011-04-29 06:14:00 +0000
commit7e5956fdff2d9312fa27c539015f889513a32c8e (patch)
tree23f83c6830a71d56f066d4c027d212783578f5b9 /lib/envars.ml
parent364902a41bf9e01bb749f0bf44f054db0b8ec686 (diff)
Choose relative directory over configured directory for coqlib.
This also fixes the bug where Util.error is always called, if coq searches for a relative directory. Signed-off-by: Tom Prince <tom.prince@ualberta.net> git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@14084 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'lib/envars.ml')
-rw-r--r--lib/envars.ml12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/envars.ml b/lib/envars.ml
index c260a8648..4f33ccb7f 100644
--- a/lib/envars.ml
+++ b/lib/envars.ml
@@ -25,21 +25,21 @@ let reldir instdir testfile oth =
let prefix = Filename.dirname (coqbin ()) in
let rpath = if Coq_config.local then [] else instdir in
let out = List.fold_left Filename.concat prefix rpath in
- if Sys.file_exists (Filename.concat out testfile) then out else oth
+ if Sys.file_exists (Filename.concat out testfile) then out else oth ()
let guess_coqlib () =
let file = "states/initial.coq" in
- if Sys.file_exists (Filename.concat Coq_config.coqlib file)
- then Coq_config.coqlib
- else reldir (if Coq_config.arch = "win32" then ["lib"] else ["lib";"coq"]) file
- (Util.error "cannot guess a path for Coq libraries; please use -coqlib option")
+ reldir (if Coq_config.arch = "win32" then ["lib"] else ["lib";"coq"]) file
+ (fun () -> if Sys.file_exists (Filename.concat Coq_config.coqlib file)
+ then Coq_config.coqlib
+ else Util.error "cannot guess a path for Coq libraries; please use -coqlib option")
let coqlib () =
if !Flags.coqlib_spec then !Flags.coqlib else
(if !Flags.boot then Coq_config.coqsrc else guess_coqlib ())
let docdir () =
- reldir (if Coq_config.arch = "win32" then ["doc"] else ["share";"doc";"coq"]) "html" Coq_config.docdir
+ reldir (if Coq_config.arch = "win32" then ["doc"] else ["share";"doc";"coq"]) "html" (fun () -> Coq_config.docdir)
let path_to_list p =
let sep = if Sys.os_type = "Win32" then ';' else ':' in