aboutsummaryrefslogtreecommitdiffhomepage
path: root/ide/minilib.ml
diff options
context:
space:
mode:
Diffstat (limited to 'ide/minilib.ml')
-rw-r--r--ide/minilib.ml10
1 files changed, 10 insertions, 0 deletions
diff --git a/ide/minilib.ml b/ide/minilib.ml
index 65ff4378e..4896cbd4b 100644
--- a/ide/minilib.ml
+++ b/ide/minilib.ml
@@ -64,6 +64,10 @@ let string_map f s =
let subst_command_placeholder s t =
Str.global_replace (Str.regexp_string "%s") t s
+let path_to_list p =
+ let sep = Str.regexp (if Sys.os_type = "Win32" then ";" else ":") in
+ Str.split sep p
+
(* On win32, the home directory is probably not in $HOME, but in
some other environment variable *)
@@ -78,6 +82,12 @@ let xdg_config_home =
with Not_found ->
Filename.concat home "/.config/coq"
+let xdg_config_dirs =
+ xdg_config_home :: (try
+ List.map (fun dir -> Filename.concat dir "coq") (path_to_list (Sys.getenv "XDG_CONFIG_DIRS"))
+ with Not_found -> "/etc/xdg/coq"::(match Coq_config.configdir with |None -> [] |Some d -> [d]))
+
+
let coqlib = ref ""
let coqtop_path = ref ""