0.6.11.13:
[sbcl.git] / src / cold / shared.lisp
index 8fc7be0..157eec9 100644 (file)
@@ -15,8 +15,6 @@
 ;;;; provided with absolutely no warranty. See the COPYING and CREDITS
 ;;;; files for more information.
 
-;;;; $Header$
-
 ;;; TO DO: Might it be possible to increase the efficiency of CMU CL's garbage
 ;;; collection on my large (256Mb) machine by doing larger incremental GC steps
 ;;; than the default 2 Mb of CMU CL 2.4.9? A quick test 19990729, setting this
 \f
 ;;;; some tools
 
-;;; Take the file named X and make it into a file named Y. Sorta like UNIX, and
-;;; unlike Common Lisp's bare RENAME-FILE, we don't allow information
-;;; from the original filename to influence the final filename. (The reason
-;;; that it's only sorta like UNIX is that in UNIX "mv foo bar/" will work,
-;;; but the analogous (RENAME-FILE-A-LA-UNIX "foo" "bar/") should fail.)
+;;; Take the file named X and make it into a file named Y. Sorta like
+;;; UNIX, and unlike Common Lisp's bare RENAME-FILE, we don't allow
+;;; information from the original filename to influence the final
+;;; filename. (The reason that it's only sorta like UNIX is that in
+;;; UNIX "mv foo bar/" will work, but the analogous
+;;; (RENAME-FILE-A-LA-UNIX "foo" "bar/") should fail.)
 ;;;
