diff options
author | Andy Wingo <wingo@pobox.com> | 2010-08-06 13:15:29 +0200 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2010-08-06 13:15:29 +0200 |
commit | bc325e763f540048adc0e6375172af5cfc38742e (patch) | |
tree | ac775f9b9c5ee6320e875ca3086d2e80f9a9f0df /libguile/load.c | |
parent | ca290a89f3109f125f1eb6eeea066053d4b52e95 (diff) | |
download | guile-bc325e763f540048adc0e6375172af5cfc38742e.tar.gz |
%site-dir is specific to the effective version
* libguile/load.h:
* libguile/load.c (scm_sys_global_site_dir): New API, is what %site-dir
used to be.
(scm_sys_site_dir): Changed to be a version-specific dir.
(scm_init_load_path): Search the version-specific sitedir before the
global one.
* libguile/Makefile.am (libpath.h): Update SCM_SITE_DIR and
SCM_GLOBAL_SITE_DIR, as appropriate.
Diffstat (limited to 'libguile/load.c')
-rw-r--r-- | libguile/load.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/libguile/load.c b/libguile/load.c index 05667af36..7c06c9b09 100644 --- a/libguile/load.c +++ b/libguile/load.c @@ -167,8 +167,9 @@ SCM_DEFINE (scm_sys_library_dir, "%library-dir", 0,0,0, #ifdef SCM_SITE_DIR SCM_DEFINE (scm_sys_site_dir, "%site-dir", 0,0,0, (), - "Return the directory where the Guile site files are installed.\n" - "E.g., may return \"/usr/share/guile/site\".") + "Return the directory where users should install Scheme code for use\n" + "with this version of Guile.\n\n" + "E.g., may return \"/usr/share/guile/site/" SCM_EFFECTIVE_VERSION "\".") #define FUNC_NAME s_scm_sys_site_dir { return scm_from_locale_string (SCM_SITE_DIR); @@ -176,6 +177,18 @@ SCM_DEFINE (scm_sys_site_dir, "%site-dir", 0,0,0, #undef FUNC_NAME #endif /* SCM_SITE_DIR */ +#ifdef SCM_GLOBAL_SITE_DIR +SCM_DEFINE (scm_sys_global_site_dir, "%global-site-dir", 0,0,0, + (), + "Return the directory where users should install Scheme code for use\n" + "with all versions of Guile.\n\n" + "E.g., may return \"/usr/share/guile/site\".") +#define FUNC_NAME s_scm_sys_global_site_dir +{ + return scm_from_locale_string (SCM_GLOBAL_SITE_DIR); +} +#undef FUNC_NAME +#endif /* SCM_GLOBAL_SITE_DIR */ @@ -239,8 +252,9 @@ scm_init_load_path () else if (env) path = scm_parse_path (scm_from_locale_string (env), path); else - path = scm_list_3 (scm_from_locale_string (SCM_LIBRARY_DIR), + path = scm_list_4 (scm_from_locale_string (SCM_LIBRARY_DIR), scm_from_locale_string (SCM_SITE_DIR), + scm_from_locale_string (SCM_GLOBAL_SITE_DIR), scm_from_locale_string (SCM_PKGDATA_DIR)); env = getenv ("GUILE_SYSTEM_COMPILED_PATH"); |