123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172(************************************************************************)(* * The Coq Proof Assistant / The Coq 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~coq_path=letopenLoadpathin{unix_path;coq_path;has_ml=false;implicit=true;recursive=true}(* Note we don't use has_ml=true due to #12771 , we need to see if we
should just remove that option *)letbuild_userlib_path~unix_path=letopenLoadpathinifSys.file_existsunix_paththenletml_path=System.all_subdirs~unix_path|>List.mapfstinletvo_path={unix_path;coq_path=Libnames.default_root_prefix;has_ml=false;implicit=false;recursive=true}inml_path,[vo_path]else[],[](* LoadPath for Coq 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))inletcoqpath=Envars.coqpathinletcoq_path=Names.DirPath.make[Libnames.coq_root]in(* ML includes *)letunix_path=Boot.Env.pluginscoqenv|>Boot.Path.to_stringinletplugins_dirs=System.all_subdirs~unix_path|>List.mapfstinletstdlib=Boot.Env.stdlibcoqenv|>Boot.Path.to_stringinletcontrib_ml,contrib_vo=build_userlib_path~unix_path:user_contribinletmisc_ml,misc_vo=List.map(funs->build_userlib_path~unix_path:s)(xdg_dirs@coqpath)|>List.splitinletml_loadpath=plugins_dirs@contrib_ml@List.concatmisc_mlinletvo_loadpath=(* current directory (not recursively!) *)[{unix_path=".";coq_path=Libnames.default_root_prefix;implicit=false;has_ml=true;recursive=false}]@(* then standard library *)[build_stdlib_vo_path~unix_path:stdlib~coq_path]@(* then user-contrib *)contrib_vo@(* then directories in XDG_DATA_DIRS and XDG_DATA_HOME and COQPATH *)List.concatmisc_voinml_loadpath,vo_loadpath