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