From: Chris Hanson Date: Fri, 15 Jun 2007 03:40:21 +0000 (+0000) Subject: Create more flexible set of command functions in "etc/functions.sh", X-Git-Tag: 20090517-FFI~528 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=2e2c78270e13a2330911a0ec05de5eae45d06652;p=mit-scheme.git Create more flexible set of command functions in "etc/functions.sh", and change the shell files to use them. --- diff --git a/v7/src/etc/build-bands.sh b/v7/src/etc/build-bands.sh index c9bcfbf44..a6d0aa840 100755 --- a/v7/src/etc/build-bands.sh +++ b/v7/src/etc/build-bands.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# $Id: build-bands.sh,v 1.12 2007/06/06 19:42:39 cph Exp $ +# $Id: build-bands.sh,v 1.13 2007/06/15 03:40:10 cph Exp $ # # Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, # 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, @@ -25,31 +25,15 @@ set -e -( -echo "cd runtime" -cd runtime +. etc/functions.sh -if [ -f make.o ]; then - FASL=http://www.gnu.org/software/mit-scheme/lib/runtime/make.so -elif [ -f make.com ]; then - FASL=make.com -else - echo "Can't find argument for --fasl." - exit 1 -fi +FASL=`get_fasl_file` -CMD="../microcode/scheme --library ../lib --fasl ${FASL}" -echo "${CMD}" -eval "${CMD}" <" exit 1 fi -CMD="${EXE} --heap 6000 --stack 200" -echo "${CMD}" -${CMD} <" exit 1 fi -CMD="${EXE} --heap 6000" -echo "${CMD}" -${CMD} <&2 + return 1 + fi } maybe_mkdir () { if [ ! -e "${1}" ]; then - run_setup_cmd "mkdir ${1}" + run_cmd mkdir "${1}" fi } maybe_link () { if [ ! -e "${1}" ] && [ ! -L "${1}" ]; then - run_setup_cmd "ln -s ${2} ${1}" + run_cmd ln -s "${2}" "${1}" fi } maybe_unlink () { if maybe_unlink_p "${1}" "${2}"; then - run_setup_cmd "rm ${1}" + run_cmd rm "${1}" fi } @@ -63,21 +94,21 @@ maybe_unlink_p () maybe_rm () { - FNS= + FILES= DIRS= for FN in "${@}"; do if [ ! -L "${FN}" ]; then if [ -f "${FN}" ]; then - FNS="${FNS} ${FN}" + FILES="${FILES} ${FN}" elif [ -d "${FN}" ]; then DIRS="${DIRS} ${FN}" fi fi done - if [ "${FNS}" ]; then - run_setup_cmd "rm -f ${FNS}" + if [ "${FILES}" ]; then + run_cmd rm -f ${FILES} fi if [ "${DIRS}" ]; then - run_setup_cmd "rm -rf ${DIRS}" + run_cmd rm -rf ${DIRS} fi } diff --git a/v7/src/etc/install-bin-symlinks.sh b/v7/src/etc/install-bin-symlinks.sh index 437f45e30..9c44632d5 100755 --- a/v7/src/etc/install-bin-symlinks.sh +++ b/v7/src/etc/install-bin-symlinks.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# $Id: install-bin-symlinks.sh,v 1.1 2007/05/02 13:51:50 cph Exp $ +# $Id: install-bin-symlinks.sh,v 1.2 2007/06/15 03:40:18 cph Exp $ # # Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, # 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, @@ -27,6 +27,8 @@ set -e +. `dirname "${0}"`/functions.sh + if [ ${#} -eq 2 ]; then DIR=${1} EXE=${2} @@ -36,15 +38,10 @@ else fi if [ "${EXE}" != mit-scheme ] && [ ! -e "${DIR}/mit-scheme" ]; then - echo "rm -f ${DIR}/mit-scheme" - rm -f "${DIR}/mit-scheme" - echo "ln -s ${EXE} ${DIR}/mit-scheme" - ln -s "${EXE}" "${DIR}/mit-scheme" + run_cmd rm -f "${DIR}"/mit-scheme + run_cmd ln -s "${EXE}" "${DIR}"/mit-scheme fi -echo "rm -f ${DIR}/scheme ${DIR}/bchscheme" -rm -f "${DIR}/scheme" "${DIR}/bchscheme" -echo "ln -s mit-scheme ${DIR}/scheme" -ln -s mit-scheme "${DIR}/scheme" -echo "ln -s mit-scheme ${DIR}/bchscheme" -ln -s mit-scheme "${DIR}/bchscheme" +run_cmd rm -f "${DIR}"/scheme "${DIR}"/bchscheme +run_cmd ln -s mit-scheme "${DIR}"/scheme +run_cmd ln -s mit-scheme "${DIR}"/bchscheme diff --git a/v7/src/etc/make-liarc-dist.sh b/v7/src/etc/make-liarc-dist.sh index ff959b4c0..140733505 100755 --- a/v7/src/etc/make-liarc-dist.sh +++ b/v7/src/etc/make-liarc-dist.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# $Id: make-liarc-dist.sh,v 1.1 2007/06/10 18:29:55 cph Exp $ +# $Id: make-liarc-dist.sh,v 1.2 2007/06/15 03:40:19 cph Exp $ # # Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, # 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, @@ -25,6 +25,8 @@ set -e -./Setup.sh -./configure --enable-native-code=c "${@}" -make liarc-dist +. etc/functions.sh + +run_cmd ./Setup.sh +run_configure --enable-native-code=c "${@}" +run_make liarc-dist diff --git a/v7/src/etc/make-liarc.sh b/v7/src/etc/make-liarc.sh index 3b8018880..0d38979b6 100755 --- a/v7/src/etc/make-liarc.sh +++ b/v7/src/etc/make-liarc.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# $Id: make-liarc.sh,v 1.1 2007/06/08 06:03:57 cph Exp $ +# $Id: make-liarc.sh,v 1.2 2007/06/15 03:40:20 cph Exp $ # # Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, # 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, @@ -25,6 +25,8 @@ set -e +. etc/functions.sh + FASTP=no for ARG in "${@}"; do case ${ARG} in @@ -38,10 +40,10 @@ if [ ${FASTP} = yes ]; then exec ./configure "${@}" fi -./configure --prefix=`pwd`/boot-root --enable-native-code=c -make stamp_install-liarc-boot-compiler -make c-clean distclean +run_configure --prefix=`pwd`/boot-root --enable-native-code=c +run_make stamp_install-liarc-boot-compiler +run_make c-clean distclean -./configure --enable-native-code=c "${@}" -make stamp_compile-liarc-bundles -make build-bands +run_configure --enable-native-code=c "${@}" +run_make stamp_compile-liarc-bundles +run_make build-bands diff --git a/v7/src/etc/native-prepare.sh b/v7/src/etc/native-prepare.sh index 1d5bb61f1..bde3ebbd2 100755 --- a/v7/src/etc/native-prepare.sh +++ b/v7/src/etc/native-prepare.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# $Id: native-prepare.sh,v 1.2 2007/06/09 02:38:06 cph Exp $ +# $Id: native-prepare.sh,v 1.3 2007/06/15 03:40:21 cph Exp $ # # Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, # 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, @@ -25,16 +25,16 @@ set -e +. etc/functions.sh + if [ ${#} -eq 1 ]; then EXE=${1} else echo "usage: ${0} " exit 1 fi -CMD="${EXE} --heap 6000 --stack 200" -echo "${CMD}" -${CMD} <