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