Make cross-compilation a configure-time option.
authorTaylor R Campbell <campbell@mumble.net>
Sat, 5 Oct 2013 19:59:04 +0000 (19:59 +0000)
committerTaylor R Campbell <campbell@mumble.net>
Sat, 5 Oct 2013 20:26:17 +0000 (20:26 +0000)
Eventually I would like to get rid of non-cross-compilation, but it's
probably a good idea to keep it for now.

src/Makefile.in
src/configure.ac

index afbb7177ae5efc3124bd29a56ceb009360a4cc25..65ed9129c60ce15729ca2e2109fdd477350e5d88 100644 (file)
@@ -94,13 +94,15 @@ all-native: compile-ssp
 all-native: compile-star-parser
 all-native: compile-win32
 all-native: compile-xml
-all-native: cross-end
+@CROSS@all-native: cross-end
+
+@CROSS@COMPILER_SETTINGS = (set! compiler:cross-compiling? true)
 
 HOST_SCHEME = '$(MIT_SCHEME_EXE)' --batch-mode
 BOOTSTRAP_COMPILER = $(BOOTSTRAP_TOOLCHAIN)
 BOOTSTRAP_SYNTAXER = $(HOST_SCHEME) --band ./boot/syntaxer.com
 BOOTSTRAP_TOOLCHAIN = $(HOST_SCHEME) --band ./boot/compiler.com \
-  --eval '(set! compiler:cross-compiling? true)'
+  --eval '(begin $(COMPILER_SETTINGS))'
 
 .PHONY: bootstrap-toolchain
 bootstrap-toolchain: boot/compiler.com
@@ -114,7 +116,7 @@ boot/syntaxer.com:
 microcode/scheme: compile-microcode
 
 lib/runtime.com: compile-runtime
-lib/runtime.com: cross-end
+@CROSS@lib/runtime.com: cross-end
 lib/runtime.com: microcode/scheme
        (. etc/functions.sh && get_fasl_file && cd runtime \
          && (echo '(disk-save "../$@")' \
index 33403dd1b7ed548a9cf99020157a3d632e0906f4..41aa4f345ab477285f858e25266bfe417f99e225 100644 (file)
@@ -54,6 +54,16 @@ else
     : ${enable_host_scheme_test=yes}
 fi
 
+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
+    CROSS=
+else
+    CROSS=\#
+fi
+
 AC_ARG_WITH([default-target],
     AS_HELP_STRING([--with-default-target],
        [Set the default make target [[all]]]))
@@ -156,6 +166,7 @@ AC_SUBST([INSTALL_LIARC_BUNDLES])
 AC_SUBST([MIT_SCHEME_EXE])
 AC_SUBST([AUXDIR_NAME])
 AC_SUBST([AUXDIR])
+AC_SUBST([CROSS])
 
 AC_PROG_INSTALL
 AC_PROG_LN_S