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