summaryrefslogtreecommitdiff
path: root/guile.c
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2013-09-22 12:11:13 -0400
committerPaul Smith <psmith@gnu.org>2013-09-22 17:10:35 -0400
commitf69922b335df7c5879142f5732f481d4f52548c6 (patch)
tree35c20f1fd7eb55ef687f88dff812be560b9110c9 /guile.c
parent65931ce7a9a84ddb9adb118b7558bfd1b8c3ee46 (diff)
downloadgunmake-f69922b335df7c5879142f5732f481d4f52548c6.tar.gz
Defer Guile initialization until the first $(guile...) call.
Diffstat (limited to 'guile.c')
-rw-r--r--guile.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/guile.c b/guile.c
index 6c9fb75..20e58d4 100644
--- a/guile.c
+++ b/guile.c
@@ -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);