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