From 50bda90e32d093a742bfd694a7f09bf38693ea41 Mon Sep 17 00:00:00 2001 From: Taylor R Campbell Date: Fri, 6 Nov 2009 16:01:58 -0500 Subject: [PATCH] Fix various minor problems introduced in the configure scripts. Also kludge up a fix to etc/run-three-stages. --- etc/run-three-stages | 19 ++++++++++++++++++- src/Makefile.in | 3 ++- src/Setup.sh | 4 +++- src/configure.ac | 8 +++++--- 4 files changed, 28 insertions(+), 6 deletions(-) diff --git a/etc/run-three-stages b/etc/run-three-stages index 3f7659e73..34054ce4c 100755 --- a/etc/run-three-stages +++ b/etc/run-three-stages @@ -41,6 +41,22 @@ if ! [[ -d .git && -d src && -d etc ]]; then exit 1 fi +choose_arch () +{ + sh src/microcode/choose-arch.sh "${@}" +} + +host_cpu="$(sh src/config.guess | awk -F- '{ print $1 }')" + +if [ $# -eq 1 ]; then + enable_native_code="${1}" +else + enable_native_code=yes +fi + +printf 'Enabling native code: %s\n' "${enable_native_code}" +SCM_ARCH="$(choose_arch "${enable_native_code}" "${host_cpu}")" + # Hack for cph if which cpx > /dev/null; then : ${COPY:="cpx -sq"} @@ -102,7 +118,8 @@ find_build_stage () find_dist_stage () { local STAGE=$(pwd)/${1} - if [[ -x ${STAGE}/bin/scheme && -f ${STAGE}/lib/mit-scheme/all.com ]]; then + if [[ -x ${STAGE}/bin/mit-scheme-${SCM_ARCH} \ + && -f ${STAGE}/lib/mit-scheme-${SCM_ARCH}/all.com ]]; then echo "${STAGE}/bin/scheme --library ${STAGE}/lib/mit-scheme" return 0 else diff --git a/src/Makefile.in b/src/Makefile.in index ffd25c5d1..f6181160e 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -67,6 +67,7 @@ SUBDIRS = $(INSTALLED_SUBDIRS) 6001 compiler rcs win32 xdoc INSTALLED_SUBDIRS = microcode runtime $(LIARC_BUNDLES) MIT_SCHEME_EXE = @MIT_SCHEME_EXE@ +EXE_NAME = @EXE_NAME@ AUXDIR_NAME = @AUXDIR_NAME@ AUXDIR = @AUXDIR@ EDDIR = $(AUXDIR)/edwin @@ -141,7 +142,7 @@ stamp_install-native-boot-compiler: stamp_build-native-boot-compiler echo "done" > $@ stamp_native-compile-scheme: compile-microcode - @$(top_srcdir)/etc/compile.sh boot-root/bin/$(MIT_SCHEME_EXE) \ + @$(top_srcdir)/etc/compile.sh boot-root/bin/$(EXE_NAME) \ --library boot-root/lib/$(AUXDIR_NAME) --band boot-compiler.com echo "done" > $@ diff --git a/src/Setup.sh b/src/Setup.sh index 3d59e71a5..3f4fc8606 100755 --- a/src/Setup.sh +++ b/src/Setup.sh @@ -39,7 +39,9 @@ an unusual name, set the environment variable MIT_SCHEME_EXE to the name or pathname of the MIT/GNU Scheme executable, which is usually \`mit-scheme' or \`/usr/local/bin/mit-scheme', and set the environment variable MITSCHEME_LIBRARY_PATH to the pathname of the MIT/GNU Scheme -library directory, which is usually \`/usr/local/lib/mit-scheme'. +library directory, which is usually \`/usr/local/lib/mit-scheme-ARCH', +where ARCH is the compiled code architecture, such as \`c', \`i386', +etc. EOF exit 1 fi diff --git a/src/configure.ac b/src/configure.ac index 72db5e554..f0077dd86 100644 --- a/src/configure.ac +++ b/src/configure.ac @@ -69,16 +69,17 @@ c) INSTALL_LIARC_BUNDLES= ;; esac +EXE_NAME=mit-scheme-${SCM_ARCH} AUXDIR_NAME=mit-scheme-${SCM_ARCH} AUXDIR='$(libdir)'/${AUXDIR_NAME} : ${MIT_SCHEME_EXE:=mit-scheme-${SCM_ARCH}} if test x"${enable_host_scheme_test}" = xyes; then AC_MSG_CHECKING([for an existing MIT/GNU Scheme installation]) - if "${MIT_SCHEME_EXE}" --batch-mode --eval '(%exit)' >/dev/null 2>&1; then + if ${MIT_SCHEME_EXE} --batch-mode --eval '(%exit)' >/dev/null 2>&1; then : elif mit-scheme-native --batch-mode --eval '(%exit)' >/dev/null 2>&1; then - MIT_SCHEME_EXE=mit-scheme + MIT_SCHEME_EXE=mit-scheme-native else AC_MSG_ERROR([ This script needs an existing MIT/GNU Scheme installation to function. @@ -88,7 +89,7 @@ an unusual name, set the environment variable MIT_SCHEME_EXE to the name or pathname of the MIT/GNU Scheme executable, which is usually \`mit-scheme' or \`/usr/local/bin/mit-scheme', and set the environment variable MITSCHEME_LIBRARY_PATH to the pathname of the MIT/GNU Scheme -library directory, which is usually \`/usr/local/lib/mit-scheme'. +library directory, which is usually \`/usr/local/lib/mit-scheme-${SCM_ARCH}'. ]) fi AC_MSG_RESULT([yes]) @@ -98,6 +99,7 @@ AC_SUBST([ALL_TARGET]) AC_SUBST([INSTALL_COM]) AC_SUBST([INSTALL_LIARC_BUNDLES]) AC_SUBST([MIT_SCHEME_EXE]) +AC_SUBST([EXE_NAME]) AC_SUBST([AUXDIR_NAME]) AC_SUBST([AUXDIR]) -- 2.25.1