+cd ./src/runtime/
+rm -f Config target-arch-os.h target-arch.h target-os.h target-lispregs.h
+# KLUDGE: these two logically belong in the previous section
+# ("architecture-dependent"); it seems silly to enforce this in terms
+# of the shell script, though. -- CSR, 2002-02-03
+link_or_copy $sbcl_arch-arch.h target-arch.h
+link_or_copy $sbcl_arch-lispregs.h target-lispregs.h
+case "$sbcl_os" in
+ linux)
+ printf ' :elf' >> $ltf
+ printf ' :linux' >> $ltf
+
+ # If you add other platforms here, don't forget to edit
+ # src/runtime/Config.foo-linux too.
+ if [ $sbcl_arch = "x86" ]; then
+ printf ' :largefile' >> $ltf
+ fi
+
+ if [ $sbcl_arch = "x86-64" ]; then
+ link_or_copy Config.x86_64-linux Config
+ else
+ link_or_copy Config.$sbcl_arch-linux Config
+ fi
+ link_or_copy $sbcl_arch-linux-os.h target-arch-os.h
+ link_or_copy linux-os.h target-os.h
+ ;;
+ osf1)
+ printf ' :elf' >> $ltf
+ printf ' :osf1' >> $ltf
+ link_or_copy Config.$sbcl_arch-osf1 Config
+ link_or_copy $sbcl_arch-osf1-os.h target-arch-os.h
+ link_or_copy osf1-os.h target-os.h
+ ;;
+ *bsd)
+ printf ' :bsd' >> $ltf
+ link_or_copy $sbcl_arch-bsd-os.h target-arch-os.h
+ link_or_copy bsd-os.h target-os.h
+ case "$sbcl_os" in
+ freebsd)
+ printf ' :elf' >> $ltf
+ printf ' :freebsd' >> $ltf
+ printf ' :sb-pthread-futex' >> $ltf
+ if [ $sbcl_arch = "x86" ]; then
+ printf ' :restore-tls-segment-register-from-tls' >> $ltf
+ fi
+ link_or_copy Config.$sbcl_arch-freebsd Config
+ ;;
+ openbsd)
+ printf ' :elf' >> $ltf
+ printf ' :openbsd' >> $ltf
+ link_or_copy Config.$sbcl_arch-openbsd Config
+ ;;
+ netbsd)
+ printf ' :netbsd' >> $ltf
+ printf ' :elf' >> $ltf
+ link_or_copy Config.$sbcl_arch-netbsd Config
+ ;;
+ *)
+ echo unsupported BSD variant: `uname`
+ exit 1
+ ;;
+ esac
+ ;;
+ darwin)
+ printf ' :mach-o' >> $ltf
+ printf ' :bsd' >> $ltf
+ printf ' :darwin' >> $ltf
+ if [ $sbcl_arch = "x86" ]; then
+ printf ' :sb-lutex :restore-fs-segment-register-from-tls' >> $ltf
+ fi
+ link_or_copy $sbcl_arch-darwin-os.h target-arch-os.h
+ link_or_copy bsd-os.h target-os.h
+ link_or_copy Config.$sbcl_arch-darwin Config
+ ;;
+ sunos)
+ printf ' :elf' >> $ltf
+ printf ' :sunos' >> $ltf
+ if [ $sbcl_arch = "x86" ]; then
+ printf ' :sb-lutex' >> $ltf
+ fi
+ link_or_copy Config.$sbcl_arch-sunos Config
+ link_or_copy $sbcl_arch-sunos-os.h target-arch-os.h
+ link_or_copy sunos-os.h target-os.h
+ ;;
+ win32)
+ printf ' :win32' >> $ltf
+ link_or_copy Config.$sbcl_arch-win32 Config
+ link_or_copy $sbcl_arch-win32-os.h target-arch-os.h
+ link_or_copy win32-os.h target-os.h
+ ;;
+ *)
+ echo unsupported OS type: `uname`
+ exit 1
+ ;;
+esac
+cd $original_dir
+
+# FIXME: Things like :c-stack-grows-..., etc, should be
+# *derived-target-features* or equivalent, so that there was a nicer
+# way to specify them then sprinkling them in this file. They should
+# still be tweakable by advanced users, though, but probably not
+# appear in *features* of target. #!+/- should be adjusted to take
+# them in account as well. At minimum the nicer specification stuff,
+# though:
+#
+# (define-feature :dlopen (features)
+# (union '(:bsd :linux :darwin :sunos) features))
+#
+# (define-feature :c-stack-grows-downwards-not-upwards (features)
+# (member :x86 features))
+
+# 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
+ printf ' :stack-allocatable-closures :alien-callbacks' >> $ltf
+ if [ "$sbcl_os" = "linux" ] || [ "$sbcl_os" = "freebsd" ] || [ "$sbcl_os" = "netbsd" ] || [ "$sbcl_os" = "sunos" ] || [ "$sbcl_os" = "darwin" ] || [ "$sbcl_os" = "win32" ]; then
+ printf ' :linkage-table' >> $ltf
+ fi
+ if [ "$sbcl_os" = "win32" ]; then
+ # of course it doesn't provide dlopen, but there is
+ # roughly-equivalent magic nevertheless.
+ printf ' :os-provides-dlopen' >> $ltf