Skip to content

Commit

Permalink
[coq_makefile] Workaround coq#8731
Browse files Browse the repository at this point in the history
  • Loading branch information
ejgallego committed Nov 13, 2018
1 parent cd17026 commit 91a2505
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
8 changes: 7 additions & 1 deletion lib/envars.ml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@ open Util

(** {1 Helper functions} *)

let getenv_else s dft = try Sys.getenv s with Not_found -> dft ()
let getenv_else s dft =
try
let v = Sys.getenv s in
if String.equal v ""
then dft ()
else v
with Not_found -> dft ()

let safe_getenv warning n =
getenv_else n (fun () ->
Expand Down
8 changes: 7 additions & 1 deletion tools/CoqMakefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,13 @@ COQLIBS := $(COQMF_COQLIBS)
COQLIBS_NOML := $(COQMF_COQLIBS_NOML)
CMDLINE_COQLIBS := $(COQMF_CMDLINE_COQLIBS)
LOCAL := $(COQMF_LOCAL)
COQLIB := $(COQMF_COQLIB)
# We add a workaround for #8731; if COQLIB is set externally, don't
# override it.
ifeq ($(COQMF_COQLIB),)
COQLIB := $(shell coqtop -where)/
else
COQLIB := $(COQMF_COQLIB)
endif
DOCDIR := $(COQMF_DOCDIR)
OCAMLFIND := $(COQMF_OCAMLFIND)
CAMLFLAGS := $(COQMF_CAMLFLAGS)
Expand Down

0 comments on commit 91a2505

Please sign in to comment.