From a090d0a7c9168ca6292c6cdf1b8c27c5a067c085 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Thu, 7 Jul 2022 21:56:17 -0400 Subject: Automatically add Haunt's modules to Guile's load path at startup. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes a longstanding usability issue where people would install Haunt to /usr/local and then wonder why Haunt doesn't work, which was because Guile's default load path is /usr and thus could not find the newly installed modules in /usr/local. I received several emails about this over the years and didn't know to deal with it. Many thanks to Daniel Meißner for pointing out that Guix had already found a solution to this problem because of course Guix would have this problem solved! Ludovic is an autotools wizard. --- configure.ac | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index da381d3..67e287c 100644 --- a/configure.ac +++ b/configure.ac @@ -14,6 +14,16 @@ AC_CONFIG_FILES([scripts/haunt], [chmod +x scripts/haunt]) GUILE_PKG([3.0 2.2 2.0]) GUILE_PROGS +dnl Compute complete installation directories for .scm and .go files +dnl so that the Haunt executable can automagically add them to Guile's +dnl load path. +haunt_prefix="`eval echo $prefix | sed -e"s|NONE|/usr/local|g"`" +haunt_libdir="`eval echo $libdir | sed -e"s|NONE|$haunt_prefix|g"`" +guilemoduledir="`eval echo ${datarootdir}/guile/site/$GUILE_EFFECTIVE_VERSION | sed -e"s|NONE|$haunt_prefix|g"`" +guileobjectdir="`eval echo ${libdir}/guile/$GUILE_EFFECTIVE_VERSION/site-ccache | sed -e"s|NONE|$haunt_prefix|g"`" +AC_SUBST([guilemoduledir]) +AC_SUBST([guileobjectdir]) + dnl Guile-reader is needed for Skribe support GUILE_MODULE_AVAILABLE([have_guile_reader], [(system reader)]) AM_CONDITIONAL([HAVE_GUILE_READER], [test "x$have_guile_reader" = "xyes"]) -- cgit v1.2.3