1 | ;;; compile-system.lisp |
---|
2 | ;;; |
---|
3 | ;;; Copyright (C) 2004-2008 Peter Graves |
---|
4 | ;;; $Id: compile-system.lisp 14378 2013-02-13 19:54:49Z mevenson $ |
---|
5 | ;;; |
---|
6 | ;;; This program is free software; you can redistribute it and/or |
---|
7 | ;;; modify it under the terms of the GNU General Public License |
---|
8 | ;;; as published by the Free Software Foundation; either version 2 |
---|
9 | ;;; of the License, or (at your option) any later version. |
---|
10 | ;;; |
---|
11 | ;;; This program is distributed in the hope that it will be useful, |
---|
12 | ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
13 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
14 | ;;; GNU General Public License for more details. |
---|
15 | ;;; |
---|
16 | ;;; You should have received a copy of the GNU General Public License |
---|
17 | ;;; along with this program; if not, write to the Free Software |
---|
18 | ;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
---|
19 | ;;; |
---|
20 | ;;; As a special exception, the copyright holders of this library give you |
---|
21 | ;;; permission to link this library with independent modules to produce an |
---|
22 | ;;; executable, regardless of the license terms of these independent |
---|
23 | ;;; modules, and to copy and distribute the resulting executable under |
---|
24 | ;;; terms of your choice, provided that you also meet, for each linked |
---|
25 | ;;; independent module, the terms and conditions of the license of that |
---|
26 | ;;; module. An independent module is a module which is not derived from |
---|
27 | ;;; or based on this library. If you modify this library, you may extend |
---|
28 | ;;; this exception to your version of the library, but you are not |
---|
29 | ;;; obligated to do so. If you do not wish to do so, delete this |
---|
30 | ;;; exception statement from your version. |
---|
31 | |
---|
32 | (in-package "SYSTEM") |
---|
33 | |
---|
34 | (require "LOOP") |
---|
35 | (require "COLLECT") |
---|
36 | (require "COMPILE-FILE") |
---|
37 | |
---|
38 | (export '(grovel-java-definitions-in-file compile-system)) |
---|
39 | |
---|
40 | |
---|
41 | (defun check-lisp-home () |
---|
42 | (loop |
---|
43 | (cond ((and *lisp-home* |
---|
44 | (probe-directory (pathname *lisp-home*))) |
---|
45 | (return)) |
---|
46 | (t |
---|
47 | (cerror "Continue" |
---|
48 | "*LISP-HOME* is NIL or invalid.~% Please set *LISP-HOME* to the full pathname of the directory containing the Lisp system files."))))) |
---|
49 | |
---|
50 | (defun grovel-java-definitions-in-file (file out) |
---|
51 | (with-open-file (in file) |
---|
52 | (declare (type stream in)) |
---|
53 | (let ((system-package (find-package "SYSTEM")) |
---|
54 | (line-number 1)) |
---|
55 | (loop |
---|
56 | (let ((text (read-line in nil))) |
---|
57 | (when (null text) |
---|
58 | (return)) |
---|
59 | (let ((position (search "###" text))) |
---|
60 | (when position |
---|
61 | (let* ((name (string (read-from-string (subseq text (+ position 3))))) |
---|
62 | (symbol (or (find-symbol name system-package) ; uses CL and EXT |
---|
63 | (find-symbol name (find-package "MOP")) |
---|
64 | (find-symbol name (find-package "JAVA"))))) |
---|
65 | (when symbol |
---|
66 | ;; Force the symbol's package prefix to be written out |
---|
67 | ;; with "::" instead of ":" so there won't be a reader |
---|
68 | ;; error if a symbol that's external now is no longer |
---|
69 | ;; external when we read the tags file. |
---|
70 | (%format out "~A::~A ~S ~S~%" |
---|
71 | (package-name (symbol-package symbol)) |
---|
72 | name |
---|
73 | file line-number))))) |
---|
74 | (incf line-number)))))) |
---|
75 | |
---|
76 | (defun grovel-java-definitions () |
---|
77 | (check-lisp-home) |
---|
78 | (time |
---|
79 | (let ((files (directory (merge-pathnames "*.java" *lisp-home*)))) |
---|
80 | (with-open-file (stream (merge-pathnames "tags" *lisp-home*) |
---|
81 | :direction :output :if-exists :supersede) |
---|
82 | (dolist (file files) |
---|
83 | (grovel-java-definitions-in-file file stream)))))) |
---|
84 | |
---|
85 | |
---|
86 | ;; |
---|
87 | ;; Functions to generate autoloads.lisp |
---|
88 | ;; |
---|
89 | |
---|
90 | (defun packages-from-combos (combos) |
---|
91 | (remove-duplicates (mapcar #'symbol-package |
---|
92 | (mapcar #'sys:fdefinition-block-name |
---|
93 | (mapcar #'second combos))))) |
---|
94 | |
---|
95 | (defun remove-multi-combo-symbols (combos) |
---|
96 | (princ "; Removing multi-homed symbols") |
---|
97 | (let ((sym-hash (make-hash-table :size (* 2 (length combos))))) |
---|
98 | (dolist (combo combos) |
---|
99 | (incf (gethash (second combo) sym-hash 0))) |
---|
100 | (print (remove-if-not (lambda (x) |
---|
101 | (< 1 (gethash x sym-hash))) |
---|
102 | combos |
---|
103 | :key #'second)) |
---|
104 | (remove-if (lambda (x) |
---|
105 | (< 1 (gethash x sym-hash))) |
---|
106 | combos |
---|
107 | :key #'second))) |
---|
108 | |
---|
109 | (defun set-equal (set1 set2 &key test) |
---|
110 | (or (eq set1 set2) |
---|
111 | (equal set1 set2) |
---|
112 | (and (subsetp set2 set1 :test test) |
---|
113 | (subsetp set1 set2 :test test)))) |
---|
114 | |
---|
115 | (defun combos-to-symbol-filesets (combos) |
---|
116 | (let (filesets) |
---|
117 | (dolist (combo combos) |
---|
118 | (pushnew (list (second combo)) filesets :test #'equal :key #'first) |
---|
119 | (pushnew (first combo) |
---|
120 | (cdr (assoc (second combo) filesets :test #'equal)) |
---|
121 | :test #'string=)) |
---|
122 | filesets)) |
---|
123 | |
---|
124 | (defun combos-to-fileset-symbols (combos) |
---|
125 | (let (fileset-symbols) |
---|
126 | (dolist (symbol-fileset (combos-to-symbol-filesets combos)) |
---|
127 | (pushnew (list (cdr symbol-fileset)) fileset-symbols |
---|
128 | :test (lambda (x y) (set-equal x y :test #'string=)) |
---|
129 | :key #'first) |
---|
130 | (pushnew (first symbol-fileset) |
---|
131 | (cdr (assoc (cdr symbol-fileset) fileset-symbols |
---|
132 | :test (lambda (x y) |
---|
133 | (set-equal x y :test #'string=)))))) |
---|
134 | fileset-symbols)) |
---|
135 | |
---|
136 | (defun write-autoloader (stream package type fileset-symbols) |
---|
137 | (when fileset-symbols |
---|
138 | (write `(in-package ,package) :stream stream) |
---|
139 | (terpri stream) |
---|
140 | (let ((*package* (find-package package))) |
---|
141 | (write `(dolist (fs ',fileset-symbols) |
---|
142 | (funcall #',type (cdr fs) (car (car fs)))) :stream stream) |
---|
143 | (terpri stream)))) |
---|
144 | |
---|
145 | (defun write-package-filesets (stream package type filesets-symbols) |
---|
146 | (let* ((filter-package (find-package package)) |
---|
147 | (filtered-filesets |
---|
148 | (remove-if (lambda (x) |
---|
149 | (null (cdr x))) |
---|
150 | (mapcar (lambda (x) |
---|
151 | (cons (car x) |
---|
152 | (remove-if-not (lambda (x) |
---|
153 | (and (symbolp x) |
---|
154 | (eq (symbol-package x) |
---|
155 | filter-package))) |
---|
156 | (cdr x)))) |
---|
157 | filesets-symbols)))) |
---|
158 | (write-autoloader stream package type filtered-filesets))) |
---|
159 | |
---|
160 | (defun load-combos (path-spec) |
---|
161 | (let (all-functions) |
---|
162 | (dolist (functions-file (directory path-spec) |
---|
163 | all-functions) |
---|
164 | ;; every file has 1 form: the list of functions in it. |
---|
165 | (let ((base-name (pathname-name functions-file))) |
---|
166 | (unless (member base-name '("asdf" "gray-streams") :test #'string=) |
---|
167 | ;; exclude ASDF and GRAY-STREAMS: they have external |
---|
168 | ;; symbols we don't have until we load them, but we need |
---|
169 | ;; those symbols to read the symbols files |
---|
170 | (with-open-file (f functions-file |
---|
171 | :direction :input) |
---|
172 | (dolist (function-name (read f)) |
---|
173 | (push (list base-name function-name) all-functions)))))))) |
---|
174 | |
---|
175 | (defun generate-autoloads (symbol-files-pathspec) |
---|
176 | (labels ((filter-combos (combos) |
---|
177 | (remove-multi-combo-symbols |
---|
178 | (remove-if (lambda (x) |
---|
179 | ;; exclude the symbols from the files |
---|
180 | ;; below: putting autoloaders on some of |
---|
181 | ;; the symbols conflicts with the bootstrapping |
---|
182 | ;; Primitives which have been defined Java-side |
---|
183 | (member x '( ;; function definitions to be excluded |
---|
184 | "fdefinition" "early-defuns" |
---|
185 | "require" "signal" "restart" |
---|
186 | |
---|
187 | ;; extensible sequences override |
---|
188 | ;; lots of default functions; |
---|
189 | ;; java-collections implements |
---|
190 | ;; extensible sequences |
---|
191 | "extensible-sequences-base" |
---|
192 | "extensible-sequences" "java-collections" |
---|
193 | |
---|
194 | ;; macro definitions to be excluded |
---|
195 | "macros" ;; "backquote" |
---|
196 | "precompiler") |
---|
197 | :test #'string=)) |
---|
198 | combos |
---|
199 | :key #'first))) |
---|
200 | (filter-setf-combos (combos) |
---|
201 | (filter-combos |
---|
202 | (remove-multi-combo-symbols |
---|
203 | (remove-if (lambda (x) (member x '("clos") :test #'string=)) combos :key #'first)))) |
---|
204 | (symbols-pathspec (filespec) |
---|
205 | (merge-pathnames filespec symbol-files-pathspec))) |
---|
206 | (let ((funcs (filter-combos (load-combos (symbols-pathspec "*.funcs")))) |
---|
207 | (macs (filter-combos (load-combos (symbols-pathspec "*.macs")))) |
---|
208 | (setf-functions (filter-setf-combos (load-combos (symbols-pathspec "*.setf-functions")))) |
---|
209 | (setf-expanders (filter-setf-combos (load-combos (symbols-pathspec "*.setf-expanders")))) |
---|
210 | (exps (filter-combos (load-combos (symbols-pathspec "*.exps"))))) |
---|
211 | (with-open-file (f (symbols-pathspec "autoloads-gen.lisp") |
---|
212 | :direction :output :if-does-not-exist :create |
---|
213 | :if-exists :supersede) |
---|
214 | ;; Generate the lisp file. This file will be included after compilation, |
---|
215 | ;; so any comments are just for debugging purposes. |
---|
216 | (terpri f) |
---|
217 | (write-line ";; ---- GENERATED CONTENT BELOW" f) |
---|
218 | (terpri f) |
---|
219 | (dolist (package '(:format :sequence :loop :mop :xp :precompiler |
---|
220 | :profiler :java :jvm :extensions :threads |
---|
221 | :top-level :system :cl)) |
---|
222 | ;; Limit the set of packages: |
---|
223 | ;; During incremental compilation, the packages GRAY-STREAMS |
---|
224 | ;; and ASDF are not being created. Nor are these packages |
---|
225 | ;; vital to the correct operation of the base system. |
---|
226 | |
---|
227 | (let* ((*package* (find-package package)) |
---|
228 | (all-exported-symbols |
---|
229 | (remove-duplicates (mapcar #'second exps))) |
---|
230 | (externals (remove-if-not (lambda (sym) |
---|
231 | (eq (symbol-package sym) |
---|
232 | *package*)) |
---|
233 | all-exported-symbols))) |
---|
234 | (when externals |
---|
235 | (write-line ";; EXPORTS" f) |
---|
236 | (write `(cl:in-package ,package) :stream f) |
---|
237 | (terpri f) |
---|
238 | (write `(cl:export ',externals) :stream f) |
---|
239 | (terpri f))) |
---|
240 | |
---|
241 | |
---|
242 | (terpri f) |
---|
243 | (write-line ";; FUNCTIONS" f) |
---|
244 | (terpri f) |
---|
245 | (write-package-filesets f package 'ext:autoload |
---|
246 | (combos-to-fileset-symbols funcs)) |
---|
247 | (terpri f) |
---|
248 | (write-line ";; MACROS" f) |
---|
249 | (terpri f) |
---|
250 | (write-package-filesets f package 'ext:autoload-macro |
---|
251 | (combos-to-fileset-symbols macs)) |
---|
252 | |
---|
253 | (terpri f) |
---|
254 | |
---|
255 | (write-line ";; SETF-FUNCTIONS" f) |
---|
256 | (terpri f) |
---|
257 | (write-package-filesets f package 'ext:autoload-setf-function |
---|
258 | (combos-to-fileset-symbols setf-functions)) |
---|
259 | (terpri f) |
---|
260 | (write-line ";; SETF-EXPANDERS" f) |
---|
261 | (terpri f) |
---|
262 | (write-package-filesets f package 'ext:autoload-setf-expander |
---|
263 | (combos-to-fileset-symbols setf-expanders))))))) |
---|
264 | |
---|
265 | ;; |
---|
266 | ;; --- End of autoloads.lisp |
---|
267 | ;; |
---|
268 | |
---|
269 | |
---|
270 | (defun %compile-system (&key output-path) |
---|
271 | (let ((*default-pathname-defaults* (pathname *lisp-home*)) |
---|
272 | (*warn-on-redefinition* nil) |
---|
273 | (*prevent-fasl-circle-detection* t)) |
---|
274 | (unless output-path |
---|
275 | (setf output-path *default-pathname-defaults*)) |
---|
276 | (flet ((do-compile (file &key (extract t)) |
---|
277 | (let ((out (make-pathname :type *compile-file-type* |
---|
278 | :defaults (merge-pathnames |
---|
279 | file output-path)))) |
---|
280 | (compile-file-if-needed file |
---|
281 | :output-file out |
---|
282 | :extract-toplevel-funcs-and-macros extract)))) |
---|
283 | (load (do-compile "defstruct.lisp")) |
---|
284 | (load (do-compile "coerce.lisp")) |
---|
285 | (load (do-compile "open.lisp")) |
---|
286 | (load (do-compile "dump-form.lisp")) |
---|
287 | (load (do-compile "compiler-types.lisp")) |
---|
288 | (load (do-compile "compile-file.lisp")) |
---|
289 | (load (do-compile "precompiler.lisp")) |
---|
290 | (load (do-compile "compiler-pass1.lisp")) |
---|
291 | (load (do-compile "compiler-pass2.lisp")) |
---|
292 | (load (do-compile "jvm-class-file.lisp")) |
---|
293 | (load (do-compile "jvm.lisp")) |
---|
294 | (load (do-compile "source-transform.lisp")) |
---|
295 | (load (do-compile "compiler-macro.lisp")) |
---|
296 | (load (do-compile "jvm-instructions.lisp")) |
---|
297 | (load (do-compile "setf.lisp")) |
---|
298 | (load (do-compile "extensible-sequences-base.lisp")) |
---|
299 | (load (do-compile "require.lisp")) |
---|
300 | (load (do-compile "substitute.lisp")) |
---|
301 | (load (do-compile "clos.lisp")) |
---|
302 | (load (do-compile "mop.lisp")) |
---|
303 | ;; Order matters for these files. |
---|
304 | (mapc #'do-compile '("collect.lisp" |
---|
305 | "macros.lisp" |
---|
306 | "loop.lisp")) |
---|
307 | (load (do-compile "backquote.lisp")) |
---|
308 | (load (do-compile "early-defuns.lisp")) |
---|
309 | (load (do-compile "typep.lisp")) |
---|
310 | (load (do-compile "subtypep.lisp")) |
---|
311 | (load (do-compile "find.lisp")) |
---|
312 | (load (do-compile "print.lisp")) |
---|
313 | (load (do-compile "pprint-dispatch.lisp")) |
---|
314 | (load (do-compile "pprint.lisp")) |
---|
315 | (load (do-compile "format.lisp")) |
---|
316 | (load (do-compile "delete.lisp")) |
---|
317 | (load (do-compile "concatenate.lisp")) |
---|
318 | (load (do-compile "ldb.lisp")) |
---|
319 | (load (do-compile "destructuring-bind.lisp")) |
---|
320 | (load (do-compile "asdf.lisp")) |
---|
321 | ;; But not for these. |
---|
322 | (mapc #'do-compile '("abcl-contrib.lisp" |
---|
323 | "adjoin.lisp" |
---|
324 | "and.lisp" |
---|
325 | "apropos.lisp" |
---|
326 | "arrays.lisp" |
---|
327 | "assert.lisp" |
---|
328 | "assoc.lisp" |
---|
329 | "aver.lisp" |
---|
330 | "bit-array-ops.lisp" |
---|
331 | "boole.lisp" |
---|
332 | "butlast.lisp" |
---|
333 | "byte-io.lisp" |
---|
334 | "case.lisp" |
---|
335 | "chars.lisp" |
---|
336 | "check-type.lisp" |
---|
337 | "compile-file-pathname.lisp" |
---|
338 | "compile-system.lisp" |
---|
339 | "compiler-error.lisp" |
---|
340 | "cond.lisp" |
---|
341 | "copy-seq.lisp" |
---|
342 | "copy-symbol.lisp" |
---|
343 | "count.lisp" |
---|
344 | "digest.lisp" |
---|
345 | "debug.lisp" |
---|
346 | "define-modify-macro.lisp" |
---|
347 | "define-symbol-macro.lisp" |
---|
348 | "defmacro.lisp" |
---|
349 | "defpackage.lisp" |
---|
350 | "defsetf.lisp" |
---|
351 | "deftype.lisp" |
---|
352 | "delete-duplicates.lisp" |
---|
353 | "deposit-field.lisp" |
---|
354 | "describe.lisp" |
---|
355 | "describe-compiler-policy.lisp" |
---|
356 | "directory.lisp" |
---|
357 | "disassemble.lisp" |
---|
358 | "do-all-symbols.lisp" |
---|
359 | "do-external-symbols.lisp" |
---|
360 | "do-symbols.lisp" |
---|
361 | "do.lisp" |
---|
362 | "documentation.lisp" |
---|
363 | "dolist.lisp" |
---|
364 | "dotimes.lisp" |
---|
365 | "dribble.lisp" |
---|
366 | "dump-class.lisp" |
---|
367 | "ed.lisp" |
---|
368 | "enough-namestring.lisp" |
---|
369 | "ensure-directories-exist.lisp" |
---|
370 | "error.lisp" |
---|
371 | "extensible-sequences.lisp" |
---|
372 | "featurep.lisp" |
---|
373 | "fdefinition.lisp" |
---|
374 | "fill.lisp" |
---|
375 | "find-all-symbols.lisp" |
---|
376 | "gentemp.lisp" |
---|
377 | "gray-streams.lisp" |
---|
378 | "gui.lisp" |
---|
379 | "inline.lisp" |
---|
380 | "inspect.lisp" |
---|
381 | "java.lisp" |
---|
382 | "java-collections.lisp" |
---|
383 | "known-functions.lisp" |
---|
384 | "known-symbols.lisp" |
---|
385 | "late-setf.lisp" |
---|
386 | "lcm.lisp" |
---|
387 | "ldiff.lisp" |
---|
388 | "list-length.lisp" |
---|
389 | "list.lisp" |
---|
390 | "load.lisp" |
---|
391 | "make-hash-table.lisp" |
---|
392 | "make-load-form-saving-slots.lisp" |
---|
393 | "make-sequence.lisp" |
---|
394 | "make-string-output-stream.lisp" |
---|
395 | "make-string.lisp" |
---|
396 | "map-into.lisp" |
---|
397 | "map.lisp" |
---|
398 | "map1.lisp" |
---|
399 | "mask-field.lisp" |
---|
400 | "member-if.lisp" |
---|
401 | "mismatch.lisp" |
---|
402 | "multiple-value-bind.lisp" |
---|
403 | "multiple-value-list.lisp" |
---|
404 | "multiple-value-setq.lisp" |
---|
405 | "nsubstitute.lisp" |
---|
406 | "nth-value.lisp" |
---|
407 | "numbers.lisp" |
---|
408 | "or.lisp" |
---|
409 | "parse-integer.lisp" |
---|
410 | "parse-lambda-list.lisp" |
---|
411 | "package.lisp" |
---|
412 | "pathnames.lisp" |
---|
413 | "print-object.lisp" |
---|
414 | "print-unreadable-object.lisp" |
---|
415 | "proclaim.lisp" |
---|
416 | "profiler.lisp" |
---|
417 | "prog.lisp" |
---|
418 | "psetf.lisp" |
---|
419 | "query.lisp" |
---|
420 | "read-circle.lisp" |
---|
421 | "read-conditional.lisp" |
---|
422 | "read-from-string.lisp" |
---|
423 | "read-sequence.lisp" |
---|
424 | "reduce.lisp" |
---|
425 | "remf.lisp" |
---|
426 | "remove-duplicates.lisp" |
---|
427 | "remove.lisp" |
---|
428 | "replace.lisp" |
---|
429 | "restart.lisp" |
---|
430 | "revappend.lisp" |
---|
431 | "rotatef.lisp" |
---|
432 | "run-program.lisp" |
---|
433 | "run-shell-command.lisp" |
---|
434 | "runtime-class.lisp" |
---|
435 | "search.lisp" |
---|
436 | "sequences.lisp" |
---|
437 | "sets.lisp" |
---|
438 | "shiftf.lisp" |
---|
439 | "signal.lisp" |
---|
440 | "socket.lisp" |
---|
441 | "sort.lisp" |
---|
442 | "step.lisp" |
---|
443 | "strings.lisp" |
---|
444 | "sublis.lisp" |
---|
445 | "subst.lisp" |
---|
446 | "tailp.lisp" |
---|
447 | "threads.lisp" |
---|
448 | "time.lisp" |
---|
449 | "top-level.lisp" |
---|
450 | "trace.lisp" |
---|
451 | "tree-equal.lisp" |
---|
452 | "upgraded-complex-part-type.lisp" |
---|
453 | "with-accessors.lisp" |
---|
454 | "with-hash-table-iterator.lisp" |
---|
455 | "with-input-from-string.lisp" |
---|
456 | "with-open-file.lisp" |
---|
457 | "with-output-to-string.lisp" |
---|
458 | "with-package-iterator.lisp" |
---|
459 | "with-slots.lisp" |
---|
460 | "with-standard-io-syntax.lisp" |
---|
461 | "write-sequence.lisp")) |
---|
462 | ;; With all files compiled, we need to use the symbols collected |
---|
463 | ;; to generate and compile autoloads.lisp |
---|
464 | |
---|
465 | ;; Generate the autoloads-gen file in the build directory in order |
---|
466 | ;; not to clobber the source file - that should keep the system |
---|
467 | ;; buildable |
---|
468 | |
---|
469 | (format t "; Generating autoloads...~%") |
---|
470 | (generate-autoloads output-path) |
---|
471 | ;; Compile the file in the build directory instead of the one in the |
---|
472 | ;; sources directory - the latter being for bootstrapping only. |
---|
473 | (do-compile (merge-pathnames #p"autoloads-gen.lisp" output-path) |
---|
474 | :extract nil) |
---|
475 | (do-compile "autoloads.lisp" |
---|
476 | :extract nil)) |
---|
477 | t)) |
---|
478 | |
---|
479 | (defun compile-system (&key quit (zip t) (cls-ext *compile-file-class-extension*) (abcl-ext *compile-file-type*) output-path) |
---|
480 | (let ((status -1) |
---|
481 | (*compile-file-class-extension* cls-ext) |
---|
482 | (*compile-file-type* abcl-ext)) |
---|
483 | (check-lisp-home) |
---|
484 | (time |
---|
485 | (with-compilation-unit () |
---|
486 | (let ((*compile-file-zip* zip) |
---|
487 | failure-p) |
---|
488 | (handler-bind (((or warning |
---|
489 | compiler-error) |
---|
490 | #'(lambda (c) |
---|
491 | (declare (ignore c)) |
---|
492 | (setf failure-p t) |
---|
493 | ;; only register that we had this type of signal |
---|
494 | ;; defer the actual handling to another handler |
---|
495 | nil))) |
---|
496 | (%compile-system :output-path output-path)) |
---|
497 | (unless failure-p |
---|
498 | (setf status 0))))) |
---|
499 | (create-system-logical-translations output-path) |
---|
500 | (when quit |
---|
501 | (quit :status status)))) |
---|
502 | |
---|
503 | (defun create-system-logical-translations (output-path) |
---|
504 | (let* ((dir (directory-namestring (pathname output-path))) |
---|
505 | (system (merge-pathnames "system.lisp" dir)) |
---|
506 | (home (pathname *lisp-home*)) |
---|
507 | (src (format nil "~A**/*.*" home)) |
---|
508 | (java (format nil "~A../../../**/*.*" home))) |
---|
509 | (with-open-file (s system :direction :output |
---|
510 | :if-exists :supersede) |
---|
511 | (pprint `(setf (logical-pathname-translations "sys") |
---|
512 | '(("SYS:SRC;**;*.*" ,src) |
---|
513 | ("SYS:JAVA;**;*.*" ,java))) |
---|
514 | s)))) |
---|
515 | |
---|