From e8626841f3a931b09e43295b3d3143ae137d4ee3 Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Sat, 27 Jul 2019 09:19:53 +0200 Subject: [PATCH] build: ./pre-inst-env MES_PREFIX fixup. * build-aux/pre-inst-env.in: Set MES_PREFIX to abs_top_srcdir. * src/mes.c (open_boot): Cater for MES_PREFIX/mes and ${srcdest}. --- build-aux/pre-inst-env.in | 2 +- src/mes.c | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) 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) {