diff options
Diffstat (limited to 'libguile/load.c')
-rw-r--r-- | libguile/load.c | 42 |
1 files changed, 40 insertions, 2 deletions
diff --git a/libguile/load.c b/libguile/load.c index c2380b94e..b0137a11b 100644 --- a/libguile/load.c +++ b/libguile/load.c @@ -210,6 +210,9 @@ static SCM *scm_loc_load_compiled_extensions; /* Whether we should try to auto-compile. */ static SCM *scm_loc_load_should_auto_compile; +/* Whether to treat all auto-compiled files as stale. */ +static SCM *scm_loc_fresh_auto_compile; + /* The fallback path for auto-compilation */ static SCM *scm_loc_compile_fallback_path; @@ -824,6 +827,7 @@ SCM_DEFINE (scm_primitive_load_path, "primitive-load-path", 0, 0, 1, if (scm_is_false (compiled_filename) && scm_is_true (full_filename) && scm_is_true (*scm_loc_compile_fallback_path) + && scm_is_false (*scm_loc_fresh_auto_compile) && scm_is_pair (*scm_loc_load_compiled_extensions) && scm_is_string (scm_car (*scm_loc_load_compiled_extensions))) { @@ -857,6 +861,7 @@ SCM_DEFINE (scm_primitive_load_path, "primitive-load-path", 0, 0, 1, if (!compiled_is_fallback && scm_is_true (*scm_loc_compile_fallback_path) + && scm_is_false (*scm_loc_fresh_auto_compile) && scm_is_pair (*scm_loc_load_compiled_extensions) && scm_is_string (scm_car (*scm_loc_load_compiled_extensions))) { @@ -933,6 +938,21 @@ init_build_info () SCM val = scm_from_locale_string (info[i].value); *loc = scm_acons (key, val, *loc); } +#ifdef PACKAGE_PACKAGER + *loc = scm_acons (scm_from_latin1_symbol ("packager"), + scm_from_latin1_string (PACKAGE_PACKAGER), + *loc); +#endif +#ifdef PACKAGE_PACKAGER_VERSION + *loc = scm_acons (scm_from_latin1_symbol ("packager-version"), + scm_from_latin1_string (PACKAGE_PACKAGER_VERSION), + *loc); +#endif +#ifdef PACKAGE_PACKAGER_BUG_REPORTS + *loc = scm_acons (scm_from_latin1_symbol ("packager-bug-reports"), + scm_from_latin1_string (PACKAGE_PACKAGER_BUG_REPORTS), + *loc); +#endif } @@ -956,6 +976,8 @@ scm_init_load () = SCM_VARIABLE_LOC (scm_c_define ("%compile-fallback-path", SCM_BOOL_F)); scm_loc_load_should_auto_compile = SCM_VARIABLE_LOC (scm_c_define ("%load-should-auto-compile", SCM_BOOL_F)); + scm_loc_fresh_auto_compile + = SCM_VARIABLE_LOC (scm_c_define ("%fresh-auto-compile", SCM_BOOL_F)); the_reader = scm_make_fluid (); scm_fluid_set_x (the_reader, SCM_BOOL_F); @@ -973,8 +995,24 @@ scm_init_load () void scm_init_load_should_auto_compile () { - *scm_loc_load_should_auto_compile = - scm_from_bool (scm_getenv_int ("GUILE_AUTO_COMPILE", 1)); + char *auto_compile = getenv ("GUILE_AUTO_COMPILE"); + + if (auto_compile && strcmp (auto_compile, "0") == 0) + { + *scm_loc_load_should_auto_compile = SCM_BOOL_F; + *scm_loc_fresh_auto_compile = SCM_BOOL_F; + } + /* Allow "freshen" also. */ + else if (auto_compile && strncmp (auto_compile, "fresh", 5) == 0) + { + *scm_loc_load_should_auto_compile = SCM_BOOL_T; + *scm_loc_fresh_auto_compile = SCM_BOOL_T; + } + else + { + *scm_loc_load_should_auto_compile = SCM_BOOL_T; + *scm_loc_fresh_auto_compile = SCM_BOOL_F; + } } |