summaryrefslogtreecommitdiff
path: root/function.c
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2012-01-15 22:41:53 +0000
committerPaul Smith <psmith@gnu.org>2012-01-15 22:41:53 +0000
commitc992c4d80f51540699f33fed067caf6b7c38df79 (patch)
tree2e8bee26fd19820b85422752724e87639d1b0c77 /function.c
parent3057357c0a5c2507eef2b61eef9ebfb569b30230 (diff)
downloadgunmake-c992c4d80f51540699f33fed067caf6b7c38df79.tar.gz
Add GNU Guile as an optional embedded scripting language for make.
On configure-enabled systems, configure will detect Guile installed (using pkg-config, which is how GNU Guile is distributed) and enable it if so. On all non-configure-enabled systems, currently, the default is for Guile support to be disabled.
Diffstat (limited to 'function.c')
-rw-r--r--function.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/function.c b/function.c
index a8b9609..2f1afe7 100644
--- a/function.c
+++ b/function.c
@@ -2103,6 +2103,21 @@ func_abspath (char *o, char **argv, const char *funcname UNUSED)
return o;
}
+#ifdef HAVE_GUILE
+static char *
+func_guile (char *o, char **argv, const char *funcname UNUSED)
+{
+ if (argv[0] && argv[0][0] != '\0')
+ {
+ char *str = guile_eval_string (argv[0]);
+ o = variable_buffer_output (o, str, strlen (str));
+ free (str);
+ }
+
+ return o;
+}
+#endif
+
/* Lookup table for builtin functions.
This doesn't have to be sorted; we use a straight lookup. We might gain
@@ -2156,6 +2171,9 @@ static struct function_table_entry function_table_init[] =
{ STRING_SIZE_TUPLE("and"), 1, 0, 0, func_and},
{ STRING_SIZE_TUPLE("value"), 0, 1, 1, func_value},
{ STRING_SIZE_TUPLE("eval"), 0, 1, 1, func_eval},
+#ifdef HAVE_GUILE
+ { STRING_SIZE_TUPLE("guile"), 0, 1, 1, func_guile},
+#endif
#ifdef EXPERIMENTAL
{ STRING_SIZE_TUPLE("eq"), 2, 2, 1, func_eq},
{ STRING_SIZE_TUPLE("not"), 0, 1, 1, func_not},