diff options
author | Stephane Glondu <steph@glondu.net> | 2013-05-08 17:47:16 +0200 |
---|---|---|
committer | Stephane Glondu <steph@glondu.net> | 2013-05-08 17:47:16 +0200 |
commit | 813d651c75cb954677a483b60d880600b421e011 (patch) | |
tree | f917021e7e7083cf1ce84f9a560179603f0c7af6 /lib/envars.ml | |
parent | 0c6687c12b628881d5660d57707f0e7ca9e521b7 (diff) | |
parent | 499a11a45b5711d4eaabe84a80f0ad3ae539d500 (diff) |
Merge tag 'upstream/8.4pl2dfsg' into experimental/master
Upstream version 8.4pl2dfsg
Diffstat (limited to 'lib/envars.ml')
-rw-r--r-- | lib/envars.ml | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/lib/envars.ml b/lib/envars.ml index 4ec68a27..c672d30c 100644 --- a/lib/envars.ml +++ b/lib/envars.ml @@ -23,6 +23,8 @@ let _ = if Coq_config.arch = "win32" then Unix.putenv "PATH" (coqbin ^ ";" ^ System.getenv_else "PATH" "") +let exe s = s ^ Coq_config.exec_extension + let reldir instdir testfile oth = let rpath = if Coq_config.local then [] else instdir in let out = List.fold_left Filename.concat coqroot rpath in @@ -87,19 +89,19 @@ let rec which l f = else which tl f let guess_camlbin () = - let path = try Sys.getenv "PATH" with _ -> raise Not_found in + let path = Sys.getenv "PATH" in (* may raise Not_found *) let lpath = path_to_list path in - which lpath "ocamlc" + which lpath (exe "ocamlc") let guess_camlp4bin () = - let path = try Sys.getenv "PATH" with _ -> raise Not_found in + let path = Sys.getenv "PATH" in (* may raise Not_found *) let lpath = path_to_list path in - which lpath Coq_config.camlp4 + which lpath (exe Coq_config.camlp4) let camlbin () = if !Flags.camlbin_spec then !Flags.camlbin else if !Flags.boot then Coq_config.camlbin else - try guess_camlbin () with _ -> Coq_config.camlbin + try guess_camlbin () with e when e <> Sys.Break -> Coq_config.camlbin let camllib () = if !Flags.boot @@ -113,9 +115,10 @@ let camllib () = let camlp4bin () = if !Flags.camlp4bin_spec then !Flags.camlp4bin else if !Flags.boot then Coq_config.camlp4bin else - try guess_camlp4bin () with _ -> let cb = camlbin () in - if Sys.file_exists (Filename.concat cb Coq_config.camlp4) then cb - else Coq_config.camlp4bin + try guess_camlp4bin () with e when e <> Sys.Break -> + let cb = camlbin () in + if Sys.file_exists (Filename.concat cb (exe Coq_config.camlp4)) then cb + else Coq_config.camlp4bin let camlp4lib () = if !Flags.boot |