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