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

4
(uiop/package:define-package :asdf/footer
5
  (:recycle :asdf/footer :asdf)
Robert P. Goldman's avatar
Robert P. Goldman committed
6 7
  (:use :uiop/common-lisp :uiop
        :asdf/upgrade :asdf/find-system :asdf/operate :asdf/bundle))
8 9 10
(in-package :asdf/footer)

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

Francois-Rene Rideau's avatar
Francois-Rene Rideau committed
22
  #+(or clasp ecl mkcl)
23
  (progn
24
    (pushnew '("fasb" . si::load-binary) si::*load-hooks* :test 'equal :key 'car)
25

Francois-Rene Rideau's avatar
Francois-Rene Rideau committed
26 27 28
    #+(or (and clasp windows) (and ecl win32) (and mkcl windows))
    (unless (assoc "asd" #+(or clasp ecl) ext:*load-hooks* #+mkcl si::*load-hooks* :test 'equal)
      (appendf #+(or clasp ecl) ext:*load-hooks* #+mkcl si::*load-hooks* '(("asd" . si::load-source))))
29

Francois-Rene Rideau's avatar
Francois-Rene Rideau committed
30 31
    (setf #+(or clasp ecl) ext:*module-provider-functions* #+mkcl mk-ext::*module-provider-functions*
          (loop :for f :in #+(or clasp ecl) ext:*module-provider-functions*
32
                #+mkcl mk-ext::*module-provider-functions*
33 34 35 36
                :collect
                (if (eq f 'module-provide-asdf) f
                    #'(lambda (name)
                        (let ((l (multiple-value-list (funcall f name))))
Robert P. Goldman's avatar
Robert P. Goldman committed
37
                          (and (first l) (register-preloaded-system (coerce-name name)))
38
                          (values-list l))))))))
39

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

46 47

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

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

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

58
  (cleanup-upgraded-asdf))
59

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