Allow option files to use boot-inits.
authorChris Hanson <org/chris-hanson/cph>
Sun, 30 Apr 2017 03:51:02 +0000 (20:51 -0700)
committerChris Hanson <org/chris-hanson/cph>
Sun, 30 Apr 2017 03:51:02 +0000 (20:51 -0700)
src/runtime/boot.scm
src/runtime/option.scm
src/runtime/runtime.pkg

index 774e12c4a04e4872e4041edb527966a37f6d2a1d..4dab58ee67e258e2a19edd59aabff95971bebb4e 100644 (file)
@@ -157,7 +157,7 @@ USA.
   unspecific)
 
 (define (save-boot-inits! environment)
-  (if (pair? boot-inits)
+  (if boot-inits
       (let ((inits (reverse! boot-inits)))
        (set! boot-inits #f)
        (let ((p (assq environment saved-boot-inits)))
index 18ae8f767f486f285c0b2e1d7c584452d7552a07..4d3c3eb4ff19e98f86ff44ab7209b7ad6a96f020 100644 (file)
@@ -112,6 +112,7 @@ USA.
     (let ((environment (package/environment (find-package package-name)))
          (runtime (pathname-as-directory "runtime"))
          (rundir (system-library-directory-pathname "runtime" #t)))
+      (if (not init-expression) (init-boot-inits!))
       (for-each
        (lambda (file)
         (let ((file (force* file)))
@@ -132,7 +133,11 @@ USA.
                                  #t))))))))))
        files)
       (flush-purification-queue!)
-      (eval init-expression environment))))
+      (if (not init-expression)
+         (begin
+           (save-boot-inits! environment)
+           ((get-boot-init-runner environment)))
+         (eval init-expression environment)))))
 
 (define (force* value)
   (cond ((procedure? value) (force* (value)))
index f313c27bbb53c5701c9c99903d72d4e35f751abe..b44bb16fc3ee66bcfd45cf64b73ef107c2cfa660 100644 (file)
@@ -164,7 +164,11 @@ USA.
          with-limited-interrupts
          without-interrupts)
   (export (runtime)
-         add-boot-init!))
+         add-boot-init!)
+  (export (runtime options)
+         get-boot-init-runner
+         init-boot-inits!
+         save-boot-inits!))
 
 (define-package (runtime equality)
   (files "equals")