Merge pull request #609 from ilammy/snow-usr-local

Always install Snow libraries to /usr/local
This commit is contained in:
Alex Shinn 2020-02-06 21:15:39 +08:00 committed by GitHub
commit fad3413235
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 26 additions and 2 deletions

View file

@ -137,7 +137,7 @@ chibi-scheme-emscripten: VERSION
include/chibi/install.h: Makefile
echo '#define sexp_so_extension "'$(SO)'"' > $@
echo '#define sexp_default_module_path "'$(MODDIR):$(BINMODDIR)'"' >> $@
echo '#define sexp_default_module_path "'$(MODDIR):$(BINMODDIR):$(SNOWMODDIR):$(SNOWBINMODDIR)'"' >> $@
echo '#define sexp_platform "'$(PLATFORM)'"' >> $@
echo '#define sexp_version "'$(VERSION)'"' >> $@
echo '#define sexp_release_name "'`cat RELEASE`'"' >> $@

View file

@ -37,6 +37,12 @@ BINMODDIR ?= $(SOLIBDIR)/chibi
PKGCONFDIR ?= $(SOLIBDIR)/pkgconfig
MANDIR ?= $(PREFIX)/share/man/man1
SNOWPREFIX ?= /usr/local
SNOWLIBDIR ?= $(SNOWPREFIX)/lib
SNOWSOLIBDIR ?= $(SNOWLIBDIR)
SNOWMODDIR ?= $(SNOWPREFIX)/share/snow
SNOWBINMODDIR ?= $(SNOWSOLIBDIR)/snow
DESTDIR ?=
########################################################################

View file

@ -1378,6 +1378,24 @@
"share/snow"
impl)))))
(define (get-install-library-dirs impl cfg)
(case impl
((chibi)
(let* ((dirs
(reverse
(cond-expand
(chibi (eval '(current-module-path) (environment '(chibi))))
(else (process->sexp
'(chibi-scheme -q -p "(current-module-path)"))))))
(lib-dir (find (lambda (d) (string-contains d "/lib")) dirs)))
(if lib-dir
(cons lib-dir (delete lib-dir dirs))
dirs)))
(else
(list (make-path (or (conf-get cfg 'install-prefix) "/usr/local")
"lib"
impl)))))
(define (scheme-script-command impl cfg)
(or (and (eq? impl 'chibi) (conf-get cfg 'chibi-path))
(let* ((prog (cond ((conf-get cfg 'scheme-script))
@ -1656,7 +1674,7 @@
(car (get-install-dirs impl cfg)))
((conf-get cfg 'install-prefix)
=> (lambda (prefix) (make-path prefix "lib" impl)))
(else (make-path "/usr/local/lib" impl))))
(else (car (get-install-library-dirs impl cfg)))))
(define (get-install-binary-dir impl cfg)
(cond