[Support native compiled code if available [[yes]]]))
: ${enable_native_code=yes}
+AC_ARG_WITH([compiler-target],
+ AS_HELP_STRING([--with-compiler-target],
+ [Compiler target architecture [[same as native code]]]))
+: ${with_compiler_target=yes}
+
AC_ARG_ENABLE([host-scheme-test],
AS_HELP_STRING([--enable-host-scheme-test],
[Test for working scheme on build host [[if necessary]]]))
AS_HELP_STRING([--enable-cross-compiling],
[Cross-compile scheme, even if to the same target]))
: ${enable_cross_compiling=no}
-if test "x$enable_cross_compiling" = xyes; then
+if test "x${enable_cross_compiling}" = xyes; then
IF_CROSS=
else
IF_CROSS=\#
INSTALL_LIARC_BUNDLES=
;;
esac
+
+AC_MSG_CHECKING([for compiler target])
+MIT_SCHEME_ARCHITECTURE([${with_compiler_target}])
+case ${mit_scheme_architecture} in
+yes)
+ mit_scheme_compiler_target=${mit_scheme_native_code}
+ ;;
+*)
+ mit_scheme_compiler_target=${mit_scheme_architecture}
+ ;;
+esac
+
+case ${mit_scheme_compiler_target} in
+none)
+ AC_MSG_RESULT([none])
+ ;;
+c)
+ AC_MSG_RESULT([yes, using portable C code])
+ ;;
+svm1)
+ AC_MSG_RESULT([yes, using portable SVM code])
+ ;;
+*)
+ AC_MSG_RESULT([yes, for ${mit_scheme_compiler_target}])
+ ;;
+esac
+
AUXDIR_NAME=mit-scheme-${mit_scheme_native_code}
AUXDIR='$(libdir)'/${AUXDIR_NAME}
# A 32bit host running LIAR/svm needs a large heap.
small_words='(= 4 (vector-ref (gc-space-status) 0))'
if test x"${mit_scheme_native_code}" = xsvm1 \
- && ${MIT_SCHEME_EXE} --eval "(%exit (if ${small_words} 0 1))"; then \
+ && ${MIT_SCHEME_EXE} --eval "(%exit (if ${small_words} 0 1))" >/dev/null; then \
HOST_COMPILER_HEAP="--heap 10000"
fi
AC_PROG_INSTALL
AC_PROG_LN_S
-echo etc/create-makefiles.sh "${MIT_SCHEME_EXE}" "${mit_scheme_native_code}"
-etc/create-makefiles.sh "${MIT_SCHEME_EXE}" "${mit_scheme_native_code}" \
+echo etc/create-makefiles.sh "${MIT_SCHEME_EXE}" "${mit_scheme_compiler_target}"
+etc/create-makefiles.sh "${MIT_SCHEME_EXE}" "${mit_scheme_compiler_target}" \
|| exit $?
-compiler/configure "${mit_scheme_native_code}" || exit $?
+compiler/configure "${mit_scheme_compiler_target}" || exit $?
AC_CONFIG_SUBDIRS([microcode])
# MIT_SCHEME_NATIVE_CODE(SPEC, HOST_CPU)
-# ----------------------
+# --------------------------------------
AC_DEFUN([MIT_SCHEME_NATIVE_CODE],[
_mit_scheme_native_code_spec=$1
_mit_scheme_native_code_host_cpu=$2
-case ${_mit_scheme_native_code_spec} in
-yes|YES|y|Y)
+AC_MSG_CHECKING([for native-code support])
+MIT_SCHEME_ARCHITECTURE([${_mit_scheme_native_code_spec}])
+
+case ${mit_scheme_architecture} in
+yes)
case ${_mit_scheme_native_code_host_cpu} in
i?86)
AC_CHECK_DECL([__x86_64__],
;;
esac
-AC_MSG_CHECKING([for native-code support])
-case ${_mit_scheme_native_code_spec} in
-yes|YES|y|Y)
+case ${mit_scheme_architecture} in
+yes)
case ${_mit_scheme_native_code_host_cpu} in
i386)
mit_scheme_native_code=i386
mit_scheme_native_code=x86-64
;;
*)
- AC_MSG_ERROR([unable to determine native-code type])
+ AC_MSG_ERROR([unable to determine host architecture])
;;
esac
;;
-c|C)
- mit_scheme_native_code=c
- ;;
-svm|svm1)
- mit_scheme_native_code=svm1
- ;;
-no|NO|none|NONE|n|N)
- mit_scheme_native_code=none
- ;;
-i?86|x86)
- mit_scheme_native_code=i386
- ;;
-x86-64|x86_64|amd64)
- mit_scheme_native_code=x86-64
- ;;
*)
- AC_MSG_ERROR([unknown native-code type: ${_mit_scheme_native_code_spec}])
+ mit_scheme_native_code=${mit_scheme_architecture}
;;
esac
;;
esac
])
+
+
+# MIT_SCHEME_ARCHITECTURE(SPEC)
+# -----------------------------
+AC_DEFUN([MIT_SCHEME_ARCHITECTURE],[
+_mit_scheme_architecture_spec=$1
+
+case ${_mit_scheme_architecture_spec} in
+yes|YES|y|Y)
+ mit_scheme_architecture=yes
+ ;;
+c|C)
+ mit_scheme_architecture=c
+ ;;
+svm|svm1)
+ mit_scheme_architecture=svm1
+ ;;
+no|NO|none|NONE|n|N)
+ mit_scheme_architecture=none
+ ;;
+i?86|x86)
+ mit_scheme_architecture=i386
+ ;;
+x86-64|x86_64|amd64)
+ mit_scheme_architecture=x86-64
+ ;;
+*)
+ AC_MSG_ERROR([unknown compiler architecture: ${_mit_scheme_architecture_spec}])
+ ;;
+esac
+])