diff options
author | herbelin <herbelin@85f007b7-540e-0410-9357-904b9bb8a0f7> | 2011-04-14 18:47:38 +0000 |
---|---|---|
committer | herbelin <herbelin@85f007b7-540e-0410-9357-904b9bb8a0f7> | 2011-04-14 18:47:38 +0000 |
commit | f36693e6a38ef7395905f7388da3d450cf5b3b5a (patch) | |
tree | aad9678c1df92ab33a4f30611a8ccf7f0c48371b /lib | |
parent | 3f787586c709a75e73837e4384d10752079bc646 (diff) |
Add directories in COQPATH to search path.
This is to allow users to install plugins when coq is installed system-wide.
Signed-off-by: Tom Prince <tom.prince@ualberta.net>
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@14001 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'lib')
-rw-r--r-- | lib/envars.ml | 6 | ||||
-rw-r--r-- | lib/envars.mli | 3 |
2 files changed, 9 insertions, 0 deletions
diff --git a/lib/envars.ml b/lib/envars.ml index efb2d3fa4..a05029c95 100644 --- a/lib/envars.ml +++ b/lib/envars.ml @@ -35,6 +35,12 @@ let path_to_list p = let sep = if Sys.os_type = "Win32" then ';' else ':' in Util.split_string_at sep p +let coqpath () = + try + let path = Sys.getenv "COQPATH" in + List.rev (path_to_list path) + with _ -> [] + let rec which l f = match l with | [] -> raise Not_found diff --git a/lib/envars.mli b/lib/envars.mli index e48f3ea00..6d053be6d 100644 --- a/lib/envars.mli +++ b/lib/envars.mli @@ -11,6 +11,9 @@ val coqlib : unit -> string val coqbin : unit -> string +(* coqpath is stored in reverse order, since that is the order it + * gets added to the searc path *) +val coqpath : unit -> string list val camlbin : unit -> string val camlp4bin : unit -> string |