#!/bin/sh
#
-# $Id: build-bands.sh,v 1.9 2007/05/02 13:49:02 cph Exp $
+# $Id: build-bands.sh,v 1.10 2007/05/03 03:45:51 cph Exp $
#
# Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
# 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301, USA.
-(
- cd runtime
- ../microcode/scheme --library ../lib --fasl make.com <<EOF
-(disk-save "../lib/runtime.com")
-EOF
-)
+set -e
+
+etc/build-runtime.sh
-microcode/scheme --library lib --heap 3000 <<EOF
-(load-option 'COMPILER)
-(load-option 'EDWIN)
-(disk-save "lib/all.com")
+echo "microcode/scheme --library lib --heap 3000"
+exec microcode/scheme --library lib --heap 3000 <<EOF
+(begin
+ (load-option (quote COMPILER))
+ (load-option (quote EDWIN))
+ (disk-save "lib/all.com"))
EOF
#!/bin/sh
#
-# $Id: c-initial-bands.sh,v 1.6 2007/05/02 13:50:59 cph Exp $
+# $Id: build-runtime.sh,v 1.1 2007/05/03 03:45:51 cph Exp $
#
-# Copyright 2007 Massachusetts Institute of Technology
+# Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
+# 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006, 2007 Massachusetts Institute of Technology
#
# This file is part of MIT/GNU Scheme.
#
#
# You should have received a copy of the GNU General Public License
# along with MIT/GNU Scheme; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+# 02110-1301, USA.
set -e
-(
- cd runtime
- ../microcode/scheme --library ../lib --fasl runtime_make.so <<EOF
-(disk-save "../lib/runtime.com")
-EOF
-)
+echo "cd runtime"
+cd runtime
-microcode/scheme --library lib --large <<EOF
-(begin
- (load-option (quote COMPILER))
- (load-option (quote *PARSER))
- (load-option (quote CREF))
- (disk-save "lib/compiler.com"))
+if [ -f make.o ]; then
+ FASL=
+elif [ -f make.com ]; then
+ FASL=make.com
+else
+ echo "Can't find argument for --fasl."
+ exit 1
+fi
+
+echo "../microcode/scheme --library ../lib --fasl ${FASL}"
+exec ../microcode/scheme --library ../lib --fasl ${FASL} <<EOF
+(disk-save "../lib/runtime.com")
EOF
#!/bin/sh
#
-# $Id: c-boot-compiler.sh,v 1.3 2007/04/30 01:49:30 cph Exp $
+# $Id: c-boot-compiler.sh,v 1.4 2007/05/03 03:45:51 cph Exp $
#
# Copyright 2007 Massachusetts Institute of Technology
#
set -e
if [ -z "${SCHEME_LARGE}" ]; then
- SCHEME_LARGE="scheme --heap 6000"
+ SCHEME_LARGE="mit-scheme --heap 6000"
fi
if [ -z "${SCHEME_COMPILER}" ]; then
# independently of the compiler. (There is no standard band that
# loads them independently.)
+echo "${SCHEME_COMPILER}"
${SCHEME_COMPILER} <<EOF
(begin
- (with-working-directory-pathname "cref"
- (lambda ()
- (load "cref.sf")
- (load "cref.cbf")
- (if (not (name->package '(CROSS-REFERENCE)))
- (load "make"))))
- (with-working-directory-pathname "sf"
- (lambda ()
- (load "sf.sf")
- (load "sf.cbf"))))
+ (load "etc/compile.scm")
+ (compile-bootstrap-1))
EOF
# Step 2: Load CREF and SF, and syntax the compiler configured with
# the C back end.
-# (There *must* be a better way to write this...)
-
-LOAD_SF_CREF='
-(for-each (lambda (subdirectory)
- (with-working-directory-pathname subdirectory
- (lambda ()
- (load "make"))))
- (quote ("cref" "sf")))
-'
-
+echo "${SCHEME_LARGE}"
${SCHEME_LARGE} <<EOF
(begin
- ${LOAD_SF_CREF}
- (with-working-directory-pathname "compiler"
- (lambda ()
- (load "compiler.sf"))))
+ (load "etc/compile.scm")
+ (compile-bootstrap-2))
EOF
# Step 3: Now that the compiler with the C back end is syntaxed and
# packaged, use the native compiler to compile the bootstrap C
# compiler natively.
+echo "${SCHEME_COMPILER}"
${SCHEME_COMPILER} <<EOF
-(with-working-directory-pathname "compiler"
- (lambda ()
- (load "compiler.cbf")))
+(begin
+ (load "etc/compile.scm")
+ (compile-bootstrap-3))
EOF
# Step 4: Load up the natively compiled compiler with the C back end,
# and save a band.
+echo "${SCHEME_LARGE}"
${SCHEME_LARGE} <<EOF
(begin
- ${LOAD_SF_CREF}
- (with-working-directory-pathname "compiler"
- (lambda ()
- (load "machines/C/make")))
+ (load "etc/compile.scm")
+ (compile-bootstrap-4)
(disk-save "boot-compiler.com"))
EOF
+++ /dev/null
-#!/bin/sh
-#
-# $Id: c-build-bands.sh,v 1.3 2007/04/30 01:42:54 cph Exp $
-#
-# Copyright 2007 Massachusetts Institute of Technology
-#
-# This file is part of MIT/GNU Scheme.
-#
-# MIT/GNU Scheme is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of the
-# License, or (at your option) any later version.
-#
-# MIT/GNU Scheme is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with MIT/GNU Scheme; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-set -e
-
-sh etc/c-initial-bands.sh
-
-microcode/scheme --library lib --compiler <<EOF
-(load-option 'EDWIN)
-(disk-save "lib/all.com")
-EOF
-
-rm -f lib/compiler.com
+++ /dev/null
-#| -*-Scheme-*-
-
-$Id: c-compile.scm,v 1.1 2007/04/04 05:08:19 riastradh Exp $
-
-Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
- 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
- 2006, 2007 Massachusetts Institute of Technology
-
-This file is part of MIT/GNU Scheme.
-
-MIT/GNU Scheme is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-MIT/GNU Scheme is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with MIT/GNU Scheme; if not, write to the Free Software
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,
-USA.
-
-|#
-
-;;; This generates correct debugging information for the parts of the
-;;; Scheme code that were statically linked to the microcode, and also
-;;; compiles the rest of the system that was not statically linked.
-
-;;; (Ideally, this file would be identical to compile.scm. But we do
-;;; not live in an ideal world, and we shall have to settle for a file
-;;; that is merely very similar. The main difference is that we need
-;;; to avoid running the C compiler on some of the files but not
-;;; others. This is bogus.)
-
-(fluid-let ((compiler:invoke-c-compiler? #f))
- (define (compile-package-descriptions subsystem)
- (for-each
- (lambda (os-suffix)
- (cbf (pathname-new-type (string-append subsystem "-" os-suffix)
- "pkd")))
- '("unx" "w32" "os2")))
- (with-working-directory-pathname "cref"
- (lambda ()
- (load "cref.sf")
- (load "cref.cbf")
- ;; This conditional is probably not necessary.
- (if (not (name->package '(CROSS-REFERENCE)))
- (load "make"))))
- (for-each
- (lambda (subsystem)
- (with-working-directory-pathname subsystem
- (lambda ()
- (load (pathname-new-type subsystem "sf"))
- (load (pathname-new-type subsystem "cbf"))
- (if (string=? subsystem "compiler") ;++ kludge
- (cbf "compiler-unx.pkd")
- (compile-package-descriptions subsystem)))))
- '("runtime" "win32" "sf" "compiler" "edwin" "6001"))
- (with-working-directory-pathname "star-parser"
- (lambda ()
- (load "compile")
- (compile-package-descriptions "parser")))
- (for-each (lambda (subsystem)
- (load (merge-pathnames "compile"
- (pathname-as-directory subsystem)))
- (with-working-directory-pathname subsystem
- (lambda ()
- (compile-package-descriptions subsystem))))
- '("sos" "imail" "xml" "ssp" "xdoc")))
#!/bin/sh
#
-# $Id: c-compile.sh,v 1.3 2007/05/02 13:50:04 cph Exp $
+# $Id: c-compile.sh,v 1.4 2007/05/03 03:45:51 cph Exp $
#
# Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
# 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
set -e
if [ ${#} -ge 1 ]; then
+ echo "cd ${1}"
cd "${1}"
-elif [ -r etc/c-compile.scm ]; then
+elif [ -r etc/compile.scm ]; then
:
else
echo "usage: ${0} DIRECTORY"
exit 1
fi
-sh etc/c-initial-bands.sh
+etc/build-runtime.sh
-exec microcode/scheme --library lib --compiler --heap 6000 --stack 200 \
- < etc/c-compile.scm
+echo "microcode/scheme --library lib --heap 6000 --stack 200"
+exec microcode/scheme --library lib --heap 6000 --stack 200 <<EOF
+(begin
+ (load-option (quote COMPILER))
+ (load-option (quote *PARSER))
+ (load-option (quote CREF))
+ (load "etc/compile.scm")
+ (c-compile))
+EOF
+++ /dev/null
-#| -*-Scheme-*-
-
-$Id: c-prepare.scm,v 1.1 2007/04/04 05:08:19 riastradh Exp $
-
-Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
- 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
- 2006, 2007 Massachusetts Institute of Technology
-
-This file is part of MIT/GNU Scheme.
-
-MIT/GNU Scheme is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-MIT/GNU Scheme is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with MIT/GNU Scheme; if not, write to the Free Software
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,
-USA.
-
-|#
-
-;;; This compiles the Scheme code that will be statically linked to
-;;; the microcode when using the C back end.
-
-(fluid-let ((compiler:invoke-c-compiler? #f))
- (define (compile-package-descriptions subsystem)
- (for-each (lambda (os-suffix)
- (cbf (pathname-new-type (string-append subsystem "-" os-suffix)
- "pkd")))
- '("unx" "w32" "os2")))
- (with-working-directory-pathname "microcode"
- (lambda ()
- (if (or (not (file-exists? "utabmd.bin"))
- (> (file-modification-time-indirect "utabmd.scm")
- (file-modification-time-indirect "utabmd.bin")))
- (sf "utabmd"))
- (cbf "utabmd")))
- (for-each (lambda (subsystem)
- (with-working-directory-pathname subsystem
- (lambda ()
- (load (pathname-new-type subsystem "sf"))
- (load (pathname-new-type subsystem "cbf"))
- (compile-package-descriptions subsystem))))
- '("runtime" "sf" "cref"))
- (with-working-directory-pathname "compiler"
- (lambda ()
- (load "compiler.sf")
- (load "compiler.cbf")
- (cbf "compiler-unx.pkd")))
- (with-working-directory-pathname "star-parser"
- (lambda ()
- (load "compile")
- (compile-package-descriptions "parser"))))
#!/bin/sh
#
-# $Id: c-prepare.sh,v 1.2 2007/04/29 20:46:43 cph Exp $
+# $Id: c-prepare.sh,v 1.3 2007/05/03 03:45:52 cph Exp $
#
# Copyright 2007 Massachusetts Institute of Technology
#
set -e
-if [ $# -ge 1 ]; then
- DIR="${1}"
-elif [ -r "./etc/c-prepare.scm" ]; then
- DIR="."
+if [ ${#} -ge 1 ]; then
+ cd "${1}"
+elif [ -r etc/compile.scm ]; then
+ :
else
echo "usage: ${0} DIRECTORY"
exit 1
fi
if [ -z "${SCHEME_LARGE}" ]; then
- SCHEME_LARGE="scheme --heap 6000"
+ SCHEME_LARGE="mit-scheme --heap 6000"
fi
-${SCHEME_LARGE} --band boot-compiler.com < "${DIR}/etc/c-prepare.scm"
+${SCHEME_LARGE} --band boot-compiler.com <<EOF
+(begin
+ (load "etc/compile.scm")
+ (c-prepare))
+EOF
#| -*-Scheme-*-
-$Id: compile.scm,v 1.13 2007/04/05 17:42:19 cph Exp $
+$Id: compile.scm,v 1.14 2007/05/03 03:45:52 cph Exp $
Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
;;; This compiles the part of the system written in Scheme.
;;; The part written in C is compiled using "make".
-(begin
- (with-working-directory-pathname "cref"
+(define boot-dirs
+ '("cref" "runtime" "sf" "compiler" "star-parser"))
+
+(define non-boot-dirs
+ '("win32" "sos" "xml" "edwin" "imail" "6001" "ssp" "xdoc"))
+
+(define (compile-dir name)
+ (with-working-directory-pathname name
+ (lambda ()
+ (if (file-exists? (pathname-new-type name "sf"))
+ (begin
+ (load (pathname-new-type name "sf"))
+ (load (pathname-new-type name "cbf")))
+ (load "compile")))))
+
+(define (load-dir name)
+ (with-working-directory-pathname name
(lambda ()
- (load "cref.sf")
- (load "cref.cbf")
- (if (not (name->package '(CROSS-REFERENCE)))
- (load "make"))))
- (for-each (lambda (name)
- (with-working-directory-pathname name
- (lambda ()
- (load (pathname-new-type name "sf"))
- (load (pathname-new-type name "cbf")))))
- '("runtime" "win32" "sf" "compiler" "edwin" "6001"))
- (with-working-directory-pathname "cref"
+ (cond ((and (string=? name "compiler")
+ (eq? microcode-id/compiled-code-type 'C))
+ (load "machines/C/make"))
+ ((file-exists? (pathname-new-type name "sf"))
+ (load "make"))
+ (else
+ (load "load"))))))
+
+(define (compile-everything)
+ (compile-dir "cref")
+ (if (not (name->package '(cross-reference)))
+ (load-dir "cref"))
+ (for-each compile-dir boot-dirs)
+ (for-each compile-dir non-boot-dirs))
+
+(define (compile-bootstrap-1)
+ (compile-dir "cref")
+ (if (not (name->package '(cross-reference)))
+ (load-dir "cref"))
+ (compile-dir "sf"))
+
+(define (compile-bootstrap-2)
+ (load-dir "cref")
+ (load-dir "sf")
+ (with-working-directory-pathname "compiler"
(lambda ()
- (if (not (file-exists? "cref.con"))
- (load "cref.sf"))))
- (for-each (lambda (name)
- (load (merge-pathnames "compile" (pathname-as-directory name))))
- '("sos" "star-parser" "imail" "xml" "ssp" "xdoc")))
\ No newline at end of file
+ (load "compiler.sf"))))
+
+(define (compile-bootstrap-3)
+ (with-working-directory-pathname "compiler"
+ (lambda ()
+ (load "compiler.cbf"))))
+
+(define (compile-bootstrap-4)
+ (load-dir "cref")
+ (load-dir "sf")
+ (load-dir "compiler"))
+
+(define (c-compile-dir name)
+ (compile-dir name)
+ (liarc-compile-pkgs name))
+
+(define (c-compile-pkgs name)
+ (with-working-directory-pathname name
+ (lambda ()
+ (cbf (string-append name "-unx.pkd"))
+ (if (not (string=? name "compiler")) ;kludge
+ (begin
+ (cbf (string-append name "-w32.pkd"))
+ (cbf (string-append name "-os2.pkd")))))))
+
+(define (c-prepare)
+ (fluid-let ((compiler:invoke-c-compiler? #f))
+ (for-each liarc-compile-dir boot-dirs)))
+
+(define (c-compile)
+ (fluid-let ((compiler:invoke-c-compiler? #f))
+ (for-each liarc-compile-dir boot-dirs)
+ (for-each liarc-compile-dir non-boot-dirs)))
\ No newline at end of file
#!/bin/sh
#
-# $Id: compile.sh,v 1.10 2007/01/05 21:19:25 cph Exp $
+# $Id: compile.sh,v 1.11 2007/05/03 03:45:52 cph Exp $
#
# Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
# 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301, USA.
-if [ $# -ge 1 ]; then
- DIR="${1}"
-elif [ -r "./etc/compile.scm" ]; then
- DIR="."
+set -e
+
+if [ ${#} -ge 1 ]; then
+ echo "cd ${1}"
+ cd "${1}"
+elif [ -r etc/compile.scm ]; then
+ :
else
- echo "usage: ${0} DIRECTORY"
- exit 1
+ echo "usage: ${0} DIRECTORY"
+ exit 1
fi
+
if [ -z "${SCHEME_COMPILER}" ]; then
- SCHEME_COMPILER="scheme --compiler --heap 3000"
+ SCHEME_COMPILER="mit-scheme --compiler --heap 6000 --stack 200"
fi
-${SCHEME_COMPILER} < "${DIR}/etc/compile.scm"
+
+echo "${SCHEME_COMPILER}"
+exec ${SCHEME_COMPILER} <<EOF
+(begin
+ (load "etc/compile.scm")
+ (compile-everything))
+EOF