Add loaders for SOS and IMAIL.
authorChris Hanson <org/chris-hanson/cph>
Fri, 18 Aug 2000 20:23:03 +0000 (20:23 +0000)
committerChris Hanson <org/chris-hanson/cph>
Fri, 18 Aug 2000 20:23:03 +0000 (20:23 +0000)
v7/dist/optiondb.scm

index cc17d75ad8194e409db3d9767dff630626a61172..e431865f5b476a72018abc98ca0cb5368bafaaa3 100644 (file)
@@ -1,3 +1,30 @@
 ;; -*- Scheme -*-
 
+(define (guarded-system-loader package-name place #!optional filename)
+  (let ((directory
+        (merge-pathnames place
+                         (directory-pathname (current-load-pathname)))))
+    (lambda ()
+      (if (not (name->package package-name))
+         (with-working-directory-pathname directory
+           (lambda ()
+             (load
+              (let ((test
+                     (lambda (name)
+                       (or (file-exists? name)
+                           (there-exists? load/default-types
+                             (lambda (type)
+                               (file-exists?
+                                (pathname-new-type name (car type)))))))))
+                (cond ((not (default-object? filename)) filename)
+                      ((test "make") "make")
+                      ((test "load") "load")
+                      (else (error "Can't find loader.")))))))))))
+
+(define-load-option 'SOS
+  (guarded-system-loader '(runtime object-system) "sos"))
+
+(define-load-option 'IMAIL
+  (guarded-system-loader '(edwin imail) "imail"))
+
 (further-load-options standard-load-options)
\ No newline at end of file