summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ghc/ghc.mk40
-rw-r--r--rules/distdir-way-opts.mk6
-rw-r--r--rules/package-config.mk8
3 files changed, 30 insertions, 24 deletions
diff --git a/ghc/ghc.mk b/ghc/ghc.mk
index 11d506bce7..ecce7c823a 100644
--- a/ghc/ghc.mk
+++ b/ghc/ghc.mk
@@ -14,9 +14,9 @@
ghc_USES_CABAL = YES
ghc_PACKAGE = ghc-bin
-ghc_stage1_HC_OPTS = $(GhcStage1HcOpts)
-ghc_stage2_HC_OPTS = $(GhcStage2HcOpts)
-ghc_stage3_HC_OPTS = $(GhcStage3HcOpts)
+ghc_stage1_MORE_HC_OPTS = $(GhcStage1HcOpts)
+ghc_stage2_MORE_HC_OPTS = $(GhcStage2HcOpts)
+ghc_stage3_MORE_HC_OPTS = $(GhcStage3HcOpts)
ghc_stage2_CC_OPTS = -Iincludes
ghc_stage3_CC_OPTS = -Iincludes
@@ -27,27 +27,29 @@ ghc_stage2_MKDEPENDC_OPTS = -DMAKING_GHC_BUILD_SYSTEM_DEPENDENCIES
ghc_stage3_MKDEPENDC_OPTS = -DMAKING_GHC_BUILD_SYSTEM_DEPENDENCIES
ifeq "$(GhcWithInterpreter)" "YES"
-ghc_stage2_HC_OPTS += -DGHCI
-ghc_stage3_HC_OPTS += -DGHCI
+ghc_stage2_MORE_HC_OPTS += -DGHCI
+ghc_stage3_MORE_HC_OPTS += -DGHCI
endif
ifeq "$(GhcDebugged)" "YES"
-ghc_HC_OPTS += -debug
+ghc_stage1_MORE_HC_OPTS += -debug
+ghc_stage2_MORE_HC_OPTS += -debug
+ghc_stage3_MORE_HC_OPTS += -debug
endif
ifeq "$(GhcDynamic)" "YES"
-ghc_stage2_HC_OPTS += -dynamic
-ghc_stage3_HC_OPTS += -dynamic
+ghc_stage2_MORE_HC_OPTS += -dynamic
+ghc_stage3_MORE_HC_OPTS += -dynamic
endif
ifeq "$(GhcThreaded)" "YES"
# Use threaded RTS with GHCi, so threads don't get blocked at the prompt.
-ghc_stage2_HC_OPTS += -threaded
-ghc_stage3_HC_OPTS += -threaded
+ghc_stage2_MORE_HC_OPTS += -threaded
+ghc_stage3_MORE_HC_OPTS += -threaded
endif
ifeq "$(GhcProfiled)" "YES"
-ghc_stage2_HC_OPTS += -prof
+ghc_stage2_MORE_HC_OPTS += -prof
endif
ghc_stage1_MODULES = Main
@@ -67,11 +69,11 @@ ghc_stage2_PROG = ghc-stage2$(exeext)
ghc_stage3_PROG = ghc-stage3$(exeext)
# ToDo: perhaps use ghc-cabal to configure ghc-bin
-ghc_stage1_HC_OPTS += -package $(compiler_PACKAGE)-$(compiler_stage1_VERSION)
-ghc_stage2_HC_OPTS += -package $(compiler_PACKAGE)-$(compiler_stage2_VERSION)
-ghc_stage3_HC_OPTS += -package $(compiler_PACKAGE)-$(compiler_stage3_VERSION)
-ghc_stage2_HC_OPTS += -package haskeline
-ghc_stage3_HC_OPTS += -package haskeline
+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 \
@@ -79,9 +81,9 @@ ghc_language_extension_flags = -XCPP \
-XUnboxedTuples \
-XFlexibleInstances \
-XMagicHash
-ghc_stage1_HC_OPTS += $(ghc_language_extension_flags)
-ghc_stage2_HC_OPTS += $(ghc_language_extension_flags)
-ghc_stage3_HC_OPTS += $(ghc_language_extension_flags)
+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
diff --git a/rules/distdir-way-opts.mk b/rules/distdir-way-opts.mk
index 5fd825361e..7a83f50c2e 100644
--- a/rules/distdir-way-opts.mk
+++ b/rules/distdir-way-opts.mk
@@ -20,7 +20,10 @@ define distdir-way-opts # args: $1 = dir, $2 = distdir, $3 = way, $4 = stage
# configure-time
# - SRC_HC_OPTS source-tree-wide options from build.mk
# (optimisation, heap settings)
-# - libraries/base_HC_OPTS options from libraries/base for all ways
+# - libraries/base_HC_OPTS options from Cabal for libraries/base
+# for all ways
+# - libraries/base_MORE_HC_OPTS options from elsewhere in the build
+# system for libraries/base for all ways
# - libraries/base_v_HC_OPTS options from libraries/base for way v
# - WAY_v_HC_OPTS options for this way
# - EXTRA_HC_OPTS options from the command-line
@@ -48,6 +51,7 @@ $1_$2_$3_MOST_HC_OPTS = \
$$(foreach pkg,$$($1_$2_DEPS),-package $$(pkg)) \
$$(if $$(findstring YES,$$($1_$2_SplitObjs)),$$(if $$(findstring dyn,$3),,-split-objs),) \
$$($1_$2_HC_OPTS) \
+ $$($1_$2_MORE_HC_OPTS) \
$$($1_$2_EXTRA_HC_OPTS) \
$$($1_$2_$3_HC_OPTS) \
$$($$(basename $$<)_HC_OPTS) \
diff --git a/rules/package-config.mk b/rules/package-config.mk
index 871fde6775..f111e1efac 100644
--- a/rules/package-config.mk
+++ b/rules/package-config.mk
@@ -31,9 +31,9 @@ $1_$2_HC_DEP =
$1_$2_HC_PKGCONF = -package-conf $$(BOOTSTRAPPING_CONF)
$1_$2_GHC_PKG_OPTS = --package-conf=$$(BOOTSTRAPPING_CONF)
$1_$2_CONFIGURE_OPTS += --package-db=$$(TOP)/$$(BOOTSTRAPPING_CONF)
-$1_$2_HC_OPTS += -no-user-package-conf
+$1_$2_MORE_HC_OPTS += -no-user-package-conf
ifeq "$(ghc_ge_613)" "YES"
-$1_$2_HC_OPTS += -rtsopts
+$1_$2_MORE_HC_OPTS += -rtsopts
endif
else
$1_$2_ghc_ge_613 = YES
@@ -48,8 +48,8 @@ $1_$2_GHC_PKG_OPTS =
$1_$2_HC_MK_DEPEND = $$(GHC_STAGE1)
$1_$2_HC_MK_DEPEND_DEP = $$($1_$2_HC_MK_DEPEND)
$1_$2_HC_DEP = $$($1_$2_HC)
-$1_$2_HC_OPTS += -no-user-package-conf
-$1_$2_HC_OPTS += -rtsopts
+$1_$2_MORE_HC_OPTS += -no-user-package-conf
+$1_$2_MORE_HC_OPTS += -rtsopts
endif
# Useful later