overflows. (lp#888410)
* enhancement: RUN-PROGRAM now distinguishes exec() failing from child
process exiting with code 1. (lp#676987)
+ * enhancement: convenience function SET-SBCL-SOURCE-LOCATION for informing
+ the system where on the filesystem the SBCL sources themselves are
+ located. (Thanks to Zach Beane)
* bug fix: on 64-bit targets, atomic-incf/aref does index computation
correctly, even on wide-fixnum builds. (lp#887220)
* bug fix: (directory "foo/*/*.*") did not follow symlinks in foo/ that
@code{"SYS:SRC;**;*.*.*"}, and the contributed modules' source files
match @code{"SYS:CONTRIB;**;*.*.*"}.
+@include fun-sb-ext-set-sbcl-source-location.texinfo
+
@node Native Filenames
@comment node-name, next, previous, up
@section Native Filenames
`(("SYS:SRC;**;*.*.*" ,src)
("SYS:CONTRIB;**;*.*.*" ,contrib)
("SYS:OUTPUT;**;*.*.*" ,output)))))
+
+(defun set-sbcl-source-location (pathname)
+ "Initialize the SYS logical host based on PATHNAME, which should be
+the top-level directory of the SBCL sources. This will replace any
+existing translations for \"SYS:SRC;\", \"SYS:CONTRIB;\", and
+\"SYS:OUTPUT;\". Other \"SYS:\" translations are preserved."
+ (let ((truename (truename pathname))
+ (current-translations
+ (remove-if (lambda (translation)
+ (or (pathname-match-p "SYS:SRC;" translation)
+ (pathname-match-p "SYS:CONTRIB;" translation)
+ (pathname-match-p "SYS:OUTPUT;" translation)))
+ (logical-pathname-translations "SYS")
+ :key #'first)))
+ (flet ((physical-target (component)
+ (merge-pathnames
+ (make-pathname :directory (list :relative component
+ :wild-inferiors)
+ :name :wild
+ :type :wild)
+ truename)))
+ (setf (logical-pathname-translations "SYS")
+ `(("SYS:SRC;**;*.*.*" ,(physical-target "src"))
+ ("SYS:CONTRIB;**;*.*.*" ,(physical-target "contrib"))
+ ("SYS:OUTPUT;**;*.*.*" ,(physical-target "output"))
+ ,@current-translations)))))