Automatically pre-register libraries in standard places.
authorChris Hanson <org/chris-hanson/cph>
Sun, 27 Oct 2019 05:50:52 +0000 (22:50 -0700)
committerChris Hanson <org/chris-hanson/cph>
Sun, 27 Oct 2019 06:14:33 +0000 (23:14 -0700)
src/runtime/library-loader.scm
src/runtime/make.scm

index 7dd55fbef00bc22b99b7cb0b0c7b0d805cfc372c..7f284a4e13a37afb86e5011c7b2e98a7d42b95d9 100644 (file)
@@ -196,6 +196,19 @@ USA.
              (error "Not an exported name:" name))
          (cdr p))))))
 \f
+(define (preregister-standard-libraries!)
+  (parameterize ((param:hide-notifications? #t))
+    (let ((pn (system-library-directory-pathname "libraries")))
+      (if pn
+         (find-scheme-libraries! pn)))
+    (let ((pn (init-file-specifier->pathname '("libraries"))))
+      (if (file-directory? pn)
+         (find-scheme-libraries! (pathname-as-directory pn))))))
+
+(add-boot-init!
+ (lambda ()
+   (add-event-receiver! event:after-restart preregister-standard-libraries!)))
+
 (define (find-scheme-libraries! pathname)
   (preregister-libraries! pathname (current-library-db)))
 
index 1dd45290b65c8d3bbef3f2432e42ada3d1ab3022..66043d71811a63f56e6279ad75b07ce5f09cc7f7 100644 (file)
@@ -478,6 +478,7 @@ USA.
    (runtime hash)
    (runtime dynamic)
    (runtime regular-sexpression)
+   (runtime library loader)
    (runtime library standard)
    ;; Microcode data structures
    (runtime history)