From: Chris Hanson Date: Wed, 17 Oct 2018 02:28:14 +0000 (-0700) Subject: Split handling of compiler target from host architecture. X-Git-Tag: mit-scheme-pucked-10.1.2~16^2~212 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=7d2397c9308249838f1ecbb77a7ba6465388a313;p=mit-scheme.git Split handling of compiler target from host architecture. --- diff --git a/src/configure.ac b/src/configure.ac index c7169c951..847977204 100644 --- a/src/configure.ac +++ b/src/configure.ac @@ -45,6 +45,11 @@ AC_ARG_ENABLE([native-code], [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]]])) @@ -58,7 +63,7 @@ AC_ARG_ENABLE([cross-compiling], 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=\# @@ -98,6 +103,33 @@ svm1) 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} @@ -168,7 +200,7 @@ fi # 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 @@ -187,10 +219,10 @@ AC_SUBST([HOST_COMPILER_HEAP]) 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]) diff --git a/src/microcode/aclocal.m4 b/src/microcode/aclocal.m4 index 0d43d87f8..4113994d8 100644 --- a/src/microcode/aclocal.m4 +++ b/src/microcode/aclocal.m4 @@ -1,11 +1,14 @@ # 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__], @@ -16,9 +19,8 @@ yes|YES|y|Y) ;; 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 @@ -27,27 +29,12 @@ yes|YES|y|Y) 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 @@ -66,3 +53,34 @@ svm1) ;; 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 +])