|
35 | 35 | *load-truename*
|
36 | 36 | *default-pathname-defaults*
|
37 | 37 | (error "Indeterminate load pathname...")))
|
| 38 | + |
38 | 39 | (setq *build-init-pathname* (truename *build-init-pathname*))
|
39 | 40 |
|
40 | 41 | (when *load-verbose*
|
|
44 | 45 | ;;; load the production asdf version for building images
|
45 | 46 | ;;; in a dev tree, this mens to go upwards to look for the production tree
|
46 | 47 |
|
| 48 | +(defun compile-and-load-file (source-pathname) |
| 49 | + (let ((binary-pathname (compile-file-pathname source-pathname))) |
| 50 | + (if (probe-file binary-pathname) |
| 51 | + (if (probe-file source-pathname) |
| 52 | + (if (> (file-write-date binary-pathname) (file-write-date source-pathname)) |
| 53 | + (load binary-pathname) |
| 54 | + (load (compile-file source-pathname))) |
| 55 | + (load binary-pathname)) |
| 56 | + (load (compile-file source-pathname))))) |
| 57 | + |
47 | 58 | (defparameter *asdf-pathname*
|
48 | 59 | (make-pathname :directory (append (pathname-directory *build-init-pathname*)
|
49 | 60 | '("net" "common-lisp" "asdf"))
|
|
55 | 66 | (cond ((probe-file *asdf-pathname*)
|
56 | 67 | (when *load-verbose*
|
57 | 68 | (format *trace-output* "~&;Incorporating asdf anew from ~s." *asdf-pathname*))
|
58 |
| - (load (compile-file *asdf-pathname*)) |
| 69 | + (compile-and-load-file *asdf-pathname*) |
59 | 70 | #+ecl
|
60 |
| - (load (compile-file (make-pathname :name "asdf-ecl" :defaults *asdf-pathname*)))) |
| 71 | + (compile-and-load-file (make-pathname :name "asdf-ecl" :defaults *asdf-pathname*))) |
61 | 72 | (t
|
62 | 73 | (cerror "Continue anyway." "ASDF is missing: ~s." *asdf-pathname*))))
|
63 | 74 |
|
64 | 75 |
|
65 | 76 | ;;;
|
66 | 77 | ;;; incorporate support for hierarchical names
|
67 |
| -#+(or :clozure :allegro sbcl) ;; for now |
| 78 | + |
| 79 | +#+(or :clozure :allegro :sbcl) ;; for now |
68 | 80 | (unless (fboundp (find-symbol (string :sysdef-hierarchical-search-function) :asdf))
|
69 |
| - (loop for (path name) in '((("de" "setf" "utility") "pathnames") |
| 81 | + (loop for (path name) in '((("de" "setf" "utility") "package") |
| 82 | + (("de" "setf" "utility") "pathnames") |
70 | 83 | (("de" "setf" "utility" "asdf") "hierarchical-names"))
|
71 | 84 | do (let ((pathname (make-pathname :directory (append (pathname-directory *build-init-pathname*) path)
|
72 | 85 | :name name :type "lisp"
|
73 | 86 | :defaults *build-init-pathname*)))
|
74 | 87 | (if (probe-file pathname)
|
75 |
| - (load pathname) |
| 88 | + (compile-and-load-file pathname) |
76 | 89 | (cerror "Continue anyway." "Hierarchical name component is missing: ~s." pathname)))))
|
77 | 90 |
|
| 91 | +;;; |
| 92 | +;;; define logical hosts for the dev sources and, optionally, production sources |
| 93 | + |
| 94 | +(or (ignore-errors (logical-pathname-translations "LIBRARY")) |
| 95 | + (de.setf.utility:define-library-host *build-init-pathname* "LIBRARY")) |
| 96 | + |
| 97 | +;; nb. clisp neither merges :up relative pathnames, nor (by default) correctly parses logical namestrings |
| 98 | +(or (ignore-errors (logical-pathname-translations "P-LIBRARY")) |
| 99 | + (let* ((library (truename (make-pathname :host "LIBRARY" :directory '(:absolute)))) |
| 100 | + (production (make-pathname :directory (substitute "production" "dev" |
| 101 | + (pathname-directory *build-init-pathname*) |
| 102 | + :test #'string-equal) |
| 103 | + :name nil :type nil :defaults *build-init-pathname*))) |
| 104 | + (when (and (#-clisp probe-file #+clisp ext:probe-directory production) |
| 105 | + (not (equalp production library))) |
| 106 | + (de.setf.utility:define-library-host production "P-LIBRARY")))) |
| 107 | + |
| 108 | + |
78 | 109 |
|
79 | 110 | ;;;
|
80 | 111 | ;;; augment the asdf central registry.
|
|
87 | 118 | (when (#-clisp probe-file #+clisp probe-directory pathname)
|
88 | 119 | (pushnew (truename pathname) asdf:*central-registry* :test #'equalp)))
|
89 | 120 | (list (make-pathname :directory (append (pathname-directory *build-init-pathname*)
|
90 |
| - '("asdf-registry")) |
| 121 | + '("asdf-registry")) |
91 | 122 | :defaults *build-init-pathname*)
|
92 | 123 | *build-init-pathname*))
|
93 | 124 |
|
|
0 commit comments