Using Makefile-configured snow install directories.

This commit is contained in:
Alex Shinn 2022-08-08 18:43:30 +09:00
parent eac4adc272
commit 1f1b361010
4 changed files with 20 additions and 5 deletions

View file

@ -90,13 +90,21 @@ chibi-scheme-emscripten: VERSION
$(MAKE) distclean; \
mv "$$tempfile" chibi-scheme-emscripten)
include/chibi/install.h: Makefile
include/chibi/install.h: Makefile.libs Makefile.detect
echo '#define sexp_so_extension "'$(SO)'"' > $@
echo '#define sexp_default_module_path "'$(MODDIR):$(BINMODDIR):$(SNOWMODDIR):$(SNOWBINMODDIR)'"' >> $@
echo '#define sexp_platform "'$(PLATFORM)'"' >> $@
echo '#define sexp_version "'$(CHIBI_VERSION)'"' >> $@
echo '#define sexp_release_name "'`cat RELEASE`'"' >> $@
lib/chibi/snow/install.sld: Makefile.libs Makefile.detect
echo '(define-library (chibi snow install)' > $@
echo ' (import (scheme base))' >> $@
echo ' (export snow-module-directory snow-binary-module-directory)' >> $@
echo ' (begin' >> $@
echo ' (define snow-module-directory "'$(SNOWMODDIR)'")' >> $@
echo ' (define snow-binary-module-directory "'$(SNOWBINMODDIR)'")))' >> $@
%.o: %.c $(BASE_INCLUDES)
$(CC) -c $(XCPPFLAGS) $(XCFLAGS) $(CLIBFLAGS) -o $@ $<

View file

@ -67,7 +67,7 @@ include Makefile.detect
########################################################################
all-libs: $(COMPILED_LIBS)
all-libs: $(COMPILED_LIBS) lib/chibi/snow/install.sld
lib/%.c: lib/%.stub $(CHIBI_FFI_DEPENDENCIES)
$(CHIBI_FFI) $<

View file

@ -1650,7 +1650,7 @@
((conf-get cfg 'install-source-dir))
((conf-get cfg 'install-prefix)
=> (lambda (prefix) (make-path prefix "share/snow" impl)))
(else (car (get-install-dirs impl cfg)))))
(else snow-module-directory)))
(define (get-install-data-dir impl cfg)
(cond
@ -1659,7 +1659,7 @@
((conf-get cfg 'install-data-dir))
((conf-get cfg 'install-prefix)
=> (lambda (prefix) (make-path prefix "share/snow" impl)))
(else (car (get-install-dirs impl cfg)))))
(else snow-module-directory)))
(define (get-install-library-dir impl cfg)
(cond
@ -1675,7 +1675,7 @@
(car (get-install-dirs impl cfg)))
((conf-get cfg 'install-prefix)
=> (lambda (prefix) (make-path prefix "lib" impl)))
(else (car (get-install-library-dirs impl cfg)))))
(else snow-binary-module-directory)))
(define (get-install-binary-dir impl cfg)
(cond

View file

@ -59,4 +59,11 @@
((library (srfi 151)) (import (srfi 151)))
((library (srfi 33)) (import (srfi 33)))
(else (import (srfi 60))))
(cond-expand
((library (chibi snow install))
(import (chibi snow install)))
(else
(begin
(define snow-module-directory "/usr/local/share/snow")
(define snow-binary-module-directory "/usr/local/lib/snow"))))
(include "commands.scm"))