diff options
author | Paul Smith <psmith@gnu.org> | 2013-09-22 17:10:35 -0400 |
---|---|---|
committer | Paul Smith <psmith@gnu.org> | 2013-09-22 17:10:35 -0400 |
commit | 6f64c399845d6187cf0bf2b6486e1089ebd239a4 (patch) | |
tree | 35c20f1fd7eb55ef687f88dff812be560b9110c9 /guile.c | |
parent | de16e24b3647f53e2bb8dc8c6aa6cc3166c5c1d9 (diff) | |
download | make-6f64c399845d6187cf0bf2b6486e1089ebd239a4.tar.gz |
Defer Guile initialization until the first $(guile...) call.
Diffstat (limited to 'guile.c')
-rw-r--r-- | guile.c | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -107,6 +107,15 @@ internal_guile_eval (void *arg) static char * func_guile (const char *funcname UNUSED, int argc UNUSED, char **argv) { + static int init = 0; + + if (! init) + { + /* Initialize the Guile interpreter. */ + scm_with_guile (guile_init, NULL); + init = 1; + } + if (argv[0] && argv[0][0] != '\0') return scm_with_guile (internal_guile_eval, argv[0]); @@ -120,9 +129,6 @@ func_guile (const char *funcname UNUSED, int argc UNUSED, char **argv) int guile_gmake_setup (const gmk_floc *flocp UNUSED) { - /* Initialize the Guile interpreter. */ - scm_with_guile (guile_init, NULL); - /* Create a make function "guile". */ gmk_add_function ("guile", func_guile, 0, 1, 1); |