From: Paul Smith Date: Sun, 22 Sep 2013 16:11:13 +0000 (-0400) Subject: Defer Guile initialization until the first $(guile...) call. X-Git-Tag: 3.99.92~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f69922b335df7c5879142f5732f481d4f52548c6;p=thirdparty%2Fmake.git Defer Guile initialization until the first $(guile...) call. --- diff --git a/ChangeLog b/ChangeLog index 8905116f..8c5b3e5d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2013-09-22 Paul Smith + * guile.c (guile_gmake_setup): Don't initialize Guile so early. + (func_guile): Lazily initialize Guile the first time the $(guile ..) + function is invoked. Guile can steal file descriptors which + confuses our jobserver FD checking, so we don't want to initialize + it before we have to. + VMS port updates by Hartmut Becker * makefile.com: Add output to the filelist. diff --git a/guile.c b/guile.c index 6c9fb753..20e58d4b 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);