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