Follow Windows -> Windows_Host change in config.mk.in
[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 # Do we support shared libs?
92 SharedLibsPlatformList = \
93 i386-unknown-linux x86_64-unknown-linux \
94 i386-unknown-freebsd x86_64-unknown-freebsd \
95 i386-unknown-openbsd x86_64-unknown-openbsd \
96 i386-unknown-netbsd x86_64-unknown-netbsd \
97 i386-unknown-mingw32 x86_64-unknown-mingw32 \
98 i386-apple-darwin x86_64-apple-darwin powerpc-apple-darwin
99
100 ifeq "$(SOLARIS_BROKEN_SHLD)" "NO"
101 SharedLibsPlatformList += i386-unknown-solaris2
102 endif
103
104 PlatformSupportsSharedLibs = $(if $(filter $(TARGETPLATFORM),\
105 $(SharedLibsPlatformList)),YES,NO)
106
107 # DYNAMIC_BY_DEFAULT says whether this compiler will default to
108 # building dynamic executables, i.e. -dynamic is on. We do this for
109 # most platforms because it lets us use the system dynamic linker
110 # instead of our own linker for GHCi.
111 #
112 # Currently this isn't possible on Windows, and we have not yet enabled
113 # it on i386 while we consider the performance implications.
114 #
115 ifeq "$(TargetOS_CPP)" "mingw32"
116 DYNAMIC_BY_DEFAULT = NO
117 else ifeq "$(TargetArch_CPP)" "i386"
118 DYNAMIC_BY_DEFAULT = NO
119 else
120 DYNAMIC_BY_DEFAULT = YES
121 endif
122
123 # For now, we unconditionally disable dynamic-by-default, as the
124 # cabal-install's that are in the wild don't handle it properly.
125 DYNAMIC_BY_DEFAULT = NO
126
127 # For now, we unconditionally disable building with -dynamic-too
128 DYNAMIC_TOO = NO
129
130 # Build a compiler that will build *unregisterised* libraries and
131 # binaries by default. Unregisterised code is supposed to compile and
132 # run without any support for architecture-specific assembly mangling,
133 # register assignment or tail-calls, and is therefore a good way to get
134 # started when porting GHC to new architectures.
135 #
136 # NOTE: the stage1 compiler will be a registerised binary (assuming
137 # the compiler you build with is generating registerised binaries), but
138 # the stage2 compiler will be an unregisterised binary.
139 #
140 GhcUnregisterised=@Unregisterised@
141
142 # Build a compiler with a native code generator backend
143 # (as well as a C backend)
144 #
145 # Target platforms supported:
146 # i386, powerpc
147 # AIX is not supported
148 ArchSupportsNCG=$(strip $(patsubst $(TargetArch_CPP), YES, $(findstring $(TargetArch_CPP), i386 x86_64 powerpc sparc)))
149 OsSupportsNCG=$(strip $(patsubst $(TargetOS_CPP), YES, $(patsubst aix,,$(TargetOS_CPP))))
150
151 GhcWithNativeCodeGen := $(strip\
152 $(if $(filter YESYESNO,\
153 $(OsSupportsNCG)$(ArchSupportsNCG)$(GhcUnregisterised)),YES,NO))
154
155 HaveLibDL = @HaveLibDL@
156
157 # ArchSupportsSMP should be set iff there is support for that arch in
158 # includes/stg/SMP.h
159 ArchSupportsSMP=$(strip $(patsubst $(TargetArch_CPP), YES, $(findstring $(TargetArch_CPP), i386 x86_64 sparc powerpc arm)))
160
161 GhcWithSMP := $(strip $(if $(filter YESNO, $(ArchSupportsSMP)$(GhcUnregisterised)),YES,NO))
162
163 # Whether to include GHCi in the compiler. Depends on whether the RTS linker
164 # has support for this OS/ARCH combination.
165
166 OsSupportsGHCi=$(strip $(patsubst $(TargetOS_CPP), YES, $(findstring $(TargetOS_CPP), mingw32 cygwin32 linux solaris2 freebsd dragonfly netbsd openbsd darwin kfreebsdgnu)))
167 ArchSupportsGHCi=$(strip $(patsubst $(TargetArch_CPP), YES, $(findstring $(TargetArch_CPP), i386 x86_64 powerpc sparc sparc64 arm)))
168
169 ifeq "$(OsSupportsGHCi)$(ArchSupportsGHCi)" "YESYES"
170 GhcWithInterpreter=YES
171 else
172 GhcWithInterpreter=$(if $(findstring YES,$(DYNAMIC_BY_DEFAULT)),YES,NO)
173 endif
174
175 # GhcEnableTablesNextToCode tells us whether the target architecture
176 # supports placing info tables directly before the entry code
177 # (see TABLES_NEXT_TO_CODE in the RTS). Whether we actually compile for
178 # TABLES_NEXT_TO_CODE depends on whether we're building unregisterised
179 # code or not, which may be decided by options to the compiler later.
180 ifneq "$(findstring $(TargetArch_CPP)X, ia64X powerpc64X)" ""
181 GhcEnableTablesNextToCode=NO
182 else
183 GhcEnableTablesNextToCode=YES
184 endif
185
186 # Whether to use libffi for adjustors (foreign import "wrapper") or
187 # not. If we have built-in support (rts/Adjustor.c) then we use that,
188 # otherwise we fall back on libffi, which is slightly slower.
189 ArchHasAdjustorSupport = $(if $(findstring $(TargetArch_CPP),i386 x86_64),YES,NO)
190 ifeq "$(ArchHasAdjustorSupport)" "YES"
191 UseLibFFIForAdjustors=NO
192 else
193 UseLibFFIForAdjustors=YES
194 endif
195
196 # On Windows we normally want to make a relocatable bindist, to we
197 # ignore flags like libdir
198 ifeq "$(Windows_Host)" "YES"
199 RelocatableBuild = YES
200 else
201 RelocatableBuild = NO
202 endif
203
204 # needs to be after $(RelocatableBuild) is set above
205 include $(TOP)/mk/install.mk
206
207 # When building bindists we set this to yes so that the binaries are as
208 # portable as possible.
209 BeConservative = NO
210
211 ExtraMakefileSanityChecks = NO
212
213 #
214 # Building various ways?
215 # (right now, empty if not).
216 BuildingParallel=$(subst mp,YES,$(filter mp,$(WAYS)))
217 BuildingGranSim=$(subst mg,YES,$(filter mg,$(WAYS)))
218
219 #------------------------------------------------------------------------------
220 # Options for Libraries
221
222 # Which directory (in libraries/) contains the integer library?
223 INTEGER_LIBRARY=integer-gmp
224
225 # We build the libraries at least the "vanilla" way (way "v")
226 GhcLibWays = v
227
228 # In addition to the normal sequential way, the default is to also build
229 # profiled prelude libraries unless we are booting from .hc files
230 ifneq "$(BootingFromHc)" "YES"
231 GhcLibWays += p
232 endif
233
234 ifeq "$(PlatformSupportsSharedLibs)" "YES"
235 GhcLibWays += dyn
236 endif
237
238 # Handy way to test whether we're building shared libs or not.
239 BuildSharedLibs=$(strip $(if $(findstring dyn,$(GhcLibWays)),YES,NO))
240
241 # In addition, the RTS is built in some further variations. Ways that
242 # make sense here:
243 #
244 # thr : threaded
245 # thr_p : threaded profiled
246 # debug : debugging (compile with -g for the C compiler, and -DDEBUG)
247 # debug_p : debugging profiled
248 # thr_debug : debugging threaded
249 # thr_debug_p : debugging threaded profiled
250 # l : event logging
251 # thr_l : threaded and event logging
252 #
253 GhcRTSWays=l
254
255 # Usually want the debug version
256 ifeq "$(BootingFromHc)" "NO"
257 GhcRTSWays += debug
258 endif
259
260 # We always have the threaded versions, but note that SMP support may be disabled
261 # (see GhcWithSMP).
262 GhcRTSWays += thr thr_debug thr_l
263 GhcRTSWays += $(if $(findstring p, $(GhcLibWays)),thr_p,)
264 GhcRTSWays += $(if $(findstring dyn, $(GhcLibWays)),dyn debug_dyn thr_dyn thr_debug_dyn l_dyn thr_l_dyn,)
265
266 # We can only build GHCi threaded if we have a threaded RTS:
267 GhcThreaded = $(if $(findstring thr,$(GhcRTSWays)),YES,NO)
268
269 # Option flags to pass to GHC when it's compiling modules in
270 # fptools/libraries. Typically these are things like -O or
271 # -dcore-lint or -H32m. The ones that are *essential* are wired into
272 # the build system.
273 #
274 # -O(2) is pretty desirable, otherwise no inlining of prelude
275 # things (incl "+") happens when compiling with this compiler
276
277 GhcLibHcOpts=-O2
278
279 # Strip local symbols from libraries? This can make the libraries smaller,
280 # but makes debugging somewhat more difficult. Doesn't work with all ld's.
281 #
282 StripLibraries=NO
283
284 # These are the URL patterns that Haddock uses to generate the "Source
285 # File" links on each page.
286 PackageSourceURL = http://darcs.haskell.org/packages/$(PACKAGE)/%{FILE}
287
288 # ----------------------------------------------------------------------------
289 # Object-file splitting
290 #
291 # Set SplitObjs=YES or NO in your build.mk
292 #
293 # Don't use -split-objs in in GhcLibHcOpts, because the build
294 # system needs to do other special magic if you are
295 # doing object-file splitting
296
297 ArchSupportsSplitObjs=$(strip $(if $(filter $(TargetArch_CPP),i386 x86_64 powerpc sparc),YES,NO))
298 OsSupportsSplitObjs=$(strip $(if $(filter $(TargetOS_CPP),mingw32 cygwin32 linux darwin solaris2 freebsd dragonfly netbsd openbsd),YES,NO))
299 SplitObjsBroken = @SplitObjsBroken@
300
301 SupportsSplitObjs := $(strip \
302 $(if $(and $(filter YES,$(ArchSupportsSplitObjs)),\
303 $(filter YES,$(OsSupportsSplitObjs)),\
304 $(filter NO,$(SplitObjsBroken)),\
305 $(filter NO,$(BootingFromHc)),\
306 $(filter NO,$(GhcUnregisterised))),\
307 YES,NO))
308
309 # By default, enable SplitObjs for the libraries if this build supports it
310 SplitObjs=$(SupportsSplitObjs)
311
312 # ----------------------------------------------------------------------------
313 # Package-related things
314
315 # Whether to install the extra packages
316 InstallExtraPackages = NO
317
318 # Run "ghc-pkg check" on each package
319 CHECK_PACKAGES = NO
320
321 # ----------------------------------------------------------------------------
322
323 # There are a number of things which technically depend on GHC (e.g. if
324 # ghc changes then Haskell files may be compiled differently, or Cabal
325 # packages may be configured differently). By default we therefore
326 # have dependencies on the compiler executable.
327
328 # However, in practice, having a dependency on GHC is just a pain: We
329 # normally don't want to spend time recompiling other things while
330 # we're working on the compiler, and even if we did, GHC will normally
331 # decide compilation isn't needed anyway. So by setting LAX_DEPENDENCIES
332 # to YES you can turn these dependencies into order-only dependencies,
333 # i.e. GHC must exist, but if it's newer than other targets then
334 # rebuilding is not necessary.
335
336 LAX_DEPENDENCIES = NO
337
338 # ----------------------------------------------------------------------------
339 # Options for GHC's RTS
340
341 # Build an optimised RTS. Remember that we need to turn on
342 # optimisation both for C code (-optc-O2) and .cmm code (-O2). For
343 # the debugging RTS flavour, rts/ghc.mk overrides these to turn off
344 # optimisation.
345 GhcRtsHcOpts=-O2
346 GhcRtsCcOpts=-O2 -fomit-frame-pointer
347
348 # Include the front panel code? Needs GTK+.
349 GhcRtsWithFrontPanel = NO
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_BZ2 = $(BIN_DIST_PREP_TAR).bz2
392 BIN_DIST_TAR_BZ2 = $(BIN_DIST_NAME)-$(TARGETPLATFORM).tar.bz2
393 BIN_DIST_LIST = bindist-list
394
395 WINDOWS_INSTALLER_BASE = ghc-$(ProjectVersion)-$(TargetArch_CPP)-windows
396 WINDOWS_INSTALLER = $(WINDOWS_INSTALLER_BASE)$(exeext)
397
398 # -----------------------------------------------------------------------------
399 # Utilities programs: flags
400
401 # If you want to give any standard flags to pretty much any utility
402 # (see utils.mk for a complete list), by adding a line here
403 #
404 # SRC_P_OPTS += ...
405 #
406 # where P is the utility. For example, to add -O to all Haskell
407 # compilations,
408 #
409 # SRC_HC_OPTS += -O
410
411
412 # SRC_HC_OPTS includes flags to be added to *every* Haskell
413 # compilation. Setting SRC_HC_OPTS is a good way to set the default
414 # optimisation level (-O) and heap size (-H<size>).
415 #
416 # SRC_HC_OPTS is *not* for adding flags that are required to make your
417 # build work. Examples:
418 #
419 # - instead of using -pgmc/-pgma-/-pgml, use the --with-gcc option to configure
420 #
421 # - if you need -optc, -opta, or -optl flags, the CONF_CC_* and CONF_LD_*
422 # variables are more appropriate (set via configure)
423 #
424 # Note that SRC_HC_OPTS are added to every Haskell compilation,
425 # including when using the bootstrapping compiler (stage 0), So don't
426 # put options here that are only supported by very recent GHCs.
427 #
428 SRC_HC_OPTS += -H32m -O
429
430 # These flags make flex 8-bit
431 SRC_FLEX_OPTS += -8
432
433
434 # -----------------------------------------------------------------------------
435 # Names of programs in the GHC tree
436 #
437 # xxx_PGM the name of an executable, without the path
438 # xxx the executable relative to the current dir
439
440 GHC_UNLIT_PGM = unlit$(exeext)
441 GHC_HSC2HS_PGM = hsc2hs$(exeext)
442 GHC_TOUCHY_PGM = touchy$(exeext)
443 GHC_SPLIT_PGM = ghc-split
444 GHC_GENPRIMOP_PGM = genprimopcode$(exeext)
445 GHC_GENAPPLY_PGM = genapply$(exeext)
446 GHC_CABAL_PGM = ghc-cabal$(exeext)
447 GHC_PKG_PGM = ghc-pkg$(exeext)
448 GHC_MKDIRHIER_PGM = mkdirhier
449
450 SPLIT = $(INPLACE_LIB)/$(GHC_SPLIT_PGM)
451
452 UNLIT = $(INPLACE_LIB)/$(GHC_UNLIT_PGM)
453 TOUCHY = $(INPLACE_LIB)/$(GHC_TOUCHY_PGM)
454 MKDIRHIER = $(INPLACE_BIN)/$(GHC_MKDIRHIER_PGM)
455 GHC_CABAL_INPLACE = $(INPLACE_BIN)/$(GHC_CABAL_PGM)
456 GENAPPLY_INPLACE = $(INPLACE_BIN)/$(GHC_GENAPPLY_PGM)
457 GHC_PKG_INPLACE = $(INPLACE_BIN)/$(GHC_PKG_PGM)
458 HSC2HS_INPLACE = $(INPLACE_BIN)/$(GHC_HSC2HS_PGM)
459 GENPRIMOP_INPLACE = $(INPLACE_BIN)/$(GHC_GENPRIMOP_PGM)
460
461 GENERATED_FILE = chmod a-w
462 EXECUTABLE_FILE = chmod +x
463
464 #-----------------------------------------------------------------------------
465 # Installed GHC
466
467 # $(GHC) points to installed version of the compiler.
468 #
469 # NOTE: Don't override $(GHC) in build.mk, use configure --with-ghc instead
470 # (because the version numbers have to be calculated).
471
472 GHC := @WithGhc@
473 # If we have a make dependency on c:/ghc/ghc, and the file is actually
474 # called c:/ghc/ghc.exe, then make will think that ghc doesn't exist
475 # and that it doesn't know how to create it.
476 ifneq "$(wildcard $(GHC).exe)" ""
477 GHC := $(GHC).exe
478 endif
479
480 # Sometimes we want to invoke ghc from the build tree in different
481 # places (eg. it's handy to have a nofib & a ghc build in the same
482 # tree). We can refer to "this ghc" as $(GHC_INPLACE):
483
484 GHC_INPLACE = $(GHC_STAGE1)
485
486 GHC_STAGE0_ABS = $(GHC)
487 GHC_STAGE1_ABS = $(TOP)/$(INPLACE_BIN)/ghc-stage1$(exeext)
488 GHC_STAGE2_ABS = $(TOP)/$(INPLACE_BIN)/ghc-stage2$(exeext)
489 GHC_STAGE3_ABS = $(TOP)/$(INPLACE_BIN)/ghc-stage3$(exeext)
490
491 GHC_STAGE0 = $(GHC)
492 GHC_STAGE1 = $(INPLACE_BIN)/ghc-stage1$(exeext)
493 GHC_STAGE2 = $(INPLACE_BIN)/ghc-stage2$(exeext)
494 GHC_STAGE3 = $(INPLACE_BIN)/ghc-stage3$(exeext)
495
496 BOOTSTRAPPING_CONF = libraries/bootstrapping.conf
497
498 INPLACE_PACKAGE_CONF = $(INPLACE_LIB)/package.conf.d
499
500 GhcVersion = @GhcVersion@
501 GhcPatchLevel = @GhcPatchLevel@
502 GhcMajVersion = @GhcMajVersion@
503 GhcMinVersion = @GhcMinVersion@
504
505 # Canonicalised ghc version number, used for easy (integer) version
506 # comparisons. We must expand $(GhcMinVersion) to two digits by
507 # adding a leading zero if necessary:
508 ifneq "$(findstring $(GhcMinVersion), 0 1 2 3 4 5 6 7 8 9)" ""
509 GhcCanonVersion = $(GhcMajVersion)0$(GhcMinVersion)
510 else
511 GhcCanonVersion = $(GhcMajVersion)$(GhcMinVersion)
512 endif
513
514 GHC_PACKAGE_DB_FLAG = @GHC_PACKAGE_DB_FLAG@
515
516 #-----------------------------------------------------------------------------
517 # C compiler
518 #
519 # NB. Don't override $(WhatGccIsCalled) using build.mk, re-configure using
520 # the flag --with-gcc=<blah> instead. The reason is that the configure script
521 # needs to know which gcc you're using in order to perform its tests.
522
523 WhatGccIsCalled = @WhatGccIsCalled@
524 GccVersion = @GccVersion@
525 ifeq "$(phase)" "0"
526 CrossCompilePrefix =
527 else
528 CrossCompilePrefix = @CrossCompilePrefix@
529 endif
530 # TargetPlatformFull retains the string passed to configure so we have it in
531 # the necessary format to pass to libffi's configure.
532 TargetPlatformFull = @TargetPlatformFull@
533 GccLT34 = @GccLT34@
534 GccLT46 = @GccLT46@
535
536 CC = $(WhatGccIsCalled)
537 CC_STAGE0 = @CC_STAGE0@
538 CC_STAGE1 = $(CC)
539 CC_STAGE2 = $(CC)
540 CC_STAGE3 = $(CC)
541
542 AS = $(WhatGccIsCalled)
543 AS_STAGE0 = @CC_STAGE0@
544 AS_STAGE1 = $(AS)
545 AS_STAGE2 = $(AS)
546 AS_STAGE3 = $(AS)
547
548 # We don't have an LD_STAGE0. CC_STAGE0 is determined by asking "ghc
549 # --info", and it doesn't report an LD.
550 LD_STAGE0 = error-no-ld-stage0
551 LD_STAGE1 = $(LD)
552 LD_STAGE2 = $(LD)
553 LD_STAGE3 = $(LD)
554
555 # Cross-compiling options
556 #
557 CrossCompiling = @CrossCompiling@
558
559 # Change this to YES if you're building a cross-compiler and don't
560 # want to build stage 2.
561 Stage1Only = NO
562
563 # Install stage 2 by default, or stage 1 in the cross compiler
564 # case. Can be changed to 3
565 INSTALL_GHC_STAGE= $(if $(filter YES,$(Stage1Only)),1,2)
566
567 # C compiler and linker flags from configure (e.g. -m<blah> to select
568 # correct C compiler backend). The stage number is the stage of GHC
569 # that is being used to compile with.
570 CONF_CC_OPTS_STAGE0 = @CONF_CC_OPTS_STAGE0@
571 CONF_CC_OPTS_STAGE1 = @CONF_CC_OPTS_STAGE1@
572 CONF_CC_OPTS_STAGE2 = @CONF_CC_OPTS_STAGE2@
573 CONF_GCC_LINKER_OPTS_STAGE0 = @CONF_GCC_LINKER_OPTS_STAGE0@
574 CONF_GCC_LINKER_OPTS_STAGE1 = @CONF_GCC_LINKER_OPTS_STAGE1@
575 CONF_GCC_LINKER_OPTS_STAGE2 = @CONF_GCC_LINKER_OPTS_STAGE2@
576 CONF_LD_LINKER_OPTS_STAGE0 = @CONF_LD_LINKER_OPTS_STAGE0@
577 CONF_LD_LINKER_OPTS_STAGE1 = @CONF_LD_LINKER_OPTS_STAGE1@
578 CONF_LD_LINKER_OPTS_STAGE2 = @CONF_LD_LINKER_OPTS_STAGE2@
579 CONF_CPP_OPTS_STAGE0 = @CONF_CPP_OPTS_STAGE0@
580 CONF_CPP_OPTS_STAGE1 = @CONF_CPP_OPTS_STAGE1@
581 CONF_CPP_OPTS_STAGE2 = @CONF_CPP_OPTS_STAGE2@
582
583 ifeq "$(TARGETPLATFORM)" "ia64-unknown-linux"
584 CONF_CC_OPTS += -G0
585 endif
586
587 # The .hsc files aren't currently safe for cross-compilation on Windows:
588 # libraries\haskeline\.\System\Console\Haskeline\Backend\Win32.hsc:160
589 # directive "let" is not safe for cross-compilation
590 ifneq "$(Windows_Host)" "YES"
591 SRC_HSC2HS_OPTS += --cross-safe
592 endif
593 SRC_HSC2HS_OPTS += $(addprefix --cflag=,$(filter-out -O,$(SRC_CC_OPTS) $(CONF_CC_OPTS_STAGE0)))
594 SRC_HSC2HS_OPTS += $(foreach d,$(GMP_INCLUDE_DIRS),-I$(d))
595 ifeq "$(CrossCompiling)" "YES"
596 SRC_HSC2HS_OPTS += --cross-compile
597 endif
598
599 ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
600 WINDRES = $(INPLACE_MINGW)/bin/windres
601 else ifeq "$(TARGETPLATFORM)" "x86_64-unknown-mingw32"
602 WINDRES = $(INPLACE_MINGW)/bin/windres
603 endif
604
605 #-----------------------------------------------------------------------------
606 # Mingwex Library
607 #
608 HaveLibMingwEx = @HaveLibMingwEx@
609 ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
610 DLLTOOL = inplace/mingw/bin/dlltool.exe
611 else ifeq "$(TARGETPLATFORM)" "x86_64-unknown-mingw32"
612 DLLTOOL = inplace/mingw/bin/dlltool.exe
613 endif
614
615 #-----------------------------------------------------------------------------
616 # Flex (currently unused, could be moved to glafp-utils)
617
618 # FLEX = @LEX@
619 # Don't bother with -lfl, we define our own yywrap()s anyway.
620 # FLEX_LIB =
621 #WAS:FLEX_LIB = @LEXLIB@
622
623 #-----------------------------------------------------------------------------
624 # Other standard (ha!) Unix utilities
625
626 AR = @ArCmd@
627 AR_OPTS = @ArArgs@
628 ArSupportsAtFile = @ArSupportsAtFile@
629
630 AR_STAGE0 = @AR_STAGE0@
631 AR_STAGE1 = $(AR)
632 AR_STAGE2 = $(AR)
633 AR_STAGE3 = $(AR)
634 AR_OPTS_STAGE0 = @AR_OPTS_STAGE0@
635 AR_OPTS_STAGE1 = $(AR_OPTS)
636 AR_OPTS_STAGE2 = $(AR_OPTS)
637 AR_OPTS_STAGE3 = $(AR_OPTS)
638 EXTRA_AR_ARGS_STAGE0 = $(EXTRA_AR_ARGS)
639 EXTRA_AR_ARGS_STAGE1 = $(EXTRA_AR_ARGS)
640 EXTRA_AR_ARGS_STAGE2 = $(EXTRA_AR_ARGS)
641 EXTRA_AR_ARGS_STAGE3 = $(EXTRA_AR_ARGS)
642 ArSupportsAtFile_STAGE0 = @ArSupportsAtFile_STAGE0@
643 ArSupportsAtFile_STAGE1 = $(ArSupportsAtFile)
644 ArSupportsAtFile_STAGE2 = $(ArSupportsAtFile)
645 ArSupportsAtFile_STAGE3 = $(ArSupportsAtFile)
646
647 CONTEXT_DIFF = @ContextDiffCmd@
648 CP = cp
649 # It's not easy to separate the CPP program from its flags, as
650 # AC_PROG_CPP defines CPP as "/usr/bin/gcc -E"
651 CPP = @CPP@ @CPPFLAGS@
652 CTAGS = $(ETAGS)
653 #
654 # RAWCPP_FLAGS are the flags to give to cpp (viz, gcc -E) to persuade it to
655 # behave plausibly on Haskell sources.
656 #
657 RAWCPP_FLAGS = -undef -traditional
658 FIND = @FindCmd@
659
660 #
661 # Sigh - the autoconf macro for INSTALL will subst a relative path to the fallback
662 # install-sh script (if chosen). This not terribly useful to us, so we convert
663 # it into an abs. path.
664 #
665 INSTALL = @INSTALL@
666 INSTALL := $(subst .././install-sh,$(TOP)/install-sh,$(INSTALL))
667
668 LN_S = @LN_S@
669 MV = mv
670 PERL = @PerlCmd@
671 PIC = pic
672 RANLIB = @RANLIB@
673 SED = @SedCmd@
674 SHELL = /bin/sh
675
676 HaveDtrace = @HaveDtrace@
677 USE_DTRACE = $(HaveDtrace)
678 DTRACE = @DtraceCmd@
679
680 LD = @LdCmd@
681 NM = @NmCmd@
682 OBJDUMP = @ObjdumpCmd@
683
684 LLC = @LlcCmd@
685 OPT = @OptCmd@
686
687 # GNU ld supports input via a linker script, which is useful to avoid
688 # overflowing command-line length limits.
689 LdIsGNULd = @LdIsGNULd@
690
691 # Set to YES if ld has the --build-id flag. Sometimes we need to
692 # disable it with --build-id=none.
693 LdHasBuildId = @LdHasBuildId@
694
695 # Set to YES if ld has the --no_compact_unwind flag. See #5019
696 # and compiler/main/DriverPipeline.hs.
697 LdHasNoCompactUnwind = @LdHasNoCompactUnwind@
698
699 # On MSYS, building with SplitObjs=YES fails with
700 # ar: Bad file number
701 # see #3201. We need to specify a smaller max command-line size
702 # to work around it. 32767 doesn't work; 30000 does, but says
703 # xargs: value for -s option should be < 28153
704 # so we now use 20000 to be comfortably below this bound
705 XARGS = xargs
706 ifeq "$(Windows_Host)" "YES"
707 XARGS_OPTS = -s 20000
708 endif
709
710 #
711 # In emergency situations, REAL_SHELL is used to perform shell commands
712 # from within the ghc driver script, by scribbling the command line to
713 # a temp file and then having $(REAL_SHELL) execute it.
714 #
715 # The reason for having to do this is that overly long command lines
716 # cause unnecessary trouble with some shells (e.g., /bin/sh on Solaris
717 # 2.5.1), which is why this backdoor is provided. The situation of overly
718 # long command lines is either encountered while doing `make boot' in compiler/,
719 # or when linking the compiler binary (`hsc').
720 #
721 # We do not use SHELL to execute long commands, as `make' will more than likely
722 # override whatever setting you have in your environment while executing.
723
724 # By default, REAL_SHELL is set equal to SHELL, which is not really a smart move
725 # as it is SHELL that will show up the bogosity in the first place, but setting
726 # it to anything else isn't really portable.
727 #
728 # ====> If long command lines cause you trouble, invoke `ghc' (via `make' or otherwise)
729 # with REAL_SHELL set to something else than /bin/sh, for instance, your favourite
730 # command shell.
731 #
732 REAL_SHELL = $(SHELL)
733
734 ifeq "$(TARGETPLATFORM)" "x86_64-unknown-mingw32"
735 STRIP_CMD = $(TOP)/inplace/mingw/bin/strip.exe
736 else
737 STRIP_CMD = strip
738 endif
739 PATCH_CMD = @PatchCmd@
740 TAR_CMD = @TarCmd@
741 BZIP2_CMD = bzip2
742 GZIP_CMD = gzip
743
744 ifeq "$(Windows_Host)" "YES"
745 TOUCH_CMD = $(utils/touchy_dist_INPLACE)
746 TOUCH_DEP = $(TOUCH_CMD)
747 else
748 TOUCH_CMD = touch
749 TOUCH_DEP =
750 endif
751
752 HSCOLOUR_CMD = @HSCOLOUR@
753
754 TIME_CMD = @TimeCmd@
755
756 # GTK+
757 GTK_CONFIG_CMD = @GTK_CONFIG@
758
759 # Set this if you want to use Inno Setup to build a Windows installer
760 # when you make a bindist
761 ISCC_CMD =
762
763 #-----------------------------------------------------------------------------
764 # DocBook XML stuff
765
766 BUILD_DOCBOOK_HTML = @BUILD_DOCBOOK_HTML@
767 BUILD_DOCBOOK_PS = @BUILD_DOCBOOK_PS@
768 BUILD_DOCBOOK_PDF = @BUILD_DOCBOOK_PDF@
769 DBLATEX = @DblatexCmd@
770 # filename.as.url=0 is needed with dblatex 0.3.4 (#7486)
771 DBLATEX_OPTS = -P 'filename.as.url=0'
772 XSLTPROC = @XsltprocCmd@
773 XMLLINT = @XmllintCmd@
774 HAVE_DOCBOOK_XSL = @HAVE_DOCBOOK_XSL@
775 XSLTPROC_HTML_STYLESHEET = http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl
776 XSLTPROC_LABEL_OPTS = --stringparam toc.section.depth 3 \
777 --stringparam section.autolabel 1 \
778 --stringparam section.label.includes.component.label 1
779
780 #-----------------------------------------------------------------------------
781 # FPtools support software
782
783 #
784 # ghc-pkg
785 #
786 GHC_PKG = @GhcPkgCmd@
787
788 #
789 # Happy
790 #
791 HAPPY = @HappyCmd@
792 HAPPY_VERSION = @HappyVersion@
793 #
794 # Options to pass to Happy when we're going to compile the output with GHC
795 #
796 SRC_HAPPY_OPTS = -agc --strict
797
798 #
799 # Alex
800 #
801 ALEX = @AlexCmd@
802 ALEX_VERSION = @AlexVersion@
803 Alex3 = @Alex3@
804 #
805 # Options to pass to Happy when we're going to compile the output with GHC
806 #
807 ifeq "$(Alex3)" "YES"
808 # We aren't using the Unicode support in Alex 3.0 yet, in fact we do our own
809 # Unicode handling, so diable Alex's.
810 SRC_ALEX_OPTS = -g --latin1
811 else
812 SRC_ALEX_OPTS = -g
813 endif
814
815 # Should we build haddock docs?
816 HADDOCK_DOCS = YES
817 # And HsColour the sources?
818 ifeq "$(HSCOLOUR_CMD)" ""
819 HSCOLOUR_SRCS = NO
820 else
821 HSCOLOUR_SRCS = YES
822 endif
823
824 ################################################################################
825 #
826 # 31-bit-Int Core files
827 #
828 ################################################################################
829
830 #
831 # It is possible to configure the compiler and prelude to support 31-bit
832 # integers, suitable for a back-end and RTS using a tag bit on a 32-bit
833 # architecture. Currently the only useful output from this option is external Core
834 # files. The following additions to your build.mk will produce the
835 # 31-bit core output. Note that this is *not* just a library "way"; the
836 # compiler must be built a special way too.
837
838 # GhcCppOpts +=-DWORD_SIZE_IN_BITS=31
839 # GhcLibHcOpts +=-fext-core -fno-code -DWORD_SIZE_IN_BITS=31
840 # GhcLibCppOpts += -DWORD_SIZE_IN_BITS=31
841 # SplitObjs=NO
842
843 ################################################################################
844 #
845 # Library configure arguments
846 #
847 ################################################################################
848
849 CONFIGURE_ARGS = @CONFIGURE_ARGS@
850
851 ################################################################################
852 #
853 # To be passed to sub-builds
854 #
855 ################################################################################
856
857 ICONV_INCLUDE_DIRS = @ICONV_INCLUDE_DIRS@
858 ICONV_LIB_DIRS = @ICONV_LIB_DIRS@
859
860 GMP_INCLUDE_DIRS = @GMP_INCLUDE_DIRS@
861 GMP_LIB_DIRS = @GMP_LIB_DIRS@