ifneq "$(findstring $(stage), 2 3)" ""
bootstrapped = YES
else
-bootstrapped = $(shell if (test $(GhcCanonVersion) -ge $(ProjectVersionInt) -a $(GhcPatchLevel) -ge $(ProjectPatchLevel)); then echo YES; else echo NO; fi)
+bootstrapped = $(shell if (test $(GhcCanonVersion) -eq $(ProjectVersionInt) -a $(GhcPatchLevel) -eq $(ProjectPatchLevel)); then echo YES; else echo NO; fi)
endif
endif
SRC_HC_OPTS += -DGHCI -package template-haskell
PKG_DEPENDS += template-haskell
+# Use threaded RTS with GHCi, so threads don't get blocked at the prompt.
+SRC_HC_OPTS += -threaded
+
ALL_DIRS += ghci
# If we are going to use dynamic libraries instead of .o files for ghci,
utils/Binary_HC_OPTS = -funbox-strict-fields
endif
-# BinIface and Binary take ages to both compile and run if you don's use -O
+# We always optimise some low-level modules, otherwise performance of
+# a non-optimised compiler is severely affected.
main/BinIface_HC_OPTS += -O
utils/Binary_HC_OPTS += -O
utils/FastMutInt_HC_OPTS += -O
-
+utils/Encoding_HC_OPTS += -O
+utils/StringBuffer_HC_OPTS += -O
+utils/FastString_HC_OPTS += -O
# ---- Profiling ----
#simplCore/Simplify_HC_OPTS = -auto-all
# typecheck/TcUnify_HC_OPTS += -auto-all
coreSyn/CorePrep_HC_OPTS += -auto-all
+# parser/Parser_HC_OPTS += -fasm
#-----------------------------------------------------------------------------
# Building the GHC package
PKG_DEPENDS += base haskell98
PACKAGE_CPP_OPTS += -DPKG_DEPENDS='$(PKG_DEPENDS)'
+# Omit Main from the library, the client will want to plug their own Main in
+LIBOBJS = $(filter-out $(odir)/main/Main.o, $(OBJS))
+
# disable splitting: it won't really help with GHC, and the specialised
# build system for ghc/compiler isn't set up to handle it.
SplitObjs = NO
$(MKDEPENDHS) -M -optdep-f -optdep.depend-BASE $(foreach way,$(WAYS),-optdep-s -optdep$(way)) $(foreach obj,$(MKDEPENDHS_OBJ_SUFFICES),-osuf $(obj)) $(MKDEPENDHS_OPTS) $(filter-out -split-objs, $(MKDEPENDHS_HC_OPTS)) $(HS_SRCS)
endif
$(MKDEPENDC) -f .depend-BASE $(MKDEPENDC_OPTS) $(foreach way,$(WAYS),-s $(way)) -- $(CC_OPTS) -- $(C_SRCS)
- $(PERL) -pe 'binmode(stdin); binmode(stdout); s@^(\S*\.o)@stage$(stage)/$$1@g; s@(\S*\.hi)@stage$(stage)/$$1@g; s@^.*/lib/compat.*$@@g;' <.depend-BASE >.depend-$(stage)
+ $(PERL) -pe 'binmode(stdin); binmode(stdout); s@^(\S*\.o)@stage$(stage)/$$1@g; s@(\S*\.hi)@stage$(stage)/$$1@g; s@^.*/lib/compat.*$$@@g;' <.depend-BASE >.depend-$(stage)
# The binmode stuff tells perl not to add stupid ^M's to the output
#
# The /lib/compat replacement is to workaround a bug in the