asdf-tools 1.55 KB
Newer Older
1 2
":" ; exec sbcl --script "$0" "$@" ; exit # -*- Lisp -*-
;;;;; Really runs on any decent Common Lisp implementation
3 4
;;;;; Can also be invoked by cl-launch 4:
;;;;;    cl-launch -sp asdf-tools -r entry-point -- "$@"
5 6 7 8 9 10 11 12 13 14 15 16

(in-package :cl-user) ;; That may be default, but let's make double sure and tell SLIME.

;;; Ensure we load and configure this particular ASDF
(eval-when (:compile-toplevel :load-toplevel :execute)
  (unless (member :cl-launch *features*) ;; (not necessary if we're invoked via cl-launch)
    (load (make-pathname
           :name "load-asdf" :type "lisp" :defaults
           (or *compile-file-truename* *load-truename* (truename *default-pathname-defaults*))))))

;;; ASDF3 is loaded, now use it!
(eval-when (:compile-toplevel :load-toplevel :execute)
17 18 19 20 21 22 23 24 25 26
  ;; For bootstrap purposes, avoid having to extract cl-launch.asd into ext/cl-launch/
  (let ((cl-launch-dir (uiop:subpathname (uiop:current-lisp-file-pathname) "../ext/cl-launch/")))
    (when (uiop:probe-file* (uiop:subpathname cl-launch-dir "dispatch.lisp"))
      (asdf:register-preloaded-system
       :cl-launch/dispatch
       :class :package-inferred-system
       :source-file nil
       :pathname cl-launch-dir
       :components '((cl-source-file "lisp" :pathname "dispatch.lisp")))))
  ;; Load either with or without quicklisp
27 28 29 30 31
  #-quicklisp
  (asdf:load-system :asdf-tools :verbose nil)
  #+quicklisp
  (let ((*standard-output* (make-broadcast-stream)))
    (ql:quickload :asdf-tools)))
32

33 34
(in-package :asdf-tools)

35
;;; Actually run the stuff!
36
(restore-image :entry-point 'entry-point :lisp-interaction nil)