Improve error message for fundeps
[ghc.git] / mk / config.mk.in
1 # -*-makefile-*-
2 # @configure_input@
3 #
4 ################################################################################
5 #
6 # config.mk.in
7 #
8 # This file supplies defaults for many tweakable build configuration
9 # options. Some of the defaults are filled in by the autoconf-generated
10 # configure script.
11 #
12 # DO NOT EDIT THIS FILE!
13 #
14 # - config.mk is auto-generated from config.mk.in by configure.
15 # If you edit config.mk your changes will be spammed.
16 #
17 # - Settings in this file may be overriden by giving replacement
18 # definitions in build.mk. See build.mk.sample for a good
19 # starting point for a build.mk file.
20 #
21 # If you don't have a build.mk file then you get defaults for everything.
22 # The defaults should provide a reasonable vanilla build.
23
24 # TOP: the top of the fptools hierarchy, absolute path.
25 # On Windows this is a c:/foo/bar style path.
26 TOP = @hardtop@
27
28 include $(TOP)/mk/project.mk
29
30 # By default, be verbose
31 V = 1
32
33 ################################################################################
34 #
35 # Global configuration options
36 #
37 ################################################################################
38
39 NO_INCLUDE_DEPS = NO
40 NO_INCLUDE_PKGDATA = NO
41
42 ################################################################################
43 #
44 # Variables that control how the compiler itself is built
45 #
46 ################################################################################
47
48 # The compiler used to build GHC is $(GHC). To change the actual compiler
49 # used, re-configure with --with-ghc=<path-to-ghc>.
50
51 # Extra option flags to pass to the compiler that compiles the compiler
52 # (Ones that are essential are wired into compiler/Makefile)
53 # Typical options to use here:
54 #
55 # -DDEBUG include debugging code and assertions (will make the
56 # compiler slower and produce debugging output, but useful
57 # for development)
58 #
59 # -dcore-lint check the types after every pass of the compiler;
60 # a pretty strong internal check of the compiler being
61 # used to compile GHC. Useful when bootstrapping.
62 GhcHcOpts=-Rghc-timing
63
64 # Extra options added to specific stages of the compiler bootstrap.
65 # These are placed later on the command line, and may therefore
66 # override options from $(GhcHcOpts).
67 GhcStage1HcOpts=
68 GhcStage2HcOpts=-O2
69 GhcStage3HcOpts=-O2
70
71 GhcDebugged=NO
72 GhcDynamic=NO
73
74 # GhcProfiled=YES means compile a profiled stage-2 compiler
75 GhcProfiled=NO
76
77 ifeq "$(findstring $(TargetOS_CPP),linux freebsd dragonfly openbsd netbsd solaris2 kfreebsdgnu haiku linux-android)" ""
78 TargetElf = NO
79 else
80 TargetElf = YES
81 endif
82
83 # Some platforms don't support shared libraries
84 NoSharedLibsPlatformList = \
85 x86_64-unknown-mingw32 \
86 i386-unknown-mingw32
87
88 ifeq "$(SOLARIS_BROKEN_SHLD)" "YES"
89 NoSharedLibsPlatformList += i386-unknown-solaris2
90 endif
91
92 PlatformSupportsSharedLibs = $(if $(filter $(TARGETPLATFORM),\
93 $(NoSharedLibsPlatformList)),NO,YES)
94
95 # DYNAMIC_BY_DEFAULT says whether this compiler will default to
96 # building dynamic executables, i.e. -dynamic is on. We do this for
97 # most platforms because it lets us use the system dynamic linker
98 # instead of our own linker for GHCi.
99 #
100 # Currently this isn't possible on Windows, and we have not yet enabled
101 # it on i386 while we consider the performance implications.
102 #
103 ifeq "$(TargetOS_CPP)" "mingw32"
104 DYNAMIC_BY_DEFAULT = NO
105 else ifeq "$(TargetArch_CPP)" "i386"
106 DYNAMIC_BY_DEFAULT = NO
107 else
108 DYNAMIC_BY_DEFAULT = YES
109 endif
110
111 # For now, we unconditionally disable dynamic-by-default, as the
112 # cabal-install's that are in the wild don't handle it properly.
113 DYNAMIC_BY_DEFAULT = NO
114
115 # If building both v and dyn ways, then use -dynamic-too to build them.
116 # This makes the build faster.
117 DYNAMIC_TOO = YES
118
119 # Use the dynamic way when building programs in the GHC tree. In
120 # particular, this means that GHCi will use DLLs rather than loading
121 # object files directly.
122 ifeq "$(TargetOS_CPP)" "mingw32"
123 # This doesn't work on Windows yet
124 DYNAMIC_GHC_PROGRAMS = NO
125 DYNAMIC_TOO=NO
126 else ifeq "$(PlatformSupportsSharedLibs)" "NO"
127 DYNAMIC_GHC_PROGRAMS = NO
128 else
129 DYNAMIC_GHC_PROGRAMS = YES
130 endif
131
132 # Build a compiler that will build *unregisterised* libraries and
133 # binaries by default. Unregisterised code is supposed to compile and
134 # run without any support for architecture-specific assembly mangling,
135 # register assignment or tail-calls, and is therefore a good way to get
136 # started when porting GHC to new architectures.
137 #
138 # NOTE: the stage1 compiler will be a registerised binary (assuming
139 # the compiler you build with is generating registerised binaries), but
140 # the stage2 compiler will be an unregisterised binary.
141 #
142 GhcUnregisterised=@Unregisterised@
143
144 # Build a compiler with a native code generator backend
145 # (as well as a C backend)
146 #
147 # Target platforms supported:
148 # i386, powerpc, powerpc64, sparc
149 # IOS and AIX are not supported
150 ArchSupportsNCG=$(strip $(patsubst $(TargetArch_CPP), YES, $(findstring $(TargetArch_CPP), i386 x86_64 powerpc powerpc64 powerpc64le sparc)))
151 OsSupportsNCG=$(strip $(patsubst $(TargetOS_CPP), YES, $(patsubst ios,,$(patsubst aix,,$(TargetOS_CPP)))))
152
153 GhcWithNativeCodeGen := $(strip\
154 $(if $(filter YESYESNO,\
155 $(OsSupportsNCG)$(ArchSupportsNCG)$(GhcUnregisterised)),YES,NO))
156
157 HaveLibDL = @HaveLibDL@
158
159 # ArchSupportsSMP should be set iff there is support for that arch in
160 # includes/stg/SMP.h
161 ArchSupportsSMP=$(strip $(patsubst $(TargetArch_CPP), YES, $(findstring $(TargetArch_CPP), i386 x86_64 sparc powerpc powerpc64 powerpc64le arm aarch64)))
162
163 GhcWithSMP := $(strip $(if $(filter YESNO, $(ArchSupportsSMP)$(GhcUnregisterised)),YES,NO))
164
165 # Whether to include GHCi in the compiler. Depends on whether the RTS linker
166 # has support for this OS/ARCH combination.
167
168 OsSupportsGHCi=$(strip $(patsubst $(TargetOS_CPP), YES, $(findstring $(TargetOS_CPP), mingw32 cygwin32 linux solaris2 freebsd dragonfly netbsd openbsd darwin kfreebsdgnu)))
169 ArchSupportsGHCi=$(strip $(patsubst $(TargetArch_CPP), YES, $(findstring $(TargetArch_CPP), i386 x86_64 powerpc powerpc64 powerpc64le sparc sparc64 arm aarch64)))
170
171 ifeq "$(OsSupportsGHCi)$(ArchSupportsGHCi)" "YESYES"
172 GhcWithInterpreter=YES
173 else
174 GhcWithInterpreter=$(if $(findstring YES,$(DYNAMIC_GHC_PROGRAMS)),YES,NO)
175 endif
176
177 # GhcEnableTablesNextToCode tells us whether the target architecture
178 # supports placing info tables directly before the entry code
179 # (see TABLES_NEXT_TO_CODE in the RTS). Whether we actually compile for
180 # TABLES_NEXT_TO_CODE depends on whether we're building unregisterised
181 # code or not, which may be decided by options to the compiler later.
182 ifneq "$(findstring $(TargetArch_CPP)X, ia64X powerpc64X powerpc64leX)" ""
183 GhcEnableTablesNextToCode=NO
184 else
185 GhcEnableTablesNextToCode=YES
186 endif
187
188 # Whether to use libffi for adjustors (foreign import "wrapper") or
189 # not. If we have built-in support (rts/Adjustor.c) then we use that,
190 # otherwise we fall back on libffi, which is slightly slower.
191 ArchHasAdjustorSupport = $(if $(findstring $(TargetArch_CPP),i386 x86_64),YES,NO)
192 ifeq "$(ArchHasAdjustorSupport)" "YES"
193 UseLibFFIForAdjustors=NO
194 else
195 UseLibFFIForAdjustors=YES
196 endif
197
198 # On Windows we normally want to make a relocatable bindist, to we
199 # ignore flags like libdir
200 ifeq "$(Windows_Host)" "YES"
201 RelocatableBuild = YES
202 else
203 RelocatableBuild = NO
204 endif
205
206 # needs to be after $(RelocatableBuild) is set above
207 include $(TOP)/mk/install.mk
208
209 # When building bindists we set this to yes so that the binaries are as
210 # portable as possible.
211 BeConservative = NO
212
213 ExtraMakefileSanityChecks = NO
214
215 #------------------------------------------------------------------------------
216 # Options for Libraries
217
218 # Which directory (in libraries/) contains the integer library?
219 INTEGER_LIBRARY=integer-gmp
220
221 # We build the libraries at least the "vanilla" way (way "v")
222 # Technically we don't need the v way if DYNAMIC_GHC_PROGRAMS is YES,
223 # but with -dynamic-too it's cheap, and makes life easier.
224 GhcLibWays = v
225
226 # In addition to the normal sequential way, the default is to also build
227 # profiled prelude libraries
228 # $(if $(filter ...)) allows controlling this expression from build.mk.
229 GhcLibWays += $(if $(filter $(BUILD_PROF_LIBS),NO),,p)
230
231 # Backward compatibility: although it would be cleaner to test for
232 # PlatformSupportsSharedLibs, or perhaps a new variable BUILD_SHARED_LIBS,
233 # some users currently expect that DYNAMIC_GHC_PROGRAMS=NO in build.mk implies
234 # that dyn is not added to GhcLibWays.
235 GhcLibWays += $(if $(filter $(DYNAMIC_GHC_PROGRAMS),NO),,dyn)
236
237 # Handy way to test whether we're building shared libs or not.
238 BuildSharedLibs=$(strip $(if $(findstring dyn,$(GhcLibWays)),YES,NO))
239
240 # In addition, the RTS is built in some further variations. Ways that
241 # make sense here:
242 #
243 # thr : threaded
244 # thr_p : threaded profiled
245 # debug : debugging (compile with -g for the C compiler, and -DDEBUG)
246 # debug_p : debugging profiled
247 # thr_debug : debugging threaded
248 # thr_debug_p : debugging threaded profiled
249 # l : event logging
250 # thr_l : threaded and event logging
251 #
252 GhcRTSWays=l
253
254 # Usually want the debug version
255 GhcRTSWays += debug
256
257 # We always have the threaded versions, but note that SMP support may be disabled
258 # (see GhcWithSMP).
259 GhcRTSWays += thr thr_debug thr_l
260 GhcRTSWays += $(if $(findstring p, $(GhcLibWays)),thr_p,)
261 GhcRTSWays += $(if $(findstring dyn, $(GhcLibWays)),dyn debug_dyn thr_dyn thr_debug_dyn l_dyn thr_l_dyn,)
262
263 # We can only build GHCi threaded if we have a threaded RTS:
264 GhcThreaded = $(if $(findstring thr,$(GhcRTSWays)),YES,NO)
265
266 # Option flags to pass to GHC when it's compiling modules in
267 # fptools/libraries. Typically these are things like -O or
268 # -dcore-lint or -H32m. The ones that are *essential* are wired into
269 # the build system.
270 #
271 # -O(2) is pretty desirable, otherwise no inlining of prelude
272 # things (incl "+") happens when compiling with this compiler
273
274 GhcLibHcOpts=-O2
275
276 # Strip local symbols from libraries? This can make the libraries smaller,
277 # but makes debugging somewhat more difficult. Doesn't work with all ld's.
278 #
279 StripLibraries=NO
280
281 # ----------------------------------------------------------------------------
282 # Object-file splitting
283 #
284 # Set SplitObjs=YES or NO in your build.mk
285 #
286 # Don't use -split-objs in in GhcLibHcOpts, because the build
287 # system needs to do other special magic if you are
288 # doing object-file splitting
289
290 ArchSupportsSplitObjs=$(strip $(if $(filter $(TargetArch_CPP),i386 x86_64 powerpc sparc),YES,NO))
291 OsSupportsSplitObjs=$(strip $(if $(filter $(TargetOS_CPP),mingw32 cygwin32 linux darwin solaris2 freebsd dragonfly netbsd openbsd),YES,NO))
292 SplitObjsBroken = @SplitObjsBroken@
293
294 SupportsSplitObjs := $(strip \
295 $(if $(and $(filter YES,$(ArchSupportsSplitObjs)),\
296 $(filter YES,$(OsSupportsSplitObjs)),\
297 $(filter NO,$(SplitObjsBroken)),\
298 $(filter NO,$(GhcUnregisterised))),\
299 YES,NO))
300
301 # By default, enable SplitObjs for the libraries if this build supports it
302 SplitObjs=$(SupportsSplitObjs)
303
304 # ----------------------------------------------------------------------------
305 # Package-related things
306
307 # Whether to install the extra packages
308 InstallExtraPackages = NO
309
310 # ----------------------------------------------------------------------------
311
312 # There are a number of things which technically depend on GHC (e.g. if
313 # ghc changes then Haskell files may be compiled differently, or Cabal
314 # packages may be configured differently). By default we therefore
315 # have dependencies on the compiler executable.
316
317 # However, in practice, having a dependency on GHC is just a pain: We
318 # normally don't want to spend time recompiling other things while
319 # we're working on the compiler, and even if we did, GHC will normally
320 # decide compilation isn't needed anyway. So by setting LAX_DEPENDENCIES
321 # to YES you can turn these dependencies into order-only dependencies,
322 # i.e. GHC must exist, but if it's newer than other targets then
323 # rebuilding is not necessary.
324
325 LAX_DEPENDENCIES = NO
326
327 # ----------------------------------------------------------------------------
328 # Options for GHC's RTS
329
330 # Build an optimised RTS. Remember that we need to turn on
331 # optimisation both for C code (-optc-O2) and .cmm code (-O2). For
332 # the debugging RTS flavour, rts/ghc.mk overrides these to turn off
333 # optimisation.
334 GhcRtsHcOpts=-O2
335 GhcRtsCcOpts=-O2 -fomit-frame-pointer -g
336
337 # Include support for CPU performance counters via the PAPI library in the RTS?
338 # (PAPI: http://icl.cs.utk.edu/papi/)
339 GhcRtsWithPapi = NO
340 PapiLibDir=
341 PapiIncludeDir=
342
343 # Configuration for libffi
344 UseSystemLibFFI=@UseSystemLibFFI@
345 # Flags to go into package.conf for rts
346 FFILibDir=@FFILibDir@
347 FFIIncludeDir=@FFIIncludeDir@
348
349
350 ################################################################################
351 #
352 # Paths (see paths.mk)
353 #
354 ################################################################################
355
356 # Directory used by GHC (and possibly other tools) for storing
357 # temporary files. If your TMPDIR isn't big enough, either override
358 # this in build.mk or set your environment variable "TMPDIR" to point
359 # to somewhere with more space. (TMPDIR=. is a good choice).
360
361 # DEFAULT_TMPDIR isn't called TMPDIR because GNU make tends to
362 # override an environment variable with the value of the make variable
363 # of the same name (if it exists) when executing sub-processes, so
364 # setting the TMPDIR env var would have no effect in the build tree.
365
366 DEFAULT_TMPDIR = /tmp
367 ifeq "$(TARGETPLATFORM)" "i386-unknown-cygwin32"
368 DEFAULT_TMPDIR = /C/TEMP
369 endif
370 ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
371 DEFAULT_TMPDIR = /C/TEMP
372 endif
373
374 BIN_DIST_NAME = ghc-$(ProjectVersion)
375 BIN_DIST_PREP_DIR = bindistprep/$(BIN_DIST_NAME)
376 BIN_DIST_PREP_TAR = bindistprep/$(BIN_DIST_NAME)-$(TARGETPLATFORM).tar
377 BIN_DIST_PREP_TAR_COMP = $(BIN_DIST_PREP_TAR).$(TAR_COMP_EXT)
378 BIN_DIST_TAR_COMP = $(BIN_DIST_NAME)-$(TARGETPLATFORM).tar.$(TAR_COMP_EXT)
379
380 # -----------------------------------------------------------------------------
381 # Utilities programs: flags
382
383 # If you want to give any standard flags to pretty much any utility
384 # (see utils.mk for a complete list), by adding a line here
385 #
386 # SRC_P_OPTS += ...
387 #
388 # where P is the utility. For example, to add -O to all Haskell
389 # compilations,
390 #
391 # SRC_HC_OPTS += -O
392
393
394 # SRC_HC_OPTS includes flags to be added to *every* Haskell
395 # compilation. Setting SRC_HC_OPTS is a good way to set the default
396 # optimisation level (-O) and heap size (-H<size>).
397 #
398 # SRC_HC_OPTS is *not* for adding flags that are required to make your
399 # build work. Examples:
400 #
401 # - instead of using -pgmc/-pgma-/-pgml, use the --with-gcc option to configure
402 #
403 # - if you need -optc, -opta, or -optl flags, the CONF_CC_* and CONF_LD_*
404 # variables are more appropriate (set via configure)
405 #
406 # Note that SRC_HC_OPTS are added to every Haskell compilation,
407 # including when using the bootstrapping compiler (stage 0), So don't
408 # put options here that are only supported by very recent GHCs.
409 #
410 SRC_HC_OPTS += -H32m -O
411
412 # Disable -O2 optimization. Otherwise amount of generated C code
413 # makes things very slow to compile (~5 minutes on core-i7 for 'compiler/hsSyn/HsExpr.lhs')
414 # and sometimes not compile at all (powerpc64 overflows something
415 # on 'compiler/hsSyn/HsExpr.lhs').
416 ifeq "$(GhcUnregisterised)" "YES"
417 GhcStage1HcOpts=
418 GhcStage2HcOpts=
419 GhcStage3HcOpts=
420 endif
421
422 # -----------------------------------------------------------------------------
423 # Names of programs in the GHC tree
424
425 MKDIRHIER = $(INPLACE_BIN)/mkdirhier
426
427 GENERATED_FILE = chmod a-w
428 EXECUTABLE_FILE = chmod +x
429
430 #-----------------------------------------------------------------------------
431 # Installed GHC
432
433 # $(GHC) points to installed version of the compiler.
434 #
435 # NOTE: Don't override $(GHC) in build.mk, use configure --with-ghc instead
436 # (because the version numbers have to be calculated).
437
438 GHC := @WithGhc@
439 # If we have a make dependency on c:/ghc/ghc, and the file is actually
440 # called c:/ghc/ghc.exe, then make will think that ghc doesn't exist
441 # and that it doesn't know how to create it.
442 ifneq "$(wildcard $(GHC).exe)" ""
443 GHC := $(GHC).exe
444 endif
445
446 GHC_STAGE0 = $(GHC)
447 GHC_STAGE1 = $(ghc-stage1_INPLACE)
448 GHC_STAGE2 = $(ghc-stage2_INPLACE)
449 GHC_STAGE3 = $(ghc-stage3_INPLACE)
450
451 BOOTSTRAPPING_CONF = libraries/bootstrapping.conf
452
453 INPLACE_PACKAGE_CONF = $(INPLACE_LIB)/package.conf.d
454
455 GhcVersion = @GhcVersion@
456 GhcPatchLevel = @GhcPatchLevel@
457 GhcMajVersion = @GhcMajVersion@
458 GhcMinVersion = @GhcMinVersion@
459
460 # Canonicalised ghc version number, used for easy (integer) version
461 # comparisons. We must expand $(GhcMinVersion) to two digits by
462 # adding a leading zero if necessary:
463 ifneq "$(findstring $(GhcMinVersion), 0 1 2 3 4 5 6 7 8 9)" ""
464 GhcCanonVersion = $(GhcMajVersion)0$(GhcMinVersion)
465 else
466 GhcCanonVersion = $(GhcMajVersion)$(GhcMinVersion)
467 endif
468
469 GHC_PACKAGE_DB_FLAG = @GHC_PACKAGE_DB_FLAG@
470
471 CMM_SINK_BOOTSTRAP_IS_NEEDED = @CMM_SINK_BOOTSTRAP_IS_NEEDED@
472
473 SUPPORTS_PACKAGE_KEY = @SUPPORTS_PACKAGE_KEY@
474
475 #-----------------------------------------------------------------------------
476 # C compiler
477 #
478 # NB. Don't override $(WhatGccIsCalled) using build.mk, re-configure using
479 # the flag --with-gcc=<blah> instead. The reason is that the configure script
480 # needs to know which gcc you're using in order to perform its tests.
481
482 WhatGccIsCalled = @WhatGccIsCalled@
483 GccVersion = @GccVersion@
484 ifeq "$(phase)" "0"
485 CrossCompilePrefix =
486 else
487 CrossCompilePrefix = @CrossCompilePrefix@
488 endif
489 # TargetPlatformFull retains the string passed to configure so we have it in
490 # the necessary format to pass to libffi's configure.
491 TargetPlatformFull = @TargetPlatformFull@
492 GccLT34 = @GccLT34@
493 GccLT46 = @GccLT46@
494 GccIsClang = @GccIsClang@
495
496 CC = $(WhatGccIsCalled)
497 CC_STAGE0 = @CC_STAGE0@
498 CC_STAGE1 = $(CC)
499 CC_STAGE2 = $(CC)
500 CC_STAGE3 = $(CC)
501
502 AS = $(WhatGccIsCalled)
503 AS_STAGE0 = @CC_STAGE0@
504 AS_STAGE1 = $(AS)
505 AS_STAGE2 = $(AS)
506 AS_STAGE3 = $(AS)
507
508 # We don't have an LD_STAGE0. CC_STAGE0 is determined by asking "ghc
509 # --info", and it doesn't report an LD.
510 LD_STAGE0 = error-no-ld-stage0
511 LD_STAGE1 = $(LD)
512 LD_STAGE2 = $(LD)
513 LD_STAGE3 = $(LD)
514
515 # Cross-compiling options
516 #
517 CrossCompiling = @CrossCompiling@
518
519 # Change this to YES if you're building a cross-compiler and don't
520 # want to build stage 2.
521 Stage1Only = NO
522
523 # Install stage 2 by default, or stage 1 in the cross compiler
524 # case. Can be changed to 3
525 INSTALL_GHC_STAGE= $(if $(filter YES,$(Stage1Only)),1,2)
526
527 # C compiler and linker flags from configure (e.g. -m<blah> to select
528 # correct C compiler backend). The stage number is the stage of GHC
529 # that is being used to compile with.
530 CONF_CC_OPTS_STAGE0 = @CONF_CC_OPTS_STAGE0@
531 CONF_CC_OPTS_STAGE1 = @CONF_CC_OPTS_STAGE1@
532 CONF_CC_OPTS_STAGE2 = @CONF_CC_OPTS_STAGE2@
533 CONF_GCC_LINKER_OPTS_STAGE0 = @CONF_GCC_LINKER_OPTS_STAGE0@
534 CONF_GCC_LINKER_OPTS_STAGE1 = @CONF_GCC_LINKER_OPTS_STAGE1@
535 CONF_GCC_LINKER_OPTS_STAGE2 = @CONF_GCC_LINKER_OPTS_STAGE2@
536 CONF_LD_LINKER_OPTS_STAGE0 = @CONF_LD_LINKER_OPTS_STAGE0@
537 CONF_LD_LINKER_OPTS_STAGE1 = @CONF_LD_LINKER_OPTS_STAGE1@
538 CONF_LD_LINKER_OPTS_STAGE2 = @CONF_LD_LINKER_OPTS_STAGE2@
539 CONF_CPP_OPTS_STAGE0 = @CONF_CPP_OPTS_STAGE0@
540 CONF_CPP_OPTS_STAGE1 = @CONF_CPP_OPTS_STAGE1@
541 CONF_CPP_OPTS_STAGE2 = @CONF_CPP_OPTS_STAGE2@
542
543 ifeq "$(TARGETPLATFORM)" "ia64-unknown-linux"
544 CONF_CC_OPTS += -G0
545 endif
546
547 # The .hsc files aren't currently safe for cross-compilation on Windows:
548 # libraries\haskeline\.\System\Console\Haskeline\Backend\Win32.hsc:160
549 # directive "let" is not safe for cross-compilation
550 ifneq "$(Windows_Host)" "YES"
551 SRC_HSC2HS_OPTS += --cross-safe
552 endif
553 SRC_HSC2HS_OPTS += $(foreach d,$(GMP_INCLUDE_DIRS),-I$(d))
554
555 define set_stage_HSC2HS_OPTS
556 # $1 = stage
557 SRC_HSC2HS_OPTS_STAGE$1 += $$(addprefix --cflag=,$$(filter-out -O,$$(SRC_CC_OPTS) $$(CONF_CC_OPTS_STAGE$1)))
558 SRC_HSC2HS_OPTS_STAGE$1 += $$(addprefix --cflag=,$$(CONF_CPP_OPTS_STAGE$1))
559 SRC_HSC2HS_OPTS_STAGE$1 += $$(addprefix --lflag=,$$(CONF_GCC_LINKER_OPTS_STAGE$1))
560 endef
561 $(eval $(call set_stage_HSC2HS_OPTS,0))
562 $(eval $(call set_stage_HSC2HS_OPTS,1))
563 $(eval $(call set_stage_HSC2HS_OPTS,2))
564 ifeq "$(CrossCompiling)" "YES"
565 SRC_HSC2HS_OPTS_STAGE1 += --cross-compile
566 SRC_HSC2HS_OPTS_STAGE2 += --cross-compile
567 endif
568 SRC_HSC2HS_OPTS_STAGE0 += --cflag=-D$(HostArch_CPP)_HOST_ARCH=1 --cflag=-D$(HostOS_CPP)_HOST_OS=1
569 SRC_HSC2HS_OPTS_STAGE1 += --cflag=-D$(TargetArch_CPP)_HOST_ARCH=1 --cflag=-D$(TargetOS_CPP)_HOST_OS=1
570 SRC_HSC2HS_OPTS_STAGE2 += --cflag=-D$(TargetArch_CPP)_HOST_ARCH=1 --cflag=-D$(TargetOS_CPP)_HOST_OS=1
571
572 ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
573 WINDRES = $(INPLACE_MINGW)/bin/windres
574 else ifeq "$(TARGETPLATFORM)" "x86_64-unknown-mingw32"
575 WINDRES = $(INPLACE_MINGW)/bin/windres
576 endif
577
578 #-----------------------------------------------------------------------------
579 # Mingwex Library
580 #
581 HaveLibMingwEx = @HaveLibMingwEx@
582 ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
583 DLLTOOL = inplace/mingw/bin/dlltool.exe
584 else ifeq "$(TARGETPLATFORM)" "x86_64-unknown-mingw32"
585 DLLTOOL = inplace/mingw/bin/dlltool.exe
586 endif
587
588 #-----------------------------------------------------------------------------
589 # Other standard (ha!) Unix utilities
590
591 AR = @ArCmd@
592 AR_OPTS = @ArArgs@
593 ArSupportsAtFile = @ArSupportsAtFile@
594
595 AR_STAGE0 = @AR_STAGE0@
596 AR_STAGE1 = $(AR)
597 AR_STAGE2 = $(AR)
598 AR_STAGE3 = $(AR)
599 AR_OPTS_STAGE0 = @AR_OPTS_STAGE0@
600 AR_OPTS_STAGE1 = $(AR_OPTS)
601 AR_OPTS_STAGE2 = $(AR_OPTS)
602 AR_OPTS_STAGE3 = $(AR_OPTS)
603 EXTRA_AR_ARGS_STAGE0 = $(EXTRA_AR_ARGS)
604 EXTRA_AR_ARGS_STAGE1 = $(EXTRA_AR_ARGS)
605 EXTRA_AR_ARGS_STAGE2 = $(EXTRA_AR_ARGS)
606 EXTRA_AR_ARGS_STAGE3 = $(EXTRA_AR_ARGS)
607 ArSupportsAtFile_STAGE0 = @ArSupportsAtFile_STAGE0@
608 ArSupportsAtFile_STAGE1 = $(ArSupportsAtFile)
609 ArSupportsAtFile_STAGE2 = $(ArSupportsAtFile)
610 ArSupportsAtFile_STAGE3 = $(ArSupportsAtFile)
611
612 CONTEXT_DIFF = @ContextDiffCmd@
613 CP = cp
614
615 # It's not easy to separate the CPP program from its flags, as
616 # AC_PROG_CPP defines CPP as "/usr/bin/gcc -E"
617 CPP = @CPP@ @CPPFLAGS@
618 HS_CPP = @HaskellCPPCmd@ @HaskellCPPArgs@
619
620 FIND = @FindCmd@
621
622 #
623 # Sigh - the autoconf macro for INSTALL will subst a relative path to the fallback
624 # install-sh script (if chosen). This not terribly useful to us, so we convert
625 # it into an abs. path.
626 #
627 INSTALL = @INSTALL@
628 INSTALL := $(subst .././install-sh,$(TOP)/install-sh,$(INSTALL))
629
630 LN_S = @LN_S@
631 MV = mv
632 PERL = @PerlCmd@
633 PIC = pic
634 RANLIB_CMD = @RANLIB_CMD@
635 REAL_RANLIB_CMD = @REAL_RANLIB_CMD@
636 SED = @SedCmd@
637 SHELL = @SHELL@
638
639 HaveDtrace = @HaveDtrace@
640 USE_DTRACE = $(HaveDtrace)
641 DTRACE = @DtraceCmd@
642
643 LD = @LdCmd@
644 NM = @NmCmd@
645 AR = @ArCmd@
646 OBJDUMP = @ObjdumpCmd@
647
648 LLC = @LlcCmd@
649 OPT = @OptCmd@
650
651 # GNU ld supports input via a linker script, which is useful to avoid
652 # overflowing command-line length limits.
653 LdIsGNULd = @LdIsGNULd@
654
655 # Set to YES if ld has the --build-id flag. Sometimes we need to
656 # disable it with --build-id=none.
657 LdHasBuildId = @LdHasBuildId@
658
659 # Set to YES if ld has the --no_compact_unwind flag. See #5019
660 # and compiler/main/DriverPipeline.hs.
661 LdHasNoCompactUnwind = @LdHasNoCompactUnwind@
662
663 # On MSYS, building with SplitObjs=YES fails with
664 # ar: Bad file number
665 # see #3201. We need to specify a smaller max command-line size
666 # to work around it. 32767 doesn't work; 30000 does, but says
667 # xargs: value for -s option should be < 28153
668 # so we now use 20000 to be comfortably below this bound
669 XARGS = xargs
670 ifeq "$(Windows_Host)" "YES"
671 XARGS_OPTS = -s 20000
672 endif
673
674 ifeq "$(TARGETPLATFORM)" "x86_64-unknown-mingw32"
675 STRIP_CMD = $(TOP)/inplace/mingw/bin/strip.exe
676 else
677 STRIP_CMD = strip
678 endif
679 PATCH_CMD = @PatchCmd@
680 TAR_CMD = @TarCmd@
681 BZIP2_CMD = bzip2
682 GZIP_CMD = gzip
683 XZ_CMD = xz -9e
684
685 # bzip2 is default compression
686 TAR_COMP = bzip2
687
688 # select compression command and .tar extension based on TAR_COMP value
689 ifeq "$(TAR_COMP)" "bzip2"
690 TAR_COMP_CMD = $(BZIP2_CMD)
691 TAR_COMP_EXT = bz2
692 else ifeq "$(TAR_COMP)" "gzip"
693 TAR_COMP_CMD = $(GZIP_CMD)
694 TAR_COMP_EXT = gz
695 else ifeq "$(TAR_COMP)" "xz"
696 TAR_COMP_CMD = $(XZ_CMD)
697 TAR_COMP_EXT = xz
698 else
699 $(error $$(TAR_COMP) set to unknown value "$(TAR_COMP)" (supported: "bzip2", "gzip", "xz"))
700 endif
701
702 ifeq "$(Windows_Host)" "YES"
703 TOUCH_CMD = $(utils/touchy_dist_INPLACE)
704 TOUCH_DEP = $(TOUCH_CMD)
705 else
706 TOUCH_CMD = touch
707 TOUCH_DEP =
708 endif
709
710 HSCOLOUR_CMD = @HSCOLOUR@
711
712 TIME_CMD = @TimeCmd@
713
714 #-----------------------------------------------------------------------------
715 # DocBook XML stuff
716
717 BUILD_DOCBOOK_HTML = @BUILD_DOCBOOK_HTML@
718 BUILD_DOCBOOK_PS = @BUILD_DOCBOOK_PS@
719 BUILD_DOCBOOK_PDF = @BUILD_DOCBOOK_PDF@
720 DBLATEX = @DblatexCmd@
721 # filename.as.url=0 is needed with dblatex 0.3.4 (#7486)
722 DBLATEX_OPTS = -P 'filename.as.url=0' -P 'latex.unicode.use=1'
723 XSLTPROC = @XsltprocCmd@
724 XMLLINT = @XmllintCmd@
725 HAVE_DOCBOOK_XSL = @HAVE_DOCBOOK_XSL@
726 XSLTPROC_HTML_STYLESHEET = http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl
727 XSLTPROC_LABEL_OPTS = --stringparam toc.section.depth 3 \
728 --stringparam section.autolabel 1 \
729 --stringparam section.label.includes.component.label 1
730
731 #-----------------------------------------------------------------------------
732 # FPtools support software
733
734 #
735 # ghc-pkg
736 #
737 GHC_PKG = @GhcPkgCmd@
738
739 #
740 # Happy
741 #
742 HAPPY = @HappyCmd@
743 HAPPY_VERSION = @HappyVersion@
744 #
745 # Options to pass to Happy when we're going to compile the output with GHC
746 #
747 SRC_HAPPY_OPTS = -agc --strict
748
749 #
750 # Alex
751 #
752 ALEX = @AlexCmd@
753 ALEX_VERSION = @AlexVersion@
754 Alex3 = @Alex3@
755 #
756 # Options to pass to Alex when we're going to compile the output with GHC
757 #
758 SRC_ALEX_OPTS = -g
759 ifeq "$(Alex3)" "YES"
760 # The compiler isn't using the Unicode support in Alex 3.0 yet, in fact we do our own
761 # Unicode handling, so diable Alex's.
762 compiler_ALEX_OPTS = --latin1
763 endif
764
765 # Should we build haddock docs?
766 HADDOCK_DOCS = YES
767 # And HsColour the sources?
768 ifeq "$(HSCOLOUR_CMD)" ""
769 HSCOLOUR_SRCS = NO
770 else
771 HSCOLOUR_SRCS = YES
772 endif
773
774 # Build DPH?
775 BUILD_DPH = NO
776
777 ################################################################################
778 #
779 # Library configure arguments
780 #
781 ################################################################################
782
783 CONFIGURE_ARGS = @CONFIGURE_ARGS@
784
785 ################################################################################
786 #
787 # To be passed to sub-builds
788 #
789 ################################################################################
790
791 ICONV_INCLUDE_DIRS = @ICONV_INCLUDE_DIRS@
792 ICONV_LIB_DIRS = @ICONV_LIB_DIRS@
793
794 GMP_INCLUDE_DIRS = @GMP_INCLUDE_DIRS@
795 GMP_LIB_DIRS = @GMP_LIB_DIRS@
796
797 CURSES_INCLUDE_DIRS = @CURSES_INCLUDE_DIRS@
798 CURSES_LIB_DIRS = @CURSES_LIB_DIRS@