From 047b1e8f48257f10f97fdbe61ef9176079ca947e Mon Sep 17 00:00:00 2001 From: Eli Barzilay Date: Thu, 16 Feb 2006 00:06:17 +0000 Subject: [PATCH] search for slib in some common places svn: r2249 --- collects/slibinit/init.ss | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/collects/slibinit/init.ss b/collects/slibinit/init.ss index 1c644d2d9d..340911aefc 100644 --- a/collects/slibinit/init.ss +++ b/collects/slibinit/init.ss @@ -65,15 +65,20 @@ (define library-vicinity (let ((library-path - (or - ;; Use this getenv if your implementation supports it. - (getenv "SCHEME_LIBRARY_PATH") - ;; Use this path if your scheme does not support GETENV - (with-handlers ([void - (lambda (x) - (error 'slib-init - "can't find SCHEME_LIBRARY_PATH environment variable or \"slib\" collection"))]) - (path->string (collection-path "slib")))))) + (or + ;; Use this getenv if your implementation supports it. + (getenv "SCHEME_LIBRARY_PATH") + ;; Try an slib collection first + (with-handlers ([void #f]) + (path->string (collection-path "slib"))) + ;; look for slib in a few common places + (ormap (lambda (dir) + (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))) ;;; (home-vicinity) should return the vicinity of the user's HOME