#!/bin/sh
#
-# $Id: Setup.sh,v 1.22 2007/05/06 04:45:18 cph Exp $
+# $Id: Setup.sh,v 1.23 2007/05/09 02:05:38 cph Exp $
#
# Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
# 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
# lib
maybe_mkdir lib
+maybe_mkdir lib/lib
maybe_link lib/SRC ..
maybe_link lib/include ../microcode
maybe_link lib/optiondb.scm ../etc/optiondb.scm
maybe_link lib/edwin/etc/mime.types ../../../etc/mime.types
maybe_link lib/edwin/autoload ../../edwin
-# lib/lib
-maybe_mkdir lib/lib
-for BUNDLE in 6001 compiler cref edwin imail sf sos ssp star-parser xdoc xml; do
- maybe_link "lib/lib/${BUNDLE}.so" "../../microcode/${BUNDLE}.so"
-done
-
for SUBDIR in 6001 compiler cref edwin imail rcs runtime \
sf sos ssp star-parser win32 xdoc xml microcode; do
echo "setting up ${SUBDIR}"
#| -*-Scheme-*-
-$Id: compiler.pkg,v 1.25 2007/04/15 18:02:15 cph Exp $
+$Id: compiler.pkg,v 1.26 2007/05/09 02:05:44 cph Exp $
Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
compile-file:sf-only?
compile-procedure
compile-scode
- compiler:c-compiler-name
- compiler:c-compiler-switches
- compiler:c-linker-name
- compiler:c-linker-switches
compiler:invoke-c-compiler?
compiler:reset!
;; cross-compile-bin-file
#| -*-Scheme-*-
-$Id: ctop.scm,v 1.26 2007/04/15 17:36:30 cph Exp $
+$Id: ctop.scm,v 1.27 2007/05/09 02:05:50 cph Exp $
Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
(define compiled-output-extension "c")
(define compiler:invoke-c-compiler? #t)
(define compiler:invoke-verbose? #t)
-(define compiler:c-compiler-name #f)
-(define compiler:c-compiler-switches #f)
-(define compiler:c-linker-name #f)
-(define compiler:c-linker-switches #f)
(define (compiler-file-output object pathname)
(let ((pair (vector-ref object 1)))
))))))
(define (c-compile pathname)
- (let ((source (enough-namestring pathname))
- (object (enough-namestring (pathname-new-type pathname "o")))
- (run
- (lambda items
- (let ((command-line
- (decorated-string-append "" " " ""
- (let flatten ((items items))
- (append-map! (lambda (item)
- (if (list? item)
- (flatten item)
- (list item)))
- items)))))
+ (let ((run
+ (lambda tokens
+ (let ((command
+ (decorated-string-append
+ "" " " ""
+ (map (lambda (token)
+ (let ((s
+ (if (pathname? token)
+ (enough-namestring token)
+ token)))
+ (if (string-find-next-char s #\space)
+ (string-append "\"" s "\"")
+ s)))
+ tokens))))
(maybe-with-notification compiler:invoke-verbose?
(lambda (port)
(write-string "Executing " port)
- (write command-line port))
+ (write command port))
(lambda ()
- (run-shell-command command-line)))))))
- (maybe-with-notification compiler:noisy?
- (lambda (port)
- (write-string "Compiling " port)
- (write-string source port))
- (lambda ()
- (run (c-compiler-name)
- (c-compiler-switches)
- "-DCOMPILE_FOR_DYNAMIC_LOADING"
- "-o"
- object
- source)))
- (maybe-with-notification compiler:noisy?
- (lambda (port)
- (write-string "Linking " port)
- (write-string object port))
- (lambda ()
- (run (c-linker-name)
- "-o"
- (enough-namestring
- (pathname-new-type pathname (c-output-extension)))
- (c-linker-switches)
- object)))
- (delete-file object)))
+ (run-shell-command command)))))))
+ (run (system-library-pathname "liarc-cc")
+ (pathname-new-type pathname "o")
+ pathname)
+ (run (system-library-pathname "liarc-ld")
+ (pathname-new-type pathname (c-output-extension))
+ (pathname-new-type pathname "o"))))
(define (maybe-with-notification flag message thunk)
(if flag
(with-notification message thunk)
(thunk)))
-\f
-(define c-compiler-switch-table
- `(
- ;; 32-bit PowerPC MacOSX
- ("MacOSX" ; "MacOSX-PowerPC-32"
- "dylib"
- ("-g" "-O2" "-fno-common" "-DPIC" "-c")
- ("-dylib" "-flat_namespace" "-undefined" "suppress")
- "cc"
- "ld")
- ;; 64-bit PowerPC MacOSX
- ("MacOSX-PowerPC-64"
- "dylib"
- ("-m64" "-g" "-O2" "-fno-common" "-DPIC" "-c")
- ("-m64" "-dylib" "-flat_namespace" "-undefined" "suppress")
- "gcc-4.0"
- "ld")
- ;; 32-bit i386 Linux
- ("GNU/Linux" ; "GNU/Linux-IA-32"
- "so"
- ("-m32" "-g" "-O2" "-fPIC" "-c")
- ("-m32" "-shared")
- "cc"
- "ld")
- ;; 64-bit x86_64 Linux
- ("GNU/Linux-x86-64"
- "so"
- ("-m64" "-g" "-O2" "-fPIC" "-c")
- ("-m64" "-shared")
- "cc"
- "ld")
- ("GNU/Linux-ia64"
- "so"
- ("-g" "-O2" "-fPIC" "-c")
- ("-shared")
- "cc"
- "ld")
- ("NETBSD-x86-64"
- "so"
- ("-g" "-O2" "-fPIC" "-c")
- ("-shared")
- "cc"
- "ld")
- #|
- ;; All the following are old stuff that probably no longer works
- ("AIX"
- "so"
- ("-c" "-O" "-D_AIX")
- ,(lambda (dir)
- (list "-bM:SRE"
- (string-append "-bE:"
- (->namestring (merge-pathnames dir "liarc.exp")))
- (string-append "-bI:"
- (->namestring (merge-pathnames dir "scheme.imp")))
- "-edload_initialize_file"))
-
- "cc"
- "cc")
- ("HP-UX"
- "sl"
- ("-c" "+z" "-O" "-Ae" "-D_HPUX")
- ("-b")
- "cc"
- "ld")
- ("OSF"
- "so"
- ("-c" "-std1" "-O")
- ("-shared" "-expect_unresolved" "'*'")
- "cc"
- "ld")
- ("SunOS"
- "so"
- ("-c" "-pic" "-O" "-Dsun4" "-D_SUNOS4" "-w")
- ()
- "cc"
- "ld")
- |#
- ))
-
-(define (find-switches fail-name)
- (or (assoc (string-append microcode-id/operating-system-variant
- "-"
- microcode-id/machine-type)
- c-compiler-switch-table)
- (assoc microcode-id/operating-system-variant
- c-compiler-switch-table)
- (and fail-name
- (error fail-name "Unknown OS/machine"))))
-\f
+
(define (c-output-extension)
- ;; Always use .so -- this simplifies logic for built-in objects.
- ;;(list-ref (find-switches 'c-output-extension) 1)
"so")
-(define (c-compiler-name)
- (or compiler:c-compiler-name
- (let ((p (find-switches #f)))
- (if p
- (list-ref p 4)
- "cc"))))
-
-(define (c-compiler-switches)
- (or compiler:c-compiler-switches
- (let ((p (find-switches 'c-compiler-switches))
- (dir (system-library-directory-pathname "include")))
- (if (not dir)
- (error 'c-compiler-switches
- "Cannot find \"include\" directory"))
- (append (list-ref p 2)
- (list
- (string-append
- "-I"
- (->namestring (directory-pathname-as-file dir))))))))
-
-(define (c-linker-name)
- (or compiler:c-linker-name
- (let ((p (find-switches #f)))
- (if p
- (list-ref p 5)
- "ld"))))
-
-(define (c-linker-switches)
- (or compiler:c-linker-switches
- (let ((p (find-switches 'c-linker-switches)))
- (let ((switches (list-ref p 3)))
- (if (not (procedure? switches))
- switches
- (let ((dir (system-library-directory-pathname
- "include")))
- (if (not dir)
- (error 'c-linker-switches
- "Cannot find \"include\" directory"))
- (switches dir)))))))
-
(define (recursive-compilation-results)
(sort *recursive-compilation-results*
(lambda (x y)
dnl Process this file with autoconf to produce a configure script.
AC_INIT([MIT/GNU Scheme], [7.7.91], [bug-mit-scheme@gnu.org], [mit-scheme])
-AC_REVISION([$Id: configure.ac,v 1.11 2007/05/08 12:54:52 cph Exp $])
+AC_REVISION([$Id: configure.ac,v 1.12 2007/05/09 02:05:32 cph Exp $])
AC_CONFIG_SRCDIR([microcode/boot.c])
AC_PROG_MAKE_SET
SYSTEM_BASE_NAME=mit-scheme
;;
esac
+AUXDIR='$(libdir)'/${SYSTEM_BASE_NAME}
AC_SUBST([ALL_TARGET])
AC_SUBST([INSTALL_COM])
+AC_SUBST([AUXDIR])
AC_PROG_INSTALL
AC_PROG_LN_S
INSTALL="${INSTALL} --preserve-timestamps"
fi
-AUXDIR='$(libdir)'/${SYSTEM_BASE_NAME}
-AC_SUBST([AUXDIR])
-
AC_CONFIG_SUBDIRS([microcode compiler])
AC_CONFIG_FILES([
Makefile
xml/Makefile
])
AC_OUTPUT
+
+if test x${enable_native_code} = xc; then
+ BN=liarcc-cc
+ (cd lib; rm -f ${BN}; ${LN_S} ../microcode/${BN} ${BN})
+ BN=liarcc-ld
+ (cd lib; rm -f ${BN}; ${LN_S} ../microcode/${BN} ${BN})
+ for BUNDLE in compiler cref edwin imail sf sos ssp star-parser xdoc xml; do
+ BN=${BUNDLE}.so
+ (cd lib/lib; rm -f ${BN}; ${LN_S} ../../microcode/${BN} ${BN})
+ done
+fi
dnl Process this file with autoconf to produce a configure script.
AC_INIT([MIT/GNU Scheme microcode], [15.1], [bug-mit-scheme@gnu.org], [mit-scheme])
-AC_REVISION([$Id: configure.ac,v 1.45 2007/05/06 04:43:01 cph Exp $])
+AC_REVISION([$Id: configure.ac,v 1.46 2007/05/09 02:05:56 cph Exp $])
AC_CONFIG_SRCDIR([boot.c])
AC_CONFIG_HEADERS([config.h])
AC_PROG_MAKE_SET
STATIC_SUFFIX=
PRBFISH_LIBS=
PRMD5_LIBS=
-SCHEME_DEFS=
+SCHEME_DEFS=-DMIT_SCHEME
SCHEME_LDFLAGS=
MODULE_BASES=
MODULE_LIBS=
MODULE_TARGETS=
MODULE_RULES=/dev/null
-MODULE_CFLAGS="-DCOMPILE_AS_MODULE"
+MODULE_CFLAGS=
MODULE_LDFLAGS=
LIARC_VARS=/dev/null
LIARC_RULES=/dev/null
if test "x${FOO}" != x; then
INSTALL="${INSTALL} --preserve-timestamps"
fi
+CCLD=${CC}
dnl Checks for libraries.
AC_CHECK_LIB([m], [exp])
c)
AC_MSG_RESULT([yes, using portable C code])
AC_CONFIG_LINKS([cmpauxmd.c:cmpauxmd/c.c])
+ AC_CONFIG_FILES([liarc-cc], [chmod +x liarc-cc])
+ AC_CONFIG_FILES([liarc-ld], [chmod +x liarc-ld])
AC_DEFINE([COMPILE_FOR_STATIC_LINKING], [1],
[Define to 1 for static compilation of C native code.])
OPTIONAL_BASES="${OPTIONAL_BASES} cmpauxmd unstackify compinit"
AC_SUBST_FILE([LIARC_RULES])
AC_SUBST([SYSTEM_BASE_NAME])
AC_SUBST([INSTALL_INCLUDE])
+AC_SUBST([CCLD])
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
--- /dev/null
+#!/bin/sh
+#
+# $Id: liarc-cc.in,v 1.1 2007/05/09 02:06:02 cph 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.
+
+set -e
+
+if [ ${#} -ne 2 ]; then
+ echo "usage: ${0} OUTPUT INPUT"
+ exit 1
+fi
+
+@CC@ @DEFS@ @SCHEME_DEFS@ @CPPFLAGS@ @CFLAGS@ @MODULE_CFLAGS@ \
+ -DCOMPILE_FOR_DYNAMIC_LOADING -o "${1}" "${2}"
--- /dev/null
+#!/bin/sh
+#
+# $Id: liarc-ld.in,v 1.1 2007/05/09 02:06:16 cph 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.
+
+set -e
+
+if [ ${#} -lt 2 ]; then
+ echo "usage: ${0} SOFILE OFILE ..."
+ exit 1
+fi
+
+OUTPUT=${1}
+shift
+
+@CCLD@ @LDFLAGS@ @MODULE_LDFLAGS@ -o "${OUTPUT}" "${@}"
+rm -f "${@}"
# -*- Makefile -*-
#
-# $Id: Makefile.in.in,v 1.53 2007/05/06 04:43:06 cph Exp $
+# $Id: Makefile.in.in,v 1.54 2007/05/09 02:06:22 cph Exp $
#
# Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
# 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
AUXDIR = $(libdir)/$(SYSTEM_BASE_NAME)
CC = @CC@
+CCLD = @CCLD@
M4 = $(srcdir)/makegen/m4.sh
AS = as
TAR = tar
GZIP_ENV = --best
-DEFS = @DEFS@ @SCHEME_DEFS@ -DMIT_SCHEME -DDEFAULT_LIBRARY_PATH=\"$(AUXDIR)\"
+DEFS = @DEFS@ @SCHEME_DEFS@ -DDEFAULT_LIBRARY_PATH=\"$(AUXDIR)\"
CFLAGS = @CFLAGS@
CPPFLAGS = @CPPFLAGS@ -I. -I$(srcdir)
LDFLAGS = @LDFLAGS@
AS_FLAGS = @AS_FLAGS@
COMPILE = $(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS)
-CCLD = $(CC)
LINK = $(CCLD) $(LDFLAGS) -o $@
EXPAND = $(M4) $(M4_FLAGS)
ASSEMBLE = $(AS) $(AS_FLAGS)
MODULE_TARGETS = @MODULE_TARGETS@
MODULE_CFLAGS = @MODULE_CFLAGS@
MODULE_LDFLAGS = @MODULE_LDFLAGS@
-COMPILE_MODULE = $(COMPILE) $(MODULE_CFLAGS)
+COMPILE_MODULE = $(COMPILE) -DCOMPILE_AS_MODULE $(MODULE_CFLAGS)
LINK_MODULE = $(LINK) $(MODULE_LDFLAGS)
MODULE_LIBS = -lc