Implement MIT_SCHEME_COMPILER_TARGET for TL and microcode configuration.
authorChris Hanson <org/chris-hanson/cph>
Sat, 20 Oct 2018 03:21:29 +0000 (20:21 -0700)
committerChris Hanson <org/chris-hanson/cph>
Sat, 20 Oct 2018 03:21:29 +0000 (20:21 -0700)
src/configure.ac
src/microcode/aclocal.m4
src/microcode/configure.ac

index 2022e288884c23ce80f88d1113c1fec63d5f278f..977530f590f5d3ed712a3ce696ab222e3e329545 100644 (file)
@@ -89,56 +89,30 @@ AC_ARG_WITH([scheme-build],
 
 AC_CANONICAL_HOST
 
-MIT_SCHEME_NATIVE_CODE([${enable_native_code}],[${host_cpu}])
+ALL_TARGET=all-native
+INSTALL_COM='$(INSTALL_DATA)'
+INSTALL_LIARC_BUNDLES=
 IF_LIARC='#!LIARC: '
 IF_SVM='#!SVM: '
+
+MIT_SCHEME_NATIVE_CODE([${enable_native_code}],[${host_cpu}])
 case ${mit_scheme_native_code} in
 c)
-    ALL_TARGET=all-liarc
     INSTALL_COM=:
     INSTALL_LIARC_BUNDLES=install-liarc-bundles
     IF_LIARC=
     ;;
 svm1)
-    ALL_TARGET=all-native
-    INSTALL_COM='$(INSTALL_DATA)'
-    INSTALL_LIARC_BUNDLES=
     IF_SVM=
     ;;
-*)
-    ALL_TARGET=all-native
-    INSTALL_COM='$(INSTALL_DATA)'
-    INSTALL_LIARC_BUNDLES=
-    ;;
 esac
 
-AC_MSG_CHECKING([for compiler target])
-IF_SVM_COMPILER='#!SVM compiler: '
-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])
+MIT_SCHEME_COMPILER_TARGET([${with_compiler_target}])
+if test x"${mit_scheme_compiler_target}" = xsvm1; then
     IF_SVM_COMPILER=
-    ;;
-*)
-    AC_MSG_RESULT([yes, for ${mit_scheme_compiler_target}])
-    ;;
-esac
+else
+    IF_SVM_COMPILER='#!SVM compiler: '
+fi
 
 AUXDIR_NAME=mit-scheme-${mit_scheme_native_code}
 AUXDIR='$(libdir)'/${AUXDIR_NAME}
@@ -173,6 +147,8 @@ if test x"${with_scheme_build}" != xdefault; then
     else
         AC_MSG_ERROR([no, unable to use ${MIT_SCHEME_EXE}])
     fi
+    # To get some version numbers into the build log:
+    ${MIT_SCHEME_EXE} --version
 else
     AC_MSG_CHECKING([for an existing MIT/GNU Scheme installation])
     # Kinda hairy logic to detect this: (1) Use MIT_SCHEME_EXE, and
@@ -278,14 +254,18 @@ xml/Makefile
 ])
 AC_OUTPUT
 
-if test x"${mit_scheme_native_code}" = xc; then
+if test x"${mit_scheme_compiler_target}" = xc; then
     BN=liarc-cc
     (cd lib; rm -f ${BN}; ${LN_S} ../microcode/${BN} .)
     BN=liarc-ld
     (cd lib; rm -f ${BN}; ${LN_S} ../microcode/${BN} .)
+fi
+
+if test x"${mit_scheme_native_code}" = xc; then
     for BN in star-parser; do
         (cd lib; rm -f ${BN}; ${LN_S} ../${BN} .)
     done
+    mkdir lib/lib
     for BUNDLE in 6001 compiler cref ffi sf sos ssp star-parser \
                  xdoc xml; do
        SO=${BUNDLE}.so
index 4113994d83db29912e72734c4f65750ec0595040..990eacd72a97b358265e57e41f1b18ae73fc7cd7 100644 (file)
@@ -54,6 +54,38 @@ svm1)
 esac
 ])
 
+# MIT_SCHEME_COMPILER_TARGET(SPEC)
+# --------------------------------
+AC_DEFUN([MIT_SCHEME_COMPILER_TARGET],[
+_mit_scheme_compiler_target_spec=$1
+
+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
+])
 
 # MIT_SCHEME_ARCHITECTURE(SPEC)
 # -----------------------------
index 738e0847618b306a58f889b15f9c73aa29b11cb6..337c9ea963bf53d48cd7fcaa2c0bddf2d7853296 100644 (file)
@@ -130,6 +130,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_WITH([termcap],
     AS_HELP_STRING([--with-termcap],
        [Use a termcap library if available [[yes]]]))
@@ -235,6 +240,7 @@ fi
 CCLD=${CC}
 
 MIT_SCHEME_NATIVE_CODE([${enable_native_code}],[${host_cpu}])
+MIT_SCHEME_COMPILER_TARGET([${with_compiler_target}])
 
 AUXDIR_NAME=mit-scheme-${mit_scheme_native_code}
 EXE_NAME=mit-scheme-${mit_scheme_native_code}
@@ -819,8 +825,6 @@ none)
     ;;
 c)
     AC_CONFIG_LINKS([cmpauxmd.c:cmpauxmd/c.c])
-    AC_CONFIG_FILES([liarc-cc], [chmod +x liarc-cc])
-    AC_CONFIG_FILES([liarc-ld], [chmod +x liarc-ld])
     OPTIONAL_BASES="${OPTIONAL_BASES} cmpauxmd unstackify compinit"
     LIARC_VARS=liarc-vars
     LIARC_RULES=liarc-rules
@@ -841,6 +845,11 @@ svm1)
     ;;
 esac
 
+if test x"${mit_scheme_compiler_target}" = xc; then
+    AC_CONFIG_FILES([liarc-cc], [chmod +x liarc-cc])
+    AC_CONFIG_FILES([liarc-ld], [chmod +x liarc-ld])
+fi
+
 AC_CONFIG_LINKS([
     cmpintmd.h:cmpintmd/${mit_scheme_native_code}.h
     cmpintmd.c:cmpintmd/${mit_scheme_native_code}.c