diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | configure.ac | 10 | ||||
-rw-r--r-- | pre-inst-env.in | 2 | ||||
-rwxr-xr-x | scripts/haunt.in | 9 |
4 files changed, 22 insertions, 0 deletions
@@ -2,6 +2,7 @@ Makefile Makefile.in /aclocal.m4 /autom4te.cache/ +/build-aux/ /config.log /config.status /configure 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"]) diff --git a/pre-inst-env.in b/pre-inst-env.in index 84c88ca..8a3ad0a 100644 --- a/pre-inst-env.in +++ b/pre-inst-env.in @@ -28,4 +28,6 @@ export GUILE_LOAD_COMPILED_PATH GUILE_LOAD_PATH PATH="$abs_top_builddir/scripts:$PATH" export PATH +HAUNT_UNINSTALLED=true + exec "$@" diff --git a/scripts/haunt.in b/scripts/haunt.in index 7206036..dd25efb 100755 --- a/scripts/haunt.in +++ b/scripts/haunt.in @@ -19,6 +19,15 @@ ;;; You should have received a copy of the GNU General Public License ;;; along with Haunt. If not, see <http://www.gnu.org/licenses/>. +(define-syntax-rule (push! elt v) (set! v (cons elt v))) + +;; Automatically add Haunt modules to Guile's load path so that users +;; aren't wondering why Haunt isn't working when the modules aren't +;; installed to Guile's default module locations. +(unless (getenv "HAUNT_UNINSTALLED") + (push! "@guilemoduledir@" %load-path) + (push! "@guileobjectdir@" %load-compiled-path)) + (use-modules (haunt ui)) (apply haunt-main (command-line)) |