12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273(************************************************************************)(* * The Rocq Prover / The Rocq Development Team *)(* v * Copyright INRIA, CNRS and contributors *)(* <O___,, * (see version control and CREDITS file for authors & dates) *)(* \VV/ **************************************************************)(* // * This file is distributed under the terms of the *)(* * GNU Lesser General Public License Version 2.1 *)(* * (see LICENSE file for the text of the license) *)(************************************************************************)openUtilopenPp(* Recursively puts `.v` files in the LoadPath *)letbuild_corelib_vo_path~unix_path~rocq_path=letopenLoadpathin{unix_path;coq_path=rocq_path;implicit=true;recursive=true;installed=true}letbuild_userlib_path~unix_path=letopenLoadpathinifSys.file_existsunix_paththenletvo_path={unix_path;coq_path=Libnames.default_root_prefix;implicit=false;recursive=true;installed=true}in[vo_path]else[](* LoadPath for Rocq user libraries *)letinit_load_path~coqenv=letopenLoadpathinletuser_contrib=Boot.Env.user_contribcoqenv|>Boot.Path.to_stringinletxdg_dirs=Envars.xdg_dirs~warn:(funx->Feedback.msg_warning(strx))inletrocqpath=Envars.coqpathinletrocq_path=Names.DirPath.make[Libnames.rocq_init_root]in(* ML includes *)letcore_dir=Boot.Env.runtimelibcoqenvin(* EJGA: this needs clenaup, we must be deterministic *)letmeta_dir=ifBoot.Env.Path.(exists(relativecore_dir"META"))then[Boot.Env.Path.(to_string(relativecore_dir".."))]else[]inletcorelib=Boot.Env.corelibcoqenv|>Boot.Path.to_stringinletcontrib_vo=build_userlib_path~unix_path:user_contribinletmisc_vo=List.map(funs->build_userlib_path~unix_path:s)(xdg_dirs@(rocqpath()))inletml_loadpath=meta_dirinletvo_loadpath=(* current directory (not recursively!) *)[{unix_path=".";coq_path=Libnames.default_root_prefix;implicit=false;recursive=false;installed=false(* not considered "installed" *)}]@(* then standard library *)[build_corelib_vo_path~unix_path:corelib~rocq_path]@(* then user-contrib *)contrib_vo@(* then directories in XDG_DATA_DIRS and XDG_DATA_HOME and ROCQPATH *)List.concatmisc_voinml_loadpath,vo_loadpath