0.6.12.6:
[sbcl.git] / make-config.sh
index 3b112dd..c157609 100644 (file)
@@ -20,12 +20,15 @@ echo //entering make-config.sh
 
 ltf=`pwd`/local-target-features.lisp-expr
 echo //initializing $ltf
-echo '; This is a machine-generated file and should not be edited by hand.' > $ltf
+echo ';;;; This is a machine-generated file.' > $ltf
+echo ';;;; Please do not edit it by hand.' > $ltf
+echo ';;;; See make-config.sh.' > $ltf
 echo -n '(' >> $ltf
 
-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 //setting up CPU-architecture-dependent information
+# Currently supported: x86 alpha
+sbcl_arch=${SBCL_ARCH:-x86}
+echo -n ":$sbcl_arch" >> $ltf 
 for d in src/compiler src/assembly; do
     echo //setting up symlink $d/target
     original_dir=`pwd`
@@ -46,26 +49,29 @@ for d in src/compiler src/assembly; do
 done
 
 echo //setting up OS-dependent information
+original_dir=`pwd`
 cd src/runtime/
 rm -f Config
 if [ `uname` = Linux ]; then
     echo -n ' :linux' >> $ltf
-    ln -s Config.x86-linux Config
+    ln -s Config.$sbcl_arch-linux Config
 elif uname | grep BSD; then
+    echo -n ' :bsd' >> $ltf
     if [ `uname` = FreeBSD ]; then
        echo -n ' :freebsd' >> $ltf
+       ln -s Config.$sbcl_arch-freebsd Config
     elif [ `uname` = OpenBSD ]; then
        echo -n ' :openbsd' >> $ltf
+       ln -s Config.$sbcl_arch-openbsd Config
     else
        echo unsupported BSD variant: `uname`
        exit 1
     fi
-    echo -n ' :bsd' >> $ltf
-    ln -s Config.x86-bsd Config
 else
     echo unsupported OS type: `uname`
     exit 1
 fi
+cd $original_dir
 
 echo //finishing $ltf
 echo ')' >> $ltf