0.8.0.58:
[sbcl/lichteblau.git] / make.sh
blobb3b47fa6f4ba385c3dc4484cd94bceefb01dc603
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 # "openmcl --batch"
39 # to use an OpenMCL binary as a cross-compilation host
40 # "clisp"
41 # to use a CLISP binary as a cross-compilation host
43 # FIXME: Make a more sophisticated command line parser, probably
44 # accepting "sh make.sh --xc-host foolisp" instead of the
45 # the present "sh make.sh foolisp".
46 # FIXME: Tweak this script, and the rest of the system, to support
47 # a second bootstrapping pass in which the cross-compilation host is
48 # known to be SBCL itself, so that the cross-compiler can do some
49 # optimizations (especially specializable arrays) that it doesn't
50 # know how to implement how in a portable way. (Or maybe that wouldn't
51 # require a second pass, just testing at build-the-cross-compiler time
52 # whether the cross-compilation host returns suitable values from
53 # UPGRADED-ARRAY-ELEMENT-TYPE?)
54 # FIXME: --noprogrammer was deprecated in sbcl-0.7.5, replaced by
55 # --disable-debugger. We still use the old form here because the
56 # change was not preannounced, and it would be rude to make our new
57 # version of SBCL unbootstrappable by immediately prior versions.
58 # But in a year or so the --noprogrammer here can change to
59 # --disable-debugger (and the deprecated --noprogrammer support can
60 # go away completely).
61 SBCL_XC_HOST="${1:-sbcl --noprogrammer}"
62 export SBCL_XC_HOST
63 echo //SBCL_XC_HOST=\"$SBCL_XC_HOST\"
65 # the GNU dialect of "make" -- easier to find or port it than to
66 # try to figure out how to port to the local dialect...
67 if [ "$GNUMAKE" != "" ] ; then
68 # The user is evidently trying to tell us something.
69 GNUMAKE="$GNUMAKE"
70 elif [ -x "`which gmake`" ] ; then
71 # "gmake" is the preferred name in *BSD.
72 GNUMAKE=gmake
73 else
74 # FIXME: Now that we do this early, maybe prompt the user rather
75 # than guessing? I'd still be annoyed, though... -- CSR,
76 # 2003-05-16.
78 # All the world's a Linux, and all its users weary of cautious
79 # BSDish worries that "make" might not be GNU make; so just guess
80 # that "make" is GNU make and hope for the best.
81 GNUMAKE=make
84 export GNUMAKE
85 echo //GNUMAKE=\"$GNUMAKE\"
88 # If you're cross-compiling, you should probably just walk through the
89 # make-config.sh script by hand doing the right thing on both the host
90 # and target machines.
91 sh make-config.sh || exit 1
93 # The make-host-*.sh scripts are run on the cross-compilation host,
94 # and the make-target-*.sh scripts are run on the target machine. In
95 # ordinary compilation, we just do these phases consecutively on the
96 # same machine, but if you wanted to cross-compile from one machine
97 # which supports Common Lisp to another which does not (yet:-) support
98 # Common Lisp, you could do something like this:
99 # Create copies of the source tree on both the host and the target.
100 # Read the make-config.sh script carefully and emulate it by hand
101 # on both machines (e.g. creating "target"-named symlinks to
102 # identify the target architecture).
103 # On the host system:
104 # SBCL_XC_HOST=<whatever> sh make-host-1.sh
105 # Copy src/runtime/genesis/*.h from the host system to the target
106 # system.
107 # On the target system:
108 # sh make-target-1.sh
109 # Copy src/runtime/sbcl.nm and output/stuff-groveled-from-headers.lisp
110 # from the target system to the host system.
111 # On the host system:
112 # SBCL_XC_HOST=<whatever> sh make-host-2.sh
113 # Copy output/cold-sbcl.core from the host system to the target system.
114 # On the target system:
115 # sh make-target-2.sh
116 # sh make-target-contrib.sh
117 # Or, if you can set up the files somewhere shared (with NFS, AFS, or
118 # whatever) between the host machine and the target machine, the basic
119 # procedure above should still work, but you can skip the "copy" steps.
120 sh make-host-1.sh || exit 1
121 sh make-target-1.sh || exit 1
122 sh make-host-2.sh || exit 1
123 sh make-target-2.sh || exit 1
124 sh make-target-contrib.sh || exit 1
125 date