#!/bin/sh
#
-# $Id: bootstrap.sh,v 1.2 2000/10/16 18:24:10 cph Exp $
+# $Id: bootstrap.sh,v 1.3 2000/10/16 18:43:42 cph Exp $
#
# Copyright (c) 2000 Massachusetts Institute of Technology
#
MITSCHEME_LARGE_HEAP=4000
export MITSCHEME_LARGE_HEAP
+if [ $# -eq 0 ]; then
+ case "`uname`" in
+ Linux)
+ cname=i386-linux
+ ;;
+ FreeBSD)
+ cname=i386-freebsd
+ ;;
+ *)
+ echo "Don't know what system you're using."
+ echo "You must re-run this script with a configuration name argument."
+ echo "Here are the allowed names:"
+ microcode/unxutl/config
+ exit 1
+ ;;
+ esac
+elif [ $# -eq 1 ]; then
+ cname=$1
+else
+ echo "usage: $0 [config-name]"
+ exit 1
+fi
+
if [ ! -d 6001 ]; then
- echo "This must be run from the top-level Scheme source directory."
- exit 1
+ echo "This must be run from the top-level Scheme source directory."
+ exit 1
fi
# If this tree is freshly checked out, do the post-checkout adjustments.
if [ ! -f 6001/Makefile ]; then
- etc/build-tree.sh
+ etc/build-tree.sh
fi
+# Set up the compiler directory.
+(
+ cd compiler
+ if [ ! -L machine ]; then
+ ln -s machines/i386 machine
+ ln -s machine/compiler.* .
+ ln -s machine/make.com .
+ fi
+)
+
+# Compile the C code.
+(
+ cd microcode
+ unxutl/config "${cname}"
+ make
+)
+
+# Compile the Scheme code.
+./microcode/scheme -compiler < etc/bootstrap-compile.scm
+
# Build the lib directory.
rm -rf lib
mkdir lib
mkdir edwin/info
cp -p etc/optiondb.scm lib/.
(
- cd lib
- ln -s .. SRC
- ln -s SRC/runtime options
- ln -s ../../edwin edwin/autoload
- ln -s ../cref .
-)
-
-# Set up the compiler directory.
-(
- cd compiler
- ln -s machines/i386 machine
- ln -s machine/compiler.* .
- ln -s machine/make.com .
+ cd lib
+ ln -s .. SRC
+ ln -s SRC/runtime options
+ ln -s ../../edwin edwin/autoload
+ ln -s ../cref .
)
-# Compile everything.
-scheme -compiler < etc/bootstrap-compile.scm
-
cp -p microcode/utabmd.bin lib/.
-(cd runtime; scheme -library ../lib -fasl make.com) < etc/build-runtime.scm
-scheme -library lib -large < etc/build-compiler.scm
-scheme -library lib -large < etc/build-edwin.scm
+(
+ cd runtime
+ ../microcode/scheme -library ../lib -fasl make.com
+) < etc/build-runtime.scm
+
+./microcode/scheme -library lib -large < etc/build-compiler.scm
+./microcode/scheme -library lib -large < etc/build-edwin.scm