8 # "When we build software, it's a good idea to have a reliable method
9 # for getting an executable from it. We want any two reconstructions
10 # starting from the same source to end up in the same result. That's
11 # just a basic intellectual premise."
12 # -- Christian Queinnec, in _Lisp In Small Pieces_, p. 313
14 # This software is part of the SBCL system. See the README file for
17 # This software is derived from the CMU CL system, which was
18 # written at Carnegie Mellon University and released into the
19 # public domain. The software is in the public domain and is
20 # provided with absolutely no warranty. See the COPYING and CREDITS
21 # files for more information.
23 # If you're cross-compiling, make-config.sh should "do the right
24 # thing" when run on the target machine, with the minor caveat that
25 # any --xc-host parameter should be suitable for the host machine
26 # instead of the target.
27 sh make-config.sh
"$@" --check-host-lisp ||
exit $?
32 echo //building
host tools
33 # Build the perfect-hash-generator. It's actually OK if this fails,
34 # as long as xperfecthash.lisp-expr is up-to-date
35 $GNUMAKE -C tools-for-build perfecthash || true
38 echo "//Starting build: $build_started"
39 # Apparently option parsing succeeded. Print out the results.
40 echo "//Options: --prefix='$SBCL_PREFIX' --xc-host='$SBCL_XC_HOST'"
42 # Enforce the source policy for no bogus whitespace
43 $SBCL_XC_HOST < tools-for-build
/canonicalize-whitespace.lisp ||
exit 1
45 # The make-host-*.sh scripts are run on the cross-compilation host,
46 # and the make-target-*.sh scripts are run on the target machine. In
47 # ordinary compilation, we just do these phases consecutively on the
48 # same machine, but if you wanted to cross-compile from one machine
49 # which supports Common Lisp to another which does not (yet:-) support
50 # Common Lisp, you could do something like this:
51 # Create copies of the source tree on both the host and the target.
52 # Read the make-config.sh script carefully and emulate it by hand
53 # on both machines (e.g. creating "target"-named symlinks to
54 # identify the target architecture).
56 # SBCL_XC_HOST=<whatever> sh make-host-1.sh
57 # Copy src/runtime/genesis/*.h from the host system to the target
59 # On the target system:
61 # Copy output/stuff-groveled-from-headers.lisp
62 # from the target system to the host system.
64 # SBCL_XC_HOST=<whatever> sh make-host-2.sh
65 # Copy output/cold-sbcl.core from the host system to the target system.
66 # On the target system:
68 # sh make-target-contrib.sh
69 # Or, if you can set up the files somewhere shared (with NFS, AFS, or
70 # whatever) between the host machine and the target machine, the basic
71 # procedure above should still work, but you can skip the "copy" steps.
72 # If you can use rsync on the host machine, you can call make-config.sh
74 # --host-location=user@host-machine:<rsync path to host sbcl directory>
75 # and the make-target-*.sh scripts will take care of transferring the
78 if command -v time > /dev
/null
; then
84 maybetime sh make-host-1.sh
85 maybetime sh make-target-1.sh
86 maybetime sh make-host-2.sh
87 maybetime sh make-target-2.sh
88 maybetime sh make-target-contrib.sh
90 # Confirm that default evaluation strategy is :INTERPRET if sb-fasteval was built
91 src
/runtime
/sbcl
--core output
/sbcl.core
--lose-on-corruption --noinform \
92 --no-sysinit --no-userinit --disable-debugger \
93 --eval '(when (find-package "SB-INTERPRETER") (assert (eq *evaluator-mode* :interpret)))' \
96 .
/src
/runtime
/sbcl
--core output
/sbcl.core \
97 --lose-on-corruption --noinform $SBCL_MAKE_TARGET_2_OPTIONS --no-sysinit --no-userinit --eval '
102 (sb-vm:map-allocated-objects
103 (lambda (obj type size)
104 (declare (ignore size))
105 (when (and (= type sb-vm:symbol-widetag) (not (symbol-package obj))
106 (search "!" (string obj)))
108 (when (and (= type sb-vm:fdefn-widetag)
110 (sb-int:fun-name-block-name
111 (sb-kernel:fdefn-name obj)))))
114 (when l1 (format t "Found ~D:~%~S~%" (length l1) l1))
116 (mapcan (quote apropos-list)
117 (quote ("DEFINE-INFO-TYPE" "LVAR-TYPE-USING"
119 "PPRINT-TAGBODY-GUTS" "WITH-DESCRIPTOR-HANDLERS"
120 "SUBTRACT-BIGNUM-LOOP" "BIGNUM-REPLACE" "WITH-BIGNUM-BUFFERS"
121 "GCD-ASSERT" "MODULARLY" "BIGNUM-NEGATE-LOOP"
122 "SHIFT-RIGHT-UNALIGNED"
123 "STRING-LESS-GREATER-EQUAL-TESTS")))
124 (format t "~&Leftover from [disabled?] tree-shaker:~%~S~%" sb-int:it))
126 (format t "Found ~D fdefns named by uninterned symbols:~%~S~%" (length l2) l2)))
128 :report "Abort building SBCL."
129 (sb-ext:exit :code 1))))' --quit
131 # contrib/Makefile shouldn't be counted in NCONTRIBS nor should asdf and uiop.
132 # The asdf directory produces 2 fasls, so is unlike all our other contribs
133 # and would therefore mess up the accounting here if included.
134 NCONTRIBS
=`ls -1 contrib/sb-*/Makefile | wc -l`
135 NPASSED
=`ls obj/sbcl-home/contrib/sb-*.fasl | wc -l`
137 echo "The build seems to have finished successfully, including $NPASSED (out of $NCONTRIBS)"
138 echo "contributed modules. If you would like to run more extensive tests on"
139 echo "the new SBCL, you can try:"
141 echo " cd ./tests && sh ./run-tests.sh"
143 echo "To build documentation:"
145 echo " cd ./doc/manual && make"
147 echo "To install SBCL (more information in INSTALL):"
149 echo " sh install.sh"
151 build_finished
=`date`
153 echo "//build started: $build_started"
154 echo "//build finished: $build_finished"