aboutsummaryrefslogtreecommitdiff
path: root/tools/coqdoc
diff options
context:
space:
mode:
authorGaëtan Gilbert2019-02-21 14:18:43 +0100
committerGaëtan Gilbert2019-02-21 14:18:43 +0100
commit5f7bb95b6532a6983a2d1880aa531e4e4dd6568d (patch)
tree668ac7028f2f0490c15054d93c6b0868eaed93ea /tools/coqdoc
parent87b4657566d5d4f0ea3d40dae7ba470d957ffe76 (diff)
parentd6f88819f5279e94d33e0e15f6be1e368210af08 (diff)
Merge PR #9588: [azure] [ci] Build on Windows using Dune.
Reviewed-by: SkySkimmer
Diffstat (limited to 'tools/coqdoc')
-rw-r--r--tools/coqdoc/cdglobals.ml5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/coqdoc/cdglobals.ml b/tools/coqdoc/cdglobals.ml
index 0d3fb77551..5dd6cc6c83 100644
--- a/tools/coqdoc/cdglobals.ml
+++ b/tools/coqdoc/cdglobals.ml
@@ -79,14 +79,17 @@ let use_suffix prefix suffix =
(** A weaker analog of the function in Envars *)
+let getenv_else s dft = try Sys.getenv s with Not_found -> dft ()
+
let guess_coqlib () =
+ getenv_else "COQLIB" (fun () ->
let file = "theories/Init/Prelude.vo" in
let coqbin = normalize_path (Filename.dirname Sys.executable_name) in
let prefix = Filename.dirname coqbin in
let coqlib = use_suffix prefix Coq_config.coqlibsuffix in
if Sys.file_exists (coqlib / file) then coqlib else
if not Coq_config.local && Sys.file_exists (Coq_config.coqlib / file)
- then Coq_config.coqlib else prefix
+ then Coq_config.coqlib else prefix)
let header_trailer = ref true
let header_file = ref ""