From f36693e6a38ef7395905f7388da3d450cf5b3b5a Mon Sep 17 00:00:00 2001 From: herbelin Date: Thu, 14 Apr 2011 18:47:38 +0000 Subject: 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 git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@14001 85f007b7-540e-0410-9357-904b9bb8a0f7 --- lib/envars.ml | 6 ++++++ lib/envars.mli | 3 +++ 2 files changed, 9 insertions(+) (limited to 'lib') diff --git a/lib/envars.ml b/lib/envars.ml index efb2d3fa46..a05029c95b 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 e48f3ea000..6d053be6d5 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 -- cgit v1.2.3