From c992c4d80f51540699f33fed067caf6b7c38df79 Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Sun, 15 Jan 2012 22:41:53 +0000 Subject: 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. --- function.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'function.c') 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}, -- cgit v1.2.3