Merge branch 'master' of http://darcs.haskell.org/ghc
[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
30 # We define DefaultFastGhcLibWays in this style so that the value is
31 # correct even if the user alters DYNAMIC_BY_DEFAULT
32 DefaultFastGhcLibWays = $(if $(filter $(DYNAMIC_BY_DEFAULT),YES),v dyn,v)
33
34 ifeq "$(ValidateSpeed)" "FAST"
35 GhcLibWays = $(DefaultFastGhcLibWays)
36 else
37 GhcLibWays := $(filter v dyn,$(GhcLibWays))
38 endif
39 SplitObjs = NO
40 NoFibWays =
41 STRIP_CMD = :
42
43 CHECK_PACKAGES = YES
44
45 # We want to install DPH when validating, so that we can test it
46 InstallExtraPackages = YES
47
48 # dblatex with miktex under msys/mingw can't build the PS and PDF docs,
49 # and just building the HTML docs is sufficient to check that the
50 # markup is correct, so we turn off PS and PDF doc building when
51 # validating.
52 BUILD_DOCBOOK_PS = NO
53 BUILD_DOCBOOK_PDF = NO
54
55 ifeq "$(ValidateHpc)" "YES"
56 GhcStage2HcOpts += -fhpc -hpcdir $(TOP)/testsuite/hpc_output/
57 endif
58 ifeq "$(ValidateSpeed)" "SLOW"
59 GhcStage2HcOpts += -DDEBUG
60 endif
61
62 ######################################################################
63 # Disable some warnings in packages we use
64
65 # Cabal doesn't promise to be warning-free
66 utils/ghc-cabal_dist_EXTRA_HC_OPTS += -w
67 libraries/Cabal/Cabal_dist-boot_EXTRA_HC_OPTS += -w
68 libraries/Cabal/Cabal_dist-install_EXTRA_HC_OPTS += -w
69
70 # Temporarily turn off incomplete-pattern warnings for containers
71 libraries/containers_dist-install_EXTRA_HC_OPTS += -fno-warn-incomplete-patterns
72
73 # Temporarily turn off pointless-pragma warnings for containers
74 libraries/containers_dist-install_EXTRA_HC_OPTS += -fno-warn-pointless-pragmas
75
76 # bytestring has identities at the moment
77 libraries/bytestring_dist-install_EXTRA_HC_OPTS += -fno-warn-identities
78
79 # bytestring uses bitSize at the moment
80 libraries/bytestring_dist-install_EXTRA_HC_OPTS += -fno-warn-deprecations
81
82 # containers uses bitSize at the moment
83 libraries/containers_dist-install_EXTRA_HC_OPTS += -fno-warn-deprecations
84
85 # Temporarily turn off unused-do-bind warnings for the time package
86 libraries/time_dist-install_EXTRA_HC_OPTS += -fno-warn-unused-do-bind
87
88
89 # Rank2Types is deprecated, so switch off deprecation warnings
90 libraries/time_dist-install_EXTRA_HC_OPTS += -fno-warn-deprecations
91 libraries/containers_dist-install_EXTRA_HC_OPTS += -fno-warn-deprecations
92 libraries/dph/dph-lifted-copy_dist-install_EXTRA_HC_OPTS += -fno-warn-deprecations
93 # vector already has -Wwarn
94 # Cabal already has -Wwarn
95
96
97 # Temporary: mkTyCon is deprecated
98 libraries/time_dist-install_EXTRA_HC_OPTS += -fno-warn-deprecations
99 # On Windows, there are also some unused import warnings
100 libraries/time_dist-install_EXTRA_HC_OPTS += -fno-warn-unused-imports -fno-warn-identities
101
102 # haskeline has warnings about deprecated use of block/unblock
103 libraries/haskeline_dist-install_EXTRA_HC_OPTS += -fno-warn-deprecations
104 libraries/haskeline_dist-install_EXTRA_HC_OPTS += -fno-warn-unused-imports
105
106 # Temporarily turn off unused-import warnings for the binary package
107 libraries/binary_dist-boot_EXTRA_HC_OPTS += -fno-warn-unused-imports
108 libraries/binary_dist-install_EXTRA_HC_OPTS += -fno-warn-unused-imports -fno-warn-identities
109
110 # temporarily turn off -Werror for mtl
111 libraries/mtl_dist-install_EXTRA_HC_OPTS += -Wwarn
112
113 # primitive has a warning about deprecated use of GHC.IOBase
114 libraries/primitive_dist-install_EXTRA_HC_OPTS += -Wwarn
115
116 # temporarily turn off -Werror for transformers
117 libraries/transformers_dist-install_EXTRA_HC_OPTS += -Wwarn
118
119 # vector has some unused match warnings
120 libraries/vector_dist-install_EXTRA_HC_OPTS += -Wwarn
121
122 libraries/dph/dph-base_dist-install_EXTRA_HC_OPTS += -Wwarn
123 libraries/dph/dph-prim-interface_dist-install_EXTRA_HC_OPTS += -Wwarn
124 libraries/dph/dph-prim-seq_dist-install_EXTRA_HC_OPTS += -Wwarn
125 libraries/dph/dph-prim-par_dist-install_EXTRA_HC_OPTS += -Wwarn
126 libraries/dph/dph-lifted-common-install_EXTRA_HC_OPTS += -Wwarn
127
128 # We need to turn of deprecated warnings for SafeHaskell transition
129 libraries/array_dist-install_EXTRA_HC_OPTS += -fno-warn-warnings-deprecations
130 libraries/binary_dist-install_EXTRA_HC_OPTS += -fno-warn-warnings-deprecations
131 libraries/binary/src/Data/Binary/Builder/Base_HC_OPTS += -fno-warn-warnings-deprecations
132 libraries/binary/src/Data/Binary/Get_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