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