From: Chris Hanson Date: Fri, 8 Jun 2007 06:04:15 +0000 (+0000) Subject: Redesign the liarc compilation strategy again. The new strategy has X-Git-Tag: 20090517-FFI~542 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=5d60b2f624690123d22daa0561adf2303db7ae71;p=mit-scheme.git Redesign the liarc compilation strategy again. The new strategy has two features: (1) it uses a shell script to control the compilation sequence, rather than trying to get make to do the job; and (2) it creates the second bootstrap compiler by installing it into a subdirectory, which isolates it from the state of the build tree. --- diff --git a/v7/src/Clean.sh b/v7/src/Clean.sh index 6d83df255..643d7e391 100755 --- a/v7/src/Clean.sh +++ b/v7/src/Clean.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# $Id: Clean.sh,v 1.16 2007/05/14 16:50:31 cph Exp $ +# $Id: Clean.sh,v 1.17 2007/06/08 06:03:20 cph Exp $ # # Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, # 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, @@ -74,7 +74,7 @@ if [ ${DIST} = yes ]; then fi if [ ${MAINTAINER} = yes ]; then - maybe_rm autom4te.cache configure liarc.stamp lib + maybe_rm autom4te.cache configure lib stamp_* boot-root fi for SUBDIR in ${SUBDIRS}; do diff --git a/v7/src/Makefile.in b/v7/src/Makefile.in index 4d46b7136..f9b0de749 100644 --- a/v7/src/Makefile.in +++ b/v7/src/Makefile.in @@ -1,4 +1,4 @@ -# $Id: Makefile.in,v 1.40 2007/06/06 19:42:38 cph Exp $ +# $Id: Makefile.in,v 1.41 2007/06/08 06:03:32 cph Exp $ # # Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, # 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, @@ -61,20 +61,23 @@ mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs # **** END BOILERPLATE **** -SUBDIRS_1 = cref sf star-parser -SUBDIRS_2 = edwin imail sos ssp xml +LIARC_BOOT_BUNDLES = compiler cref sf sos star-parser +LIARC_BUNDLES = $(LIARC_BOOT_BUNDLES) edwin imail ssp xml SUBDIRS = $(INSTALLED_SUBDIRS) 6001 compiler rcs win32 xdoc -INSTALLED_SUBDIRS = microcode runtime $(SUBDIRS_1) $(SUBDIRS_2) - -LIARC_BOOT_BUNDLES = $(SUBDIRS_1) compiler -LIARC_INSTALLED_BUNDLES = $(SUBDIRS_1) $(SUBDIRS_2) -LIARC_BUNDLES = $(LIARC_INSTALLED_BUNDLES) compiler +INSTALLED_SUBDIRS = microcode runtime $(LIARC_BUNDLES) AUXDIR = @AUXDIR@ EDETC = $(AUXDIR)/edwin/etc -all: compile-microcode @ALL_TARGET@ build-bands +all: @ALL_TARGET@ + +all-native: compile-microcode + @$(top_srcdir)/etc/compile.sh + $(MAKE) build-bands + +all-liarc: + @echo "Use etc/make-liarc.sh script." compile-microcode: (cd microcode && $(MAKE) all) @@ -82,64 +85,58 @@ compile-microcode: build-bands: @$(top_srcdir)/etc/build-bands.sh -all-native: - @$(top_srcdir)/etc/compile.sh - - -liarc-dist: liarc-stamp distclean - -liarc-stamp: +liarc-dist: @$(top_srcdir)/etc/compile-boot-compiler.sh mit-scheme @$(top_srcdir)/etc/c-prepare.sh mit-scheme - echo "done" > liarc.stamp - -all-liarc: liarc-compile-scheme - $(MAKE) compile-microcode - $(MAKE) compile-liarc-bundles - rm -rf boot-lib + $(MAKE) distclean -liarc-compile-scheme: boot-lib/liarc-compiler.com c-clean - @$(top_srcdir)/etc/c-compile.sh boot-lib/scheme --library boot-lib \ - --band boot-lib/liarc-compiler.com +stamp_install-liarc-microcode: compile-microcode + (cd microcode; $(MAKE) install) + echo "done" > $@ -boot-lib/liarc-compiler.com: boot-lib/scheme compile-liarc-boot-bundles - $(INSTALL_PROGRAM) microcode/liarc-cc boot-lib/. - $(INSTALL_PROGRAM) microcode/liarc-ld boot-lib/. - $(mkinstalldirs) boot-lib/include - $(INSTALL_DATA) microcode/*.h boot-lib/include/. +stamp_compile-liarc-boot-bundles: stamp_install-liarc-microcode @for BN in $(LIARC_BOOT_BUNDLES); do \ - CMD="$(INSTALL_DATA) $${BN}/$${BN}.so boot-lib/lib/.";\ + CMD="(cd $${BN} && $(MAKE) compile-liarc-bundle)";\ echo "$${CMD}"; eval "$${CMD}";\ done - @$(top_srcdir)/etc/build-boot-compiler.sh boot-lib liarc-compiler.com - -boot-lib/scheme: compile-microcode - $(mkinstalldirs) boot-lib boot-lib/lib - $(INSTALL_DATA) $(top_srcdir)/etc/optiondb.scm boot-lib/. - $(INSTALL_PROGRAM) microcode/scheme boot-lib/. - $(INSTALL_PROGRAM) microcode/gen-nonce boot-lib/. - $(INSTALL_DATA) microcode/*.so boot-lib/lib/. - rm -f boot-lib/star-parser; ln -s ../star-parser boot-lib/. - rm -f boot-lib/options; ln -s ../runtime boot-lib/options - -compile-liarc-boot-bundles: + echo "done" > $@ + +stamp_install-liarc-boot-bundles: stamp_compile-liarc-boot-bundles @for BN in $(LIARC_BOOT_BUNDLES); do \ - CMD="(cd $${BN} && $(MAKE) compile-liarc-bundle)";\ + CMD="(cd $${BN} && $(MAKE) install-liarc-bundle)";\ echo "$${CMD}"; eval "$${CMD}";\ done + echo "done" > $@ + +stamp_build-liarc-boot-compiler: stamp_install-liarc-boot-bundles + @$(top_srcdir)/etc/build-boot-compiler.sh + echo "done" > $@ + +stamp_install-liarc-boot-compiler: stamp_build-liarc-boot-compiler + $(MAKE) install-auxdir-top + echo "done" > $@ + +stamp_liarc-compile-scheme: + @$(top_srcdir)/etc/c-compile.sh boot-root/bin/scheme \ + --band boot-compiler.com + echo "done" > $@ -compile-liarc-bundles: +stamp_compile-liarc-bundles: stamp_liarc-compile-scheme compile-microcode @for BN in $(LIARC_BUNDLES); do \ CMD="(cd $${BN} && $(MAKE) compile-liarc-bundle)";\ echo "$${CMD}"; eval "$${CMD}";\ done + echo "done" > $@ -install-liarc-bundles: - @for BN in $(LIARC_INSTALLED_BUNDLES); do \ +install-liarc-bundles: stamp_compile-liarc-bundles + @for BN in $(LIARC_BUNDLES); do \ CMD="(cd $${BN} && $(MAKE) install-liarc-bundle)";\ echo "$${CMD}"; eval "$${CMD}";\ done + + + native-from-liarc: boot-lib/native-compiler.com clean $(MAKE) compile-microcode @$(top_srcdir)/etc/compile.sh boot-lib/scheme --library boot-lib \ @@ -147,7 +144,7 @@ native-from-liarc: boot-lib/native-compiler.com clean rm -rf boot-lib boot-lib/native-compiler.com: boot-lib/scheme native-prepare - @$(top_srcdir)/etc/build-boot-compiler.sh boot-lib native-compiler.com + @$(top_srcdir)/etc/build-boot-compiler.sh native-compiler.com native-prepare: @$(top_srcdir)/etc/compile-boot-compiler.sh mit-scheme-c @@ -164,21 +161,22 @@ tags TAGS: install: install-standard @INSTALL_LIARC_BUNDLES@ -install-standard: +install-standard: install-auxdir-top @for SUBDIR in $(INSTALLED_SUBDIRS); do \ echo "Making $@ in $${SUBDIR}";\ (cd $${SUBDIR}; $(MAKE) install) || exit 1;\ done + $(mkinstalldirs) $(DESTDIR)$(EDETC) + $(INSTALL_DATA) $(top_srcdir)/etc/TUTORIAL $(DESTDIR)$(EDETC)/. + +install-auxdir-top: $(mkinstalldirs) $(DESTDIR)$(AUXDIR) $(INSTALL_DATA) $(top_srcdir)/etc/optiondb.scm $(DESTDIR)$(AUXDIR)/. $(INSTALL_DATA) lib/*.com $(DESTDIR)$(AUXDIR)/. - $(mkinstalldirs) $(DESTDIR)$(EDETC) - $(INSTALL_DATA) $(top_srcdir)/etc/TUTORIAL $(DESTDIR)$(EDETC)/. - .PHONY: all compile-microcode build-bands all-native -.PHONY: liarc-dist all-c liarc-compile-scheme compile-liarc-boot-bundles -.PHONY: compile-liarc-bundles native +.PHONY: liarc-dist install-liarc-bundles +.PHONY: native .PHONY: mostlyclean clean distclean maintainer-clean c-clean -.PHONY: tags TAGS install install-standard +.PHONY: tags TAGS install install-standard install-auxdir-top diff --git a/v7/src/compiler/choose-machine.sh b/v7/src/compiler/choose-machine.sh index e94295964..dcac55f65 100755 --- a/v7/src/compiler/choose-machine.sh +++ b/v7/src/compiler/choose-machine.sh @@ -1,6 +1,6 @@ #!/bin/sh -# $Id: choose-machine.sh,v 1.1 2007/06/06 19:42:38 cph Exp $ +# $Id: choose-machine.sh,v 1.2 2007/06/08 06:03:38 cph Exp $ # # Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, # 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, @@ -60,8 +60,6 @@ no) chosen "${MACHINE}" esac -[ -f ../liarc.stamp ] && chosen C - case `${DIR}/config.guess` in alpha-* | alphaev[56]-* | alphaev56-* | alphapca56-*) chosen alpha diff --git a/v7/src/configure.ac b/v7/src/configure.ac index 721fd973f..d8dea57d7 100644 --- a/v7/src/configure.ac +++ b/v7/src/configure.ac @@ -1,7 +1,7 @@ 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.15 2007/06/06 19:42:38 cph Exp $]) +AC_REVISION([$Id: configure.ac,v 1.16 2007/06/08 06:03:26 cph Exp $]) AC_CONFIG_SRCDIR([microcode/boot.c]) AC_PROG_MAKE_SET @@ -31,11 +31,7 @@ USA. AC_ARG_ENABLE([native-code], AS_HELP_STRING([--enable-native-code], [Support native compiled code if available [[yes]]])) -if test -f liarc.stamp; then - : ${enable_native_code='c'} -else - : ${enable_native_code='yes'} -fi +: ${enable_native_code='yes'} case ${enable_native_code} in c) @@ -91,6 +87,9 @@ if test x${enable_native_code} = xc; then (cd lib; rm -f ${BN}; ${LN_S} ../microcode/${BN} .) BN=liarcc-ld (cd lib; rm -f ${BN}; ${LN_S} ../microcode/${BN} .) + for BN in sos star-parser; do + (cd lib; rm -f ${BN}; ${LN_S} ../${BN} .) + done for BUNDLE in 6001 compiler cref edwin imail sf sos ssp star-parser xdoc xml; do SO=${BUNDLE}.so (cd lib/lib; rm -f ${SO}; ${LN_S} ../../${BUNDLE}/${SO} .) diff --git a/v7/src/etc/build-boot-compiler.sh b/v7/src/etc/build-boot-compiler.sh index 93da9d330..5a2604324 100755 --- a/v7/src/etc/build-boot-compiler.sh +++ b/v7/src/etc/build-boot-compiler.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# $Id: build-boot-compiler.sh,v 1.1 2007/06/06 19:42:39 cph Exp $ +# $Id: build-boot-compiler.sh,v 1.2 2007/06/08 06:03:44 cph Exp $ # # Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, # 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, @@ -25,14 +25,6 @@ set -e -if [ ${#} -eq 2 ]; then - LIB=${1} - BAND=${2} -else - echo "usage: ${0} " - exit 1 -fi - cd runtime if [ -f make.o ]; then @@ -44,12 +36,12 @@ else exit 1 fi -CMD="../microcode/scheme --library ../${LIB} --fasl ${FASL} --heap 6000" +CMD="../microcode/scheme --library ../lib --fasl ${FASL} --heap 6000" echo "${CMD}" eval "${CMD}" <