-echo '//setting up "target"-named symlinks to designate target architecture'
-sbcl_arch=x86 # (the only possibility supported, at least as of sbcl-0.6.7)
-echo -n ":x86" >> $ltf # (again, the only possibility supported)
+echo //guessing default target CPU architecture from host architecture
+case `uname -m` in
+ *86) guessed_sbcl_arch=x86 ;;
+ [Aa]lpha) guessed_sbcl_arch=alpha ;;
+ sparc*) guessed_sbcl_arch=sparc ;;
+ ppc) guessed_sbcl_arch=ppc ;;
+ *)
+ # If we're not building on a supported target architecture, we
+ # we have no guess, but it's not an error yet, since maybe
+ # target architecture will be specified explicitly below.
+ guessed_sbcl_arch=''
+ ;;
+esac
+
+echo //setting up CPU-architecture-dependent information
+sbcl_arch=${SBCL_ARCH:-$guessed_sbcl_arch}
+echo sbcl_arch=\"$sbcl_arch\"
+if [ "$sbcl_arch" = "" ] ; then
+ echo "can't guess target SBCL architecture, need SBCL_ARCH environment var"
+ exit 1
+fi
+echo -n ":$sbcl_arch" >> $ltf
+# 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
+if [ "$sbcl_arch" = "x86" ] ; then
+ echo -n ' :gencgc' >> $ltf
+fi