-rm -f Config
-if [ `uname` = Linux ]; then
- echo -n ' :linux' >> $ltf
- ln -s Config.x86-linux Config
-elif uname | grep BSD; then
- if [ `uname` = FreeBSD ]; then
- echo -n ' :freebsd' >> $ltf
- elif [ `uname` = OpenBSD ]; then
- echo -n ' :openbsd' >> $ltf
- else
- echo unsupported BSD variant: `uname`
+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
+ln -s $sbcl_arch-arch.h target-arch.h
+ln -s $sbcl_arch-lispregs.h target-lispregs.h
+case `uname` in
+ Linux)
+ printf ' :linux' >> $ltf
+ sbcl_os="linux"
+ if [ "`uname -m`" = "x86_64" ]; then
+ ln -s Config.x86_64-linux Config
+ else
+ ln -s Config.$sbcl_arch-linux Config
+ fi
+ ln -s $sbcl_arch-linux-os.h target-arch-os.h
+ ln -s linux-os.h target-os.h
+ ;;
+ OSF1)
+ # it's changed name twice since it was called OSF/1: clearly
+ # the marketers forgot to tell the engineers about Digital Unix
+ # _or_ OSF/1 ...
+ printf ' :osf1' >> $ltf
+ sbcl_os="osf1"
+ ln -s Config.$sbcl_arch-osf1 Config
+ ln -s $sbcl_arch-osf1-os.h target-arch-os.h
+ ln -s osf1-os.h target-os.h
+ ;;
+ *BSD)
+ printf ' :bsd' >> $ltf
+ ln -s $sbcl_arch-bsd-os.h target-arch-os.h
+ ln -s bsd-os.h target-os.h
+ case `uname` in
+ FreeBSD)
+ printf ' :freebsd' >> $ltf
+ sbcl_os="freebsd"
+ ln -s Config.$sbcl_arch-freebsd Config
+ ;;
+ OpenBSD)
+ printf ' :openbsd' >> $ltf
+ sbcl_os="openbsd"
+ ln -s Config.$sbcl_arch-openbsd Config
+ ;;
+ *)
+ echo unsupported BSD variant: `uname`
+ exit 1
+ ;;
+ esac
+ ;;
+ Darwin)
+ printf ' :bsd' >> $ltf
+ sbcl_os="darwin"
+ ln -s $sbcl_arch-darwin-os.h target-arch-os.h
+ ln -s bsd-os.h target-os.h
+ printf ' :darwin' >> $ltf
+ ln -s Config.$sbcl_arch-darwin Config
+ ;;
+ SunOS)
+ printf ' :sunos' >> $ltf
+ sbcl_os="sunos"
+ ln -s Config.$sbcl_arch-sunos Config
+ ln -s $sbcl_arch-sunos-os.h target-arch-os.h
+ ln -s sunos-os.h target-os.h
+ ;;
+ *)
+ echo unsupported OS type: `uname`