From: Chris Hanson Date: Thu, 8 Mar 2001 20:58:23 +0000 (+0000) Subject: Handle case where "lib" directory doesn't exist. X-Git-Tag: 20090517-FFI~2915 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=d41d567b11ebc5ef3546e979b6830b985765c2ed;p=mit-scheme.git Handle case where "lib" directory doesn't exist. --- diff --git a/v7/src/runtime/load.scm b/v7/src/runtime/load.scm index 5a64e6a37..24975c2a9 100644 --- a/v7/src/runtime/load.scm +++ b/v7/src/runtime/load.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: load.scm,v 14.56 2001/03/08 19:26:56 cph Exp $ +$Id: load.scm,v 14.57 2001/03/08 20:58:23 cph Exp $ Copyright (c) 1988-2000 Massachusetts Institute of Technology @@ -277,33 +277,37 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. environment))) (define (load-library-object-file name errors?) - (let ((pathname - (merge-pathnames name - (system-library-directory-pathname "lib")))) - (if (there-exists? loaded-object-files - (lambda (pathname*) - (pathname=? pathname pathname*))) - #t - (let ((pathname* - (let ((find - (lambda (type) - (let ((pathname (pathname-new-type pathname type))) - (and (file-exists? pathname) - pathname))))) - (or (find "so") - (find "sl"))))) - (cond ((not pathname*) - (and errors? - (error "No library object file of this name:" pathname))) - ((ignore-errors (lambda () (load pathname*))) - => (lambda (condition) - (if errors? - (signal-condition condition) - condition))) - (else - (set! loaded-object-files - (cons pathname loaded-object-files)) - #t)))))) + (let ((directory (system-library-directory-pathname "lib")) + (nsf + (lambda () + (and errors? + (error "No library object file of this name:" name))))) + (if (not directory) + (nsf)) + (let ((pathname (merge-pathnames name directory))) + (if (there-exists? loaded-object-files + (lambda (pathname*) + (pathname=? pathname pathname*))) + #t + (let ((pathname* + (let ((find + (lambda (type) + (let ((pathname (pathname-new-type pathname type))) + (and (file-exists? pathname) + pathname))))) + (or (find "so") + (find "sl"))))) + (cond ((not pathname*) + (nsf)) + ((ignore-errors (lambda () (load pathname*))) + => (lambda (condition) + (if errors? + (signal-condition condition) + condition))) + (else + (set! loaded-object-files + (cons pathname loaded-object-files)) + #t))))))) (define (reset-loaded-object-files!) (set! loaded-object-files '())