Skip to content
Snippets Groups Projects
footer.lisp 2.56 KiB
Newer Older
;;;; -----------------------------------------------------------------------
;;;; ASDF Footer: last words and cleanup

(uiop/package:define-package :asdf/footer
  (:use :uiop/common-lisp :uiop
        :asdf/upgrade :asdf/find-system :asdf/operate :asdf/bundle))
(in-package :asdf/footer)

;;;; Hook ASDF into the implementation's REQUIRE and other entry points.
Francois-Rene Rideau's avatar
Francois-Rene Rideau committed
#+(or abcl clasp clisp clozure cmu ecl mkcl sbcl)
(with-upgradability ()
  (if-let (x (and #+clisp (find-symbol* '#:*module-provider-functions* :custom nil)))
    (eval `(pushnew 'module-provide-asdf
                    #+abcl sys::*module-provider-functions*
Francois-Rene Rideau's avatar
Francois-Rene Rideau committed
                    #+(or clasp cmu ecl) ext:*module-provider-functions*
                    #+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
  #+(or clasp ecl mkcl)
    (pushnew '("fasb" . si::load-binary) si::*load-hooks* :test 'equal :key 'car)
Francois-Rene Rideau's avatar
Francois-Rene Rideau committed
    #+(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))))
Francois-Rene Rideau's avatar
Francois-Rene Rideau committed
    (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*
                #+mkcl mk-ext::*module-provider-functions*
                :collect
                (if (eq f 'module-provide-asdf) f
                    #'(lambda (name)
                        (let ((l (multiple-value-list (funcall f name))))
                          (and (first l) (register-preloaded-system (coerce-name name)))
                          (values-list l))))))))
(with-upgradability ()
  (defun herald-asdf (stream)
    (format stream "    ASDF ~A" (asdf-version)))
  (setf (getf ext:*herald-items* :asdf) `(herald-asdf)))

(with-upgradability ()
  #+allegro
  (when (boundp 'excl:*warn-on-nested-reader-conditionals*)
    (setf excl:*warn-on-nested-reader-conditionals* asdf/common-lisp::*acl-warn-save*))
  (dolist (f '(:asdf :asdf2 :asdf3 :asdf3.1 :asdf-package-system)) (pushnew f *features*))
  ;; Provide both lowercase and uppercase, to satisfy more people, especially LispWorks users.
  (provide "asdf") (provide "ASDF")
  (cleanup-upgraded-asdf))
(when *load-verbose*
  (asdf-message ";; ASDF, version ~a~%" (asdf-version)))