mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-17 01:00:20 +02:00
going through scm_shell not necessary to get autocompilation
* libguile/load.c (scm_init_load): Initialize %load-should-autocompile from the environment variable here, so that apps that don't go through scm_shell get autocompilation. * libguile/script.c (scm_compile_shell_switches): Explicitly enable or disable autocompilation here, if told to do so.
This commit is contained in:
parent
0eedfa5cab
commit
655aadf4b0
2 changed files with 10 additions and 8 deletions
|
@ -27,6 +27,7 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#include "libguile/_scm.h"
|
#include "libguile/_scm.h"
|
||||||
|
#include "libguile/private-gc.h" /* scm_getenv_int */
|
||||||
#include "libguile/libpath.h"
|
#include "libguile/libpath.h"
|
||||||
#include "libguile/fports.h"
|
#include "libguile/fports.h"
|
||||||
#include "libguile/read.h"
|
#include "libguile/read.h"
|
||||||
|
@ -901,8 +902,11 @@ scm_init_load ()
|
||||||
scm_loc_compile_fallback_path
|
scm_loc_compile_fallback_path
|
||||||
= SCM_VARIABLE_LOC (scm_c_define ("%compile-fallback-path", SCM_BOOL_F));
|
= SCM_VARIABLE_LOC (scm_c_define ("%compile-fallback-path", SCM_BOOL_F));
|
||||||
|
|
||||||
|
{
|
||||||
|
SCM autocomp = scm_from_bool (scm_getenv_int ("GUILE_AUTO_COMPILE", 1));
|
||||||
scm_loc_load_should_autocompile
|
scm_loc_load_should_autocompile
|
||||||
= SCM_VARIABLE_LOC (scm_c_define ("%load-should-autocompile", SCM_BOOL_F));
|
= SCM_VARIABLE_LOC (scm_c_define ("%load-should-autocompile", autocomp));
|
||||||
|
}
|
||||||
|
|
||||||
the_reader = scm_make_fluid ();
|
the_reader = scm_make_fluid ();
|
||||||
scm_fluid_set_x (the_reader, SCM_BOOL_F);
|
scm_fluid_set_x (the_reader, SCM_BOOL_F);
|
||||||
|
|
|
@ -720,13 +720,11 @@ scm_compile_shell_switches (int argc, char **argv)
|
||||||
tail = scm_cons (scm_cons (sym_load_user_init, SCM_EOL), tail);
|
tail = scm_cons (scm_cons (sym_load_user_init, SCM_EOL), tail);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If GUILE_AUTO_COMPILE is not set and no args are given, default to
|
/* If we are given an autocompilation arg, set %load-should-autocompile. */
|
||||||
autocompilation. */
|
if (turn_on_autocompile || dont_turn_on_autocompile)
|
||||||
if (turn_on_autocompile || (scm_getenv_int ("GUILE_AUTO_COMPILE", 1)
|
|
||||||
&& !dont_turn_on_autocompile))
|
|
||||||
{
|
{
|
||||||
tail = scm_cons (scm_list_3 (sym_set_x, sym_sys_load_should_autocompile,
|
tail = scm_cons (scm_list_3 (sym_set_x, sym_sys_load_should_autocompile,
|
||||||
SCM_BOOL_T),
|
scm_from_bool (turn_on_autocompile)),
|
||||||
tail);
|
tail);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue