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