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