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