-;;; (This is a workaround for the weird behavior of Debian CMU CL 2.4.6, where
-;;; (RENAME-FILE "dir/x" "dir/y") tries to create a file called "dir/dir/y".
-;;; If that behavior goes away, then we should be able to get rid of this
-;;; function and use plain RENAME-FILE in the COMPILE-STEM function
-;;; above. -- WHN 19990321
+;;; (This is a workaround for the weird behavior of Debian CMU CL
+;;; 2.4.6, where (RENAME-FILE "dir/x" "dir/y") tries to create a file
+;;; called "dir/dir/y". If that behavior goes away, then we should be
+;;; able to get rid of this function and use plain RENAME-FILE in the
+;;; COMPILE-STEM function above. -- WHN 19990321
 (defun rename-file-a-la-unix (x y)
   (rename-file x
               ;; (Note that the TRUENAME expression here is lifted from an
 ;;; Compile the source file whose basic name is STEM, using some
 ;;; standard-for-the-SBCL-build-process procedures to generate the full
 ;;; pathnames of source file and object file. Return the pathname of the object
-;;; file for STEM. Several keyword arguments are accepted:
-;;;   SRC-PREFIX, SRC-SUFFIX =
-;;; strings to be concatenated to STEM to produce source filename
-;;;   OBJ-PREFIX, OBJ-SUFFIX =
-;;; strings to be concatenated to STEM to produce object filename
-;;;   TMP-OBJ-SUFFIX-SUFFIX
-;;; string to be appended to the name of an object file to produce the
-;;; name of a temporary object file
-;;;   COMPILE-FILE, IGNORE-FAILURE-P =
-;;; COMPILE-FILE is a function to use for compiling the file (with the
-;;; same calling conventions as ANSI CL:COMPILE-FILE). If the third
-;;; return value (FAILURE-P) of this function is true, a continuable
-;;; error will be signalled, unless IGNORE-FAILURE-P is set, in which
-;;; case only a warning will be signalled.
+;;; file for STEM. Several &KEY arguments are accepted:
+;;;   :SRC-PREFIX, :SRC-SUFFIX =
+;;;      strings to be concatenated to STEM to produce source filename
+;;;   :OBJ-PREFIX, :OBJ-SUFFIX =
+;;;      strings to be concatenated to STEM to produce object filename
+;;;   :TMP-OBJ-SUFFIX-SUFFIX =
+;;;      string to be appended to the name of an object file to produce 
+;;;      the name of a temporary object file
+;;;   :COMPILE-FILE, :IGNORE-FAILURE-P =
+;;;     :COMPILE-FILE is a function to use for compiling the file (with the
+;;;     same calling conventions as ANSI CL:COMPILE-FILE). If the third
+;;;     return value (FAILURE-P) of this function is true, a continuable
+;;;     error will be signalled, unless :IGNORE-FAILURE-P is set, in which
+;;;     case only a warning will be signalled.
 (defun compile-stem (stem
                     &key
                     (obj-prefix "")
    (pathname obj)))
 (compile 'compile-stem)
 
-;;; basic tool for building other tools
-#+nil
-(defun tool-cload-stem (stem)
-  (load (compile-stem stem
-                     :src-prefix *src-prefix*
-                     :obj-prefix *host-obj-prefix*
-                     :obj-suffix *host-obj-suffix*
-                     :compile-file #'compile-file))
-  (values))
-#+nil (compile 'tool-cload-stem)
-
 ;;; other miscellaneous tools
 (load "src/cold/read-from-file.lisp")
 (load "src/cold/rename-package-carefully.lisp")
 ;;; *SHEBANG-FEATURES* instead of *FEATURES*, and use the #!+ and #!-
 ;;; readmacros instead of the ordinary #+ and #- readmacros.
 (setf *shebang-features*
-      (append (read-from-file "base-target-features.lisp-expr")
-             (read-from-file "local-target-features.lisp-expr")))
+      (let* ((default-features
+              (append (read-from-file "base-target-features.lisp-expr")
+                      (read-from-file "local-target-features.lisp-expr")))
+            (customizer-file-name "customize-target-features.lisp")
+            (customizer (if (probe-file customizer-file-name)
+                            (compile nil 
+                                     (read-from-file customizer-file-name))
+                            #'identity)))
+       (funcall customizer default-features)))
+(let ((*print-length* nil)
+      (*print-level* nil))
+  (format t
+         "target features *SHEBANG-FEATURES*=~@<~S~:>~%"
+         *shebang-features*))
 \f
 ;;;; cold-init-related PACKAGE and SYMBOL tools
 
     ;; :NOT-HOST is also set, since the SBCL assembler doesn't exist
     ;; while the cross-compiler is being built in the host ANSI Lisp.)
     :assem
-    ;; meaning: The COMPILE-STEM keyword argument called
-    ;; IGNORE-FAILURE-P should be true. (This is a KLUDGE: I'd like to
-    ;; get rid of it. For now, it exists so that compilation can
-    ;; proceed through the legacy warnings in
-    ;; src/compiler/x86/array.lisp, which I've never figured out but
-    ;; which were apparently acceptable in CMU CL. Eventually, it
-    ;; would be great to just get rid of all warnings and remove
-    ;; support for this flag. -- WHN 19990323)
+    ;; meaning: The #'COMPILE-STEM argument called :IGNORE-FAILURE-P
+    ;; should be true. (This is a KLUDGE: I'd like to get rid of it.
+    ;; For now, it exists so that compilation can proceed through the
+    ;; legacy warnings in src/compiler/x86/array.lisp, which I've
+    ;; never figured out but which were apparently acceptable in CMU
+    ;; CL. Eventually, it would be great to just get rid of all
+    ;; warnings and remove support for this flag. -- WHN 19990323)
     :ignore-failure-p))
 
 (defparameter *stems-and-flags* (read-from-file "stems-and-flags.lisp-expr"))
         ,@body))))
 
 ;;; Check for stupid typos in FLAGS list keywords.
-(let ((stems (make-hash-table :test #'equal)))
+(let ((stems (make-hash-table :test 'equal)))
   (for-stems-and-flags (stem flags)
     (if (gethash stem stems)
       (error "duplicate stem ~S in stems-and-flags data" stem)
 ;;; (This function is not used by the build process, but is intended
 ;;; for interactive use when experimenting with the system. It runs
 ;;; the cross-compiler on test files with arbitrary filenames, not
-;;; necessarily in the source tree, e.g. in "/tmp/".)
+;;; necessarily in the source tree, e.g. in "/tmp".)
 (defun target-compile-file (filename)
   (funcall *in-target-compilation-mode-fn*
           (lambda ()