asdf-tools 2.6 KB
Newer Older
1 2
#| -*- Lisp -*-
case "$LISP" in
3 4 5 6
  # SBCL is our default on Unix, because while CCL has better support on Windows and MacOS,
  # SBCL still runs decently on MacOS and CCL has a background thread that eats input
  # (and still puts the tty in raw mode if using single-threaded-ccl) which defeats
  # the purpose of `make load`. See: https://bugs.launchpad.net/asdf/+bug/1624909
7 8 9

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

10 11 12
  ccl) exec ${CCL:-ccl} --no-init --load "$0" -- "$@" ;;

  ""|sbcl) exec ${SBCL:-sbcl} --noinform --no-userinit --no-sysinit --script "$0" "$@" ;;
13 14 15 16 17 18 19

  # 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
20
|#
21 22 23 24 25 26

(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)
27 28 29 30 31
    (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*)))))))
32 33

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

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

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