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