Add findlib predicate pkg_utop

This allows required packages to distinguish whether they are
loaded in regular toplevel or in utop, and thus call Toploop
functions or those in UTop.
This commit is contained in:
Peter Zotov 2014-12-11 13:46:08 +03:00
parent 970b308126
commit ff18d998b5
1 changed files with 1 additions and 0 deletions

View File

@ -725,6 +725,7 @@ let () =
(* "utop" is an internal library so it is not passed as "-package"
to "ocamlfind ocamlmktop". *)
Topfind.don't_load ["utop"];
Topfind.add_predicates ["pkg_utop"];
(* Add findlib path so Topfind is available and it won't be
initialized twice if the user does [#use "topfind"]. *)
Topdirs.dir_directory (Findlib.package_directory "findlib");