oops. actually stop when seeing --with-foo and customize-target-features.lisp
[sbcl.git] / make-config.sh
1 #!/bin/sh
2 set -e
3
4 # The make-config.sh script uses information about the target machine
5 # to set things up for compilation. It's vaguely like a stripped-down
6 # version of autoconf. It's intended to be run as part of make.sh. The
7 # only time you'd want to run it by itself is if you're trying to
8 # cross-compile the system or if you're doing some kind of
9 # troubleshooting.
10
11 # This software is part of the SBCL system. See the README file for
12 # more information.
13 #
14 # This software is derived from the CMU CL system, which was
15 # written at Carnegie Mellon University and released into the
16 # public domain. The software is in the public domain and is
17 # provided with absolutely no warranty. See the COPYING and CREDITS
18 # files for more information.
19
20 print_help="no"
21
22 # The classic form here was to use --userinit $DEVNULL --sysinit
23 # $DEVNULL, but that doesn't work on Win32 because SBCL doesn't handle
24 # device names properly. We still need $DEVNULL to be NUL on Win32
25 # because it's used elsewhere (such as canonicalize-whitespace), so we
26 # need an alternate solution for the init file overrides. --no-foos
27 # have now been available long enough that this should not stop anyone
28 # from building.
29 if [ "$OSTYPE" = "cygwin" -o "$OSTYPE" = "msys" ]
30 then
31     SBCL_PREFIX="$PROGRAMFILES/sbcl"
32 else
33     SBCL_PREFIX="/usr/local"
34 fi
35 SBCL_XC_HOST="sbcl --disable-debugger --no-userinit --no-sysinit"
36 export SBCL_XC_HOST
37
38 # Parse command-line options.
39 bad_option() {
40     echo $1
41     echo "Enter \"$0 --help\" for list of valid options."
42     exit 1
43 }
44
45 WITH_FEATURES=""
46 WITHOUT_FEATURES=""
47
48 fancy=false
49 some_options=false
50 for option
51 do
52   optarg_ok=true
53   # Split --foo=bar into --foo and bar.
54   case $option in
55       *=*)
56         # For ease of scripting skip valued options with empty
57         # values.
58         optarg=`expr "X$option" : '[^=]*=\(.*\)'` || optarg_ok=false
59         option=`expr "X$option" : 'X\([^=]*=\).*'`
60         ;;
61       --with*)
62         optarg=`expr "X$option" : 'X--[^-]*-\(.*\)'` \
63             || bad_option "Malformed feature toggle: $option"
64         option=`expr "X$option" : 'X\(--[^-]*\).*'`
65         ;;
66       *)
67         optarg=""
68         ;;
69   esac
70
71   case $option in
72       --help | -help | -h)
73         print_help="yes" ;;
74       --prefix=)
75         $optarg_ok && SBCL_PREFIX=$optarg
76         ;;
77       --arch=)
78         $oparg_ok && SBCL_ARCH=$optarg
79         ;;
80       --xc-host=)
81         $optarg_ok && SBCL_XC_HOST=$optarg
82         ;;
83       --dynamic-space-size=)
84         $optarg_ok && SBCL_DYNAMIC_SPACE_SIZE=$optarg
85         ;;
86       --with)
87         WITH_FEATURES="$WITH_FEATURES :$optarg"
88         ;;
89       --without)
90         WITHOUT_FEATURES="$WITHOUT_FEATURES :$optarg"
91         ;;
92       --fancy)
93         WITH_FEATURES="$WITH_FEATURES :sb-core-compression :sb-xref-for-internals :sb-after-xc-core"
94         # Lower down we add :sb-thread for platforms where it can be built.
95         fancy=true
96         ;;
97       -*)
98         bad_option "Unknown command-line option to $0: \"$option\""
99         ;;
100       *)
101         if $some_options
102         then
103             bad_option "Unknown command-line option to $0: \"$option\""
104         else
105             legacy_xc_spec=$option
106         fi
107         ;;
108   esac
109   some_options=true
110 done
111
112 if (test -f customize-target-features.lisp && \
113     (test -n "$WITH_FEATURES" || test -n "$WITHOUT_FEATURES"))
114 then
115     # Actually there's no reason why it would not work, but it would
116     # be confusing to say --with-thread only to have it turned off by
117     # customize-target-features.lisp...
118     echo "ERROR: Both customize-target-features.lisp, and feature-options"
119     echo "to make.sh present -- cannot use both at the same time."
120     exit 1
121 fi
122
123 # Previously XC host was provided as a positional argument. 
124 if test -n "$legacy_xc_spec"
125 then
126     SBCL_XC_HOST="$legacy_xc_spec"
127 fi
128
129 if test "$print_help" = "yes"
130 then
131   cat <<EOF
132 \`make.sh' drives the SBCL build.
133
134 Usage: $0 [OPTION]...
135
136   Important: make.sh does not currently control the entirety of the
137   build: configuration file customize-target-features.lisp and certain
138   environment variables play a role as well. see file INSTALL for
139   details.
140
141 Options:
142   -h, --help           Display this help and exit.
143
144   --prefix=<path>      Specify the install location.
145
146       Script install.sh installs SBCL under the specified prefix
147       path: runtime as prefix/bin/sbcl, additional files under
148       prefix/lib/sbcl, and documentation under prefix/share.
149
150       This option also affects the binaries: built-in default for
151       SBCL_HOME is: prefix/lib/sbcl/
152
153       Default prefix is: /usr/local
154
155   --dynamic-space-size=<size> Default dynamic-space size for target.
156
157       This specifies the default dynamic-space size for the SBCL
158       being built. If you need to control the dynamic-space size
159       of the host SBCL, use the --xc-host option.
160
161       If not provided, the default is platform-specific. <size> is
162       taken to be megabytes unless explicitly suffixed with Gb in
163       order to specify the size in gigabytes.
164
165   --with-<feature>     Build with specified feature.
166   --without-<feature>  Build wihout the specfied feature.
167
168   --arch=<string>      Specify the architecture to build for.
169
170       Mainly for doing x86 builds on x86-64.
171
172   --xc-host=<string>   Specify the Common Lisp compilation host.
173
174       The string provided should be a command to invoke the
175       cross-compilation Lisp system in such a way, that it reads
176       commands from standard input, and terminates when it reaches end
177       of file on standard input.
178
179       Examples:
180
181        "sbcl --disable-debugger --no-sysinit --no-userinit"
182                   Use an existing SBCL binary as a cross-compilation
183                   host even though you have stuff in your
184                   initialization files which makes it behave in such a
185                   non-standard way that it keeps the build from
186                   working. Also disable the debugger instead of
187                   waiting endlessly for a programmer to help it out
188                   with input on *DEBUG-IO*. (This is the default.)
189
190        "sbcl"
191                   Use an existing SBCL binary as a cross-compilation
192                   host, including your initialization files and
193                   building with the debugger enabled. Not recommended
194                   for casual users.
195
196        "lisp -noinit -batch"
197                   Use an existing CMU CL binary as a cross-compilation
198                   host when you have weird things in your .cmucl-init
199                   file.
200 EOF
201   exit 1
202 fi
203
204 mkdir -p output
205 # Save prefix for make and install.sh.
206 echo "SBCL_PREFIX='$SBCL_PREFIX'" > output/prefix.def
207 echo "$SBCL_DYNAMIC_SPACE_SIZE" > output/dynamic-space-size.txt
208
209 # FIXME: Tweak this script, and the rest of the system, to support
210 # a second bootstrapping pass in which the cross-compilation host is
211 # known to be SBCL itself, so that the cross-compiler can do some
212 # optimizations (especially specializable arrays) that it doesn't
213 # know how to implement how in a portable way. (Or maybe that wouldn't
214 # require a second pass, just testing at build-the-cross-compiler time
215 # whether the cross-compilation host returns suitable values from
216 # UPGRADED-ARRAY-ELEMENT-TYPE?)
217
218 if [ "$OSTYPE" = "cygwin" -o "$OSTYPE" = "msys" ] ; then
219     DEVNULL=NUL
220 else
221     DEVNULL=/dev/null
222 fi
223 export DEVNULL
224
225 . ./find-gnumake.sh
226 find_gnumake
227
228 . ./generate-version.sh
229 generate_version
230
231 # Now that we've done our option parsing and found various
232 # dependencies, write them out to a file to be sourced by other
233 # scripts.
234
235 echo "DEVNULL=\"$DEVNULL\"; export DEVNULL" > output/build-config
236 echo "GNUMAKE=\"$GNUMAKE\"; export GNUMAKE" >> output/build-config
237 echo "SBCL_XC_HOST=\"$SBCL_XC_HOST\"; export SBCL_XC_HOST" >> output/build-config
238 echo "legacy_xc_spec=\"$legacy_xc_spec\"; export legacy_xc_spec" >> output/build-config
239
240 # And now, sorting out the per-target dependencies...
241
242 case `uname` in
243     Linux)
244         sbcl_os="linux"
245         ;;
246     OSF1)
247         # it's changed name twice since it was called OSF/1: clearly
248         # the marketers forgot to tell the engineers about Digital Unix
249         # _or_ OSF/1 ...
250         sbcl_os="osf1"
251         ;;
252     *BSD)
253         case `uname` in
254             FreeBSD)
255                 sbcl_os="freebsd"
256                 ;;
257             OpenBSD)
258                 sbcl_os="openbsd"
259                 ;;
260             NetBSD)
261                 sbcl_os="netbsd"
262                 ;;
263             *)
264                 echo unsupported BSD variant: `uname`
265                 exit 1
266                 ;;
267         esac
268         ;;
269     Darwin)
270         sbcl_os="darwin"
271         ;;
272     SunOS)
273         sbcl_os="sunos"
274         ;;
275     CYGWIN* | WindowsNT | MINGW*)
276         sbcl_os="win32"
277         ;;
278     HP-UX)
279         sbcl_os="hpux"
280         ;;
281     *)
282         echo unsupported OS type: `uname`
283         exit 1
284         ;;
285 esac
286
287 link_or_copy() {
288    if [ "$sbcl_os" = "win32" ] ; then
289        cp -r "$1" "$2"
290    else
291        ln -s "$1" "$2"
292    fi
293 }
294
295 remove_dir_safely() {
296    if [ "$sbcl_os" = "win32" ] ; then
297         if [ -d "$1" ] ; then
298             rm -rf "$1"
299         elif [ -e "$1" ] ; then
300             echo "I'm afraid to remove non-directory $1."
301             exit 1
302         fi
303     else
304         if [ -h "$1" ] ; then
305             rm "$1"
306         elif [ -w "$1" ] ; then
307             echo "I'm afraid to replace non-symlink $1 with a symlink."
308             exit 1
309         fi
310     fi
311 }
312
313 echo //entering make-config.sh
314
315 echo //ensuring the existence of output/ directory
316 if [ ! -d output ] ; then mkdir output; fi
317
318 echo //guessing default target CPU architecture from host architecture
319 case `uname -m` in
320     *86) guessed_sbcl_arch=x86 ;;
321     i86pc) guessed_sbcl_arch=x86 ;;
322     *x86_64) guessed_sbcl_arch=x86-64 ;;
323     amd64) guessed_sbcl_arch=x86-64 ;;
324     [Aa]lpha) guessed_sbcl_arch=alpha ;;
325     sparc*) guessed_sbcl_arch=sparc ;;
326     sun*) guessed_sbcl_arch=sparc ;;
327     *ppc) guessed_sbcl_arch=ppc ;;
328     ppc64) guessed_sbcl_arch=ppc ;;
329     Power*Macintosh) guessed_sbcl_arch=ppc ;;
330     parisc) guessed_sbcl_arch=hppa ;;
331     9000/800) guessed_sbcl_arch=hppa ;;
332     mips*) guessed_sbcl_arch=mips ;;
333     *)
334         # If we're not building on a supported target architecture, we
335         # we have no guess, but it's not an error yet, since maybe
336         # target architecture will be specified explicitly below.
337         guessed_sbcl_arch=''
338         ;;
339 esac
340
341 # Under Solaris, uname -m returns "i86pc" even if CPU is amd64.
342 if [ "$sbcl_os" = "sunos" ] && [ `isainfo -k` = "amd64" ]; then
343     guessed_sbcl_arch=x86-64
344 fi
345
346 # Under Darwin, uname -m returns "i386" even if CPU is x86_64.
347 if [ "$sbcl_os" = "darwin" ] && [ "`/usr/sbin/sysctl -n hw.optional.x86_64`" = "1" ]; then
348     guessed_sbcl_arch=x86-64
349 fi
350
351 echo //setting up CPU-architecture-dependent information
352 if test -n "$SBCL_ARCH"
353 then
354     # Normalize it.
355     SBCL_ARCH=`echo $SBCL_ARCH | tr '[A-Z]' '[a-z]' | tr _ -`
356 fi
357 sbcl_arch=${SBCL_ARCH:-$guessed_sbcl_arch}
358 echo sbcl_arch=\"$sbcl_arch\"
359 if [ "$sbcl_arch" = "" ] ; then
360     echo "can't guess target SBCL architecture, please specify --arch=<name>"
361     exit 1
362 fi
363 if $fancy
364 then
365     # If --fancy, enable threads on platforms where they can be built.
366     case $sbcl_arch in
367         x86|x86-64|ppc)
368             WITH_FEATURES="$WITH_FEATURES :sb-thread"
369             echo "Enabling threads due to --fancy."
370             ;;
371         *)
372             echo "No threads on this platform."
373             ;;
374     esac
375 fi
376
377 ltf=`pwd`/local-target-features.lisp-expr
378 echo //initializing $ltf
379 echo ';;;; This is a machine-generated file.' > $ltf
380 echo ';;;; Please do not edit it by hand.' >> $ltf
381 echo ';;;; See make-config.sh.' >> $ltf
382 echo "((lambda (features) (set-difference features (list$WITHOUT_FEATURES)))" >> $ltf
383 printf " (union (list$WITH_FEATURES) (list " >> $ltf
384
385 printf ":%s" "$sbcl_arch" >> $ltf
386
387 echo //setting up OS-dependent information
388 # Under Darwin x86-64, guess whether Darwin 9+ or below.
389 if [ "$sbcl_os" = "darwin" ] && [ "$sbcl_arch" = "x86-64" ]; then
390     darwin_version=`uname -r`
391     darwin_version_major=${DARWIN_VERSION_MAJOR:-${darwin_version%%.*}}
392     if (( 8 < $darwin_version_major )); then
393         printf ' :inode64 :darwin9-or-better' >> $ltf
394     fi
395 fi
396
397 original_dir=`pwd`
398 cd ./src/runtime/
399 rm -f Config target-arch-os.h target-arch.h target-os.h target-lispregs.h
400 # KLUDGE: these two logically belong in the previous section
401 # ("architecture-dependent"); it seems silly to enforce this in terms
402 # of the shell script, though. -- CSR, 2002-02-03
403 link_or_copy $sbcl_arch-arch.h target-arch.h
404 link_or_copy $sbcl_arch-lispregs.h target-lispregs.h
405 case "$sbcl_os" in
406     linux)
407         printf ' :unix' >> $ltf
408         printf ' :elf' >> $ltf
409         printf ' :linux' >> $ltf
410
411         # If you add other platforms here, don't forget to edit
412         # src/runtime/Config.foo-linux too.
413         case "$sbcl_arch" in
414             mips)
415                 printf ' :largefile' >> $ltf
416                 ;;
417             x86 | x86-64)
418                 printf ' :sb-thread :sb-futex :largefile' >> $ltf
419                 ;;
420             ppc)
421                 printf ' :sb-futex' >> $ltf
422                 ;;
423         esac
424
425         if [ $sbcl_arch = "x86-64" ]; then
426             link_or_copy Config.x86_64-linux Config
427         else
428             link_or_copy Config.$sbcl_arch-linux Config
429         fi
430         link_or_copy $sbcl_arch-linux-os.h target-arch-os.h
431         link_or_copy linux-os.h target-os.h
432         ;;
433     osf1)
434         printf ' :unix' >> $ltf
435         printf ' :elf' >> $ltf
436         printf ' :osf1' >> $ltf
437         link_or_copy Config.$sbcl_arch-osf1 Config
438         link_or_copy $sbcl_arch-osf1-os.h target-arch-os.h
439         link_or_copy osf1-os.h target-os.h
440         ;;
441     hpux)
442         printf ' :unix' >> $ltf
443         printf ' :elf' >> $ltf
444         printf ' :hpux' >> $ltf
445         link_or_copy Config.$sbcl_arch-hpux Config
446         link_or_copy $sbcl_arch-hpux-os.h target-arch-os.h
447         link_or_copy hpux-os.h target-os.h
448         ;;
449     *bsd)
450         printf ' :unix' >> $ltf
451         printf ' :bsd' >> $ltf
452         link_or_copy $sbcl_arch-bsd-os.h target-arch-os.h
453         link_or_copy bsd-os.h target-os.h
454         case "$sbcl_os" in
455             freebsd)
456                 printf ' :elf' >> $ltf
457                 printf ' :freebsd' >> $ltf
458                 printf ' :gcc-tls' >> $ltf
459                 if [ $sbcl_arch = "x86" ]; then
460                     printf ' :restore-tls-segment-register-from-context' >> $ltf
461                 fi
462                 link_or_copy Config.$sbcl_arch-freebsd Config
463                 ;;
464             openbsd)
465                 printf ' :elf' >> $ltf
466                 printf ' :openbsd' >> $ltf
467                 link_or_copy Config.$sbcl_arch-openbsd Config
468                 ;;
469             netbsd)
470                 printf ' :netbsd' >> $ltf
471                 printf ' :elf' >> $ltf
472                 link_or_copy Config.$sbcl_arch-netbsd Config
473                 ;;
474             *)
475                 echo unsupported BSD variant: `uname`
476                 exit 1
477                 ;;
478         esac
479         ;;
480     darwin)
481         printf ' :unix' >> $ltf
482         printf ' :mach-o' >> $ltf
483         printf ' :bsd' >> $ltf
484         printf ' :darwin' >> $ltf
485         if [ $sbcl_arch = "x86" ]; then
486             printf ' :mach-exception-handler :restore-fs-segment-register-from-tls :ud2-breakpoints' >> $ltf
487         fi
488         if [ $sbcl_arch = "x86-64" ]; then
489             printf ' :mach-exception-handler :ud2-breakpoints' >> $ltf
490         fi
491         link_or_copy $sbcl_arch-darwin-os.h target-arch-os.h
492         link_or_copy bsd-os.h target-os.h
493         link_or_copy Config.$sbcl_arch-darwin Config
494         ;;
495     sunos)
496         printf ' :unix' >> $ltf
497         printf ' :elf' >> $ltf
498         printf ' :sunos' >> $ltf
499         if [ $sbcl_arch = "x86-64" ]; then
500             printf ' :largefile' >> $ltf
501         fi
502         link_or_copy Config.$sbcl_arch-sunos Config
503         link_or_copy $sbcl_arch-sunos-os.h target-arch-os.h
504         link_or_copy sunos-os.h target-os.h
505         ;;
506     win32)
507         printf ' :win32' >> $ltf
508         link_or_copy Config.$sbcl_arch-win32 Config
509         link_or_copy $sbcl_arch-win32-os.h target-arch-os.h
510         link_or_copy win32-os.h target-os.h
511         ;;
512     *)
513         echo unsupported OS type: `uname`
514         exit 1
515         ;;
516 esac
517 cd "$original_dir"
518
519 # FIXME: Things like :c-stack-grows-..., etc, should be
520 # *derived-target-features* or equivalent, so that there was a nicer
521 # way to specify them then sprinkling them in this file. They should
522 # still be tweakable by advanced users, though, but probably not
523 # appear in *features* of target. #!+/- should be adjusted to take
524 # them in account as well. At minimum the nicer specification stuff,
525 # though:
526 #
527 # (define-feature :dlopen (features)
528 #   (union '(:bsd :linux :darwin :sunos) features))
529 #
530 # (define-feature :c-stack-grows-downwards-not-upwards (features)
531 #   (member :x86 features))
532
533 # KLUDGE: currently the x86 only works with the generational garbage
534 # collector (indicated by the presence of :GENCGC in *FEATURES*) and
535 # alpha, sparc and ppc with the stop'n'copy collector (indicated by
536 # the absence of :GENCGC in *FEATURES*). This isn't a great
537 # separation, but for now, rather than have :GENCGC in
538 # base-target-features.lisp-expr, we add it into local-target-features
539 # if we're building for x86. -- CSR, 2002-02-21 Then we do something
540 # similar with :STACK-GROWS-FOOWARD, too. -- WHN 2002-03-03
541 if [ "$sbcl_arch" = "x86" ]; then
542     printf ' :gencgc :stack-grows-downward-not-upward :c-stack-is-control-stack' >> $ltf
543     printf ' :compare-and-swap-vops :unwind-to-frame-and-call-vop :raw-instance-init-vops' >> $ltf
544     printf ' :stack-allocatable-closures :stack-allocatable-vectors' >> $ltf
545     printf ' :stack-allocatable-lists :stack-allocatable-fixed-objects' >> $ltf
546     printf ' :alien-callbacks :cycle-counter :inline-constants ' >> $ltf
547     printf ' :memory-barrier-vops :multiply-high-vops' >> $ltf
548     case "$sbcl_os" in
549     linux | freebsd | netbsd | openbsd | sunos | darwin | win32)
550         printf ' :linkage-table' >> $ltf
551     esac
552     if [ "$sbcl_os" = "win32" ]; then
553         # of course it doesn't provide dlopen, but there is
554         # roughly-equivalent magic nevertheless.
555         printf ' :os-provides-dlopen' >> $ltf
556     fi
557     if [ "$sbcl_os" = "openbsd" ]; then
558         rm -f src/runtime/openbsd-sigcontext.h
559         sh tools-for-build/openbsd-sigcontext.sh > src/runtime/openbsd-sigcontext.h
560     fi
561 elif [ "$sbcl_arch" = "x86-64" ]; then
562     printf ' :gencgc :stack-grows-downward-not-upward :c-stack-is-control-stack :linkage-table' >> $ltf
563     printf ' :compare-and-swap-vops :unwind-to-frame-and-call-vop :raw-instance-init-vops' >> $ltf
564     printf ' :stack-allocatable-closures :stack-allocatable-vectors' >> $ltf
565     printf ' :stack-allocatable-lists :stack-allocatable-fixed-objects' >> $ltf
566     printf ' :alien-callbacks :cycle-counter :complex-float-vops' >> $ltf
567     printf ' :float-eql-vops :inline-constants :memory-barrier-vops' >> $ltf
568     printf ' :multiply-high-vops' >> $ltf
569 elif [ "$sbcl_arch" = "mips" ]; then
570     printf ' :linkage-table' >> $ltf
571     printf ' :stack-allocatable-closures :stack-allocatable-vectors' >> $ltf
572     printf ' :stack-allocatable-lists :stack-allocatable-fixed-objects' >> $ltf
573     printf ' :alien-callbacks' >> $ltf
574     # Use a little C program to try to guess the endianness.  Ware
575     # cross-compilers!
576     #
577     # FIXME: integrate to grovel-features, mayhaps
578     $GNUMAKE -C tools-for-build determine-endianness -I ../src/runtime
579     tools-for-build/determine-endianness >> $ltf
580 elif [ "$sbcl_arch" = "ppc" ]; then
581     printf ' :gencgc :stack-allocatable-closures :stack-allocatable-lists' >> $ltf
582     printf ' :linkage-table :raw-instance-init-vops :memory-barrier-vops' >> $ltf
583     printf ' :compare-and-swap-vops :multiply-high-vops' >> $ltf
584     if [ "$sbcl_os" = "linux" ]; then
585         # Use a C program to detect which kind of glibc we're building on,
586         # to bandage across the break in source compatibility between
587         # versions 2.3.1 and 2.3.2
588         #
589         # FIXME: integrate to grovel-features, mayhaps
590         $GNUMAKE -C tools-for-build where-is-mcontext -I ../src/runtime
591         tools-for-build/where-is-mcontext > src/runtime/ppc-linux-mcontext.h || (echo "error running where-is-mcontext"; exit 1)
592     elif [ "$sbcl_os" = "darwin" ]; then
593         # We provide a dlopen shim, so a little lie won't hurt
594         printf " :os-provides-dlopen :alien-callbacks" >> $ltf
595         # The default stack ulimit under darwin is too small to run PURIFY.
596         # Best we can do is complain and exit at this stage
597         if [ "`ulimit -s`" = "512" ]; then
598             echo "Your stack size limit is too small to build SBCL."
599             echo "See the limit(1) or ulimit(1) commands and the README file."
600             exit 1
601         fi
602     fi
603 elif [ "$sbcl_arch" = "sparc" ]; then
604     # Test the compiler in order to see if we are building on Sun
605     # toolchain as opposed to GNU binutils, and write the appropriate
606     # FUNCDEF macro for assembler. No harm in running this on sparc-linux
607     # as well.
608     sh tools-for-build/sparc-funcdef.sh > src/runtime/sparc-funcdef.h
609     if [ "$sbcl_os" = "sunos" ] || [ "$sbcl_os" = "linux" ]; then
610         printf ' :linkage-table' >> $ltf
611     fi
612     printf ' :stack-allocatable-closures :stack-allocatable-lists' >> $ltf
613 elif [ "$sbcl_arch" = "alpha" ]; then
614     printf ' :stack-allocatable-closures :stack-allocatable-lists' >> $ltf
615 elif [ "$sbcl_arch" = "hppa" ]; then
616     printf ' :stack-allocatable-vectors :stack-allocatable-fixed-objects' >> $ltf
617     printf ' :stack-allocatable-lists' >> $ltf
618 else
619     # Nothing need be done in this case, but sh syntax wants a placeholder.
620     echo > /dev/null
621 fi
622
623 export sbcl_os sbcl_arch
624 sh tools-for-build/grovel-features.sh >> $ltf
625
626 echo //finishing $ltf
627 echo ')))' >> $ltf
628
629 # FIXME: The version system should probably be redone along these lines:
630 #
631 # echo //setting up version information.
632 # versionfile=version.txt
633 # cp base-version.txt $versionfile
634 # echo " (built `date -u` by `whoami`@`hostname`)" >> $versionfile
635 # echo 'This is a machine-generated file and should not be edited by hand.' >> $versionfile
636
637 # Make a unique ID for this build (to discourage people from
638 # mismatching sbcl and *.core files).
639 if [ `uname` = "SunOS" ] ; then
640   # use /usr/xpg4/bin/id instead of /usr/bin/id
641   PATH=/usr/xpg4/bin:$PATH
642 fi
643 echo '"'`hostname`-`id -un`-`date +%Y-%m-%d-%H-%M-%S`'"' > output/build-id.tmp