asdf-tools 2.14 KB
Newer Older
1
":" ; exec ${CCL:-ccl} --no-init --load "$0" -- "$@" ; exit # -*- Lisp -*-
2 3 4 5
#|
asdf-tools could also run on SBCL, or on any decent Common Lisp implementation,
including using cl-launch, but CCL is the single implementation that has decent
portable support on all of Windows, Linux (x64, x86, ARM), MacOS X
6
":" ; exec ${SBCL:-sbcl} --no-userinit --no-sysinit --script "$0" "$@" ; exit
7 8
":" ; cl-launch -l ccl -Q -sp asdf-tools -r entry-point -- "$@"
|#
9 10 11 12 13 14 15 16 17 18 19

(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!
20 21
(in-package :asdf)

22
(eval-when (:compile-toplevel :load-toplevel :execute)
23
  ;; For bootstrap purposes, avoid having to extract cl-launch.asd into ext/cl-launch/
24 25 26 27 28 29 30 31 32
  (let* ((asdf-dir (pathname-parent-directory-pathname
                    (ensure-absolute-pathname (current-lisp-file-pathname) 'getcwd)))
         (cl-launch-dir (subpathname asdf-dir "ext/cl-launch/")))
    (when (and (not (find-system "cl-launch/dispatch" nil))
               (probe-file* (subpathname cl-launch-dir "dispatch.lisp")))
      (eval `(defsystem "cl-launch/dispatch"
               :class :package-inferred-system
               :source-file nil
               :pathname ,cl-launch-dir
33
               :components ((cl-source-file "lisp" :pathname "dispatch"))))))
34 35 36 37
  ;; Depending on whether Quicklisp was loaded or not, either use it or use regular load-system
  (defun load-sys (system)
    (if (featurep :quicklisp)
        (let ((*standard-output* (make-broadcast-stream))) ;; be quiet
38
          (symbol-call :ql :quickload system))
39 40 41
        (load-system system :verbose nil)))
  ;; Finally, load asdf-tools
  (load-sys "asdf-tools"))
42

43 44
;;; asdf-tools is loaded, now actually run it!
(restore-image :entry-point 'asdf-tools::entry-point :lisp-interaction nil)