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