 ;; generate-application, then typically, there will not be an ACL image file.
 
   (setq sw:common-lisp-image-name (getenv "LISP_EXECUTABLE"))
-  (setq sw:common-lisp-image-file (getenv "LISP_HEAP_IMAGE"))
+  (setq sw:common-lisp-image-file (or sw:common-lisp-image-file (getenv "LISP_HEAP_IMAGE")))
   (setq sw:common-lisp-image-arguments
     (if *windows-system-p* '("+cn") nil))
 

  (let ((log-warning-minimum-level 'error))
    (sw:common-lisp sw:common-lisp-buffer-name
		    sw:common-lisp-directory
		    sw:common-lisp-image-name)
    (when sleep (sleep-for sleep))))

(defvar *specware-auto-start* t

    (simulate-input-expression "(time (load \"Specware4.lisp\"))")
    (continue-form-when-ready
     (`(build-specware4-continue (, specware4-dir) (, build-dir) (, bin-dir)
				 (, slash-dir) (, world-name) (, base-world-name))))))

(defun build-specware4-continue (specware4-dir build-dir bin-dir slash-dir world-name base-world-name)
  (when base-world-name
    (run-plain-lisp 1)
    ;; Currently
    (sw:eval-in-lisp-no-value (format "(build-lisp-image %S :lisp-heap-start #x48000000 :oldspace #x100)"
				      base-world-name))
    (sleep-for 10))
  (let ((sw:common-lisp-image-file base-world-name))
    (run-lisp-application))
  (unless (inferior-lisp-running-p)
    (sleep-for 1))
  (sw:eval-in-lisp-no-value
