Define a build time configurable default value for the new BASH_LIBRARIES_PATH variable. Look for libraries in the user's home directory as well as the system wide directories.
Signed-off-by: Matheus Afonso Martins Moreira <math...@matheusmoreira.com> --- config-top.h | 7 +++++++ variables.c | 1 + 2 files changed, 8 insertions(+) diff --git a/config-top.h b/config-top.h index db4ab6ee..8f31e285 100644 --- a/config-top.h +++ b/config-top.h @@ -83,6 +83,13 @@ "/usr/local/lib/bash:/usr/lib/bash:/opt/local/lib/bash:/usr/pkg/lib/bash:/opt/pkg/lib/bash:." #endif +/* The default value of the BASH_LIBRARIES_PATH variable + which is used by source -l instead of PATH. */ +#ifndef DEFAULT_LIBRARIES_PATH +#define DEFAULT_LIBRARIES_PATH \ + "~/.local/lib/bash:/usr/local/lib/bash:/usr/lib/bash" +#endif + /* Default primary and secondary prompt strings. */ #define PPROMPT "\\s-\\v\\$ " #define SPROMPT "> " diff --git a/variables.c b/variables.c index 1a0c2c45..f2f8c76c 100644 --- a/variables.c +++ b/variables.c @@ -697,6 +697,7 @@ initialize_shell_variables (env, privmode) uidset (); temp_var = set_if_not ("BASH_LOADABLES_PATH", DEFAULT_LOADABLE_BUILTINS_PATH); + temp_var = set_if_not ("BASH_LIBRARIES_PATH", DEFAULT_LIBRARIES_PATH); temp_var = find_variable ("BASH_XTRACEFD"); if (temp_var && imported_p (temp_var)) -- 2.44.0