aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/envars.ml5
-rw-r--r--lib/envars.mli12
2 files changed, 14 insertions, 3 deletions
diff --git a/lib/envars.ml b/lib/envars.ml
index 78f14273db..bc8012297f 100644
--- a/lib/envars.ml
+++ b/lib/envars.ml
@@ -135,6 +135,11 @@ let datadir () =
let path = use_suffix coqroot Coq_config.datadirsuffix in
if Sys.file_exists path then path else Coq_config.datadir
+let configdir () =
+ (* This assumes implicitly that the suffix is non-trivial *)
+ let path = use_suffix coqroot Coq_config.configdirsuffix in
+ if Sys.file_exists path then path else Coq_config.configdir
+
let coqpath =
let coqpath = getenv_else "COQPATH" (fun () -> "") in
let make_search_path path =
diff --git a/lib/envars.mli b/lib/envars.mli
index c33a08c405..c8bbf17d96 100644
--- a/lib/envars.mli
+++ b/lib/envars.mli
@@ -27,12 +27,18 @@ val home : warn:(string -> unit) -> string
(** [coqlib] is the path to the Coq library. *)
val coqlib : unit -> string
+(** [docdir] is the path to the installed documentation. *)
+val docdir : unit -> string
+
+(** [datadir] is the path to the installed data directory. *)
+val datadir : unit -> string
+
+(** [configdir] is the path to the installed config directory. *)
+val configdir : unit -> string
+
(** [set_coqlib] must be runned once before any access to [coqlib] *)
val set_coqlib : fail:(string -> string) -> unit
-(** [docdir] is the path to the Coq documentation. *)
-val docdir : unit -> string
-
(** [coqbin] is the name of the current executable. *)
val coqbin : string