Remove a redundant cond.
[sbcl.git] / make-target-2.sh
blobd02afc1bdfbbe761dd796fc69f6a554fcfcc54e9
1 #!/bin/sh
2 set -em
4 # --load argument skips compilation.
6 # This is a script to be run as part of make.sh. The only time you'd
7 # want to run it by itself is if you're trying to cross-compile the
8 # system or if you're doing some kind of troubleshooting.
10 # This software is part of the SBCL system. See the README file for
11 # more information.
13 # This software is derived from the CMU CL system, which was
14 # written at Carnegie Mellon University and released into the
15 # public domain. The software is in the public domain and is
16 # provided with absolutely no warranty. See the COPYING and CREDITS
17 # files for more information.
19 echo //entering make-target-2.sh
21 LANG=C
22 LC_ALL=C
23 export LANG LC_ALL
25 # Load our build configuration
26 . output/build-config
28 if [ -n "$SBCL_HOST_LOCATION" ]; then
29 echo //copying host-2 files to target
30 rsync -a "$SBCL_HOST_LOCATION/output/" output/
33 # Do warm init stuff, e.g. building and loading CLOS, and stuff which
34 # can't be done until CLOS is running.
36 # Note that it's normal for the newborn system to think rather hard at
37 # the beginning of this process (e.g. using nearly 100Mb of virtual memory
38 # and >30 seconds of CPU time on a 450MHz CPU), and unless you built the
39 # system with the :SB-SHOW feature enabled, it does it rather silently,
40 # without trying to tell you about what it's doing. So unless it hangs
41 # for much longer than that, don't worry, it's likely to be normal.
42 warm_compile=yes
43 devel=""
44 if [ "$1" = --load ]; then
45 warm_compile=no
46 elif [ "$1" = --load-with-sb-devel ]; then
47 warm_compile=no
48 devel="(pushnew :sb-devel *features*)"
49 elif [ "x$1" != x ]; then
50 echo Unknown option \'"$1"\' to make-target-2
51 exit 1
53 if [ "$warm_compile" = yes ]; then
54 echo //doing warm init - compilation phase
55 ./src/runtime/sbcl --core output/cold-sbcl.core \
56 --lose-on-corruption $SBCL_MAKE_TARGET_2_OPTIONS --no-sysinit --no-userinit \
57 --eval '(sb-fasl::!warm-load "src/cold/warm.lisp")' --quit
59 echo //doing warm init - load and dump phase
60 ./src/runtime/sbcl --noinform --core output/cold-sbcl.core \
61 --lose-on-corruption $SBCL_MAKE_TARGET_2_OPTIONS \
62 --no-sysinit --no-userinit --noprint <<EOF
63 (progn ${devel})
64 (sb-fasl::!warm-load "make-target-2-load.lisp")
65 (setf (extern-alien "gc_coalesce_string_literals" char) 2)
66 ;;; Use the historical (bad) convention for *compile-file-pathname*
67 (setf sb-c::*merge-pathnames* t)
68 ;;; and for storing pathname namestrings in fasls too.
69 (setq sb-c::*name-context-file-path-selector* 'truename)
70 ; Turn off IR consistency checking in release mode.
71 (setq sb-c::*check-consistency* nil)
72 (let ((sb-ext:*invoke-debugger-hook* (prog1 sb-ext:*invoke-debugger-hook* (sb-ext:enable-debugger))))
73 (sb-ext:save-lisp-and-die "output/sbcl.core"))
74 EOF
76 ./src/runtime/sbcl --noinform --core output/sbcl.core \
77 --no-sysinit --no-userinit --noprint <<EOF
78 (load "validate-float.lisp")
79 (check-float-file "output/xfloat-math.lisp-expr")
80 (ignore-errors (delete-file "output/reorg.core"))
81 ;; * Lisp won't read compressed cores, and crashes on arm64
82 #+(and mark-region-gc x86-64 (not sb-core-compression))
83 (progn
84 (load "tools-for-build/editcore")
85 (funcall (intern "REORGANIZE-CORE" "SB-EDITCORE") "output/sbcl.core" "output/reorg.core"))
86 EOF
87 if [ -r output/reorg.core ]
88 then
89 mv output/reorg.core output/sbcl.core