Merge branch 'master' of darcs.haskell.org:/srv/darcs//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 # Temporary: mkTyCon is deprecated
88 libraries/time_dist-install_EXTRA_HC_OPTS += -fno-warn-deprecations
89 # On Windows, there are also some unused import warnings
90 libraries/time_dist-install_EXTRA_HC_OPTS += -fno-warn-unused-imports -fno-warn-identities
91
92 # haskeline has warnings about deprecated use of block/unblock
93 libraries/haskeline_dist-install_EXTRA_HC_OPTS += -fno-warn-deprecations
94 libraries/haskeline_dist-install_EXTRA_HC_OPTS += -fno-warn-unused-imports
95
96 # Temporarily turn off unused-import warnings for the binary package
97 libraries/binary_dist-boot_EXTRA_HC_OPTS += -fno-warn-unused-imports
98 libraries/binary_dist-install_EXTRA_HC_OPTS += -fno-warn-unused-imports -fno-warn-identities
99
100 # temporarily turn off -Werror for mtl
101 libraries/mtl_dist-install_EXTRA_HC_OPTS += -Wwarn
102
103 # primitive has a warning about deprecated use of GHC.IOBase
104 libraries/primitive_dist-install_EXTRA_HC_OPTS += -Wwarn
105
106 # temporarily turn off -Werror for transformers
107 libraries/transformers_dist-install_EXTRA_HC_OPTS += -Wwarn
108
109 # vector has some unused match warnings
110 libraries/vector_dist-install_EXTRA_HC_OPTS += -Wwarn
111
112 libraries/dph/dph-base_dist-install_EXTRA_HC_OPTS += -Wwarn
113 libraries/dph/dph-prim-interface_dist-install_EXTRA_HC_OPTS += -Wwarn
114 libraries/dph/dph-prim-seq_dist-install_EXTRA_HC_OPTS += -Wwarn
115 libraries/dph/dph-prim-par_dist-install_EXTRA_HC_OPTS += -Wwarn
116 libraries/dph/dph-lifted-common-install_EXTRA_HC_OPTS += -Wwarn
117
118 # We need to turn of deprecated warnings for SafeHaskell transition
119 libraries/array_dist-install_EXTRA_HC_OPTS += -fno-warn-warnings-deprecations
120 libraries/binary_dist-install_EXTRA_HC_OPTS += -fno-warn-warnings-deprecations
121 libraries/binary/src/Data/Binary/Builder/Base_HC_OPTS += -fno-warn-warnings-deprecations
122 libraries/binary/src/Data/Binary/Get_HC_OPTS += -fno-warn-warnings-deprecations
123
124 # Temporarely disable inline rule shadowing warning
125 libraries/bytestring_dist-install_EXTRA_HC_OPTS += -fno-warn-inline-rule-shadowing
126 libraries/template-haskell_dist-install_EXTRA_HC_OPTS += -fno-warn-inline-rule-shadowing
127
128 # We need -fno-warn-deprecated-flags to avoid failure with -Werror
129 GhcLibHcOpts += -fno-warn-deprecated-flags
130 GhcBootLibHcOpts += -fno-warn-deprecated-flags