compiler/generic/primtype: Enable holding non-complex floats in registers.
[sbcl/nyef.git] / make-config.sh
blobe7f00a4c05711c960ef0e4509ac39c39cc025c6f
1 #!/bin/sh
2 set -e
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.
11 # This software is part of the SBCL system. See the README file for
12 # more information.
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.
20 print_help="no"
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"
35 SBCL_XC_HOST="sbcl --disable-debugger --no-userinit --no-sysinit"
36 export SBCL_XC_HOST
38 # Parse command-line options.
39 bad_option() {
40 echo $1
41 echo "Enter \"$0 --help\" for list of valid options."
42 exit 1
45 WITH_FEATURES=""
46 WITHOUT_FEATURES=""
47 FANCY_FEATURES=":sb-core-compression :sb-xref-for-internals :sb-after-xc-core"
49 fancy=false
50 some_options=false
51 for option
53 optarg_ok=true
54 # Split --foo=bar into --foo and bar.
55 case $option in
56 *=*)
57 # For ease of scripting skip valued options with empty
58 # values.
59 optarg=`expr "X$option" : '[^=]*=\(.*\)'` || optarg_ok=false
60 option=`expr "X$option" : 'X\([^=]*=\).*'`
62 --with*)
63 optarg=`expr "X$option" : 'X--[^-]*-\(.*\)'` \
64 || bad_option "Malformed feature toggle: $option"
65 option=`expr "X$option" : 'X\(--[^-]*\).*'`
68 optarg=""
70 esac
72 case $option in
73 --help | -help | -h)
74 print_help="yes" ;;
75 --prefix=)
76 $optarg_ok && SBCL_PREFIX=$optarg
78 --arch=)
79 $oparg_ok && SBCL_ARCH=$optarg
81 --xc-host=)
82 $optarg_ok && SBCL_XC_HOST=$optarg
84 --dynamic-space-size=)
85 $optarg_ok && SBCL_DYNAMIC_SPACE_SIZE=$optarg
87 --with)
88 WITH_FEATURES="$WITH_FEATURES :$optarg"
90 --without)
91 WITHOUT_FEATURES="$WITHOUT_FEATURES :$optarg"
93 --fancy)
94 WITH_FEATURES="$WITH_FEATURES $FANCY_FEATURES"
95 # Lower down we add :sb-thread for platforms where it can be built.
96 fancy=true
98 -*)
99 bad_option "Unknown command-line option to $0: \"$option\""
102 if $some_options
103 then
104 bad_option "Unknown command-line option to $0: \"$option\""
105 else
106 legacy_xc_spec=$option
109 esac
110 some_options=true
111 done
113 if (test -f customize-target-features.lisp && \
114 (test -n "$WITH_FEATURES" || test -n "$WITHOUT_FEATURES"))
115 then
116 # Actually there's no reason why it would not work, but it would
117 # be confusing to say --with-thread only to have it turned off by
118 # customize-target-features.lisp...
119 echo "ERROR: Both customize-target-features.lisp, and feature-options"
120 echo "to make.sh present -- cannot use both at the same time."
121 exit 1
124 # Previously XC host was provided as a positional argument.
125 if test -n "$legacy_xc_spec"
126 then
127 SBCL_XC_HOST="$legacy_xc_spec"
130 if test "$print_help" = "yes"
131 then
132 cat <<EOF
133 \`make.sh' drives the SBCL build.
135 Usage: $0 [OPTION]...
137 Important: make.sh does not currently control the entirety of the
138 build: configuration file customize-target-features.lisp and certain
139 environment variables play a role as well. see file INSTALL for
140 details.
142 Options:
143 -h, --help Display this help and exit.
145 --prefix=<path> Specify the install location.
147 Script install.sh installs SBCL under the specified prefix
148 path: runtime as prefix/bin/sbcl, additional files under
149 prefix/lib/sbcl, and documentation under prefix/share.
151 This option also affects the binaries: built-in default for
152 SBCL_HOME is: prefix/lib/sbcl/
154 Default prefix is: /usr/local
156 --dynamic-space-size=<size> Default dynamic-space size for target.
158 This specifies the default dynamic-space size for the SBCL
159 being built. If you need to control the dynamic-space size
160 of the host SBCL, use the --xc-host option.
162 If not provided, the default is platform-specific. <size> is
163 taken to be megabytes unless explicitly suffixed with Gb in
164 order to specify the size in gigabytes.
166 --with-<feature> Build with specified feature.
167 --without-<feature> Build wihout the specfied feature.
169 --fancy Build with several optional features:
171 $FANCY_FEATURES
173 Plus threading on platforms which support it.
175 --arch=<string> Specify the architecture to build for.
177 Mainly for doing x86 builds on x86-64.
179 --xc-host=<string> Specify the Common Lisp compilation host.
181 The string provided should be a command to invoke the
182 cross-compilation Lisp system in such a way, that it reads
183 commands from standard input, and terminates when it reaches end
184 of file on standard input.
186 Examples:
188 "sbcl --disable-debugger --no-sysinit --no-userinit"
189 Use an existing SBCL binary as a cross-compilation
190 host even though you have stuff in your
191 initialization files which makes it behave in such a
192 non-standard way that it keeps the build from
193 working. Also disable the debugger instead of
194 waiting endlessly for a programmer to help it out
195 with input on *DEBUG-IO*. (This is the default.)
197 "sbcl"
198 Use an existing SBCL binary as a cross-compilation
199 host, including your initialization files and
200 building with the debugger enabled. Not recommended
201 for casual users.
203 "lisp -noinit -batch"
204 Use an existing CMU CL binary as a cross-compilation
205 host when you have weird things in your .cmucl-init
206 file.
208 exit 1
211 # Running make.sh with different options without clean.sh in the middle
212 # can break things.
213 sh clean.sh
215 mkdir -p output
216 # Save prefix for make and install.sh.
217 echo "SBCL_PREFIX='$SBCL_PREFIX'" > output/prefix.def
218 echo "$SBCL_DYNAMIC_SPACE_SIZE" > output/dynamic-space-size.txt
220 # FIXME: Tweak this script, and the rest of the system, to support
221 # a second bootstrapping pass in which the cross-compilation host is
222 # known to be SBCL itself, so that the cross-compiler can do some
223 # optimizations (especially specializable arrays) that it doesn't
224 # know how to implement how in a portable way. (Or maybe that wouldn't
225 # require a second pass, just testing at build-the-cross-compiler time
226 # whether the cross-compilation host returns suitable values from
227 # UPGRADED-ARRAY-ELEMENT-TYPE?)
229 if [ "$OSTYPE" = "cygwin" -o "$OSTYPE" = "msys" ] ; then
230 DEVNULL=NUL
231 else
232 DEVNULL=/dev/null
234 export DEVNULL
236 . ./find-gnumake.sh
237 find_gnumake
239 . ./generate-version.sh
240 generate_version
242 # Now that we've done our option parsing and found various
243 # dependencies, write them out to a file to be sourced by other
244 # scripts.
246 echo "DEVNULL=\"$DEVNULL\"; export DEVNULL" > output/build-config
247 echo "GNUMAKE=\"$GNUMAKE\"; export GNUMAKE" >> output/build-config
248 echo "SBCL_XC_HOST=\"$SBCL_XC_HOST\"; export SBCL_XC_HOST" >> output/build-config
249 echo "legacy_xc_spec=\"$legacy_xc_spec\"; export legacy_xc_spec" >> output/build-config
251 # And now, sorting out the per-target dependencies...
253 case `uname` in
254 Linux)
255 sbcl_os="linux"
257 OSF1)
258 # it's changed name twice since it was called OSF/1: clearly
259 # the marketers forgot to tell the engineers about Digital Unix
260 # _or_ OSF/1 ...
261 sbcl_os="osf1"
263 *BSD)
264 case `uname` in
265 FreeBSD)
266 sbcl_os="freebsd"
268 OpenBSD)
269 sbcl_os="openbsd"
271 NetBSD)
272 sbcl_os="netbsd"
275 echo unsupported BSD variant: `uname`
276 exit 1
278 esac
280 Darwin)
281 sbcl_os="darwin"
283 SunOS)
284 sbcl_os="sunos"
286 CYGWIN* | WindowsNT | MINGW*)
287 sbcl_os="win32"
289 HP-UX)
290 sbcl_os="hpux"
293 echo unsupported OS type: `uname`
294 exit 1
296 esac
298 link_or_copy() {
299 if [ "$sbcl_os" = "win32" ] ; then
300 # Use preprocessor or makefile includes instead of copying if
301 # possible, to avoid unexpected use of the original, unchanged
302 # files when re-running only make-target-1 during development.
303 if echo "$1" | egrep '[.][ch]$'; then
304 echo "#include \"$1\"" >"$2"
305 elif echo "$1" | egrep '^Config[.]'; then
306 echo "include $1" >"$2"
307 else
308 cp -r "$1" "$2"
310 else
311 ln -s "$1" "$2"
315 remove_dir_safely() {
316 if [ "$sbcl_os" = "win32" ] ; then
317 if [ -d "$1" ] ; then
318 rm -rf "$1"
319 elif [ -e "$1" ] ; then
320 echo "I'm afraid to remove non-directory $1."
321 exit 1
323 else
324 if [ -h "$1" ] ; then
325 rm "$1"
326 elif [ -w "$1" ] ; then
327 echo "I'm afraid to replace non-symlink $1 with a symlink."
328 exit 1
333 echo //entering make-config.sh
335 echo //ensuring the existence of output/ directory
336 if [ ! -d output ] ; then mkdir output; fi
338 echo //guessing default target CPU architecture from host architecture
339 case `uname -m` in
340 *86) guessed_sbcl_arch=x86 ;;
341 i86pc) guessed_sbcl_arch=x86 ;;
342 *x86_64) guessed_sbcl_arch=x86-64 ;;
343 amd64) guessed_sbcl_arch=x86-64 ;;
344 [Aa]lpha) guessed_sbcl_arch=alpha ;;
345 sparc*) guessed_sbcl_arch=sparc ;;
346 sun*) guessed_sbcl_arch=sparc ;;
347 *ppc) guessed_sbcl_arch=ppc ;;
348 ppc64) guessed_sbcl_arch=ppc ;;
349 Power*Macintosh) guessed_sbcl_arch=ppc ;;
350 parisc) guessed_sbcl_arch=hppa ;;
351 9000/800) guessed_sbcl_arch=hppa ;;
352 mips*) guessed_sbcl_arch=mips ;;
353 arm*) guessed_sbcl_arch=arm ;;
355 # If we're not building on a supported target architecture, we
356 # we have no guess, but it's not an error yet, since maybe
357 # target architecture will be specified explicitly below.
358 guessed_sbcl_arch=''
360 esac
362 # Under Solaris, uname -m returns "i86pc" even if CPU is amd64.
363 if [ "$sbcl_os" = "sunos" ] && [ `isainfo -k` = "amd64" ]; then
364 guessed_sbcl_arch=x86-64
367 # Under Darwin, uname -m returns "i386" even if CPU is x86_64.
368 if [ "$sbcl_os" = "darwin" ] && [ "`/usr/sbin/sysctl -n hw.optional.x86_64`" = "1" ]; then
369 guessed_sbcl_arch=x86-64
372 echo //setting up CPU-architecture-dependent information
373 if test -n "$SBCL_ARCH"
374 then
375 # Normalize it.
376 SBCL_ARCH=`echo $SBCL_ARCH | tr '[A-Z]' '[a-z]' | tr _ -`
378 sbcl_arch=${SBCL_ARCH:-$guessed_sbcl_arch}
379 echo sbcl_arch=\"$sbcl_arch\"
380 if [ "$sbcl_arch" = "" ] ; then
381 echo "can't guess target SBCL architecture, please specify --arch=<name>"
382 exit 1
384 if $fancy
385 then
386 # If --fancy, enable threads on platforms where they can be built.
387 case $sbcl_arch in
388 x86|x86-64|ppc)
389 if [ "$sbcl_os" = "sunos" ] && [ "$sbcl_arch" = "x86-64" ]
390 then
391 echo "No threads on this platform."
392 else
393 WITH_FEATURES="$WITH_FEATURES :sb-thread"
394 echo "Enabling threads due to --fancy."
398 echo "No threads on this platform."
400 esac
403 ltf=`pwd`/local-target-features.lisp-expr
404 echo //initializing $ltf
405 echo ';;;; This is a machine-generated file.' > $ltf
406 echo ';;;; Please do not edit it by hand.' >> $ltf
407 echo ';;;; See make-config.sh.' >> $ltf
408 echo "(lambda (features) (union (set-difference features (list$WITHOUT_FEATURES))" >> $ltf
409 printf " (union (list$WITH_FEATURES) (list " >> $ltf
411 printf ":%s" "$sbcl_arch" >> $ltf
413 echo //setting up OS-dependent information
414 # Under Darwin x86-64, guess whether Darwin 9+ or below.
415 if [ "$sbcl_os" = "darwin" ] && [ "$sbcl_arch" = "x86-64" ]; then
416 darwin_version=`uname -r`
417 darwin_version_major=${DARWIN_VERSION_MAJOR:-${darwin_version%%.*}}
418 if (( 8 < $darwin_version_major )); then
419 printf ' :inode64 :darwin9-or-better' >> $ltf
423 original_dir=`pwd`
424 cd ./src/runtime/
425 rm -f Config target-arch-os.h target-arch.h target-os.h target-lispregs.h
426 # KLUDGE: these two logically belong in the previous section
427 # ("architecture-dependent"); it seems silly to enforce this in terms
428 # of the shell script, though. -- CSR, 2002-02-03
429 link_or_copy $sbcl_arch-arch.h target-arch.h
430 link_or_copy $sbcl_arch-lispregs.h target-lispregs.h
431 case "$sbcl_os" in
432 linux)
433 printf ' :unix' >> $ltf
434 printf ' :elf' >> $ltf
435 printf ' :linux' >> $ltf
437 # If you add other platforms here, don't forget to edit
438 # src/runtime/Config.foo-linux too.
439 case "$sbcl_arch" in
440 mips)
441 printf ' :largefile' >> $ltf
443 x86 | x86-64)
444 printf ' :sb-thread :sb-futex :largefile' >> $ltf
446 ppc)
447 printf ' :sb-futex' >> $ltf
449 esac
452 link_or_copy Config.$sbcl_arch-linux Config
453 link_or_copy $sbcl_arch-linux-os.h target-arch-os.h
454 link_or_copy linux-os.h target-os.h
456 osf1)
457 printf ' :unix' >> $ltf
458 printf ' :elf' >> $ltf
459 printf ' :osf1' >> $ltf
460 link_or_copy Config.$sbcl_arch-osf1 Config
461 link_or_copy $sbcl_arch-osf1-os.h target-arch-os.h
462 link_or_copy osf1-os.h target-os.h
464 hpux)
465 printf ' :unix' >> $ltf
466 printf ' :elf' >> $ltf
467 printf ' :hpux' >> $ltf
468 link_or_copy Config.$sbcl_arch-hpux Config
469 link_or_copy $sbcl_arch-hpux-os.h target-arch-os.h
470 link_or_copy hpux-os.h target-os.h
472 *bsd)
473 printf ' :unix' >> $ltf
474 printf ' :bsd' >> $ltf
475 link_or_copy $sbcl_arch-bsd-os.h target-arch-os.h
476 link_or_copy bsd-os.h target-os.h
477 case "$sbcl_os" in
478 freebsd)
479 printf ' :elf' >> $ltf
480 printf ' :freebsd' >> $ltf
481 printf ' :gcc-tls' >> $ltf
482 if [ $sbcl_arch = "x86" ]; then
483 printf ' :restore-fs-segment-register-from-tls' >> $ltf
485 link_or_copy Config.$sbcl_arch-freebsd Config
487 openbsd)
488 printf ' :elf' >> $ltf
489 printf ' :openbsd' >> $ltf
490 link_or_copy Config.$sbcl_arch-openbsd Config
492 netbsd)
493 printf ' :netbsd' >> $ltf
494 printf ' :elf' >> $ltf
495 link_or_copy Config.$sbcl_arch-netbsd Config
498 echo unsupported BSD variant: `uname`
499 exit 1
501 esac
503 darwin)
504 printf ' :unix' >> $ltf
505 printf ' :mach-o' >> $ltf
506 printf ' :bsd' >> $ltf
507 printf ' :darwin' >> $ltf
508 if [ $sbcl_arch = "x86" ]; then
509 printf ' :mach-exception-handler :restore-fs-segment-register-from-tls :ud2-breakpoints' >> $ltf
511 if [ $sbcl_arch = "x86-64" ]; then
512 printf ' :mach-exception-handler :ud2-breakpoints' >> $ltf
514 link_or_copy $sbcl_arch-darwin-os.h target-arch-os.h
515 link_or_copy bsd-os.h target-os.h
516 link_or_copy Config.$sbcl_arch-darwin Config
518 sunos)
519 printf ' :unix' >> $ltf
520 printf ' :elf' >> $ltf
521 printf ' :sunos' >> $ltf
522 if [ $sbcl_arch = "x86-64" ]; then
523 printf ' :largefile' >> $ltf
525 link_or_copy Config.$sbcl_arch-sunos Config
526 link_or_copy $sbcl_arch-sunos-os.h target-arch-os.h
527 link_or_copy sunos-os.h target-os.h
529 win32)
530 printf ' :win32' >> $ltf
532 # Optional features -- We enable them by default, but the build
533 # ought to work perfectly without them:
535 printf ' :sb-futex' >> $ltf
536 printf ' :sb-qshow' >> $ltf
538 # Required features -- Some of these used to be optional, but
539 # building without them is no longer considered supported:
541 # (Of course it doesn't provide dlopen, but there is
542 # roughly-equivalent magic nevertheless:)
543 printf ' :sb-dynamic-core :os-provides-dlopen' >> $ltf
544 printf ' :sb-thread :sb-safepoint :sb-thruption :sb-wtimer' >> $ltf
545 printf ' :sb-safepoint-strictly' >> $ltf
547 link_or_copy Config.$sbcl_arch-win32 Config
548 link_or_copy $sbcl_arch-win32-os.h target-arch-os.h
549 link_or_copy win32-os.h target-os.h
552 echo unsupported OS type: `uname`
553 exit 1
555 esac
556 cd "$original_dir"
558 # FIXME: Things like :c-stack-grows-..., etc, should be
559 # *derived-target-features* or equivalent, so that there was a nicer
560 # way to specify them then sprinkling them in this file. They should
561 # still be tweakable by advanced users, though, but probably not
562 # appear in *features* of target. #!+/- should be adjusted to take
563 # them in account as well. At minimum the nicer specification stuff,
564 # though:
566 # (define-feature :dlopen (features)
567 # (union '(:bsd :linux :darwin :sunos) features))
569 # (define-feature :c-stack-grows-downwards-not-upwards (features)
570 # (member :x86 features))
572 # KLUDGE: currently the x86 only works with the generational garbage
573 # collector (indicated by the presence of :GENCGC in *FEATURES*) and
574 # alpha, sparc and ppc with the stop'n'copy collector (indicated by
575 # the absence of :GENCGC in *FEATURES*). This isn't a great
576 # separation, but for now, rather than have :GENCGC in
577 # base-target-features.lisp-expr, we add it into local-target-features
578 # if we're building for x86. -- CSR, 2002-02-21 Then we do something
579 # similar with :STACK-GROWS-FOOWARD, too. -- WHN 2002-03-03
580 if [ "$sbcl_arch" = "x86" ]; then
581 printf ' :gencgc :stack-grows-downward-not-upward :c-stack-is-control-stack' >> $ltf
582 printf ' :compare-and-swap-vops :unwind-to-frame-and-call-vop :raw-instance-init-vops' >> $ltf
583 printf ' :stack-allocatable-closures :stack-allocatable-vectors' >> $ltf
584 printf ' :stack-allocatable-lists :stack-allocatable-fixed-objects' >> $ltf
585 printf ' :alien-callbacks :cycle-counter :inline-constants ' >> $ltf
586 printf ' :memory-barrier-vops :multiply-high-vops :ash-right-vops :symbol-info-vops' >> $ltf
587 case "$sbcl_os" in
588 linux | freebsd | netbsd | openbsd | sunos | darwin | win32)
589 printf ' :linkage-table' >> $ltf
590 esac
591 if [ "$sbcl_os" = "win32" ]; then
592 # of course it doesn't provide dlopen, but there is
593 # roughly-equivalent magic nevertheless.
594 printf ' :os-provides-dlopen' >> $ltf
596 if [ "$sbcl_os" = "openbsd" ]; then
597 rm -f src/runtime/openbsd-sigcontext.h
598 sh tools-for-build/openbsd-sigcontext.sh > src/runtime/openbsd-sigcontext.h
600 elif [ "$sbcl_arch" = "x86-64" ]; then
601 printf ' :gencgc :stack-grows-downward-not-upward :c-stack-is-control-stack :linkage-table' >> $ltf
602 printf ' :compare-and-swap-vops :unwind-to-frame-and-call-vop :raw-instance-init-vops' >> $ltf
603 printf ' :stack-allocatable-closures :stack-allocatable-vectors' >> $ltf
604 printf ' :stack-allocatable-lists :stack-allocatable-fixed-objects' >> $ltf
605 printf ' :alien-callbacks :cycle-counter :complex-float-vops' >> $ltf
606 printf ' :float-eql-vops :inline-constants :memory-barrier-vops' >> $ltf
607 printf ' :multiply-high-vops :sb-simd-pack :ash-right-vops :symbol-info-vops' >> $ltf
608 elif [ "$sbcl_arch" = "mips" ]; then
609 printf ' :cheneygc :linkage-table' >> $ltf
610 printf ' :stack-allocatable-closures :stack-allocatable-vectors' >> $ltf
611 printf ' :stack-allocatable-lists :stack-allocatable-fixed-objects' >> $ltf
612 printf ' :alien-callbacks' >> $ltf
613 elif [ "$sbcl_arch" = "ppc" ]; then
614 printf ' :gencgc :stack-allocatable-closures :stack-allocatable-vectors' >> $ltf
615 printf ' :stack-allocatable-lists :stack-allocatable-fixed-objects' >> $ltf
616 printf ' :linkage-table :raw-instance-init-vops :memory-barrier-vops' >> $ltf
617 printf ' :compare-and-swap-vops :multiply-high-vops' >> $ltf
618 if [ "$sbcl_os" = "linux" ]; then
619 # Use a C program to detect which kind of glibc we're building on,
620 # to bandage across the break in source compatibility between
621 # versions 2.3.1 and 2.3.2
623 # FIXME: integrate to grovel-features, mayhaps
624 $GNUMAKE -C tools-for-build where-is-mcontext -I ../src/runtime
625 tools-for-build/where-is-mcontext > src/runtime/ppc-linux-mcontext.h || (echo "error running where-is-mcontext"; exit 1)
626 elif [ "$sbcl_os" = "darwin" ]; then
627 # We provide a dlopen shim, so a little lie won't hurt
628 printf " :os-provides-dlopen :alien-callbacks" >> $ltf
629 # The default stack ulimit under darwin is too small to run PURIFY.
630 # Best we can do is complain and exit at this stage
631 if [ "`ulimit -s`" = "512" ]; then
632 echo "Your stack size limit is too small to build SBCL."
633 echo "See the limit(1) or ulimit(1) commands and the README file."
634 exit 1
637 elif [ "$sbcl_arch" = "sparc" ]; then
638 # Test the compiler in order to see if we are building on Sun
639 # toolchain as opposed to GNU binutils, and write the appropriate
640 # FUNCDEF macro for assembler. No harm in running this on sparc-linux
641 # as well.
642 sh tools-for-build/sparc-funcdef.sh > src/runtime/sparc-funcdef.h
643 if [ "$sbcl_os" = "sunos" ] || [ "$sbcl_os" = "linux" ]; then
644 printf ' :gencgc' >> $ltf
645 else
646 echo '***'
647 echo '*** You are running SPARC on non-SunOS, non-Linux. Since'
648 echo '*** GENCGC is untested on this combination, make-config.sh'
649 echo '*** is falling back to CHENEYGC. Please consider adjusting'
650 echo '*** parms.lisp to build with GENCGC instead.'
651 echo '***'
652 printf ' :cheneygc' >> $ltf
654 if [ "$sbcl_os" = "sunos" ] || [ "$sbcl_os" = "linux" ]; then
655 printf ' :linkage-table' >> $ltf
657 printf ' :stack-allocatable-closures :stack-allocatable-lists' >> $ltf
658 elif [ "$sbcl_arch" = "alpha" ]; then
659 printf ' :cheneygc' >> $ltf
660 printf ' :stack-allocatable-closures :stack-allocatable-lists' >> $ltf
661 elif [ "$sbcl_arch" = "hppa" ]; then
662 printf ' :cheneygc' >> $ltf
663 printf ' :stack-allocatable-vectors :stack-allocatable-fixed-objects' >> $ltf
664 printf ' :stack-allocatable-lists' >> $ltf
665 elif [ "$sbcl_arch" = "arm" ]; then
666 printf ' :cheneygc' >> $ltf
667 # As opposed to soft-float or FPA, we support VFP only (and
668 # possibly VFPv2 and higher only), but we'll leave the obvious
669 # hooks in for someone to add the support later.
670 printf ' :arm-vfp :arm-vfpv2' >> $ltf
671 else
672 # Nothing need be done in this case, but sh syntax wants a placeholder.
673 echo > /dev/null
676 # Use a little C program to try to guess the endianness. Ware
677 # cross-compilers!
679 # FIXME: integrate to grovel-features, mayhaps
680 $GNUMAKE -C tools-for-build determine-endianness -I ../src/runtime
681 tools-for-build/determine-endianness >> $ltf
683 export sbcl_os sbcl_arch
684 sh tools-for-build/grovel-features.sh >> $ltf
686 echo //finishing $ltf
687 echo '))))' >> $ltf
689 # FIXME: The version system should probably be redone along these lines:
691 # echo //setting up version information.
692 # versionfile=version.txt
693 # cp base-version.txt $versionfile
694 # echo " (built `date -u` by `whoami`@`hostname`)" >> $versionfile
695 # echo 'This is a machine-generated file and should not be edited by hand.' >> $versionfile
697 # Make a unique ID for this build (to discourage people from
698 # mismatching sbcl and *.core files).
699 if [ `uname` = "SunOS" ] ; then
700 # use /usr/xpg4/bin/id instead of /usr/bin/id
701 PATH=/usr/xpg4/bin:$PATH
703 echo '"'`hostname`-`id -un`-`date +%Y-%m-%d-%H-%M-%S`'"' > output/build-id.tmp