4 ################################################################################
8 # This file supplies defaults for many tweakable build configuration
9 # options. Some of the defaults are filled in by the autoconf-generated
12 # DO NOT EDIT THIS FILE!
14 # - config.mk is auto-generated from config.mk.in by configure.
15 # This may be triggered automatically by the build system (say
16 # if config.mk.in has changed more recently than config.mk),
17 # so if you edit config.mk your changes will be spammed.
19 # - Settings in this file may be overriden by giving replacement
20 # definitions in build.mk. See build.mk.sample for a good
21 # starting point for a build.mk file.
23 # If you don't have a build.mk file then you get defaults for everything.
24 # The defaults should provide a reasonable vanilla build.
26 # This is one of only two files that configure generates (the other is config.h)
29 ifneq "$(findstring 3.7, $(MAKE_VERSION))" ""
30 ifeq "$(findstring 3.79.1, $(MAKE_VERSION))" ""
31 $(error GNU make version 3.79.1 or later is required.)
35 # TOP: the top of the fptools hierarchy, absolute path.
36 # On Windows this is a c:/foo/bar style path.
39 include $(TOP)/mk/project.mk
41 ################################################################################
43 # Global configuration options
45 ################################################################################
47 # BootingFromHc - build GHC and the libraries from .hc files?
48 BootingFromHc = @BootingFromHc@
50 # BootingFromUnregisterisedHc - treat .hc files as containing unregisterised
51 # rather than registerised code, i.e., disable the mangler?
52 BootingFromUnregisterisedHc = @BootingFromUnregisterisedHc@
55 NO_INCLUDE_PKGDATA = NO
58 # Which ways should DocBook XML documents be built?
59 # options are: dvi ps pdf html chm HxS
63 # Should we build latex docs?
66 # Mac OS X deployment target (to cross-compile for older OS versions)
68 MACOSX_DEPLOYMENT_VERSION = @MACOSX_DEPLOYMENT_VERSION@
69 MACOSX_DEPLOYMENT_SDK = @MACOSX_DEPLOYMENT_SDK@
71 ifneq "$(MACOSX_DEPLOYMENT_VERSION)" ""
72 MACOSX_DEPLOYMENT_CC_OPTS = -mmacosx-version-min=$(MACOSX_DEPLOYMENT_VERSION) \
73 -isysroot $(MACOSX_DEPLOYMENT_SDK) \
75 MACOSX_DEPLOYMENT_LD_OPTS = -mmacosx-version-min=$(MACOSX_DEPLOYMENT_VERSION) \
76 -Wl,-syslibroot,$(MACOSX_DEPLOYMENT_SDK)
77 # We don't extend SRC_CC_OPTS and friends here directly, as (a) they may get
78 # overwritten in build.mk and (b) we must not use the deployment options in
79 # stage 1 or we get a linker error if the bootstrap compiler is for a more
82 # We need --no-builtin-fprintf, as the use of the builtin function optimisation
83 # for fprintf together with #include "PosixSource" in the RTS leads to the
84 # use of fwrite$UNIX2003 (with GCC 4.0.1 on Mac OS X 10.5.2).
87 ################################################################################
89 # Variables that control how the compiler itself is built
91 ################################################################################
93 # The compiler used to build GHC is $(GHC). To change the actual compiler
94 # used, re-configure with --with-ghc=<path-to-ghc>.
96 # Extra ways in which to build the compiler (for example, you might want to
97 # build a profiled compiler so you can see where it spends its time)
100 # Extra option flags to pass to the compiler that compiles the compiler
101 # (Ones that are essential are wired into compiler/Makefile)
102 # Typical options to use here:
104 # -DDEBUG include debugging code and assertions (will make the
105 # compiler slower and produce debugging output, but useful
108 # -dcore-lint check the types after every pass of the compiler;
109 # a pretty strong internal check of the compiler being
110 # used to compile GHC. Useful when bootstrapping.
111 GhcHcOpts=-Rghc-timing
113 # Extra options added to specific stages of the compiler bootstrap.
114 # These are placed later on the command line, and may therefore
115 # override options from $(GhcHcOpts).
122 GhcLibProfiled=$(if $(filter p,$(GhcLibWays)),YES,NO)
124 # Build shared and/or static libs?
125 BuildSharedLibs=@BuildSharedLibs@
127 # BuildStaticLibs=@BuildStaticLibs@
129 # Build a compiler that will build *unregisterised* libraries and
130 # binaries by default. Unregisterised code is supposed to compile and
131 # run without any support for architecture-specific assembly mangling,
132 # register assignment or tail-calls, and is therefore a good way to get
133 # started when porting GHC to new architectures.
135 # If this is set to NO, you can still use the unregisterised way
136 # (way 'u') to get unregisterised code, but the default way will be
139 # NOTE: the stage1 compiler will be a registerised binary (assuming
140 # the compiler you build with is generating registerised binaries), but
141 # the stage2 compiler will be an unregisterised binary.
143 ifneq "$(findstring $(HostArch_CPP), alpha hppa)" ""
144 GhcUnregisterised=YES
149 # Build a compiler with a native code generator backend
150 # (as well as a C backend)
152 # Target platforms supported:
154 # AIX is not supported
155 ArchSupportsNCG=$(strip $(patsubst $(HostArch_CPP), YES, $(findstring $(HostArch_CPP), i386 x86_64 powerpc sparc)))
156 OsSupportsNCG=$(strip $(patsubst $(HostOS_CPP), YES, $(patsubst aix,,$(HostOS_CPP))))
158 # lazy test, because $(GhcUnregisterised) might be set in build.mk later.
159 GhcWithNativeCodeGen=$(strip\
160 $(if $(filter YESYESNO,\
161 $(OsSupportsNCG)$(ArchSupportsNCG)$(GhcUnregisterised)),YES,NO))
163 HaveLibDL = @HaveLibDL@
165 # ArchSupportsSMP should be set iff there is support for that arch in
167 ArchSupportsSMP=$(strip $(patsubst $(HostArch_CPP), YES, $(findstring $(HostArch_CPP), i386 x86_64 sparc powerpc)))
169 # lazy test, because $(GhcUnregisterised) might be set in build.mk later.
170 GhcWithSMP=$(strip $(if $(filter YESNO, $(ArchSupportsSMP)$(GhcUnregisterised)),YES,NO))
172 # Whether to include GHCi in the compiler. Depends on whether the RTS linker
173 # has support for this OS/ARCH combination.
175 OsSupportsGHCi=$(strip $(patsubst $(HostOS_CPP), YES, $(findstring $(HostOS_CPP), mingw32 cygwin32 linux solaris2 freebsd netbsd openbsd darwin)))
176 ArchSupportsGHCi=$(strip $(patsubst $(HostArch_CPP), YES, $(findstring $(HostArch_CPP), i386 x86_64 powerpc sparc sparc64)))
178 ifeq "$(OsSupportsGHCi)$(ArchSupportsGHCi)" "YESYES"
179 GhcWithInterpreter=YES
181 GhcWithInterpreter=NO
184 # GhcEnableTablesNextToCode tells us whether the target architecture
185 # supports placing info tables directly before the entry code
186 # (see TABLES_NEXT_TO_CODE in the RTS). Whether we actually compile for
187 # TABLES_NEXT_TO_CODE depends on whether we're building unregisterised
188 # code or not, which may be decided by options to the compiler later.
189 ifneq "$(findstring $(TargetArch_CPP)X, ia64X powerpc64X)" ""
190 GhcEnableTablesNextToCode=NO
192 GhcEnableTablesNextToCode=YES
195 # On Windows we normally want to make a relocatable bindist, to we
196 # ignore flags like libdir
197 ifeq "$(Windows)" "YES"
198 RelocatableBuild = YES
200 RelocatableBuild = NO
203 # When building bindists we set this to yes so that the binaries are as
204 # portable as possible.
208 # Building various ways?
209 # (right now, empty if not).
210 BuildingParallel=$(subst mp,YES,$(filter mp,$(WAYS)))
211 BuildingGranSim=$(subst mg,YES,$(filter mg,$(WAYS)))
213 # Interface file version (hi-boot files only)
215 # A GHC built with HscIfaceFileVersion=n will look for
216 # M.hi-boot-n, and only then for
218 # (It'll be happy with the latter if the former doesn't exist.)
221 # This variable is used ONLY for hi-boot files. Its only purpose is
222 # to allow you to have a single directory with multiple .hi-boot files
223 # for the same module, each corresponding to a different version of
226 # HscIfaceFileVersion is propagated to hsc via
227 # compiler/main/Config.hs, which is automatically generated by
230 HscIfaceFileVersion=6
232 #------------------------------------------------------------------------------
233 # Options for Libraries
235 # Which directory (in libraries/) contains the integer library?
236 INTEGER_LIBRARY=integer-gmp
238 # We build the libraries at least the "vanilla" way (way "v")
241 # In addition to the normal sequential way, the default is to also build
242 # profiled prelude libraries unless we are booting from .hc files
243 ifneq "$(BootingFromHc)" "YES"
247 ifeq "$(BuildSharedLibs)" "YES"
251 # In addition, the RTS is built in some further variations. Ways that
255 # thr_p : threaded profiled
256 # debug : debugging (compile with -g for the C compiler, and -DDEBUG)
257 # debug_p : debugging profiled
258 # thr_debug : debugging threaded
259 # thr_debug_p : debugging threaded profiled
260 # t : ticky-ticky profiling
261 # debug_t : debugging ticky-ticky profiling
263 # thr_l : threaded and event logging
264 # thr_debug_l : threaded and debugging and event logging
268 # Usually want the debug version
269 ifeq "$(BootingFromHc)" "NO"
273 ifeq "$(BuildSharedLibs)" "YES"
274 GhcRTSWays += dyn debug_dyn thr_dyn thr_debug_dyn
277 # Want the threaded versions unless we're unregisterised
278 # Defer the check until later by using $(if..), because GhcUnregisterised might
279 # be set in build.mk, which hasn't been read yet.
280 GhcRTSWays += $(if $(findstring NO, $(GhcUnregisterised)),thr thr_debug thr_l,)
281 GhcRTSWays += $(if $(findstring p, $(GhcLibWays)),$(if $(findstring NO, $(GhcUnregisterised)),thr_p,),)
283 # We can only build GHCi threaded if we have a threaded RTS:
284 GhcThreaded = $(if $(findstring thr,$(GhcRTSWays)),YES,NO)
286 # Option flags to pass to GHC when it's compiling modules in
287 # fptools/libraries. Typically these are things like -O or
288 # -dcore-lint or -H32m. The ones that are *essential* are wired into
291 # -O(2) is pretty desirable, otherwise no inlining of prelude
292 # things (incl "+") happens when compiling with this compiler
294 # -XGenerics switches on generation of support code for
295 # derivable type classes. This is now off by default,
296 # but we switch it on for the libraries so that we generate
297 # the code in case someone importing wants it
299 GhcLibHcOpts=-O2 -XGenerics
301 # Win32 only: Enable the RTS and libraries to be built as DLLs
302 DLLized=@EnableWin32DLLs@
304 # Strip local symbols from libraries? This can make the libraries smaller,
305 # but makes debugging somewhat more difficult. Doesn't work with all ld's.
309 # These are the URL patterns that Haddock uses to generate the "Source
310 # File" links on each page.
311 PackageSourceURL = http://darcs.haskell.org/packages/$(PACKAGE)/%{FILE}
313 # ----------------------------------------------------------------------------
314 # Object-file splitting
316 # Set SplitObjs=YES or NO in your build.mk
318 # Don't use -split-objs in in GhcLibHcOpts, because the build
319 # system needs to do other special magic if you are
320 # doing object-file splitting
322 ArchSupportsSplitObjs=$(strip $(if $(filter $(TargetArch_CPP),i386 x86_64 powerpc sparc),YES,NO))
324 # lazy test, so that $(GhcUnregisterised) can be set in build.mk
325 SupportsSplitObjs=$(strip $(if $(filter YES,$(ArchSupportsSplitObjs)),\
326 $(if $(filter NO,$(BootingFromHc)),\
327 $(if $(filter NO,$(GhcUnregisterised)),\
333 # By default, enable SplitObjs for the libraries if this build supports it
334 SplitObjs=$(SupportsSplitObjs)
339 # .NET interop support?
343 # Build unix package?
345 GhcLibsWithUnix=@GhcLibsWithUnix@
347 # ----------------------------------------------------------------------------
348 # Options for GHC's RTS
350 # For an optimised RTS (you probably don't want to change these; we build
351 # a debugging RTS by default now. Use -debug to get it).
352 GhcRtsHcOpts=-optc-O2
353 GhcRtsCcOpts=-fomit-frame-pointer
355 # Include the front panel code? Needs GTK+.
356 GhcRtsWithFrontPanel = NO
358 # Include support for CPU performance counters via the PAPI library in the RTS?
359 # (PAPI: http://icl.cs.utk.edu/papi/)
364 ################################################################################
366 # Paths (see paths.mk)
368 ################################################################################
370 # Directory used by GHC (and possibly other tools) for storing
371 # temporary files. If your TMPDIR isn't big enough, either override
372 # this in build.mk or set your environment variable "TMPDIR" to point
373 # to somewhere with more space. (TMPDIR=. is a good choice).
375 # DEFAULT_TMPDIR isn't called TMPDIR because GNU make tends to
376 # override an environment variable with the value of the make variable
377 # of the same name (if it exists) when executing sub-processes, so
378 # setting the TMPDIR env var would have no effect in the build tree.
380 DEFAULT_TMPDIR = /tmp
381 ifeq "$(TARGETPLATFORM)" "i386-unknown-cygwin32"
382 DEFAULT_TMPDIR = /C/TEMP
384 ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
385 DEFAULT_TMPDIR = /C/TEMP
388 BIN_DIST_TOPDIR_ABS=$(TOP)
389 BIN_DIST_DIR=$(BIN_DIST_TOPDIR_ABS)/$(BIN_DIST_NAME)
391 BIN_DIST_NAME=ghc-$(ProjectVersion)
392 BIN_DIST_TAR=$(TOP)/$(BIN_DIST_NAME)-$(TARGETPLATFORM).tar
393 BIN_DIST_TAR_BZ2=$(BIN_DIST_TAR).bz2
394 BIN_DIST_PREP_DIR=$(TOP)/bindist-prep
395 BIN_DIST_PREP=$(BIN_DIST_PREP_DIR)/$(BIN_DIST_NAME)
396 BIN_DIST_LIST=$(TOP)/bindist-list
398 # Definition of installation directories, we don't use half of these, but since
399 # the configure script has them on offer while passing through, we might as well
400 # set them. Note that we have to be careful, because the GNU coding standards
401 # have changed a bit over the course of time, and autoconf development reflects
404 # A little bit of history regarding autoconf and GNU coding standards, use this
405 # as a cheat-sheet for the stuff below:
407 # variable | default < 2.60 | default >= 2.60
408 # ------------+--------------------+--------------------------------------
409 # exec_prefix | ${prefix} | ${prefix}
410 # libdir | ${exec_prefix}/lib | ${exec_prefix}/lib
411 # datarootdir | NONE! | ${prefix}/share
412 # datadir | ${prefix}/share | ${datarootdir}
413 # infodir | ${prefix}/info | ${datarootdir}/info
414 # mandir | ${prefix}/man | ${datarootdir}/man
415 # docdir | NONE! | ${datarootdir}/doc/${PACKAGE_TARNAME}
416 # htmldir | NONE! | ${docdir}
417 # dvidir | NONE! | ${docdir}
418 # pdfdir | NONE! | ${docdir}
419 # psdir | NONE! | ${docdir}
421 # NOTE: The default e.g. ${docdir} above means that autoconf substitutes the
422 # string "${docdir}", not the value of docdir! This is crucial for the GNU
425 # This gets used in the default docdir when autoconf >= 2.60 is used
426 PACKAGE_TARNAME := @PACKAGE_TARNAME@
430 # New autoconf (>= 2.60?) make a configure with a --datarootdir=DIR flag.
431 # However, in order to support older autoconf's we don't use it.
432 # datarootdir is set lower down instead.
433 # But, as datadir is defined in terms of datarootdir, we also need to
434 # set it to the value (if any) that configure gives it here.
435 datarootdir := @datarootdir@
437 exec_prefix := @exec_prefix@
439 datadir0 := @datadir@
441 includedir := @includedir@
443 dynlibdir := @libdir@
445 ifeq "$(RelocatableBuild)" "YES"
447 # Hack: our directory layouts tend to be different on Windows, so
448 # hack around configure's bogus assumptions here.
449 datarootdir := $(prefix)
450 datadir := $(prefix)/lib
451 libdir := $(prefix)/lib
453 docdir := $(prefix)/doc
461 # Unix: override libdir and datadir to put ghc-specific stuff in
462 # a subdirectory with the version number included.
464 # datadir is set to libdir here as GHC needs package.conf and unlit
465 # to be in the same place (and things like ghc-pkg need to agree on
466 # where package.conf is, so we just set it globally).
468 datarootdir := $(datadir0)
469 libdir := $(libdir0)/ghc-$(ProjectVersion)
472 # New autoconf (>= 2.60?) make a configure with --docdir=DIR etc flags.
473 # However, in order to support older autoconf's we don't use them.
476 #htmldir := @htmldir@
481 docdir := $(datarootdir)/doc/ghc
489 headerdir := $(libdir)/include
491 # Default place for putting interface files is $(libdir)
492 # (overriden for packages in package.mk)
495 # NOTE: by intention, libexecdir and libdir point to
497 # => Only way to override this is to set libexecdir= on the command line.
498 # (NOTE: configure script setting is ignored).
499 libexecdir = $(libdir)
501 #-----------------------------------------------------------------------------
502 # install configuration
505 # Set this to have files installed with a specific owner
510 # Set this to have files installed with a specific group
515 # Invocations of `install' for the four different classes
518 INSTALL_PROGRAM = $(INSTALL) -m 755
519 INSTALL_SCRIPT = $(INSTALL) -m 755
520 INSTALL_SHLIB = $(INSTALL) -m 755
521 INSTALL_DATA = $(INSTALL) -m 644
522 INSTALL_HEADER = $(INSTALL) -m 644
523 INSTALL_MAN = $(INSTALL) -m 644
524 INSTALL_DIR = $(MKDIRHIER)
527 # runhaskell and hsc2hs are special, in that other compilers besides
528 # GHC might provide them. Systems with a package manager often come
529 # with tools to manage this kind of clash, e.g. RPM's
530 # update-alternatives. When building a distribution for such a system,
531 # we recommend setting both of the following to 'YES'.
533 # NO_INSTALL_RUNHASKELL = YES
534 # NO_INSTALL_HSC2HS = YES
536 # NB. we use negative tests here because for binary-distributions we cannot
537 # test build-time variables at install-time, so they must default to on.
539 # -----------------------------------------------------------------------------
540 # Utilities programs: flags
542 # If you want to give any standard flags to pretty much any utility
543 # (see utils.mk for a complete list), by adding a line here
547 # where P is the utility. For example, to add -O to all Haskell
552 SRC_HC_OPTS += -H32m -O
554 # These flags make flex 8-bit
557 # Default fptools options for dllwrap.
558 SRC_BLD_DLL_OPTS += --target=i386-mingw32
560 # Flags for CPP when running GreenCard on .pgc files
561 GC_CPP_OPTS += -P -E -x c -traditional -D__GLASGOW_HASKELL__
564 ################################################################################
566 # Layout of the source tree
568 ################################################################################
570 # Here we provide defines for the various directories in the source tree,
571 # so we can move things around more easily. A define $(GHC_FOO_DIR)
572 # indicates a directory relative to the top of the source tree.
574 GHC_UTILS_DIR = utils
575 GHC_INCLUDE_DIR = includes
576 GHC_COMPILER_DIR = compiler
579 GHC_DRIVER_DIR = driver
580 GHC_COMPAT_DIR = compat
582 GHC_MKDEPENDC_DIR = $(GHC_UTILS_DIR)/mkdependC
583 GHC_LTX_DIR = $(GHC_UTILS_DIR)/ltx
584 GHC_LNDIR_DIR = $(GHC_UTILS_DIR)/lndir
585 GHC_MKDIRHIER_DIR = $(GHC_UTILS_DIR)/mkdirhier
586 GHC_DOCBOOK_DIR = $(GHC_UTILS_DIR)/docbook
587 GHC_UNLIT_DIR = $(GHC_UTILS_DIR)/unlit
588 GHC_HP2PS_DIR = $(GHC_UTILS_DIR)/hp2ps
589 GHC_HSTAGS_DIR = $(GHC_UTILS_DIR)/hasktags
590 GHC_GHCTAGS_DIR = $(GHC_UTILS_DIR)/ghctags
591 GHC_HSC2HS_DIR = $(GHC_UTILS_DIR)/hsc2hs
592 GHC_TOUCHY_DIR = $(GHC_UTILS_DIR)/touchy
593 GHC_PKG_DIR = $(GHC_UTILS_DIR)/ghc-pkg
594 GHC_GENPRIMOP_DIR = $(GHC_UTILS_DIR)/genprimopcode
595 GHC_GENAPPLY_DIR = $(GHC_UTILS_DIR)/genapply
596 GHC_CABAL_DIR = $(GHC_UTILS_DIR)/ghc-cabal
597 GHC_MANGLER_DIR = $(GHC_DRIVER_DIR)/mangler
598 GHC_SPLIT_DIR = $(GHC_DRIVER_DIR)/split
599 GHC_SYSMAN_DIR = $(GHC_RTS_DIR)/parallel
601 # -----------------------------------------------------------------------------
602 # Names of programs in the GHC tree
604 # xxx_PGM the name of an executable, without the path
605 # xxx the executable relative to the current dir
607 GHC_UNLIT_PGM = unlit$(exeext)
608 GHC_HP2PS_PGM = hp2ps$(exeext)
609 GHC_HSTAGS_PGM = hasktags$(exeext)
610 GHC_GHCTAGS_PGM = ghctags$(exeext)
611 GHC_HSC2HS_PGM = hsc2hs$(exeext)
612 GHC_TOUCHY_PGM = touchy$(exeext)
613 GHC_MANGLER_PGM = ghc-asm
614 GHC_SPLIT_PGM = ghc-split
615 GHC_SYSMAN_PGM = SysMan
616 GHC_GENPRIMOP_PGM = genprimopcode$(exeext)
617 GHC_GENAPPLY_PGM = genapply$(exeext)
618 GHC_CABAL_PGM = ghc-cabal$(exeext)
619 GHC_PKG_PGM = ghc-pkg$(exeext)
620 GHC_MKDEPENDC_PGM = mkdependC
621 GHC_LTX_PGM = ltx$(exeext)
622 GHC_MKDIRHIER_PGM = mkdirhier
623 GHC_LNDIR_PGM = lndir
624 GHC_DUMMY_GHC_PGM = dummy-ghc$(exeext)
626 ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
634 HP2PS = $(GHC_HP2PS_DIR)/$(GHC_HP2PS_PGM)
635 HSTAGS = $(GHC_HSTAGS_DIR)/$(GHC_HSTAGS_PGM)
636 MANGLER = $(INPLACE_LIB)/$(GHC_MANGLER_PGM)
637 SPLIT = $(INPLACE_LIB)/$(GHC_SPLIT_PGM)
638 SYSMAN = $(GHC_SYSMAN_DIR)/$(GHC_SYSMAN_PGM)
639 LTX = $(GHC_LTX_DIR)/$(GHC_LTX_PGM)
640 LNDIR = $(GHC_LNDIR_DIR)/$(GHC_LNDIR_PGM)
643 INPLACE_BIN = $(INPLACE)/bin
644 INPLACE_LIB = $(INPLACE)/lib
645 INPLACE_MINGW = $(INPLACE)/mingw
647 UNLIT = $(INPLACE_LIB)/$(GHC_UNLIT_PGM)
648 TOUCHY = $(INPLACE_LIB)/$(GHC_TOUCHY_PGM)
649 MKDIRHIER = $(INPLACE_BIN)/$(GHC_MKDIRHIER_PGM)
650 MKDEPENDC = $(INPLACE_BIN)/$(GHC_MKDEPENDC_PGM)
651 GHC_CABAL_INPLACE = $(INPLACE_BIN)/$(GHC_CABAL_PGM)
652 GENAPPLY_INPLACE = $(INPLACE_BIN)/$(GHC_GENAPPLY_PGM)
653 GHC_PKG_INPLACE = $(INPLACE_BIN)/$(GHC_PKG_PGM)
654 GHCTAGS_INPLACE = $(INPLACE_BIN)/$(GHC_GHCTAGS_PGM)
655 HSC2HS_INPLACE = $(INPLACE_BIN)/$(GHC_HSC2HS_PGM)
656 GENPRIMOP_INPLACE = $(INPLACE_BIN)/$(GHC_GENPRIMOP_PGM)
657 DUMMY_GHC_INPLACE = $(INPLACE_BIN)/$(GHC_DUMMY_GHC_PGM)
659 GENERATED_FILE = chmod a-w
660 EXECUTABLE_FILE = chmod +x
662 #-----------------------------------------------------------------------------
663 # Haskell compilers and mkdependHS
665 # $(GHC), $(HBC) and $(NHC) point to installed versions of the relevant
666 # compilers, if available.
668 # $(HC) is a generic Haskell 98 compiler, set to $(GHC) by default.
669 # $(MKDEPENDHS) is the Haskell dependency generator (ghc -M).
671 # NOTE: Don't override $(GHC) in build.mk, use configure --with-ghc instead
672 # (because the version numbers have to be calculated).
675 # If we have a make dependency on c:/ghc/ghc, and the file is actually
676 # called c:/ghc/ghc.exe, then make will think that ghc doesn't exist
677 # and that it doesn't know how to create it.
678 ifneq "$(wildcard $(GHC).exe)" ""
682 GhcDir = $(dir $(GHC))
684 # Set to YES if $(GHC) has the editline package installed
685 GhcHasEditline = @GhcHasEditline@
690 # Sometimes we want to invoke ghc from the build tree in different
691 # places (eg. it's handy to have a nofib & a ghc build in the same
692 # tree). We can refer to "this ghc" as $(GHC_INPLACE):
694 GHC_INPLACE = $(GHC_STAGE1)
696 GHC_STAGE0_ABS = $(GHC)
697 GHC_STAGE1_ABS = $(TOP)/$(INPLACE_BIN)/ghc-stage1$(exeext)
698 GHC_STAGE2_ABS = $(TOP)/$(INPLACE_BIN)/ghc-stage2$(exeext)
699 GHC_STAGE3_ABS = $(TOP)/$(INPLACE_BIN)/ghc-stage3$(exeext)
702 GHC_STAGE1 = $(INPLACE_BIN)/ghc-stage1$(exeext)
703 GHC_STAGE2 = $(INPLACE_BIN)/ghc-stage2$(exeext)
704 GHC_STAGE3 = $(INPLACE_BIN)/ghc-stage3$(exeext)
706 # Install stage 2 by default, can be changed to 3
709 BOOTSTRAPPING_CONF = libraries/bootstrapping.conf
711 INPLACE_PACKAGE_CONF = $(INPLACE_LIB)/package.conf
713 GhcVersion = @GhcVersion@
714 GhcPatchLevel = @GhcPatchLevel@
715 GhcMajVersion = @GhcMajVersion@
716 GhcMinVersion = @GhcMinVersion@
718 ghc_ge_607 = @ghc_ge_607@
719 ghc_ge_609 = @ghc_ge_609@
721 # Canonicalised ghc version number, used for easy (integer) version
722 # comparisons. We must expand $(GhcMinVersion) to two digits by
723 # adding a leading zero if necessary:
724 ifneq "$(findstring $(GhcMinVersion), 0 1 2 3 4 5 6 7 8 9)" ""
725 GhcCanonVersion = $(GhcMajVersion)0$(GhcMinVersion)
727 GhcCanonVersion = $(GhcMajVersion)$(GhcMinVersion)
730 #-----------------------------------------------------------------------------
733 # NB. Don't override $(WhatGccIsCalled) using build.mk, re-configure using
734 # the flag --with-gcc=<blah> instead. The reason is that the configure script
735 # needs to know which gcc you're using in order to perform its tests.
739 WhatGccIsCalled = @WhatGccIsCalled@
740 GccVersion = @GccVersion@
741 ifeq "$(strip $(HaveGcc))" "YES"
742 ifneq "$(strip $(UseGcc))" "YES"
745 CC = $(WhatGccIsCalled)
749 # default C compiler flags
750 SRC_CC_OPTS = @SRC_CC_OPTS@
752 ifeq "$(TARGETPLATFORM)" "ia64-unknown-linux"
756 SRC_HSC2HS_OPTS += $(addprefix --cflag=,$(filter-out -O,$(SRC_CC_OPTS)))
757 SRC_HSC2HS_OPTS += $(foreach d,$(GMP_INCLUDE_DIRS),-I$(d))
759 #-----------------------------------------------------------------------------
760 # GMP Library (version 2.0.x or above)
762 HaveLibGmp = @HaveLibGmp@
765 GMP_INCLUDE_DIRS=@GMP_INCLUDE_DIRS@
766 GMP_LIB_DIRS=@GMP_LIB_DIRS@
768 #-----------------------------------------------------------------------------
769 # GMP framework (Mac OS X)
771 HaveFrameworkGMP = @HaveFrameworkGMP@
773 #-----------------------------------------------------------------------------
776 HaveLibMingwEx = @HaveLibMingwEx@
778 #-----------------------------------------------------------------------------
779 # Flex (currently unused, could be moved to glafp-utils)
782 # Don't bother with -lfl, we define our own yywrap()s anyway.
784 #WAS:FLEX_LIB = @LEXLIB@
786 #-----------------------------------------------------------------------------
787 # Other standard (ha!) Unix utilities
790 ArSupportsInput = @ArSupportsInput@
791 # Yuckage: for ghc/utils/parallel -- todo: nuke this dependency!!
792 BASH = /usr/local/bin/bash
794 CONTEXT_DIFF = @ContextDiffCmd@
796 CPP = @CPP@ @CPPFLAGS@
799 # RAWCPP_FLAGS are the flags to give to cpp (viz, gcc -E) to persuade it to
800 # behave plausibly on Haskell sources.
802 RAWCPP_FLAGS = -undef -traditional
807 # Sigh - the autoconf macro for INSTALL will subst a relative path to the fallback
808 # install-sh script (if chosen). This not terribly useful to us, so we convert
809 # it into an abs. path.
811 INSTALL := $(subst .././install-sh,$(TOP)/install-sh,$(INSTALL))
823 PREPROCESSCMD = $(CC) -E
831 # Some ld's support the -x flag and some don't, so the configure
832 # script detects which we have and sets LdXFlag to "-x" or ""
836 # GNU ld supports input via a linker script, which is useful to avoid
837 # overflowing command-line length limits.
838 LdIsGNULd = @LdIsGNULd@
841 # In emergency situations, REAL_SHELL is used to perform shell commands
842 # from within the ghc driver script, by scribbling the command line to
843 # a temp file and then having $(REAL_SHELL) execute it.
845 # The reason for having to do this is that overly long command lines
846 # cause unnecessary trouble with some shells (e.g., /bin/sh on Solaris
847 # 2.5.1), which is why this backdoor is provided. The situation of overly
848 # long command lines is either encountered while doing `make boot' in compiler/,
849 # or when linking the compiler binary (`hsc').
851 # We do not use SHELL to execute long commands, as `make' will more than likely
852 # override whatever setting you have in your environment while executing.
854 # By default, REAL_SHELL is set equal to SHELL, which is not really a smart move
855 # as it is SHELL that will show up the bogosity in the first place, but setting
856 # it to anything else isn't really portable.
858 # ====> If long command lines cause you trouble, invoke `ghc' (via `make' or otherwise)
859 # with REAL_SHELL set to something else than /bin/sh, for instance, your favourite
869 HSCOLOUR = @HSCOLOUR@
872 # This is special to literate/, ToDo: add literate-specific
873 # configure setup to literate/.
878 TGRIND_HELPER = /usr/local/lib/tgrind/tfontedpr # XXX
886 GTK_CONFIG = @GTK_CONFIG@
888 # Set this if you want to use Inno Setup to build a Windows installer
889 # when you make a bindist
892 #-----------------------------------------------------------------------------
895 BUILD_DOCBOOK_HTML = @BUILD_DOCBOOK_HTML@
896 BUILD_DOCBOOK_PS = @BUILD_DOCBOOK_PS@
897 BUILD_DOCBOOK_PDF = @BUILD_DOCBOOK_PDF@
898 DBLATEX = @DblatexCmd@
899 XSLTPROC = @XsltprocCmd@
900 XMLLINT = @XmllintCmd@
902 DIR_DOCBOOK_XSL = @DIR_DOCBOOK_XSL@
904 XSLTPROC_LABEL_OPTS = --stringparam toc.section.depth 3 \
905 --stringparam section.autolabel 1 \
906 --stringparam section.label.includes.component.label 1
908 #-----------------------------------------------------------------------------
909 # FPtools support software
916 GHC_PKG = @GhcPkgCmd@
921 GREENCARD = @GreenCardCmd@
922 GREENCARD_VERSION = @GreenCardVersion@
928 HAPPY_VERSION = @HappyVersion@
930 # Options to pass to Happy when we're going to compile the output with GHC
932 SRC_HAPPY_OPTS = -agc --strict
934 # Temp. to work around performance problems in the HEAD around 8/12/2003,
935 # A Happy compiled with this compiler needs more stack.
936 SRC_HAPPY_OPTS += +RTS -K2m -RTS
942 ALEX_VERSION = @AlexVersion@
944 # Options to pass to Happy when we're going to compile the output with GHC
948 # Should we build haddock docs?
950 # And HsColour the sources?
951 ifeq "$(HSCOLOUR)" ""
958 # Options for compiling in different `ways'.
960 # To configure up your own way, have a look at some of the standard ways
961 # such as profiling, and create your own set of WAY_*_OPTS defs below.
962 # After having done that, add your way string to WAYS, and after having
963 # run the configure script, the different projects will add the new way
964 # to the list of ways they support.
968 # Definitions of the different ways:
972 # - description, e.g., profiling
973 # * what they mean to the driver:
974 # - WAY_p_HC_OPTS gives the list of command-line options
979 # The ways currently defined.
981 ALL_WAYS=v p t l s mp mg debug dyn thr thr_l debug_dyn thr_dyn thr_debug_dyn thr_p thr_debug thr_debug_l
982 USER_WAYS=a b c d e f g h j k l m n o A B
985 # The following ways currently have treated specially, p t mg,
986 # as the driver script treats these guys specially and needs to carefully be told
987 # about the options for these. Hence, we hide the required command line options
988 # for these in the driver, as this is the only place they are needed.
990 # If you want to add to these default options, fill in the variables below:
1001 WAY_t_NAME=ticky-ticky profiling
1002 WAY_t_HC_OPTS= -ticky
1005 WAY_l_NAME=event logging
1006 WAY_l_HC_OPTS= -eventlog
1009 WAY_mp_NAME=parallel
1010 WAY_mp_HC_OPTS=-parallel
1014 WAY_mg_HC_OPTS=-gransim
1017 # These ways apply to the RTS only:
1021 WAY_thr_NAME=threaded
1022 WAY_thr_HC_OPTS=-optc-DTHREADED_RTS
1025 WAY_thr_p_NAME=threaded profiled
1026 WAY_thr_p_HC_OPTS=-optc-DTHREADED_RTS -prof
1029 WAY_thr_l_NAME=threaded event logging
1030 WAY_thr_l_HC_OPTS=-optc-DTHREADED_RTS -eventlog
1033 WAY_debug_NAME=debug
1034 WAY_debug_HC_OPTS=-optc-DDEBUG
1037 WAY_debug_p_NAME=debug profiled
1038 WAY_debug_p_HC_OPTS=-optc-DDEBUG -prof
1041 WAY_debug_t_NAME=debug ticky-ticky profiling
1042 WAY_debug_t_HC_OPTS= -ticky -optc-DDEBUG
1045 WAY_thr_debug_NAME=threaded
1046 WAY_thr_debug_HC_OPTS=-optc-DTHREADED_RTS -optc-DDEBUG
1048 # Way 'thr_debug_p':
1049 WAY_thr_debug_p_NAME=threaded debug profiling
1050 WAY_thr_debug_p_HC_OPTS=-optc-DTHREADED_RTS -optc-DDEBUG -prof
1052 # Way 'thr_debug_l':
1053 WAY_thr_debug_l_NAME=threaded debug event logging
1054 WAY_thr_debug_l_HC_OPTS=-optc-DTHREADED_RTS -optc-DDEBUG -eventlog
1056 # Way 'dyn': build dynamic shared libraries
1058 WAY_dyn_HC_OPTS=-fPIC -dynamic
1059 WAY_dyn_LIB_TARGET=libHSrts-gcc661.so
1062 WAY_thr_dyn_NAME=thr_dyn
1063 WAY_thr_dyn_HC_OPTS=-fPIC -dynamic -optc-DTHREADED_RTS
1065 # Way 'thr_debug_dyn':
1066 WAY_thr_debug_dyn_NAME=thr_dyn
1067 WAY_thr_debug_dyn_HC_OPTS=-fPIC -dynamic -optc-DTHREADED_RTS -optc-DDEBUG
1070 WAY_debug_dyn_NAME=thr_dyn
1071 WAY_debug_dyn_HC_OPTS=-fPIC -dynamic -optc-DDEBUG
1074 # Add user-way configurations here:
1124 ################################################################################
1126 # 31-bit-Int Core files
1128 ################################################################################
1131 # It is possible to configure the compiler and prelude to support 31-bit
1132 # integers, suitable for a back-end and RTS using a tag bit on a 32-bit
1133 # architecture. Currently the only useful output from this option is external Core
1134 # files. The following additions to your build.mk will produce the
1135 # 31-bit core output. Note that this is *not* just a library "way"; the
1136 # compiler must be built a special way too.
1138 # GhcCppOpts +=-DWORD_SIZE_IN_BITS=31
1139 # GhcLibHcOpts +=-fext-core -fno-code -DWORD_SIZE_IN_BITS=31
1140 # GhcLibCppOpts += -DWORD_SIZE_IN_BITS=31
1143 ################################################################################
1145 # Library configure arguments
1147 ################################################################################
1149 CONFIGURE_ARGS = @CONFIGURE_ARGS@
1151 ################################################################################
1153 # Bindist testing directory
1155 ################################################################################
1157 ifeq "$(Windows)" "YES"
1158 BIN_DIST_INST_SUBDIR = "install dir"
1160 # I very much doubt that paths with spaces will work on Unix
1161 BIN_DIST_INST_SUBDIR = installed
1164 BIN_DIST_INST_DIR = $(TOP)/bindisttest/$(BIN_DIST_INST_SUBDIR)