Change how the build system handles packages
[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 # 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 the front panel code? Needs GTK+.
352 GhcRtsWithFrontPanel = NO
353
354 # Include support for CPU performance counters via the PAPI library in the RTS?
355 # (PAPI: http://icl.cs.utk.edu/papi/)
356 GhcRtsWithPapi = NO
357 PapiLibDir=
358 PapiIncludeDir=
359
360 # Configuration for libffi
361 UseSystemLibFFI=@UseSystemLibFFI@
362 # Flags to go into package.conf for rts
363 FFILibDir=@FFILibDir@
364 FFIIncludeDir=@FFIIncludeDir@
365
366
367 ################################################################################
368 #
369 # Paths (see paths.mk)
370 #
371 ################################################################################
372
373 # Directory used by GHC (and possibly other tools) for storing
374 # temporary files. If your TMPDIR isn't big enough, either override
375 # this in build.mk or set your environment variable "TMPDIR" to point
376 # to somewhere with more space. (TMPDIR=. is a good choice).
377
378 # DEFAULT_TMPDIR isn't called TMPDIR because GNU make tends to
379 # override an environment variable with the value of the make variable
380 # of the same name (if it exists) when executing sub-processes, so
381 # setting the TMPDIR env var would have no effect in the build tree.
382
383 DEFAULT_TMPDIR = /tmp
384 ifeq "$(TARGETPLATFORM)" "i386-unknown-cygwin32"
385 DEFAULT_TMPDIR = /C/TEMP
386 endif
387 ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
388 DEFAULT_TMPDIR = /C/TEMP
389 endif
390
391 BIN_DIST_NAME = ghc-$(ProjectVersion)
392 BIN_DIST_PREP_DIR = bindistprep/$(BIN_DIST_NAME)
393 BIN_DIST_PREP_TAR = bindistprep/$(BIN_DIST_NAME)-$(TARGETPLATFORM).tar
394 BIN_DIST_PREP_TAR_BZ2 = $(BIN_DIST_PREP_TAR).bz2
395 BIN_DIST_TAR_BZ2 = $(BIN_DIST_NAME)-$(TARGETPLATFORM).tar.bz2
396 BIN_DIST_LIST = bindist-list
397
398 WINDOWS_INSTALLER_BASE = ghc-$(ProjectVersion)-$(TargetArch_CPP)-windows
399 WINDOWS_INSTALLER = $(WINDOWS_INSTALLER_BASE)$(exeext)
400
401 # -----------------------------------------------------------------------------
402 # Utilities programs: flags
403
404 # If you want to give any standard flags to pretty much any utility
405 # (see utils.mk for a complete list), by adding a line here
406 #
407 # SRC_P_OPTS += ...
408 #
409 # where P is the utility. For example, to add -O to all Haskell
410 # compilations,
411 #
412 # SRC_HC_OPTS += -O
413
414
415 # SRC_HC_OPTS includes flags to be added to *every* Haskell
416 # compilation. Setting SRC_HC_OPTS is a good way to set the default
417 # optimisation level (-O) and heap size (-H<size>).
418 #
419 # SRC_HC_OPTS is *not* for adding flags that are required to make your
420 # build work. Examples:
421 #
422 # - instead of using -pgmc/-pgma-/-pgml, use the --with-gcc option to configure
423 #
424 # - if you need -optc, -opta, or -optl flags, the CONF_CC_* and CONF_LD_*
425 # variables are more appropriate (set via configure)
426 #
427 # Note that SRC_HC_OPTS are added to every Haskell compilation,
428 # including when using the bootstrapping compiler (stage 0), So don't
429 # put options here that are only supported by very recent GHCs.
430 #
431 SRC_HC_OPTS += -H32m -O
432
433 # These flags make flex 8-bit
434 SRC_FLEX_OPTS += -8
435
436 # Flags for CPP when running GreenCard on .pgc files
437 GC_CPP_OPTS += -P -E -x c -traditional -D__GLASGOW_HASKELL__
438
439
440 # -----------------------------------------------------------------------------
441 # Names of programs in the GHC tree
442 #
443 # xxx_PGM the name of an executable, without the path
444 # xxx the executable relative to the current dir
445
446 GHC_UNLIT_PGM = unlit$(exeext)
447 GHC_HP2PS_PGM = hp2ps$(exeext)
448 GHC_GHCTAGS_PGM = ghctags$(exeext)
449 GHC_HSC2HS_PGM = hsc2hs$(exeext)
450 GHC_TOUCHY_PGM = touchy$(exeext)
451 GHC_SPLIT_PGM = ghc-split
452 GHC_SYSMAN_PGM = SysMan
453 GHC_GENPRIMOP_PGM = genprimopcode$(exeext)
454 GHC_GENAPPLY_PGM = genapply$(exeext)
455 GHC_CABAL_PGM = ghc-cabal$(exeext)
456 GHC_PKG_PGM = ghc-pkg$(exeext)
457 GHC_LTX_PGM = ltx$(exeext)
458 GHC_MKDIRHIER_PGM = mkdirhier
459 GHC_LNDIR_PGM = lndir
460
461 ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
462 GHC_CP = "xcopy /y"
463 GHC_PERL = perl
464 else
465 GHC_CP = $(CP)
466 GHC_PERL = $(PERL)
467 endif
468
469 HP2PS = $(GHC_HP2PS_DIR)/$(GHC_HP2PS_PGM)
470 SPLIT = $(INPLACE_LIB)/$(GHC_SPLIT_PGM)
471 SYSMAN = $(GHC_SYSMAN_DIR)/$(GHC_SYSMAN_PGM)
472 LTX = $(GHC_LTX_DIR)/$(GHC_LTX_PGM)
473 LNDIR = $(GHC_LNDIR_DIR)/$(GHC_LNDIR_PGM)
474
475 UNLIT = $(INPLACE_LIB)/$(GHC_UNLIT_PGM)
476 TOUCHY = $(INPLACE_LIB)/$(GHC_TOUCHY_PGM)
477 MKDIRHIER = $(INPLACE_BIN)/$(GHC_MKDIRHIER_PGM)
478 GHC_CABAL_INPLACE = $(INPLACE_BIN)/$(GHC_CABAL_PGM)
479 GENAPPLY_INPLACE = $(INPLACE_BIN)/$(GHC_GENAPPLY_PGM)
480 GHC_PKG_INPLACE = $(INPLACE_BIN)/$(GHC_PKG_PGM)
481 GHCTAGS_INPLACE = $(INPLACE_BIN)/$(GHC_GHCTAGS_PGM)
482 HSC2HS_INPLACE = $(INPLACE_BIN)/$(GHC_HSC2HS_PGM)
483 GENPRIMOP_INPLACE = $(INPLACE_BIN)/$(GHC_GENPRIMOP_PGM)
484
485 GENERATED_FILE = chmod a-w
486 EXECUTABLE_FILE = chmod +x
487
488 #-----------------------------------------------------------------------------
489 # Installed GHC
490
491 # $(GHC) points to installed version of the compiler.
492 #
493 # NOTE: Don't override $(GHC) in build.mk, use configure --with-ghc instead
494 # (because the version numbers have to be calculated).
495
496 GHC := @WithGhc@
497 # If we have a make dependency on c:/ghc/ghc, and the file is actually
498 # called c:/ghc/ghc.exe, then make will think that ghc doesn't exist
499 # and that it doesn't know how to create it.
500 ifneq "$(wildcard $(GHC).exe)" ""
501 GHC := $(GHC).exe
502 endif
503
504 # Sometimes we want to invoke ghc from the build tree in different
505 # places (eg. it's handy to have a nofib & a ghc build in the same
506 # tree). We can refer to "this ghc" as $(GHC_INPLACE):
507
508 GHC_INPLACE = $(GHC_STAGE1)
509
510 GHC_STAGE0_ABS = $(GHC)
511 GHC_STAGE1_ABS = $(TOP)/$(INPLACE_BIN)/ghc-stage1$(exeext)
512 GHC_STAGE2_ABS = $(TOP)/$(INPLACE_BIN)/ghc-stage2$(exeext)
513 GHC_STAGE3_ABS = $(TOP)/$(INPLACE_BIN)/ghc-stage3$(exeext)
514
515 GHC_STAGE0 = $(GHC)
516 GHC_STAGE1 = $(INPLACE_BIN)/ghc-stage1$(exeext)
517 GHC_STAGE2 = $(INPLACE_BIN)/ghc-stage2$(exeext)
518 GHC_STAGE3 = $(INPLACE_BIN)/ghc-stage3$(exeext)
519
520 BOOTSTRAPPING_CONF = libraries/bootstrapping.conf
521
522 INPLACE_PACKAGE_CONF = $(INPLACE_LIB)/package.conf.d
523
524 GhcVersion = @GhcVersion@
525 GhcPatchLevel = @GhcPatchLevel@
526 GhcMajVersion = @GhcMajVersion@
527 GhcMinVersion = @GhcMinVersion@
528
529 # Canonicalised ghc version number, used for easy (integer) version
530 # comparisons. We must expand $(GhcMinVersion) to two digits by
531 # adding a leading zero if necessary:
532 ifneq "$(findstring $(GhcMinVersion), 0 1 2 3 4 5 6 7 8 9)" ""
533 GhcCanonVersion = $(GhcMajVersion)0$(GhcMinVersion)
534 else
535 GhcCanonVersion = $(GhcMajVersion)$(GhcMinVersion)
536 endif
537
538 GHC_PACKAGE_DB_FLAG = @GHC_PACKAGE_DB_FLAG@
539
540 #-----------------------------------------------------------------------------
541 # C compiler
542 #
543 # NB. Don't override $(WhatGccIsCalled) using build.mk, re-configure using
544 # the flag --with-gcc=<blah> instead. The reason is that the configure script
545 # needs to know which gcc you're using in order to perform its tests.
546
547 WhatGccIsCalled = @WhatGccIsCalled@
548 GccVersion = @GccVersion@
549 ifeq "$(phase)" "0"
550 CrossCompilePrefix =
551 else
552 CrossCompilePrefix = @CrossCompilePrefix@
553 endif
554 # TargetPlatformFull retains the string passed to configure so we have it in
555 # the necessary format to pass to libffi's configure.
556 TargetPlatformFull = @TargetPlatformFull@
557 GccLT34 = @GccLT34@
558 GccLT46 = @GccLT46@
559
560 CC = $(WhatGccIsCalled)
561 CC_STAGE0 = @CC_STAGE0@
562 CC_STAGE1 = $(CC)
563 CC_STAGE2 = $(CC)
564 CC_STAGE3 = $(CC)
565
566 AS = $(WhatGccIsCalled)
567 AS_STAGE0 = @CC_STAGE0@
568 AS_STAGE1 = $(AS)
569 AS_STAGE2 = $(AS)
570 AS_STAGE3 = $(AS)
571
572 # We don't have an LD_STAGE0. CC_STAGE0 is determined by asking "ghc
573 # --info", and it doesn't report an LD.
574 LD_STAGE0 = error-no-ld-stage0
575 LD_STAGE1 = $(LD)
576 LD_STAGE2 = $(LD)
577 LD_STAGE3 = $(LD)
578
579 # Cross-compiling options
580 #
581 CrossCompiling = @CrossCompiling@
582
583 # Change this to YES if you're building a cross-compiler and don't
584 # want to build stage 2.
585 Stage1Only = NO
586
587 # Install stage 2 by default, or stage 1 in the cross compiler
588 # case. Can be changed to 3
589 INSTALL_GHC_STAGE= $(if $(filter YES,$(Stage1Only)),1,2)
590
591 # C compiler and linker flags from configure (e.g. -m<blah> to select
592 # correct C compiler backend). The stage number is the stage of GHC
593 # that is being used to compile with.
594 CONF_CC_OPTS_STAGE0 = @CONF_CC_OPTS_STAGE0@
595 CONF_CC_OPTS_STAGE1 = @CONF_CC_OPTS_STAGE1@
596 CONF_CC_OPTS_STAGE2 = @CONF_CC_OPTS_STAGE2@
597 CONF_GCC_LINKER_OPTS_STAGE0 = @CONF_GCC_LINKER_OPTS_STAGE0@
598 CONF_GCC_LINKER_OPTS_STAGE1 = @CONF_GCC_LINKER_OPTS_STAGE1@
599 CONF_GCC_LINKER_OPTS_STAGE2 = @CONF_GCC_LINKER_OPTS_STAGE2@
600 CONF_LD_LINKER_OPTS_STAGE0 = @CONF_LD_LINKER_OPTS_STAGE0@
601 CONF_LD_LINKER_OPTS_STAGE1 = @CONF_LD_LINKER_OPTS_STAGE1@
602 CONF_LD_LINKER_OPTS_STAGE2 = @CONF_LD_LINKER_OPTS_STAGE2@
603 CONF_CPP_OPTS_STAGE0 = @CONF_CPP_OPTS_STAGE0@
604 CONF_CPP_OPTS_STAGE1 = @CONF_CPP_OPTS_STAGE1@
605 CONF_CPP_OPTS_STAGE2 = @CONF_CPP_OPTS_STAGE2@
606
607 ifeq "$(TARGETPLATFORM)" "ia64-unknown-linux"
608 CONF_CC_OPTS += -G0
609 endif
610
611 # The .hsc files aren't currently safe for cross-compilation on Windows:
612 # libraries\haskeline\.\System\Console\Haskeline\Backend\Win32.hsc:160
613 # directive "let" is not safe for cross-compilation
614 ifneq "$(Windows)" "YES"
615 SRC_HSC2HS_OPTS += --cross-safe
616 endif
617 SRC_HSC2HS_OPTS += $(addprefix --cflag=,$(filter-out -O,$(SRC_CC_OPTS) $(CONF_CC_OPTS_STAGE0)))
618 SRC_HSC2HS_OPTS += $(foreach d,$(GMP_INCLUDE_DIRS),-I$(d))
619 ifeq "$(CrossCompiling)" "YES"
620 SRC_HSC2HS_OPTS += --cross-compile
621 endif
622
623 ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
624 WINDRES = $(INPLACE_MINGW)/bin/windres
625 else ifeq "$(TARGETPLATFORM)" "x86_64-unknown-mingw32"
626 WINDRES = $(INPLACE_MINGW)/bin/windres
627 endif
628
629 #-----------------------------------------------------------------------------
630 # Mingwex Library
631 #
632 HaveLibMingwEx = @HaveLibMingwEx@
633 ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
634 DLLTOOL = inplace/mingw/bin/dlltool.exe
635 else ifeq "$(TARGETPLATFORM)" "x86_64-unknown-mingw32"
636 DLLTOOL = inplace/mingw/bin/dlltool.exe
637 endif
638
639 #-----------------------------------------------------------------------------
640 # Flex (currently unused, could be moved to glafp-utils)
641
642 # FLEX = @LEX@
643 # Don't bother with -lfl, we define our own yywrap()s anyway.
644 # FLEX_LIB =
645 #WAS:FLEX_LIB = @LEXLIB@
646
647 #-----------------------------------------------------------------------------
648 # Other standard (ha!) Unix utilities
649
650 AR = @ArCmd@
651 AR_OPTS = @ArArgs@
652 ArSupportsAtFile = @ArSupportsAtFile@
653
654 AR_STAGE0 = @AR_STAGE0@
655 AR_STAGE1 = $(AR)
656 AR_STAGE2 = $(AR)
657 AR_STAGE3 = $(AR)
658 AR_OPTS_STAGE0 = @AR_OPTS_STAGE0@
659 AR_OPTS_STAGE1 = $(AR_OPTS)
660 AR_OPTS_STAGE2 = $(AR_OPTS)
661 AR_OPTS_STAGE3 = $(AR_OPTS)
662 EXTRA_AR_ARGS_STAGE0 = $(EXTRA_AR_ARGS)
663 EXTRA_AR_ARGS_STAGE1 = $(EXTRA_AR_ARGS)
664 EXTRA_AR_ARGS_STAGE2 = $(EXTRA_AR_ARGS)
665 EXTRA_AR_ARGS_STAGE3 = $(EXTRA_AR_ARGS)
666 ArSupportsAtFile_STAGE0 = @ArSupportsAtFile_STAGE0@
667 ArSupportsAtFile_STAGE1 = $(ArSupportsAtFile)
668 ArSupportsAtFile_STAGE2 = $(ArSupportsAtFile)
669 ArSupportsAtFile_STAGE3 = $(ArSupportsAtFile)
670
671 CONTEXT_DIFF = @ContextDiffCmd@
672 CP = cp
673 # It's not easy to separate the CPP program from its flags, as
674 # AC_PROG_CPP defines CPP as "/usr/bin/gcc -E"
675 CPP = @CPP@ @CPPFLAGS@
676 CTAGS = $(ETAGS)
677 #
678 # RAWCPP_FLAGS are the flags to give to cpp (viz, gcc -E) to persuade it to
679 # behave plausibly on Haskell sources.
680 #
681 RAWCPP_FLAGS = -undef -traditional
682 FIND = @FindCmd@
683
684 #
685 # Sigh - the autoconf macro for INSTALL will subst a relative path to the fallback
686 # install-sh script (if chosen). This not terribly useful to us, so we convert
687 # it into an abs. path.
688 #
689 INSTALL = @INSTALL@
690 INSTALL := $(subst .././install-sh,$(TOP)/install-sh,$(INSTALL))
691
692 LATEX = latex
693 PDFLATEX = pdflatex
694 BIBTEX = bibtex
695 LN_S = @LN_S@
696 MV = mv
697 NROFF = nroff
698 PERL = @PerlCmd@
699 PIC = pic
700 RANLIB = @RANLIB@
701 SED = @SedCmd@
702 TR = tr
703 SHELL = /bin/sh
704
705 HaveDtrace = @HaveDtrace@
706 USE_DTRACE = $(HaveDtrace)
707 DTRACE = @DtraceCmd@
708
709 LD = @LdCmd@
710 NM = @NmCmd@
711 OBJDUMP = @ObjdumpCmd@
712
713 LLC = @LlcCmd@
714 OPT = @OptCmd@
715
716 # GNU ld supports input via a linker script, which is useful to avoid
717 # overflowing command-line length limits.
718 LdIsGNULd = @LdIsGNULd@
719
720 # Set to YES if ld has the --build-id flag. Sometimes we need to
721 # disable it with --build-id=none.
722 LdHasBuildId = @LdHasBuildId@
723
724 # Set to YES if ld has the --no_compact_unwind flag. See #5019
725 # and compiler/main/DriverPipeline.hs.
726 LdHasNoCompactUnwind = @LdHasNoCompactUnwind@
727
728 # On MSYS, building with SplitObjs=YES fails with
729 # ar: Bad file number
730 # see #3201. We need to specify a smaller max command-line size
731 # to work around it. 32767 doesn't work; 30000 does, but says
732 # xargs: value for -s option should be < 28153
733 # so we now use 20000 to be comfortably below this bound
734 XARGS = xargs
735 ifeq "$(Windows)" "YES"
736 XARGS_OPTS = -s 20000
737 endif
738
739 #
740 # In emergency situations, REAL_SHELL is used to perform shell commands
741 # from within the ghc driver script, by scribbling the command line to
742 # a temp file and then having $(REAL_SHELL) execute it.
743 #
744 # The reason for having to do this is that overly long command lines
745 # cause unnecessary trouble with some shells (e.g., /bin/sh on Solaris
746 # 2.5.1), which is why this backdoor is provided. The situation of overly
747 # long command lines is either encountered while doing `make boot' in compiler/,
748 # or when linking the compiler binary (`hsc').
749 #
750 # We do not use SHELL to execute long commands, as `make' will more than likely
751 # override whatever setting you have in your environment while executing.
752
753 # By default, REAL_SHELL is set equal to SHELL, which is not really a smart move
754 # as it is SHELL that will show up the bogosity in the first place, but setting
755 # it to anything else isn't really portable.
756 #
757 # ====> If long command lines cause you trouble, invoke `ghc' (via `make' or otherwise)
758 # with REAL_SHELL set to something else than /bin/sh, for instance, your favourite
759 # command shell.
760 #
761 REAL_SHELL = $(SHELL)
762
763 ifeq "$(TARGETPLATFORM)" "x86_64-unknown-mingw32"
764 STRIP_CMD = $(TOP)/inplace/mingw/bin/strip.exe
765 else
766 STRIP_CMD = strip
767 endif
768 PATCH_CMD = @PatchCmd@
769 TAR_CMD = @TarCmd@
770 BZIP2_CMD = bzip2
771 GZIP_CMD = gzip
772
773 ifeq "$(Windows)" "YES"
774 TOUCH_CMD = $(utils/touchy_dist_INPLACE)
775 TOUCH_DEP = $(TOUCH_CMD)
776 else
777 TOUCH_CMD = touch
778 TOUCH_DEP =
779 endif
780
781 HSCOLOUR_CMD = @HSCOLOUR@
782
783 TIME_CMD = @TimeCmd@
784
785 # GTK+
786 GTK_CONFIG_CMD = @GTK_CONFIG@
787
788 # Set this if you want to use Inno Setup to build a Windows installer
789 # when you make a bindist
790 ISCC_CMD =
791
792 #-----------------------------------------------------------------------------
793 # DocBook XML stuff
794
795 BUILD_DOCBOOK_HTML = @BUILD_DOCBOOK_HTML@
796 BUILD_DOCBOOK_PS = @BUILD_DOCBOOK_PS@
797 BUILD_DOCBOOK_PDF = @BUILD_DOCBOOK_PDF@
798 DBLATEX = @DblatexCmd@
799 # filename.as.url=0 is needed with dblatex 0.3.4 (#7486)
800 DBLATEX_OPTS = -P 'filename.as.url=0'
801 XSLTPROC = @XsltprocCmd@
802 XMLLINT = @XmllintCmd@
803 HAVE_DOCBOOK_XSL = @HAVE_DOCBOOK_XSL@
804 XSLTPROC_HTML_STYLESHEET = http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl
805 XSLTPROC_LABEL_OPTS = --stringparam toc.section.depth 3 \
806 --stringparam section.autolabel 1 \
807 --stringparam section.label.includes.component.label 1
808
809 #-----------------------------------------------------------------------------
810 # FPtools support software
811
812 #
813 # ghc-pkg
814 #
815 GHC_PKG = @GhcPkgCmd@
816
817 #
818 # Happy
819 #
820 HAPPY = @HappyCmd@
821 HAPPY_VERSION = @HappyVersion@
822 #
823 # Options to pass to Happy when we're going to compile the output with GHC
824 #
825 SRC_HAPPY_OPTS = -agc --strict
826
827 #
828 # Alex
829 #
830 ALEX = @AlexCmd@
831 ALEX_VERSION = @AlexVersion@
832 Alex3 = @Alex3@
833 #
834 # Options to pass to Happy when we're going to compile the output with GHC
835 #
836 ifeq "$(Alex3)" "YES"
837 # We aren't using the Unicode support in Alex 3.0 yet, in fact we do our own
838 # Unicode handling, so diable Alex's.
839 SRC_ALEX_OPTS = -g --latin1
840 else
841 SRC_ALEX_OPTS = -g
842 endif
843
844 # Should we build haddock docs?
845 HADDOCK_DOCS = YES
846 # And HsColour the sources?
847 ifeq "$(HSCOLOUR_CMD)" ""
848 HSCOLOUR_SRCS = NO
849 else
850 HSCOLOUR_SRCS = YES
851 endif
852
853 ################################################################################
854 #
855 # 31-bit-Int Core files
856 #
857 ################################################################################
858
859 #
860 # It is possible to configure the compiler and prelude to support 31-bit
861 # integers, suitable for a back-end and RTS using a tag bit on a 32-bit
862 # architecture. Currently the only useful output from this option is external Core
863 # files. The following additions to your build.mk will produce the
864 # 31-bit core output. Note that this is *not* just a library "way"; the
865 # compiler must be built a special way too.
866
867 # GhcCppOpts +=-DWORD_SIZE_IN_BITS=31
868 # GhcLibHcOpts +=-fext-core -fno-code -DWORD_SIZE_IN_BITS=31
869 # GhcLibCppOpts += -DWORD_SIZE_IN_BITS=31
870 # SplitObjs=NO
871
872 ################################################################################
873 #
874 # Library configure arguments
875 #
876 ################################################################################
877
878 CONFIGURE_ARGS = @CONFIGURE_ARGS@
879
880 ################################################################################
881 #
882 # To be passed to sub-builds
883 #
884 ################################################################################
885
886 ICONV_INCLUDE_DIRS = @ICONV_INCLUDE_DIRS@
887 ICONV_LIB_DIRS = @ICONV_LIB_DIRS@
888
889 GMP_INCLUDE_DIRS = @GMP_INCLUDE_DIRS@
890 GMP_LIB_DIRS = @GMP_LIB_DIRS@