footer.lisp 2.45 KB
Newer Older
1 2 3
;;;; -----------------------------------------------------------------------
;;;; ASDF Footer: last words and cleanup

4
(uiop/package:define-package :asdf/footer
5
  (:recycle :asdf/footer :asdf)
6
  (:use :uiop/common-lisp :uiop :asdf/upgrade :asdf/operate :asdf/bundle))
7 8 9
(in-package :asdf/footer)

;;;; Hook ASDF into the implementation's REQUIRE and other entry points.
10
#+(or abcl clisp clozure cmu ecl mkcl sbcl)
11 12 13 14 15 16 17 18 19 20 21 22
(with-upgradability ()
  (if-let (x (and #+clisp (find-symbol* '#:*module-provider-functions* :custom nil)))
    (eval `(pushnew 'module-provide-asdf
                    #+abcl sys::*module-provider-functions*
                    #+clisp ,x
                    #+clozure ccl:*module-provider-functions*
                    #+(or cmu ecl) ext:*module-provider-functions*
                    #+mkcl mk-ext:*module-provider-functions*
                    #+sbcl sb-ext:*module-provider-functions*)))

  #+(or ecl mkcl)
  (progn
23
    (pushnew '("fasb" . si::load-binary) si::*load-hooks* :test 'equal :key 'car)
24 25 26 27 28 29 30 31

    #+(or (and ecl win32) (and mkcl windows))
    (unless (assoc "asd" #+ecl ext:*load-hooks* #+mkcl si::*load-hooks* :test 'equal)
      (appendf #+ecl ext:*load-hooks* #+mkcl si::*load-hooks* '(("asd" . si::load-source))))

    (setf #+ecl ext:*module-provider-functions* #+mkcl mk-ext::*module-provider-functions*
          (loop :for f :in #+ecl ext:*module-provider-functions*
                #+mkcl mk-ext::*module-provider-functions*
32 33 34 35 36 37
                :collect
                (if (eq f 'module-provide-asdf) f
                    #'(lambda (name)
                        (let ((l (multiple-value-list (funcall f name))))
                          (and (first l) (register-pre-built-system (coerce-name name)))
                          (values-list l))))))))
38

39
#+cmu ;; Hook into the CMUCL herald.
40 41 42 43 44
(with-upgradability ()
  (defun herald-asdf (stream)
    (format stream "    ASDF ~A" (asdf-version)))
  (setf (getf ext:*herald-items* :asdf) `(herald-asdf)))

45 46

;;;; Done!
47 48
(with-upgradability ()
  #+allegro
49
  (when (boundp 'excl:*warn-on-nested-reader-conditionals*)
50
    (setf excl:*warn-on-nested-reader-conditionals* asdf/common-lisp::*acl-warn-save*))
51

52
  (dolist (f '(:asdf :asdf2 :asdf3 :asdf3.1 :asdf-package-system)) (pushnew f *features*))
53

54 55
  ;; Provide both lowercase and uppercase, to satisfy more people, especially LispWorks users.
  (provide "asdf") (provide "ASDF")
56

57
  (cleanup-upgraded-asdf))
58

59 60 61
(when *load-verbose*
  (asdf-message ";; ASDF, version ~a~%" (asdf-version)))