Fix various minor problems introduced in the configure scripts.
authorTaylor R Campbell <campbell@mumble.net>
Fri, 6 Nov 2009 21:01:58 +0000 (16:01 -0500)
committerTaylor R Campbell <campbell@mumble.net>
Fri, 6 Nov 2009 21:01:58 +0000 (16:01 -0500)
Also kludge up a fix to etc/run-three-stages.

etc/run-three-stages
src/Makefile.in
src/Setup.sh
src/configure.ac

index 3f7659e73bdda305c9ad9c5a2587389f913064df..34054ce4c4234818dbf37e044ca8400df2ac80e7 100755 (executable)
@@ -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
index ffd25c5d13cc04462543bc62a8734acc1878201d..f6181160e0756f07ae52e7c5591bed3f41c2f4ca 100644 (file)
@@ -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" > $@
 
index 3d59e71a57fae1d3a80fe507d8092d69df6fce2b..3f4fc8606e7159b07511657aeb7989dfe02ef283 100755 (executable)
@@ -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
index 72db5e554c9f1c52c67129a08dff740d7501ead0..f0077dd86b9d08c497b3dea5c346fe7ccdacfc01 100644 (file)
@@ -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])