diff options
-rw-r--r-- | mk/validate-settings.mk | 12 | ||||
-rw-r--r-- | rules/build-package-data.mk | 2 | ||||
-rw-r--r-- | rules/distdir-way-opts.mk | 8 | ||||
-rw-r--r-- | utils/ghc-pkg/ghc.mk | 1 |
4 files changed, 16 insertions, 7 deletions
diff --git a/mk/validate-settings.mk b/mk/validate-settings.mk index 119dce10bb..fa5add53a1 100644 --- a/mk/validate-settings.mk +++ b/mk/validate-settings.mk @@ -1,20 +1,22 @@ # DO NOT EDIT! Instead, create a file mk/validate.mk, whose settings will # override these. See also mk/custom-settings.mk. -WERROR = -Werror +WERROR = -Werror +SRC_CC_WARNING_OPTS = +SRC_HC_WARNING_OPTS = HADDOCK_DOCS = YES -SRC_CC_OPTS += -Wall $(WERROR) # Debian doesn't turn -Werror=unused-but-set-variable on by default, so # we turn it on explicitly for consistency with other users ifeq "$(GccLT46)" "NO" -SRC_CC_OPTS += -Werror=unused-but-set-variable +SRC_CC_WARNING_OPTS += -Werror=unused-but-set-variable # gcc 4.6 gives 3 warning for giveCapabilityToTask not being inlined -SRC_CC_OPTS += -Wno-error=inline +SRC_CC_WARNING_OPTS += -Wno-error=inline endif -SRC_HC_OPTS += -Wall $(WERROR) -H64m -O0 +SRC_CC_OPTS += $(WERROR) -Wall +SRC_HC_OPTS += $(WERROR) -Wall -H64m -O0 GhcStage1HcOpts += -O -fwarn-tabs diff --git a/rules/build-package-data.mk b/rules/build-package-data.mk index d535e34cbe..047efcbe16 100644 --- a/rules/build-package-data.mk +++ b/rules/build-package-data.mk @@ -39,7 +39,7 @@ endif # We filter out -Werror from SRC_CC_OPTS, because when configure tests # for a feature it may not generate warning-free C code, and thus may # think that the feature doesn't exist if -Werror is on. -$1_$2_CONFIGURE_OPTS += --configure-option=CFLAGS="$$(filter-out -Werror,$$(SRC_CC_OPTS)) $$(CONF_CC_OPTS_STAGE$3) $$($1_CC_OPTS) $$($1_$2_CC_OPTS)" +$1_$2_CONFIGURE_OPTS += --configure-option=CFLAGS="$$(filter-out -Werror,$$(SRC_CC_OPTS)) $$(CONF_CC_OPTS_STAGE$3) $$($1_CC_OPTS) $$($1_$2_CC_OPTS) $$(SRC_CC_WARNING_OPTS)" $1_$2_CONFIGURE_OPTS += --configure-option=LDFLAGS="$$(SRC_LD_OPTS) $$(CONF_GCC_LINKER_OPTS_STAGE$3) $$($1_LD_OPTS) $$($1_$2_LD_OPTS)" $1_$2_CONFIGURE_OPTS += --configure-option=CPPFLAGS="$$(SRC_CPP_OPTS) $$(CONF_CPP_OPTS_STAGE$3) $$($1_CPP_OPTS) $$($1_$2_CPP_OPTS)" diff --git a/rules/distdir-way-opts.mk b/rules/distdir-way-opts.mk index 2e5f76462b..c26bbc7ece 100644 --- a/rules/distdir-way-opts.mk +++ b/rules/distdir-way-opts.mk @@ -41,6 +41,10 @@ define distdir-way-opts # args: $1 = dir, $2 = distdir, $3 = way, $4 = stage # mk/build.mk # mk/validate.mk # +# SRC_HC_WARNING_OPTS source-tree-wide GHC warning mk/config.mk.in +# options mk/build.mk +# mk/validate.mk +# # EXTRA_HC_OPTS for supplying extra options on make EXTRA_HC_OPTS=... # the command line # @@ -102,6 +106,7 @@ $1_$2_$3_MOST_HC_OPTS = \ $$($1_$2_EXTRA_HC_OPTS) \ $$($1_$2_$3_HC_OPTS) \ $$($$(basename $$<)_HC_OPTS) \ + $$(SRC_HC_WARNING_OPTS) \ $$(EXTRA_HC_OPTS) # NB. CONF_HC_OPTS_STAGE$4 has to be late enough to override $1_$2_HC_OPTS, so @@ -151,7 +156,8 @@ $1_$2_DIST_CC_OPTS = \ $$($1_$2_CC_OPTS) \ $$($1_$2_CPP_OPTS) \ $$($1_$2_CC_INC_FLAGS) \ - $$($1_$2_DEP_CC_OPTS) + $$($1_$2_DEP_CC_OPTS) \ + $$(SRC_CC_WARNING_OPTS) ifneq ($$(strip $$($1_$2_DEP_LIB_DIRS_SINGLE_QUOTED)),) $1_$2_DIST_LD_LIB_DIRS := $$(subst $$(space)',$$(space)-L',$$(space)$$($1_$2_DEP_LIB_DIRS_SINGLE_QUOTED)) diff --git a/utils/ghc-pkg/ghc.mk b/utils/ghc-pkg/ghc.mk index 11b7c8f26a..4f4967e07f 100644 --- a/utils/ghc-pkg/ghc.mk +++ b/utils/ghc-pkg/ghc.mk @@ -55,6 +55,7 @@ utils/ghc-pkg/dist/build/tmp/$(utils/ghc-pkg_dist_PROG)$(exeext): utils/ghc-pkg/ "$(GHC)" $(SRC_HC_OPTS) --make utils/ghc-pkg/Main.hs -o $@ \ -no-user-package-conf \ -Wall -fno-warn-unused-imports -fno-warn-warnings-deprecations \ + $(SRC_HC_WARNING_OPTS) \ -DCABAL_VERSION=$(CABAL_VERSION) \ -DBOOTSTRAPPING \ -odir bootstrapping \ |