Suppress binary warnings for bootstrapping as well as stage1.
[ghc.git] / mk / validate-settings.mk
1 # DO NOT EDIT! Instead, create a file mk/validate.mk, whose settings will
2 # override these. See also mk/custom-settings.mk.
3
4 WERROR = -Werror
5 SRC_CC_WARNING_OPTS =
6 SRC_HC_WARNING_OPTS =
7
8 HADDOCK_DOCS = YES
9
10 #####################
11 # Warnings
12
13 ifneq "$(GccIsClang)" "YES"
14
15 # Debian doesn't turn -Werror=unused-but-set-variable on by default, so
16 # we turn it on explicitly for consistency with other users
17 ifeq "$(GccLT46)" "NO"
18 SRC_CC_WARNING_OPTS += -Werror=unused-but-set-variable
19 # gcc 4.6 gives 3 warning for giveCapabilityToTask not being inlined
20 SRC_CC_WARNING_OPTS += -Wno-error=inline
21 endif
22
23 else
24
25 # Don't warn about unknown GCC pragmas when using clang
26 SRC_CC_WARNING_OPTS += -Wno-unknown-pragmas
27
28 endif
29
30 SRC_CC_OPTS += $(WERROR) -Wall
31 SRC_HC_OPTS += $(WERROR) -Wall
32
33 GhcStage1HcOpts += -fwarn-tabs
34 GhcStage2HcOpts += -fwarn-tabs
35
36 utils/hpc_dist-install_EXTRA_HC_OPTS += -fwarn-tabs
37
38 #####################
39 SRC_HC_OPTS += -H64m -O0
40
41 GhcStage1HcOpts += -O
42 GhcStage2HcOpts += -O -dcore-lint
43 # Using -O (rather than -O0) here bringes my validate down from 22mins to 16 mins.
44 # Compiling stage2 takes longer, but we gain a faster haddock, faster
45 # running of the tests, and faster building of the utils to be installed
46
47 GhcLibHcOpts += -O -dcore-lint
48
49 # We define DefaultFastGhcLibWays in this style so that the value is
50 # correct even if the user alters DYNAMIC_GHC_PROGRAMS.
51 # Technically we don't need the v way if DYNAMIC_GHC_PROGRAMS is YES,
52 # but with -dynamic-too it's cheap, and makes life easier.
53 DefaultFastGhcLibWays = $(if $(filter $(DYNAMIC_GHC_PROGRAMS),YES),v dyn,v)
54 DefaultProfGhcLibWays = $(if $(filter $(GhcProfiled),YES),p,)
55
56 ifeq "$(ValidateSpeed)" "FAST"
57 GhcLibWays = $(DefaultFastGhcLibWays)
58 else
59 GhcLibWays := $(filter v dyn,$(GhcLibWays))
60 endif
61 GhcLibWays += $(DefaultProfGhcLibWays)
62 SplitObjs = NO
63 NoFibWays =
64 STRIP_CMD = :
65
66 CHECK_PACKAGES = YES
67
68 # We want to install DPH when validating, so that we can test it
69 InstallExtraPackages = YES
70
71 # dblatex with miktex under msys/mingw can't build the PS and PDF docs,
72 # and just building the HTML docs is sufficient to check that the
73 # markup is correct, so we turn off PS and PDF doc building when
74 # validating.
75 BUILD_DOCBOOK_PS = NO
76 BUILD_DOCBOOK_PDF = NO
77
78 ifeq "$(ValidateHpc)" "YES"
79 GhcStage2HcOpts += -fhpc -hpcdir $(TOP)/testsuite/hpc_output/
80 endif
81 ifeq "$(ValidateSpeed)" "SLOW"
82 GhcStage2HcOpts += -DDEBUG
83 endif
84
85 ######################################################################
86 # Disable some warnings in packages we use
87
88 # Cabal doesn't promise to be warning-free
89 utils/ghc-cabal_dist_EXTRA_HC_OPTS += -w
90 libraries/Cabal/Cabal_dist-boot_EXTRA_HC_OPTS += -w
91 libraries/Cabal/Cabal_dist-install_EXTRA_HC_OPTS += -w
92
93 # Temporarily turn off incomplete-pattern warnings for containers
94 libraries/containers_dist-install_EXTRA_HC_OPTS += -fno-warn-incomplete-patterns
95
96 # Temporarily turn off pointless-pragma warnings for containers
97 libraries/containers_dist-install_EXTRA_HC_OPTS += -fno-warn-pointless-pragmas
98
99 # bytestring has identities at the moment
100 libraries/bytestring_dist-install_EXTRA_HC_OPTS += -fno-warn-identities
101
102 # bytestring uses bitSize at the moment
103 libraries/bytestring_dist-install_EXTRA_HC_OPTS += -fno-warn-deprecations
104
105 # containers uses bitSize at the moment
106 libraries/containers_dist-install_EXTRA_HC_OPTS += -fno-warn-deprecations
107
108 # Temporarily turn off unused-do-bind warnings for the time package
109 libraries/time_dist-install_EXTRA_HC_OPTS += -fno-warn-unused-do-bind
110 # Temporary: mkTyCon is deprecated
111 libraries/time_dist-install_EXTRA_HC_OPTS += -fno-warn-deprecations
112 # On Windows, there are also some unused import warnings
113 libraries/time_dist-install_EXTRA_HC_OPTS += -fno-warn-unused-imports -fno-warn-identities
114
115 # haskeline has warnings about deprecated use of block/unblock
116 libraries/haskeline_dist-install_EXTRA_HC_OPTS += -fno-warn-deprecations
117 libraries/haskeline_dist-install_EXTRA_HC_OPTS += -fno-warn-unused-imports
118
119 # binary upstream has some warnings, so don't use -Werror for it
120 libraries/binary_dist-boot_EXTRA_HC_OPTS += -Wwarn
121 libraries/binary_dist-install_EXTRA_HC_OPTS += -Wwarn
122
123 # temporarily turn off -Werror for mtl
124 libraries/mtl_dist-install_EXTRA_HC_OPTS += -Wwarn
125
126 # primitive has a warning about deprecated use of GHC.IOBase
127 libraries/primitive_dist-install_EXTRA_HC_OPTS += -Wwarn
128
129 # temporarily turn off -Werror for transformers
130 libraries/transformers_dist-boot_EXTRA_HC_OPTS += -Wwarn
131 libraries/transformers_dist-install_EXTRA_HC_OPTS += -Wwarn
132
133 # vector has some unused match warnings
134 libraries/vector_dist-install_EXTRA_HC_OPTS += -Wwarn
135
136 libraries/dph/dph-base_dist-install_EXTRA_HC_OPTS += -Wwarn
137 libraries/dph/dph-prim-interface_dist-install_EXTRA_HC_OPTS += -Wwarn
138 libraries/dph/dph-prim-seq_dist-install_EXTRA_HC_OPTS += -Wwarn
139 libraries/dph/dph-prim-par_dist-install_EXTRA_HC_OPTS += -Wwarn
140 libraries/dph/dph-lifted-common-install_EXTRA_HC_OPTS += -Wwarn
141
142 # We need to turn of deprecated warnings for SafeHaskell transition
143 libraries/array_dist-install_EXTRA_HC_OPTS += -fno-warn-warnings-deprecations
144
145 # Temporarely disable inline rule shadowing warning
146 libraries/bytestring_dist-install_EXTRA_HC_OPTS += -fno-warn-inline-rule-shadowing
147 libraries/template-haskell_dist-install_EXTRA_HC_OPTS += -fno-warn-inline-rule-shadowing
148
149 # We need -fno-warn-deprecated-flags to avoid failure with -Werror
150 GhcLibHcOpts += -fno-warn-deprecated-flags
151 GhcBootLibHcOpts += -fno-warn-deprecated-flags