asdf-tools 2.43 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#| -*- Lisp -*-
case "$LISP" in
  # CCL is our default because it is the single free software implementation that has
  # decent portable support on all of Windows, Linux (x64, x86, ARM), MacOS X
  ""|ccl) exec ${CCL:-ccl} --no-init --load "$0" -- "$@" ;;

  allegro) ${ALLEGRO:-alisp} -qq -e "(setf *load-verbose* nil)" -L "$0" -- "$@" ;;

  sbcl) exec ${SBCL:-sbcl} --noinform --no-userinit --no-sysinit --script "$0" "$@" ;;

  # Let cl-launch choose its preferred Lisp
  cl-launch) cl-launch -Q -sp asdf-tools -r entry-point -- "$@" ;;

  # asdf-tools could actually run on any implementation, if you configured it above.
  *) echo >&2 "Unknown Lisp $LISP" ; exit 2
esac ; exit
17
|#
18 19 20 21 22 23

(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)
24 25 26 27 28
    (handler-bind ((warning #'muffle-warning)) ;; hush Allegro
      (load (make-pathname
	     :name "load-asdf" :type "lisp" :defaults
	     (or *compile-file-truename* *load-truename*
		 (truename *default-pathname-defaults*)))))))
29 30

;;; ASDF3 is loaded, now use it!
31 32
(in-package :asdf)

33
(eval-when (:compile-toplevel :load-toplevel :execute)
34
  ;; For bootstrap purposes, avoid having to extract cl-launch.asd into ext/cl-launch/
35 36 37 38 39 40 41 42 43
  (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
44
               :components ((cl-source-file "lisp" :pathname "dispatch"))))))
45 46 47 48
  ;; 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
49
          (symbol-call :ql :quickload system))
50 51 52
        (load-system system :verbose nil)))
  ;; Finally, load asdf-tools
  (load-sys "asdf-tools"))
53

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