From 3c13b7eddfde1f547bc72ca4cf16b7554a92a43e Mon Sep 17 00:00:00 2001 From: Taylor R Campbell Date: Sat, 5 Oct 2013 19:59:04 +0000 Subject: [PATCH] Make cross-compilation a configure-time option. 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 | 8 +++++--- src/configure.ac | 11 +++++++++++ 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/Makefile.in b/src/Makefile.in index afbb7177a..65ed9129c 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -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 "../$@")' \ diff --git a/src/configure.ac b/src/configure.ac index 33403dd1b..41aa4f345 100644 --- a/src/configure.ac +++ b/src/configure.ac @@ -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 -- 2.25.1