0.7.5.4:
[sbcl/lichteblau.git] / make.sh
blob14dd17c76233dc8eba1eafae3be553af6dbe9545
1 #!/bin/sh
3 # "When we build software, it's a good idea to have a reliable method
4 # for getting an executable from it. We want any two reconstructions
5 # starting from the same source to end up in the same result. That's
6 # just a basic intellectual premise."
7 # -- Christian Queinnec, in _Lisp In Small Pieces_, p. 313
9 # This software is part of the SBCL system. See the README file for
10 # more information.
12 # This software is derived from the CMU CL system, which was
13 # written at Carnegie Mellon University and released into the
14 # public domain. The software is in the public domain and is
15 # provided with absolutely no warranty. See the COPYING and CREDITS
16 # files for more information.
18 # The value of SBCL_XC_HOST should be a command to invoke the
19 # cross-compilation Lisp system in such a way that it reads commands
20 # from standard input, and terminates when it reaches end of file on
21 # standard input. Some suitable values are:
22 # "sbcl" to use an existing SBCL binary as a cross-compilation host
23 # "sbcl --sysinit /dev/null --userinit /dev/null"
24 # to use an existing SBCL binary as a cross-compilation host
25 # even though you have stuff in your initialization files
26 # which makes it behave in such a non-standard way that
27 # it keeps the build from working
28 # "sbcl --disable-debugger"
29 # to use an existing SBCL binary as a cross-compilation host
30 # and tell it to handle errors as best it can by itself
31 # (probably by dying with an error code) instead of waiting
32 # endlessly for a programmer to help it out with input
33 # on *DEBUG-IO*
34 # "lisp -batch" to use an existing CMU CL binary as a cross-compilation host
35 # "lisp -noinit -batch"
36 # to use an existing CMU CL binary as a cross-compilation host
37 # when you have weird things in your .cmucl-init file
38 # Someday any sufficiently ANSI Common Lisp, perhaps CLISP and/or
39 # OpenMCL should work
40 # "clisp"
41 # "??"
42 # but not yet as of sbcl-0.7.4. (There are still some weird dependencies
43 # on idiosyncrasies of the way CMU CL implements Common Lisp.)
45 # FIXME: Make a more sophisticated command line parser, probably
46 # accepting "sh make.sh --xc-host foolisp" instead of the
47 # the present "sh make.sh foolisp".
48 # FIXME: Tweak this script, and the rest of the system, to support
49 # a second bootstrapping pass in which the cross-compilation host is
50 # known to be SBCL itself, so that the cross-compiler can do some
51 # optimizations (especially specializable arrays) that it doesn't
52 # know how to implement how in a portable way. (Or maybe that wouldn't
53 # require a second pass, just testing at build-the-cross-compiler time
54 # whether the cross-compilation host returns suitable values from
55 # UPGRADED-ARRAY-ELEMENT-TYPE?)
56 # FIXME: --noprogrammer was deprecated in sbcl-0.7.5, replaced by
57 # --disable-debugger. We still use the old form here because the
58 # change was not preannounced, and it would be rude to make our new
59 # version of SBCL unbootstrappable by immediately prior versions.
60 # But in a year or so the --noprogrammer here can change to
61 # --disable-debugger (and the deprecated --noprogrammer support can
62 # go away completely).
63 SBCL_XC_HOST="${1:-sbcl --noprogrammer}"
64 export SBCL_XC_HOST
65 echo //SBCL_XC_HOST=\"$SBCL_XC_HOST\"
67 # If you're cross-compiling, you should probably just walk through the
68 # make-config.sh script by hand doing the right thing on both the host
69 # and target machines.
70 sh make-config.sh || exit 1
72 # The make-host-*.sh scripts are run on the cross-compilation host,
73 # and the make-target-*.sh scripts are run on the target machine. In
74 # ordinary compilation, we just do these phases consecutively on the
75 # same machine, but if you wanted to cross-compile from one machine
76 # which supports Common Lisp to another which does not (yet:-) support
77 # Common Lisp, you could do something like this:
78 # Create copies of the source tree on both the host and the target.
79 # Read the make-config.sh script carefully and emulate it by hand
80 # on both machines (e.g. creating "target"-named symlinks to
81 # identify the target architecture).
82 # On the host system:
83 # SBCL_XC_HOST=<whatever> sh make-host-1.sh
84 # Copy src/runtime/sbcl.h from the host system to the target system.
85 # On the target system:
86 # sh make-target-1.sh
87 # Copy src/runtime/sbcl.nm and output/stuff-groveled-from-headers.lisp
88 # from the target system to the host system.
89 # On the host system:
90 # SBCL_XC_HOST=<whatever> sh make-host-2.sh
91 # Copy output/cold-sbcl.core from the host system to the target system.
92 # On the target system:
93 # sh make-host-2.sh
94 # Or, if you can set up the files somewhere shared (with NFS, AFS, or
95 # whatever) between the host machine and the target machine, the basic
96 # procedure above should still work, but you can skip the "copy" steps.
97 sh make-host-1.sh || exit 1
98 sh make-target-1.sh || exit 1
99 sh make-host-2.sh || exit 1
100 sh make-target-2.sh || exit 1
101 date