0.8.15.7
[sbcl.git] / contrib / asdf-stub.lisp
1 (load "../asdf/asdf")
2
3 (setf asdf::*central-registry*
4       '((merge-pathnames "systems/" (truename (sb-ext:posix-getenv "SBCL_HOME")))))
5 (push :sb-building-contrib *features*)
6 (asdf:operate 'asdf:load-op *system*)
7
8 (defvar *system-stub* (make-pathname :name *system* :type "lisp"))
9
10 (when (probe-file (compile-file-pathname *system-stub*))
11   (error "fasl file exists"))
12
13 (with-open-file (s *system-stub* :direction :output :if-exists :error)
14   (print '(unless (member "ASDF" *modules* :test #'string=)
15            (load (merge-pathnames "asdf/asdf.fasl" (truename (sb-ext:posix-getenv "SBCL_HOME")))))
16          s)
17   ;; This addition to *central-registry* allows us to find contribs
18   ;; even if the user has frobbed the original contents.
19   (print `(let ((asdf:*central-registry* (cons (merge-pathnames "systems/"
20                                                                 (truename (sb-ext:posix-getenv "SBCL_HOME")))
21                                                asdf:*central-registry*)))
22            (asdf::module-provide-asdf ,*system*))
23          s))
24
25 (compile-file *system-stub*)
26 (delete-file *system-stub*)