summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2023-09-23 17:12:30 -0400
committerDavid Thompson <dthompson2@worcester.edu>2023-09-23 17:15:11 -0400
commita86f4f6d53d05d6e1027619d00882feff1b857a8 (patch)
tree504d35823207ecbd7e2cafdd46f62e8aede4dde8
parentea0d3009fa7020d75c1657cb532570305de699a6 (diff)
Improve Guile load path initialization in launcher script.HEADmain
Use entire load path from the build environment.
-rw-r--r--Makefile.am4
-rw-r--r--configure.ac8
-rwxr-xr-xscripts/super-bloom.in7
3 files changed, 10 insertions, 9 deletions
diff --git a/Makefile.am b/Makefile.am
index 3840af1..0bfe2da 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,8 +1,8 @@
# Handle substitution of fully-expanded Autoconf variables.
do_subst = $(SED) \
-e 's,[@]GUILE[@],$(GUILE),g' \
- -e 's,[@]guilemoduledir[@],$(guilemoduledir),g' \
- -e 's,[@]guileobjectdir[@],$(guileobjectdir),g' \
+ -e 's,[@]guilemodulepath[@],$(guilemodulepath),g' \
+ -e 's,[@]guileobjectpath[@],$(guileobjectpath),g' \
-e 's,[@]datadir[@],$(datadir),g'
scripts/super-bloom: scripts/super-bloom.in Makefile
diff --git a/configure.ac b/configure.ac
index 779d240..464bfdb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -19,9 +19,9 @@ GUILE_MODULE_REQUIRED([chickadee])
GUILE_MODULE_REQUIRED([catbird])
# Installation directories for .scm and .go files.
-guilemoduledir="${datarootdir}/guile/site/$GUILE_EFFECTIVE_VERSION"
-guileobjectdir="${libdir}/guile/$GUILE_EFFECTIVE_VERSION/site-ccache"
-AC_SUBST([guilemoduledir])
-AC_SUBST([guileobjectdir])
+guilemodulepath="${datarootdir}/guile/site/$GUILE_EFFECTIVE_VERSION${GUILE_LOAD_PATH:+:}:$GUILE_LOAD_PATH"
+guileobjectpath="${libdir}/guile/$GUILE_EFFECTIVE_VERSION/site-ccache${GUILE_LOAD_COMPILED_PATH:+:}$GUILE_LOAD_COMPILED_PATH"
+AC_SUBST([guilemodulepath])
+AC_SUBST([guileobjectpath])
AC_OUTPUT
diff --git a/scripts/super-bloom.in b/scripts/super-bloom.in
index 1e9a41b..1452cd8 100755
--- a/scripts/super-bloom.in
+++ b/scripts/super-bloom.in
@@ -3,9 +3,10 @@
!#
;; Add installed modules to load path.
-(define-syntax-rule (push! elt v) (set! v (cons elt v)))
-(push! "@guilemoduledir@" %load-path)
-(push! "@guileobjectdir@" %load-compiled-path)
+(define-syntax-rule (append-path! path var)
+ (set! var (append (string-split path #\:) var)))
+(append-path! "@guilemodulepath@" %load-path)
+(append-path! "@guileobjectpath@" %load-compiled-path)
;; Launch game.
(use-modules (super-bloom main))