diff options
author | Ian Lynagh <igloo@earth.li> | 2012-04-26 19:28:39 +0100 |
---|---|---|
committer | Ian Lynagh <igloo@earth.li> | 2012-04-26 19:28:39 +0100 |
commit | 3d8dd48620ac8297d183447e5fa9687521752820 (patch) | |
tree | ab87ba9509dd6d0d702a887ce7f57184ec0b4ec0 /rules | |
parent | dd96644c9001fe3f6f78ed48caaad84f7a6820ec (diff) | |
download | haskell-3d8dd48620ac8297d183447e5fa9687521752820.tar.gz |
Add SRC_[CH]C_WARNING_OPTS
This allows you to say things like
SRC_HC_WARNING_OPTS += -fno-warn-unsupported-calling-conventions
in mk/validate.mk.
Unfortunately, we can't just use SRC_HC_OPTS, as that gets put before
the more specific options (e.g. ghc-options in a .cabal file), many of
which include -Wall. So now we have:
ghc $(SRC_HC_OPTS) ... options from .cabal etc ... $(SRC_HC_WARNING_OPTS)
Diffstat (limited to 'rules')
-rw-r--r-- | rules/build-package-data.mk | 2 | ||||
-rw-r--r-- | rules/distdir-way-opts.mk | 8 |
2 files changed, 8 insertions, 2 deletions
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)) |