From 46349cae9e70bdb9c36b02fea16fe4bf4cb8097a Mon Sep 17 00:00:00 2001 From: Taylor R Campbell Date: Thu, 3 Nov 2016 20:17:32 +0000 Subject: [PATCH] Add option for interpreted toolchain to facilitate debugging. --- src/Makefile.tools.in | 28 +++++++++++++++++++++------- src/configure.ac | 14 ++++++++++++++ 2 files changed, 35 insertions(+), 7 deletions(-) diff --git a/src/Makefile.tools.in b/src/Makefile.tools.in index fce74d2db..d8d167daf 100644 --- a/src/Makefile.tools.in +++ b/src/Makefile.tools.in @@ -119,10 +119,10 @@ restore: (cd tools/saved-objects && pax -rw -pe -v . ../../.) tools/compiler.com: tools/syntaxer.com -tools/compiler.com: compile-cross-compiler -tools/compiler.com: compile-cross-cref -tools/compiler.com: compile-cross-sf -tools/compiler.com: compile-kludgerous-star-parser +tools/compiler.com: cross-compiler +tools/compiler.com: cross-cref +tools/compiler.com: cross-sf +tools/compiler.com: kludgerous-star-parser (echo '(begin' && \ echo ' (with-working-directory-pathname "cref"' && \ echo ' (lambda () (load "make")))' && \ @@ -135,9 +135,9 @@ tools/compiler.com: compile-kludgerous-star-parser echo ' (disk-save "$@"))') \ | $(HOST_RUNTIME) -tools/syntaxer.com: compile-cross-cref -tools/syntaxer.com: compile-cross-sf -tools/syntaxer.com: compile-kludgerous-star-parser +tools/syntaxer.com: cross-cref +tools/syntaxer.com: cross-sf +tools/syntaxer.com: kludgerous-star-parser (echo '(begin' && \ echo ' (with-working-directory-pathname "cref"' && \ echo ' (lambda () (load "make")))' && \ @@ -150,6 +150,10 @@ tools/syntaxer.com: compile-kludgerous-star-parser # Compiler (LIAR) +.PHONY: cross-compiler +@IF_DEBUG_TOOLCHAIN@cross-compiler: syntax-cross-compiler +@IF_NOT_DEBUG_TOOLCHAIN@cross-compiler: compile-cross-compiler + .PHONY: compile-cross-compiler compile-cross-compiler: compile-cross-compiler-back compile-cross-compiler: compile-cross-compiler-base @@ -218,6 +222,10 @@ cref-cross-compiler: cref-kludgerous-runtime # CREF +.PHONY: cross-cref +@IF_DEBUG_TOOLCHAIN@cross-cref: syntax-cross-cref +@IF_NOT_DEBUG_TOOLCHAIN@cross-cref: compile-cross-cref + .PHONY: compile-cross-cref compile-cross-cref: syntax-cross-cref (echo '(with-working-directory-pathname "cref"' && \ @@ -239,6 +247,10 @@ cref-cross-cref: cref-kludgerous-runtime # SF +.PHONY: cross-sf +@IF_DEBUG_TOOLCHAIN@cross-sf: syntax-cross-sf +@IF_NOT_DEBUG_TOOLCHAIN@cross-sf: compile-cross-sf + .PHONY: compile-cross-sf compile-cross-sf: syntax-cross-sf (echo '(with-working-directory-pathname "sf"' && \ @@ -263,6 +275,8 @@ cref-cross-sf: cref-kludgerous-runtime # XXX This is a kludge that should be abolished. The compiler should # be able to load and run macros for the target even if we are cross- # compiling, but currently that's not doable. +.PHONY: kludgerous-star-parser +kludgerous-star-parser: compile-kludgerous-star-parser .PHONY: compile-kludgerous-star-parser compile-kludgerous-star-parser: cref-kludgerous-runtime (echo '(with-working-directory-pathname "star-parser"' && \ diff --git a/src/configure.ac b/src/configure.ac index e15b195d7..2072a6fb2 100644 --- a/src/configure.ac +++ b/src/configure.ac @@ -64,6 +64,18 @@ else IF_CROSS=\# fi +AC_ARG_ENABLE([debug-toolchain], + AS_HELP_STRING([--enable-debug-toolchain], + [Use slow interpreted cross-compiler toolchain])) +: ${enable_debug_toolchain=no} +if test "x$enable_debug_toolchain" = xyes; then + IF_DEBUG_TOOLCHAIN= + IF_NOT_DEBUG_TOOLCHAIN=\# +else + IF_DEBUG_TOOLCHAIN=\# + IF_NOT_DEBUG_TOOLCHAIN= +fi + AC_ARG_WITH([default-target], AS_HELP_STRING([--with-default-target], [Set the default make target [[all]]])) @@ -173,7 +185,9 @@ AC_SUBST([MIT_SCHEME_EXE]) AC_SUBST([AUXDIR_NAME]) AC_SUBST([AUXDIR]) AC_SUBST([IF_CROSS]) +AC_SUBST([IF_DEBUG_TOOLCHAIN]) AC_SUBST([IF_LIARC]) +AC_SUBST([IF_NOT_DEBUG_TOOLCHAIN]) AC_SUBST([IF_SVM]) AC_PROG_INSTALL -- 2.25.1