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 # Which ways should DocBook XML documents be built?
56 # options are: dvi ps pdf html chm HxS
60 # Should we build latex docs?
63 # Mac OS X deployment target (to cross-compile for older OS versions)
65 MACOSX_DEPLOYMENT_VERSION = @MACOSX_DEPLOYMENT_VERSION@
66 MACOSX_DEPLOYMENT_SDK = @MACOSX_DEPLOYMENT_SDK@
68 ifneq "$(MACOSX_DEPLOYMENT_VERSION)" ""
69 MACOSX_DEPLOYMENT_CC_OPTS = -mmacosx-version-min=$(MACOSX_DEPLOYMENT_VERSION) \
70 -isysroot $(MACOSX_DEPLOYMENT_SDK) \
72 MACOSX_DEPLOYMENT_LD_OPTS = -mmacosx-version-min=$(MACOSX_DEPLOYMENT_VERSION) \
73 -Wl,-syslibroot,$(MACOSX_DEPLOYMENT_SDK)
74 # We don't extend SRC_CC_OPTS and friends here directly, as (a) they may get
75 # overwritten in build.mk and (b) we must not use the deployment options in
76 # stage 1 or we get a linker error if the bootstrap compiler is for a more
79 # We need --no-builtin-fprintf, as the use of the builtin function optimisation
80 # for fprintf together with #include "PosixSource" in the RTS leads to the
81 # use of fwrite$UNIX2003 (with GCC 4.0.1 on Mac OS X 10.5.2).
84 ################################################################################
86 # Variables that control how the compiler itself is built
88 ################################################################################
90 # The compiler used to build GHC is $(GHC). To change the actual compiler
91 # used, re-configure with --with-ghc=<path-to-ghc>.
93 # Extra ways in which to build the compiler (for example, you might want to
94 # build a profiled compiler so you can see where it spends its time)
97 # Extra option flags to pass to the compiler that compiles the compiler
98 # (Ones that are essential are wired into compiler/Makefile)
99 # Typical options to use here:
101 # -DDEBUG include debugging code and assertions (will make the
102 # compiler slower and produce debugging output, but useful
105 # -dcore-lint check the types after every pass of the compiler;
106 # a pretty strong internal check of the compiler being
107 # used to compile GHC. Useful when bootstrapping.
108 GhcHcOpts=-Rghc-timing
110 # Extra options added to specific stages of the compiler bootstrap.
111 # These are placed later on the command line, and may therefore
112 # override options from $(GhcHcOpts).
119 GhcLibProfiled=$(if $(filter p,$(GhcLibWays)),YES,NO)
121 # Build shared and/or static libs?
122 BuildSharedLibs=@BuildSharedLibs@
124 # BuildStaticLibs=@BuildStaticLibs@
126 # Build a compiler that will build *unregisterised* libraries and
127 # binaries by default. Unregisterised code is supposed to compile and
128 # run without any support for architecture-specific assembly mangling,
129 # register assignment or tail-calls, and is therefore a good way to get
130 # started when porting GHC to new architectures.
132 # If this is set to NO, you can still use the unregisterised way
133 # (way 'u') to get unregisterised code, but the default way will be
136 # NOTE: the stage1 compiler will be a registerised binary (assuming
137 # the compiler you build with is generating registerised binaries), but
138 # the stage2 compiler will be an unregisterised binary.
140 ifneq "$(findstring $(HostArch_CPP), alpha hppa)" ""
141 GhcUnregisterised=YES
146 # Build a compiler with a native code generator backend
147 # (as well as a C backend)
149 # Target platforms supported:
151 # AIX is not supported
152 ArchSupportsNCG=$(strip $(patsubst $(HostArch_CPP), YES, $(findstring $(HostArch_CPP), i386 x86_64 powerpc sparc)))
153 OsSupportsNCG=$(strip $(patsubst $(HostOS_CPP), YES, $(patsubst aix,,$(HostOS_CPP))))
155 # lazy test, because $(GhcUnregisterised) might be set in build.mk later.
156 GhcWithNativeCodeGen=$(strip\
157 $(if $(filter YESYESNO,\
158 $(OsSupportsNCG)$(ArchSupportsNCG)$(GhcUnregisterised)),YES,NO))
160 HaveLibDL = @HaveLibDL@
162 # ArchSupportsSMP should be set iff there is support for that arch in
164 ArchSupportsSMP=$(strip $(patsubst $(HostArch_CPP), YES, $(findstring $(HostArch_CPP), i386 x86_64 sparc powerpc)))
166 # lazy test, because $(GhcUnregisterised) might be set in build.mk later.
167 GhcWithSMP=$(strip $(if $(filter YESNO, $(ArchSupportsSMP)$(GhcUnregisterised)),YES,NO))
169 # Whether to include GHCi in the compiler. Depends on whether the RTS linker
170 # has support for this OS/ARCH combination.
172 OsSupportsGHCi=$(strip $(patsubst $(HostOS_CPP), YES, $(findstring $(HostOS_CPP), mingw32 cygwin32 linux solaris2 freebsd netbsd openbsd darwin)))
173 ArchSupportsGHCi=$(strip $(patsubst $(HostArch_CPP), YES, $(findstring $(HostArch_CPP), i386 x86_64 powerpc sparc sparc64)))
175 ifeq "$(OsSupportsGHCi)$(ArchSupportsGHCi)" "YESYES"
176 GhcWithInterpreter=YES
178 GhcWithInterpreter=NO
181 # GhcEnableTablesNextToCode tells us whether the target architecture
182 # supports placing info tables directly before the entry code
183 # (see TABLES_NEXT_TO_CODE in the RTS). Whether we actually compile for
184 # TABLES_NEXT_TO_CODE depends on whether we're building unregisterised
185 # code or not, which may be decided by options to the compiler later.
186 ifneq "$(findstring $(TargetArch_CPP)X, ia64X powerpc64X)" ""
187 GhcEnableTablesNextToCode=NO
189 GhcEnableTablesNextToCode=YES
192 # On Windows we normally want to make a relocatable bindist, to we
193 # ignore flags like libdir
194 ifeq "$(Windows)" "YES"
195 RelocatableBuild = YES
197 RelocatableBuild = NO
200 # When building bindists we set this to yes so that the binaries are as
201 # portable as possible.
205 # Building various ways?
206 # (right now, empty if not).
207 BuildingParallel=$(subst mp,YES,$(filter mp,$(WAYS)))
208 BuildingGranSim=$(subst mg,YES,$(filter mg,$(WAYS)))
210 # Interface file version (hi-boot files only)
212 # A GHC built with HscIfaceFileVersion=n will look for
213 # M.hi-boot-n, and only then for
215 # (It'll be happy with the latter if the former doesn't exist.)
218 # This variable is used ONLY for hi-boot files. Its only purpose is
219 # to allow you to have a single directory with multiple .hi-boot files
220 # for the same module, each corresponding to a different version of
223 # HscIfaceFileVersion is propagated to hsc via
224 # compiler/main/Config.hs, which is automatically generated by
227 HscIfaceFileVersion=6
229 #------------------------------------------------------------------------------
230 # Options for Libraries
232 # Which directory (in libraries/) contains the integer library?
233 INTEGER_LIBRARY=integer-gmp
235 # We build the libraries at least the "vanilla" way (way "v")
238 # In addition to the normal sequential way, the default is to also build
239 # profiled prelude libraries unless we are booting from .hc files
240 ifneq "$(BootingFromHc)" "YES"
244 ifeq "$(BuildSharedLibs)" "YES"
248 # In addition, the RTS is built in some further variations. Ways that
252 # thr_p : threaded profiled
253 # debug : debugging (compile with -g for the C compiler, and -DDEBUG)
254 # debug_p : debugging profiled
255 # thr_debug : debugging threaded
256 # thr_debug_p : debugging threaded profiled
257 # t : ticky-ticky profiling
258 # debug_t : debugging ticky-ticky profiling
260 # thr_l : threaded and event logging
261 # thr_debug_l : threaded and debugging and event logging
265 # Usually want the debug version
266 ifeq "$(BootingFromHc)" "NO"
270 ifeq "$(BuildSharedLibs)" "YES"
271 GhcRTSWays += dyn debug_dyn thr_dyn thr_debug_dyn
274 # Want the threaded versions unless we're unregisterised
275 # Defer the check until later by using $(if..), because GhcUnregisterised might
276 # be set in build.mk, which hasn't been read yet.
277 GhcRTSWays += $(if $(findstring NO, $(GhcUnregisterised)),thr thr_debug thr_l,)
278 GhcRTSWays += $(if $(findstring p, $(GhcLibWays)),$(if $(findstring NO, $(GhcUnregisterised)),thr_p,),)
280 # We can only build GHCi threaded if we have a threaded RTS:
281 GhcThreaded = $(if $(findstring thr,$(GhcRTSWays)),YES,NO)
283 # Option flags to pass to GHC when it's compiling modules in
284 # fptools/libraries. Typically these are things like -O or
285 # -dcore-lint or -H32m. The ones that are *essential* are wired into
288 # -O(2) is pretty desirable, otherwise no inlining of prelude
289 # things (incl "+") happens when compiling with this compiler
291 # -XGenerics switches on generation of support code for
292 # derivable type classes. This is now off by default,
293 # but we switch it on for the libraries so that we generate
294 # the code in case someone importing wants it
296 GhcLibHcOpts=-O2 -XGenerics
298 # Win32 only: Enable the RTS and libraries to be built as DLLs
299 DLLized=@EnableWin32DLLs@
301 # Strip local symbols from libraries? This can make the libraries smaller,
302 # but makes debugging somewhat more difficult. Doesn't work with all ld's.
306 # These are the URL patterns that Haddock uses to generate the "Source
307 # File" links on each page.
308 PackageSourceURL = http://darcs.haskell.org/packages/$(PACKAGE)/%{FILE}
310 # ----------------------------------------------------------------------------
311 # Object-file splitting
313 # Set SplitObjs=YES or NO in your build.mk
315 # Don't use -split-objs in in GhcLibHcOpts, because the build
316 # system needs to do other special magic if you are
317 # doing object-file splitting
319 ArchSupportsSplitObjs=$(strip $(if $(filter $(TargetArch_CPP),i386 x86_64 powerpc sparc),YES,NO))
321 # lazy test, so that $(GhcUnregisterised) can be set in build.mk
322 SupportsSplitObjs=$(strip $(if $(filter YES,$(ArchSupportsSplitObjs)),\
323 $(if $(filter NO,$(BootingFromHc)),\
324 $(if $(filter NO,$(GhcUnregisterised)),\
330 # By default, enable SplitObjs for the libraries if this build supports it
331 SplitObjs=$(SupportsSplitObjs)
336 # .NET interop support?
340 # Build unix package?
342 GhcLibsWithUnix=@GhcLibsWithUnix@
344 # ----------------------------------------------------------------------------
345 # Options for GHC's RTS
347 # For an optimised RTS (you probably don't want to change these; we build
348 # a debugging RTS by default now. Use -debug to get it).
349 GhcRtsHcOpts=-optc-O2
350 GhcRtsCcOpts=-fomit-frame-pointer
352 # Include the front panel code? Needs GTK+.
353 GhcRtsWithFrontPanel = NO
355 # Include support for CPU performance counters via the PAPI library in the RTS?
356 # (PAPI: http://icl.cs.utk.edu/papi/)
361 ################################################################################
365 # nofib specific options
367 ################################################################################
369 WithNofibHc = $(GHC_INPLACE)
371 # NoFibSubDirs controls which set of tests should be run
372 # You can run one or more of
380 NoFibSubDirs = imaginary spectral real
382 # The different ways to build nofib. Default is just to mirror
383 # what is done for the ghc prelude libraries.
385 NoFibWays = $(GhcLibWays)
387 # Haskell compiler options for nofib
390 # Number of times to run each program
393 ################################################################################
395 # Paths (see paths.mk)
397 ################################################################################
399 # Directory used by GHC (and possibly other tools) for storing
400 # temporary files. If your TMPDIR isn't big enough, either override
401 # this in build.mk or set your environment variable "TMPDIR" to point
402 # to somewhere with more space. (TMPDIR=. is a good choice).
404 # DEFAULT_TMPDIR isn't called TMPDIR because GNU make tends to
405 # override an environment variable with the value of the make variable
406 # of the same name (if it exists) when executing sub-processes, so
407 # setting the TMPDIR env var would have no effect in the build tree.
409 DEFAULT_TMPDIR = /tmp
410 ifeq "$(TARGETPLATFORM)" "i386-unknown-cygwin32"
411 DEFAULT_TMPDIR = /C/TEMP
413 ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
414 DEFAULT_TMPDIR = /C/TEMP
417 BIN_DIST_TOPDIR_ABS=$(TOP)
418 BIN_DIST_DIR=$(BIN_DIST_TOPDIR_ABS)/$(BIN_DIST_NAME)
420 BIN_DIST_NAME=ghc-$(ProjectVersion)
421 BIN_DIST_TAR=$(TOP)/$(BIN_DIST_NAME)-$(TARGETPLATFORM).tar
422 BIN_DIST_TAR_BZ2=$(BIN_DIST_TAR).bz2
423 BIN_DIST_PREP_DIR=$(TOP)/bindist-prep
424 BIN_DIST_PREP=$(BIN_DIST_PREP_DIR)/$(BIN_DIST_NAME)
425 BIN_DIST_LIST=$(TOP)/bindist-list
427 # Definition of installation directories, we don't use half of these, but since
428 # the configure script has them on offer while passing through, we might as well
429 # set them. Note that we have to be careful, because the GNU coding standards
430 # have changed a bit over the course of time, and autoconf development reflects
433 # A little bit of history regarding autoconf and GNU coding standards, use this
434 # as a cheat-sheet for the stuff below:
436 # variable | default < 2.60 | default >= 2.60
437 # ------------+--------------------+--------------------------------------
438 # exec_prefix | ${prefix} | ${prefix}
439 # libdir | ${exec_prefix}/lib | ${exec_prefix}/lib
440 # datarootdir | NONE! | ${prefix}/share
441 # datadir | ${prefix}/share | ${datarootdir}
442 # infodir | ${prefix}/info | ${datarootdir}/info
443 # mandir | ${prefix}/man | ${datarootdir}/man
444 # docdir | NONE! | ${datarootdir}/doc/${PACKAGE_TARNAME}
445 # htmldir | NONE! | ${docdir}
446 # dvidir | NONE! | ${docdir}
447 # pdfdir | NONE! | ${docdir}
448 # psdir | NONE! | ${docdir}
450 # NOTE: The default e.g. ${docdir} above means that autoconf substitutes the
451 # string "${docdir}", not the value of docdir! This is crucial for the GNU
454 # This gets used in the default docdir when autoconf >= 2.60 is used
455 PACKAGE_TARNAME := @PACKAGE_TARNAME@
459 # New autoconf (>= 2.60?) make a configure with a --datarootdir=DIR flag.
460 # However, in order to support older autoconf's we don't use it.
461 # datarootdir is set lower down instead.
462 # But, as datadir is defined in terms of datarootdir, we also need to
463 # set it to the value (if any) that configure gives it here.
464 datarootdir := @datarootdir@
466 exec_prefix := @exec_prefix@
468 datadir0 := @datadir@
470 includedir := @includedir@
472 dynlibdir := @libdir@
474 ifeq "$(RelocatableBuild)" "YES"
476 # Hack: our directory layouts tend to be different on Windows, so
477 # hack around configure's bogus assumptions here.
478 datarootdir := $(prefix)
479 datadir := $(prefix)/lib
480 libdir := $(prefix)/lib
482 docdir := $(prefix)/doc
490 # Unix: override libdir and datadir to put ghc-specific stuff in
491 # a subdirectory with the version number included.
493 # datadir is set to libdir here as GHC needs package.conf and unlit
494 # to be in the same place (and things like ghc-pkg need to agree on
495 # where package.conf is, so we just set it globally).
497 datarootdir := $(datadir0)
498 libdir := $(libdir0)/ghc-$(ProjectVersion)
501 # New autoconf (>= 2.60?) make a configure with --docdir=DIR etc flags.
502 # However, in order to support older autoconf's we don't use them.
505 #htmldir := @htmldir@
510 docdir := $(datarootdir)/doc/ghc
518 headerdir := $(libdir)/include
520 # Default place for putting interface files is $(libdir)
521 # (overriden for packages in package.mk)
524 # NOTE: by intention, libexecdir and libdir point to
526 # => Only way to override this is to set libexecdir= on the command line.
527 # (NOTE: configure script setting is ignored).
528 libexecdir = $(libdir)
530 #-----------------------------------------------------------------------------
531 # install configuration
534 # Set this to have files installed with a specific owner
539 # Set this to have files installed with a specific group
544 # Invocations of `install' for the four different classes
547 INSTALL_PROGRAM = $(INSTALL) -m 755
548 INSTALL_SCRIPT = $(INSTALL) -m 755
549 INSTALL_SHLIB = $(INSTALL) -m 755
550 INSTALL_DATA = $(INSTALL) -m 644
551 INSTALL_HEADER = $(INSTALL) -m 644
552 INSTALL_MAN = $(INSTALL) -m 644
553 INSTALL_DIR = $(MKDIRHIER)
556 # runhaskell and hsc2hs are special, in that other compilers besides
557 # GHC might provide them. Systems with a package manager often come
558 # with tools to manage this kind of clash, e.g. RPM's
559 # update-alternatives. When building a distribution for such a system,
560 # we recommend setting both of the following to 'YES'.
562 # NO_INSTALL_RUNHASKELL = YES
563 # NO_INSTALL_HSC2HS = YES
565 # NB. we use negative tests here because for binary-distributions we cannot
566 # test build-time variables at install-time, so they must default to on.
568 # -----------------------------------------------------------------------------
569 # Utilities programs: flags
571 # If you want to give any standard flags to pretty much any utility
572 # (see utils.mk for a complete list), by adding a line here
576 # where P is the utility. For example, to add -O to all Haskell
581 SRC_HC_OPTS += -H32m -O
583 # These flags make flex 8-bit
586 # Default fptools options for dllwrap.
587 SRC_BLD_DLL_OPTS += --target=i386-mingw32
589 # Flags for CPP when running GreenCard on .pgc files
590 GC_CPP_OPTS += -P -E -x c -traditional -D__GLASGOW_HASKELL__
593 ################################################################################
595 # Layout of the source tree
597 ################################################################################
599 # Here we provide defines for the various directories in the source tree,
600 # so we can move things around more easily. A define $(GHC_FOO_DIR)
601 # indicates a directory relative to the top of the source tree.
603 GHC_UTILS_DIR = utils
604 GHC_INCLUDE_DIR = includes
605 GHC_COMPILER_DIR = compiler
608 GHC_DRIVER_DIR = driver
609 GHC_COMPAT_DIR = compat
611 GHC_MKDEPENDC_DIR = $(GHC_UTILS_DIR)/mkdependC
612 GHC_LTX_DIR = $(GHC_UTILS_DIR)/ltx
613 GHC_LNDIR_DIR = $(GHC_UTILS_DIR)/lndir
614 GHC_MKDIRHIER_DIR = $(GHC_UTILS_DIR)/mkdirhier
615 GHC_DOCBOOK_DIR = $(GHC_UTILS_DIR)/docbook
616 GHC_UNLIT_DIR = $(GHC_UTILS_DIR)/unlit
617 GHC_HP2PS_DIR = $(GHC_UTILS_DIR)/hp2ps
618 GHC_HSTAGS_DIR = $(GHC_UTILS_DIR)/hasktags
619 GHC_GHCTAGS_DIR = $(GHC_UTILS_DIR)/ghctags
620 GHC_HSC2HS_DIR = $(GHC_UTILS_DIR)/hsc2hs
621 GHC_TOUCHY_DIR = $(GHC_UTILS_DIR)/touchy
622 GHC_PKG_DIR = $(GHC_UTILS_DIR)/ghc-pkg
623 GHC_GENPRIMOP_DIR = $(GHC_UTILS_DIR)/genprimopcode
624 GHC_GENAPPLY_DIR = $(GHC_UTILS_DIR)/genapply
625 GHC_CABAL_DIR = $(GHC_UTILS_DIR)/ghc-cabal
626 GHC_MANGLER_DIR = $(GHC_DRIVER_DIR)/mangler
627 GHC_SPLIT_DIR = $(GHC_DRIVER_DIR)/split
628 GHC_SYSMAN_DIR = $(GHC_RTS_DIR)/parallel
630 # -----------------------------------------------------------------------------
631 # Names of programs in the GHC tree
633 # xxx_PGM the name of an executable, without the path
634 # xxx the executable relative to the current dir
636 GHC_UNLIT_PGM = unlit$(exeext)
637 GHC_HP2PS_PGM = hp2ps$(exeext)
638 GHC_HSTAGS_PGM = hasktags$(exeext)
639 GHC_GHCTAGS_PGM = ghctags$(exeext)
640 GHC_HSC2HS_PGM = hsc2hs$(exeext)
641 GHC_TOUCHY_PGM = touchy$(exeext)
642 GHC_MANGLER_PGM = ghc-asm
643 GHC_SPLIT_PGM = ghc-split
644 GHC_SYSMAN_PGM = SysMan
645 GHC_GENPRIMOP_PGM = genprimopcode$(exeext)
646 GHC_GENAPPLY_PGM = genapply$(exeext)
647 GHC_CABAL_PGM = ghc-cabal$(exeext)
648 GHC_PKG_PGM = ghc-pkg$(exeext)
649 GHC_MKDEPENDC_PGM = mkdependC
650 GHC_LTX_PGM = ltx$(exeext)
651 GHC_MKDIRHIER_PGM = mkdirhier
652 GHC_LNDIR_PGM = lndir
653 GHC_DUMMY_GHC_PGM = dummy-ghc$(exeext)
655 ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
663 HP2PS = $(GHC_HP2PS_DIR)/$(GHC_HP2PS_PGM)
664 HSTAGS = $(GHC_HSTAGS_DIR)/$(GHC_HSTAGS_PGM)
665 MANGLER = $(INPLACE_LIB)/$(GHC_MANGLER_PGM)
666 SPLIT = $(INPLACE_LIB)/$(GHC_SPLIT_PGM)
667 SYSMAN = $(GHC_SYSMAN_DIR)/$(GHC_SYSMAN_PGM)
668 LTX = $(GHC_LTX_DIR)/$(GHC_LTX_PGM)
669 LNDIR = $(GHC_LNDIR_DIR)/$(GHC_LNDIR_PGM)
672 INPLACE_BIN = $(INPLACE)/bin
673 INPLACE_LIB = $(INPLACE)/lib
674 INPLACE_MINGW = $(INPLACE)/mingw
676 UNLIT = $(INPLACE_LIB)/$(GHC_UNLIT_PGM)
677 TOUCHY = $(INPLACE_LIB)/$(GHC_TOUCHY_PGM)
678 MKDIRHIER = $(INPLACE_BIN)/$(GHC_MKDIRHIER_PGM)
679 MKDEPENDC = $(INPLACE_BIN)/$(GHC_MKDEPENDC_PGM)
680 GHC_CABAL_INPLACE = $(INPLACE_BIN)/$(GHC_CABAL_PGM)
681 GENAPPLY_INPLACE = $(INPLACE_BIN)/$(GHC_GENAPPLY_PGM)
682 GHC_PKG_INPLACE = $(INPLACE_BIN)/$(GHC_PKG_PGM)
683 GHCTAGS_INPLACE = $(INPLACE_BIN)/$(GHC_GHCTAGS_PGM)
684 HSC2HS_INPLACE = $(INPLACE_BIN)/$(GHC_HSC2HS_PGM)
685 GENPRIMOP_INPLACE = $(INPLACE_BIN)/$(GHC_GENPRIMOP_PGM)
686 DUMMY_GHC_INPLACE = $(INPLACE_BIN)/$(GHC_DUMMY_GHC_PGM)
688 GENERATED_FILE = chmod a-w
689 EXECUTABLE_FILE = chmod +x
691 #-----------------------------------------------------------------------------
692 # Haskell compilers and mkdependHS
694 # $(GHC), $(HBC) and $(NHC) point to installed versions of the relevant
695 # compilers, if available.
697 # $(HC) is a generic Haskell 98 compiler, set to $(GHC) by default.
698 # $(MKDEPENDHS) is the Haskell dependency generator (ghc -M).
700 # NOTE: Don't override $(GHC) in build.mk, use configure --with-ghc instead
701 # (because the version numbers have to be calculated).
704 # If we have a make dependency on c:/ghc/ghc, and the file is actually
705 # called c:/ghc/ghc.exe, then make will think that ghc doesn't exist
706 # and that it doesn't know how to create it.
707 ifneq "$(wildcard $(GHC).exe)" ""
711 GhcDir = $(dir $(GHC))
713 # Set to YES if $(GHC) has the editline package installed
714 GhcHasEditline = @GhcHasEditline@
719 # Sometimes we want to invoke ghc from the build tree in different
720 # places (eg. it's handy to have a nofib & a ghc build in the same
721 # tree). We can refer to "this ghc" as $(GHC_INPLACE):
723 GHC_INPLACE = $(GHC_STAGE1)
725 GHC_STAGE0_ABS = $(GHC)
726 GHC_STAGE1_ABS = $(TOP)/$(INPLACE_BIN)/ghc-stage1$(exeext)
727 GHC_STAGE2_ABS = $(TOP)/$(INPLACE_BIN)/ghc-stage2$(exeext)
728 GHC_STAGE3_ABS = $(TOP)/$(INPLACE_BIN)/ghc-stage3$(exeext)
731 GHC_STAGE1 = $(INPLACE_BIN)/ghc-stage1$(exeext)
732 GHC_STAGE2 = $(INPLACE_BIN)/ghc-stage2$(exeext)
733 GHC_STAGE3 = $(INPLACE_BIN)/ghc-stage3$(exeext)
735 # Install stage 2 by default, can be changed to 3
738 BOOTSTRAPPING_CONF = libraries/bootstrapping.conf
740 INPLACE_PACKAGE_CONF = $(INPLACE_LIB)/package.conf
742 GhcVersion = @GhcVersion@
743 GhcPatchLevel = @GhcPatchLevel@
744 GhcMajVersion = @GhcMajVersion@
745 GhcMinVersion = @GhcMinVersion@
747 ghc_ge_607 = @ghc_ge_607@
748 ghc_ge_609 = @ghc_ge_609@
750 # Canonicalised ghc version number, used for easy (integer) version
751 # comparisons. We must expand $(GhcMinVersion) to two digits by
752 # adding a leading zero if necessary:
753 ifneq "$(findstring $(GhcMinVersion), 0 1 2 3 4 5 6 7 8 9)" ""
754 GhcCanonVersion = $(GhcMajVersion)0$(GhcMinVersion)
756 GhcCanonVersion = $(GhcMajVersion)$(GhcMinVersion)
759 #-----------------------------------------------------------------------------
762 # NB. Don't override $(WhatGccIsCalled) using build.mk, re-configure using
763 # the flag --with-gcc=<blah> instead. The reason is that the configure script
764 # needs to know which gcc you're using in order to perform its tests.
768 WhatGccIsCalled = @WhatGccIsCalled@
769 GccVersion = @GccVersion@
770 ifeq "$(strip $(HaveGcc))" "YES"
771 ifneq "$(strip $(UseGcc))" "YES"
774 CC = $(WhatGccIsCalled)
778 # default C compiler flags
779 SRC_CC_OPTS = @SRC_CC_OPTS@
781 ifeq "$(TARGETPLATFORM)" "ia64-unknown-linux"
785 SRC_HSC2HS_OPTS += $(addprefix --cflag=,$(filter-out -O,$(SRC_CC_OPTS)))
786 SRC_HSC2HS_OPTS += $(foreach d,$(GMP_INCLUDE_DIRS),-I$(d))
788 #-----------------------------------------------------------------------------
789 # GMP Library (version 2.0.x or above)
791 HaveLibGmp = @HaveLibGmp@
794 GMP_INCLUDE_DIRS=@GMP_INCLUDE_DIRS@
795 GMP_LIB_DIRS=@GMP_LIB_DIRS@
797 #-----------------------------------------------------------------------------
798 # GMP framework (Mac OS X)
800 HaveFrameworkGMP = @HaveFrameworkGMP@
802 #-----------------------------------------------------------------------------
805 HaveLibMingwEx = @HaveLibMingwEx@
807 #-----------------------------------------------------------------------------
808 # Flex (currently unused, could be moved to glafp-utils)
811 # Don't bother with -lfl, we define our own yywrap()s anyway.
813 #WAS:FLEX_LIB = @LEXLIB@
815 #-----------------------------------------------------------------------------
816 # Other standard (ha!) Unix utilities
819 ArSupportsInput = @ArSupportsInput@
820 # Yuckage: for ghc/utils/parallel -- todo: nuke this dependency!!
821 BASH = /usr/local/bin/bash
823 CONTEXT_DIFF = @ContextDiffCmd@
825 CPP = @CPP@ @CPPFLAGS@
828 # RAWCPP_FLAGS are the flags to give to cpp (viz, gcc -E) to persuade it to
829 # behave plausibly on Haskell sources.
831 RAWCPP_FLAGS = -undef -traditional
836 # Sigh - the autoconf macro for INSTALL will subst a relative path to the fallback
837 # install-sh script (if chosen). This not terribly useful to us, so we convert
838 # it into an abs. path.
840 INSTALL := $(subst .././install-sh,$(TOP)/install-sh,$(INSTALL))
852 PREPROCESSCMD = $(CC) -E
860 # Some ld's support the -x flag and some don't, so the configure
861 # script detects which we have and sets LdXFlag to "-x" or ""
865 # GNU ld supports input via a linker script, which is useful to avoid
866 # overflowing command-line length limits.
867 LdIsGNULd = @LdIsGNULd@
870 # In emergency situations, REAL_SHELL is used to perform shell commands
871 # from within the ghc driver script, by scribbling the command line to
872 # a temp file and then having $(REAL_SHELL) execute it.
874 # The reason for having to do this is that overly long command lines
875 # cause unnecessary trouble with some shells (e.g., /bin/sh on Solaris
876 # 2.5.1), which is why this backdoor is provided. The situation of overly
877 # long command lines is either encountered while doing `make boot' in compiler/,
878 # or when linking the compiler binary (`hsc').
880 # We do not use SHELL to execute long commands, as `make' will more than likely
881 # override whatever setting you have in your environment while executing.
883 # By default, REAL_SHELL is set equal to SHELL, which is not really a smart move
884 # as it is SHELL that will show up the bogosity in the first place, but setting
885 # it to anything else isn't really portable.
887 # ====> If long command lines cause you trouble, invoke `ghc' (via `make' or otherwise)
888 # with REAL_SHELL set to something else than /bin/sh, for instance, your favourite
898 HSCOLOUR = @HSCOLOUR@
901 # This is special to literate/, ToDo: add literate-specific
902 # configure setup to literate/.
907 TGRIND_HELPER = /usr/local/lib/tgrind/tfontedpr # XXX
915 GTK_CONFIG = @GTK_CONFIG@
917 # Set this if you want to use Inno Setup to build a Windows installer
918 # when you make a bindist
921 #-----------------------------------------------------------------------------
924 XSLTPROC = @XsltprocCmd@
925 XMLLINT = @XmllintCmd@
928 PDFXMLTEX = @PdfxmltexCmd@
931 DIR_DOCBOOK_XSL = @DIR_DOCBOOK_XSL@
933 XSLTPROC_LABEL_OPTS = --stringparam toc.section.depth 3 \
934 --stringparam section.autolabel 1 \
935 --stringparam section.label.includes.component.label 1
937 #-----------------------------------------------------------------------------
938 # FPtools support software
945 GHC_PKG = @GhcPkgCmd@
950 GREENCARD = @GreenCardCmd@
951 GREENCARD_VERSION = @GreenCardVersion@
957 HAPPY_VERSION = @HappyVersion@
959 # Options to pass to Happy when we're going to compile the output with GHC
961 SRC_HAPPY_OPTS = -agc --strict
963 # Temp. to work around performance problems in the HEAD around 8/12/2003,
964 # A Happy compiled with this compiler needs more stack.
965 SRC_HAPPY_OPTS += +RTS -K2m -RTS
971 ALEX_VERSION = @AlexVersion@
973 # Options to pass to Happy when we're going to compile the output with GHC
977 # Should we build haddock docs?
979 # And HsColour the sources?
980 ifeq "$(HSCOLOUR)" ""
987 # Options for compiling in different `ways'.
989 # To configure up your own way, have a look at some of the standard ways
990 # such as profiling, and create your own set of WAY_*_OPTS defs below.
991 # After having done that, add your way string to WAYS, and after having
992 # run the configure script, the different projects will add the new way
993 # to the list of ways they support.
997 # Definitions of the different ways:
1001 # - description, e.g., profiling
1002 # * what they mean to the driver:
1003 # - WAY_p_HC_OPTS gives the list of command-line options
1008 # The ways currently defined.
1010 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
1011 USER_WAYS=a b c d e f g h j k l m n o A B
1014 # The following ways currently have treated specially, p t mg,
1015 # as the driver script treats these guys specially and needs to carefully be told
1016 # about the options for these. Hence, we hide the required command line options
1017 # for these in the driver, as this is the only place they are needed.
1019 # If you want to add to these default options, fill in the variables below:
1026 WAY_p_NAME=profiling
1027 WAY_p_HC_OPTS= -prof
1030 WAY_t_NAME=ticky-ticky profiling
1031 WAY_t_HC_OPTS= -ticky
1034 WAY_l_NAME=event logging
1035 WAY_l_HC_OPTS= -eventlog
1038 WAY_mp_NAME=parallel
1039 WAY_mp_HC_OPTS=-parallel
1043 WAY_mg_HC_OPTS=-gransim
1046 # These ways apply to the RTS only:
1050 WAY_thr_NAME=threaded
1051 WAY_thr_HC_OPTS=-optc-DTHREADED_RTS
1054 WAY_thr_p_NAME=threaded profiled
1055 WAY_thr_p_HC_OPTS=-optc-DTHREADED_RTS -prof
1058 WAY_thr_l_NAME=threaded event logging
1059 WAY_thr_l_HC_OPTS=-optc-DTHREADED_RTS -eventlog
1062 WAY_debug_NAME=debug
1063 WAY_debug_HC_OPTS=-optc-DDEBUG
1066 WAY_debug_p_NAME=debug profiled
1067 WAY_debug_p_HC_OPTS=-optc-DDEBUG -prof
1070 WAY_debug_t_NAME=debug ticky-ticky profiling
1071 WAY_debug_t_HC_OPTS= -ticky -optc-DDEBUG
1074 WAY_thr_debug_NAME=threaded
1075 WAY_thr_debug_HC_OPTS=-optc-DTHREADED_RTS -optc-DDEBUG
1077 # Way 'thr_debug_p':
1078 WAY_thr_debug_p_NAME=threaded debug profiling
1079 WAY_thr_debug_p_HC_OPTS=-optc-DTHREADED_RTS -optc-DDEBUG -prof
1081 # Way 'thr_debug_l':
1082 WAY_thr_debug_l_NAME=threaded debug event logging
1083 WAY_thr_debug_l_HC_OPTS=-optc-DTHREADED_RTS -optc-DDEBUG -eventlog
1085 # Way 'dyn': build dynamic shared libraries
1087 WAY_dyn_HC_OPTS=-fPIC -dynamic
1088 WAY_dyn_LIB_TARGET=libHSrts-gcc661.so
1091 WAY_thr_dyn_NAME=thr_dyn
1092 WAY_thr_dyn_HC_OPTS=-fPIC -dynamic -optc-DTHREADED_RTS
1094 # Way 'thr_debug_dyn':
1095 WAY_thr_debug_dyn_NAME=thr_dyn
1096 WAY_thr_debug_dyn_HC_OPTS=-fPIC -dynamic -optc-DTHREADED_RTS -optc-DDEBUG
1099 WAY_debug_dyn_NAME=thr_dyn
1100 WAY_debug_dyn_HC_OPTS=-fPIC -dynamic -optc-DDEBUG
1103 # Add user-way configurations here:
1153 ################################################################################
1155 # 31-bit-Int Core files
1157 ################################################################################
1160 # It is possible to configure the compiler and prelude to support 31-bit
1161 # integers, suitable for a back-end and RTS using a tag bit on a 32-bit
1162 # architecture. Currently the only useful output from this option is external Core
1163 # files. The following additions to your build.mk will produce the
1164 # 31-bit core output. Note that this is *not* just a library "way"; the
1165 # compiler must be built a special way too.
1167 # GhcCppOpts +=-DWORD_SIZE_IN_BITS=31
1168 # GhcLibHcOpts +=-fext-core -fno-code -DWORD_SIZE_IN_BITS=31
1169 # GhcLibCppOpts += -DWORD_SIZE_IN_BITS=31
1172 ################################################################################
1174 # Library configure arguments
1176 ################################################################################
1178 CONFIGURE_ARGS = @CONFIGURE_ARGS@
1180 ################################################################################
1182 # Bindist testing directory
1184 ################################################################################
1186 ifeq "$(Windows)" "YES"
1187 BIN_DIST_INST_SUBDIR = "install dir"
1189 # I very much doubt that paths with spaces will work on Unix
1190 BIN_DIST_INST_SUBDIR = installed
1193 BIN_DIST_INST_DIR = $(TOP)/bindisttest/$(BIN_DIST_INST_SUBDIR)