+# KLUDGE: currently the x86 only works with the generational garbage
+# collector (indicated by the presence of :GENCGC in *FEATURES*) and
+# alpha, sparc and ppc with the stop'n'copy collector (indicated by
+# the absence of :GENCGC in *FEATURES*). This isn't a great
+# separation, but for now, rather than have :GENCGC in
+# base-target-features.lisp-expr, we add it into local-target-features
+# if we're building for x86. -- CSR, 2002-02-21 Then we do something
+# similar with :STACK-GROWS-FOOWARD, too. -- WHN 2002-03-03
+if [ "$sbcl_arch" = "x86" ] ; then
+ printf ' :gencgc :stack-grows-downward-not-upward :c-stack-is-control-stack' >> $ltf
+elif [ "$sbcl_arch" = "mips" ] ; then
+ # Use a little C program to try to guess the endianness. Ware
+ # cross-compilers!
+ $GNUMAKE -C tools-for-build determine-endianness
+ tools-for-build/determine-endianness >> $ltf
+elif [ "$sbcl_arch" = "ppc" -a "$sbcl_os" = "linux" ]; then
+ # Use a C program to detect which kind of glibc we're building on,
+ # to bandage across the break in source compatibility between
+ # versions 2.3.1 and 2.3.2
+ $GNUMAKE -C tools-for-build where-is-mcontext
+ tools-for-build/where-is-mcontext > src/runtime/ppc-linux-mcontext.h
+elif [ "$sbcl_arch" = "ppc" -a "$sbcl_os" = "darwin" ]; then
+ # The default stack ulimit under darwin is too small to run PURIFY.
+ # Best we can do is complain and exit at this stage
+ if [ "`ulimit -s`" = "512" ]; then
+ echo "Your stack size limit is too small to build SBCL."
+ echo "See the limit(1) or ulimit(1) commands and the README file."
+ exit 1
+ fi
+elif [ "$sbcl_arch" = "sparc" ]; then
+ # Test the compiler in order to see if we are building on Sun
+ # toolchain as opposed to GNU binutils, and write the appropriate
+ # FUNCDEF macro for assembler. No harm in running this on sparc-linux
+ # as well.
+ sh tools-for-build/sparc-funcdef.sh > src/runtime/sparc-funcdef.h
+else
+ # Nothing need be done in this case, but sh syntax wants a placeholder.
+ echo > /dev/null
+fi
+
+sh tools-for-build/grovel-features.sh >> $ltf
+