diff --git a/build-aux/pre-inst-env.in b/build-aux/pre-inst-env.in index da9c61c0..3f6201ac 100644 --- a/build-aux/pre-inst-env.in +++ b/build-aux/pre-inst-env.in @@ -26,7 +26,7 @@ prefix=${prefix-@prefix@} export prefix program_prefix=${program_prefix-@program_prefix@} -MES_PREFIX=${MES_PREFIX-${abs_top_srcdir}/mes} +MES_PREFIX=${MES_PREFIX-${abs_top_srcdir}} export MES_PREFIX GUILE_LOAD_COMPILED_PATH="$abs_top_builddir/scripts:$abs_top_builddir/module${GUILE_LOAD_COMPILED_PATH:+:}$GUILE_LOAD_COMPILED_PATH" diff --git a/src/mes.c b/src/mes.c index 81de6a73..d9760fad 100644 --- a/src/mes.c +++ b/src/mes.c @@ -1788,6 +1788,7 @@ open_boot () if (getenv ("MES_PREFIX")) { strcpy (g_datadir, getenv ("MES_PREFIX")); + strcpy (g_datadir + strlen (g_datadir), "/mes"); strcpy (file_name, g_datadir); strcpy (file_name + strlen (file_name), "/module/mes/"); __stdin = try_open_boot (file_name, boot, "MES_PREFIX"); @@ -1809,10 +1810,13 @@ open_boot () } if (__stdin < 0) { - strcpy (g_datadir, "mes"); + g_datadir[0] = 0; + if (getenv ("srcdest")) + strcpy (g_datadir, getenv ("srcdest")); + strcpy (g_datadir + strlen (g_datadir), "mes"); strcpy (file_name, g_datadir); strcpy (file_name + strlen (file_name), "/module/mes/"); - __stdin = try_open_boot (file_name, boot, "mes"); + __stdin = try_open_boot (file_name, boot, "${srcdest}mes"); } if (__stdin < 0) {