This commit is contained in:
djcb
2017-11-05 13:12:41 +02:00
parent 9e1ce98da7
commit dbc162ef9b
3 changed files with 29 additions and 20 deletions

View File

@ -382,5 +382,5 @@ if test "x$ac_cv_header_wordexp_h" != "xyes"; then
fi fi
echo echo
echo "Now, type 'gmake' to build mu (or 'gmake check' to run the unit tests, too)" echo "Now, type 'make' (or 'gmake') to build mu"
echo echo

View File

@ -20,7 +20,10 @@ include $(top_srcdir)/gtest.mk
# with separate builddir) # with separate builddir)
SUBDIRS= . mu scripts examples tests SUBDIRS= . mu scripts examples tests
AM_CPPFLAGS=-I. -I${top_builddir} -I${top_srcdir}/lib ${GUILE_CFLAGS} ${GLIB_CFLAGS} AM_CPPFLAGS= \
-I. -I${top_builddir} -I${top_srcdir}/lib \
${GUILE_CFLAGS} \
${GLIB_CFLAGS}
# don't use -Werror, as it might break on other compilers # don't use -Werror, as it might break on other compilers
# use -Wno-unused-parameters, because some callbacks may not # use -Wno-unused-parameters, because some callbacks may not

View File

@ -308,21 +308,26 @@ gboolean
mu_script_guile_run (MuScriptInfo *msi, const char *muhome, mu_script_guile_run (MuScriptInfo *msi, const char *muhome,
const char **args, GError **err) const char **args, GError **err)
{ {
const char *s;
char *mainargs, *expr; char *mainargs, *expr;
const char * argv[] = { char **argv;
"guile", "-l", NULL, "-c", NULL, NULL
};
g_return_val_if_fail (msi, FALSE); g_return_val_if_fail (msi, FALSE);
g_return_val_if_fail (muhome, FALSE); g_return_val_if_fail (muhome, FALSE);
argv = g_new0 (char*, 6);
argv[0] = g_strdup("guile");
argv[1] = g_strdup("-l");
if (access (mu_script_info_path (msi), R_OK) != 0) { if (access (mu_script_info_path (msi), R_OK) != 0) {
mu_util_g_set_error (err, MU_ERROR_FILE_CANNOT_READ, mu_util_g_set_error (err, MU_ERROR_FILE_CANNOT_READ,
"failed to read script: %s", "failed to read script: %s",
strerror(errno)); strerror(errno));
return FALSE; return FALSE;
} }
argv[2] = (char*)mu_script_info_path (msi);
s = mu_script_info_path (msi);
argv[2] = g_strdup (s ? s : "");
mainargs = mu_str_quoted_from_strv (args); mainargs = mu_str_quoted_from_strv (args);
expr = g_strdup_printf ( expr = g_strdup_printf (
@ -332,12 +337,13 @@ mu_script_guile_run (MuScriptInfo *msi, const char *muhome,
mainargs ? mainargs : ""); mainargs ? mainargs : "");
g_free (mainargs); g_free (mainargs);
argv[3] = g_strdup("-c");
argv[4] = expr; argv[4] = expr;
scm_boot_guile (5, argv, guile_shell, NULL); scm_boot_guile (5, argv, guile_shell, NULL);
/* never reached but let's be correct(TM)*/ /* never reached but let's be correct(TM)*/
g_free (expr); g_strfreev (argv);
return TRUE; return TRUE;
} }
#else /*!BUILD_GUILE*/ #else /*!BUILD_GUILE*/