search for slib in some common places

svn: r2249
This commit is contained in:
Eli Barzilay 2006-02-16 00:06:17 +00:00
parent 0b777b2b5a
commit 047b1e8f48

View File

@ -65,15 +65,20 @@
(define library-vicinity (define library-vicinity
(let ((library-path (let ((library-path
(or (or
;; Use this getenv if your implementation supports it. ;; Use this getenv if your implementation supports it.
(getenv "SCHEME_LIBRARY_PATH") (getenv "SCHEME_LIBRARY_PATH")
;; Use this path if your scheme does not support GETENV ;; Try an slib collection first
(with-handlers ([void (with-handlers ([void #f])
(lambda (x) (path->string (collection-path "slib")))
(error 'slib-init ;; look for slib in a few common places
"can't find SCHEME_LIBRARY_PATH environment variable or \"slib\" collection"))]) (ormap (lambda (dir)
(path->string (collection-path "slib")))))) (and (directory-exists? dir) (path->string dir)))
'("/usr/share/slib"
;; this is for RH/Fedora that uses umb-scheme for slib
"/usr/share/umb-scheme/slib"))
(error 'slib-init
"can't find SCHEME_LIBRARY_PATH environment variable, \"slib\" collection, or a system slib directory"))))
(lambda () library-path))) (lambda () library-path)))
;;; (home-vicinity) should return the vicinity of the user's HOME ;;; (home-vicinity) should return the vicinity of the user's HOME