[project @ 2005-04-07 05:27:16 by wolfgang]
[ghc-hetmet.git] / ghc / compiler / Makefile
index 32b29f0..49601a4 100644 (file)
@@ -405,10 +405,20 @@ ifeq "$(GhcWithInterpreter) $(bootstrapped)" "YES YES"
 
 # Yes, include the interepreter, readline, and Template Haskell extensions
 SRC_HC_OPTS += -DGHCI -package template-haskell
-PKG_DEPENDS += template_haskell
+PKG_DEPENDS += template-haskell
 
 ALL_DIRS += ghci
 
+# If we are going to use dynamic libraries instead of .o files for ghci,
+# we will need to always retain CAFs in the compiler.
+# ghci/keepCAFsForGHCi contains a GNU C __attribute__((constructor))
+# function which sets the keepCAFs flag for the RTS before any Haskell
+# code is run.
+ifeq "$(GhcBuildDylibs)" "YES"
+else
+EXCLUDED_SRCS += ghci/keepCAFsForGHCi.c
+endif
+
 # Enable readline if either:
 #   - we're building stage 1 and $(GhcHasReadline)="YES"
 #   - we're building stage 2/3, and we have built the readline package
@@ -757,6 +767,9 @@ SplitObjs = NO
 # set GhcCompilerWays instead.
 GhcLibWays = $(GhcCompilerWays)
 
+# override $(GhcLibHcOpts): we want GhcStage2HcOpts to take precedence
+GhcLibHcOpts =
+
 # override default definition of HS_IFACES so we can add $(odir)
 HS_IFACES   = $(addsuffix .$(way_)hi,$(basename $(HS_OBJS)))
 endif