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