diff --git a/libguile/load.c b/libguile/load.c index 6dc05ef37..0f4783bc2 100644 --- a/libguile/load.c +++ b/libguile/load.c @@ -211,9 +211,17 @@ scm_init_load_path () SCM path = SCM_EOL; #ifdef SCM_LIBRARY_DIR - path = scm_list_3 (scm_from_locale_string (SCM_SITE_DIR), - scm_from_locale_string (SCM_LIBRARY_DIR), - scm_from_locale_string (SCM_PKGDATA_DIR)); + env = getenv ("GUILE_SYSTEM_PATH"); + if (env && strcmp (env, "") == 0) + /* special-case interpret system-path=="" as meaning no system path instead + of '("") */ + ; + else if (env) + path = scm_parse_path (scm_from_locale_string (env), path); + else + path = scm_list_3 (scm_from_locale_string (SCM_SITE_DIR), + scm_from_locale_string (SCM_LIBRARY_DIR), + scm_from_locale_string (SCM_PKGDATA_DIR)); #endif /* SCM_LIBRARY_DIR */ env = getenv ("GUILE_LOAD_PATH"); diff --git a/pre-inst-guile-env.in b/pre-inst-guile-env.in index e83ca4317..f9dd60179 100644 --- a/pre-inst-guile-env.in +++ b/pre-inst-guile-env.in @@ -66,6 +66,11 @@ else fi export GUILE_LOAD_PATH +# Don't look in installed dirs for guile modules +if ( env | grep -v -q -E '^GUILE_SYSTEM_PATH=' ); then + export GUILE_SYSTEM_PATH= +fi + # handle LTDL_LIBRARY_PATH (no clobber) ltdl_prefix="" dyld_prefix=""