1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071(************************************************************************)(* * 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_stdlib_vo_path~unix_path~rocq_path=letopenLoadpathin{unix_path;coq_path=rocq_path;implicit=true;recursive=true}letbuild_userlib_path~unix_path=letopenLoadpathinifSys.file_existsunix_paththenletvo_path={unix_path;coq_path=Libnames.default_root_prefix;implicit=false;recursive=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.corelibcoqenvin(* 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[]inletstdlib=Boot.Env.stdlibcoqenv|>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}]@(* then standard library *)[build_stdlib_vo_path~unix_path:stdlib~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