Manually control more of the Cabal flags for the compiler and ghc packages
[ghc-hetmet.git] / ghc / ghc.mk
index ecce7c8..e6383e1 100644 (file)
 ghc_USES_CABAL = YES
 ghc_PACKAGE = ghc-bin
 
+ghc_stage1_CONFIGURE_OPTS += --flags=stage1
+ghc_stage2_CONFIGURE_OPTS += --flags=stage2
+ghc_stage3_CONFIGURE_OPTS += --flags=stage3
+
+ifeq "$(GhcWithInterpreter)" "YES"
+ghc_stage2_CONFIGURE_OPTS += --flags=ghci
+endif
+
 ghc_stage1_MORE_HC_OPTS = $(GhcStage1HcOpts)
 ghc_stage2_MORE_HC_OPTS = $(GhcStage2HcOpts)
 ghc_stage3_MORE_HC_OPTS = $(GhcStage3HcOpts)
@@ -52,39 +60,10 @@ ifeq "$(GhcProfiled)" "YES"
 ghc_stage2_MORE_HC_OPTS += -prof
 endif
 
-ghc_stage1_MODULES = Main
-
-ghc_stage2_MODULES = $(ghc_stage1_MODULES)
-ifeq "$(GhcWithInterpreter)" "YES"
-ghc_stage2_MODULES += GhciMonad GhciTags InteractiveUI
-endif
-ghc_stage3_MODULES = $(ghc_stage2_MODULES)
-
-ghc_stage1_C_SRCS = hschooks.c
-ghc_stage2_C_SRCS = hschooks.c
-ghc_stage3_C_SRCS = hschooks.c
-
 ghc_stage1_PROG = ghc-stage1$(exeext)
 ghc_stage2_PROG = ghc-stage2$(exeext)
 ghc_stage3_PROG = ghc-stage3$(exeext)
 
-# ToDo: perhaps use ghc-cabal to configure ghc-bin
-ghc_stage1_MORE_HC_OPTS += -package $(compiler_PACKAGE)-$(compiler_stage1_VERSION)
-ghc_stage2_MORE_HC_OPTS += -package $(compiler_PACKAGE)-$(compiler_stage2_VERSION)
-ghc_stage3_MORE_HC_OPTS += -package $(compiler_PACKAGE)-$(compiler_stage3_VERSION)
-ghc_stage2_MORE_HC_OPTS += -package haskeline
-ghc_stage3_MORE_HC_OPTS += -package haskeline
-
-ghc_language_extension_flags = -XCPP \
-                               -XPatternGuards \
-                               -XForeignFunctionInterface \
-                               -XUnboxedTuples \
-                               -XFlexibleInstances \
-                               -XMagicHash
-ghc_stage1_MORE_HC_OPTS += $(ghc_language_extension_flags)
-ghc_stage2_MORE_HC_OPTS += $(ghc_language_extension_flags)
-ghc_stage3_MORE_HC_OPTS += $(ghc_language_extension_flags)
-
 ghc_stage1_SHELL_WRAPPER = YES
 ghc_stage2_SHELL_WRAPPER = YES
 ghc_stage3_SHELL_WRAPPER = YES
@@ -119,11 +98,6 @@ $(eval $(call build-prog,ghc,stage3,2))
 
 ifneq "$(BINDIST)" "YES"
 
-# ToDo: should we add these in the build-prog macro?
-ghc/stage1/build/tmp/$(ghc_stage1_PROG) : $(compiler_stage1_v_LIB)
-ghc/stage2/build/tmp/$(ghc_stage2_PROG) : $(compiler_stage2_v_LIB)
-ghc/stage3/build/tmp/$(ghc_stage3_PROG) : $(compiler_stage3_v_LIB)
-
 ifeq "$(GhcProfiled)" "YES"
 ghc/stage2/build/tmp/$(ghc_stage2_PROG) : $(compiler_stage2_p_LIB)
 ghc/stage2/build/tmp/$(ghc_stage2_PROG) : $(foreach lib,$(PACKAGES),$(libraries/$(lib)_dist-install_p_LIB))