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 ################################################################################
40 # ProjectVersion is treated as a *string*
41 # ProjectVersionInt is treated as an *integer* (for cpp defines)
43 # Versioning scheme: A.B.C
44 # A: major version, decimal, any number of digits
45 # B: minor version, decimal, any number of digits
46 # C: patchlevel, one digit, omitted if zero.
48 # ProjectVersionInt does *not* contain the patchlevel (rationale: this
49 # figure is used for conditional compilations, and library interfaces
50 # etc. are not supposed to change between patchlevels).
52 # The ProjectVersionInt is included in interface files, and GHC
53 # checks that it's reading interface generated by the same ProjectVersion
54 # as itself. It does this even though interface file syntax may not
55 # change between versions. Rationale: calling conventions or other
56 # random .o-file stuff might change even if the .hi syntax doesn't
58 ProjectVersion = @ProjectVersion@
59 ProjectVersionInt = @ProjectVersionInt@
60 ProjectPatchLevel = @ProjectPatchLevel@
62 ################################################################################
66 ################################################################################
68 # A "platform" is the GNU cpu-type/manufacturer/operating-system target machine
69 # specifier. E.g. sparc-sun-solaris2
71 # Build platform: the platform on which we are doing this build
72 # Host platform: the platform on which these binaries will run
73 # Target platform: the platform for which this compiler will generate code
75 # We don't support build & host being different, because the build
76 # process creates binaries that are run during the build, and also
79 # If host & target are different, then we are building a compiler
80 # which will generate intermediate .hc files to port to the target
81 # architecture for bootstrapping. The libraries and stage 2 compiler
82 # will be built as HC files for the target system, and likely won't
83 # build on this host platform.
85 # An important invariant is that for any piece of source code, the
86 # platform on which the code is going to run is the HOST platform,
87 # and the platform on which we are building is the BUILD platform.
88 # Additionally for the compiler, the platform this compiler will
89 # generate code for is the TARGET. TARGET is not meaningful outside
90 # the compiler sources.
92 # Guidelines for when to use HOST vs. TARGET:
94 # - In the build system (Makefile, foo.mk), normally we should test
95 # $(HOSTPLATFORM). There are some cases (eg. installation), where
96 # we expect $(HOSTPLATFORM)==$(TARGETPLATFORM), so in those cases it
97 # doesn't matter which is used.
99 # - In the compiler itself, we should test HOST or TARGET depending
100 # on whether the conditional relates to the code being generated, or
101 # the platform on which the compiler is running. See the section
102 # on "Coding Style" in the commentary for more details.
104 # - In all other code, we should be testing HOST only.
106 # NOTE: cross-compiling is not well supported by the build system.
107 # You have to do a lot of work by hand to cross compile: see the
108 # section on "Porting GHC" in the Building Guide.
110 HOSTPLATFORM = @HostPlatform@
111 TARGETPLATFORM = @TargetPlatform@
112 BUILDPLATFORM = @BuildPlatform@
115 # in one or two places, we need to get at the OS version (major and
116 # perhaps even minor), HostOS_Full is the OS name reported by
117 # AC_CANONICAL_SYSTEM.
119 HostPlatform_CPP = @HostPlatform_CPP@
120 HostArch_CPP = @HostArch_CPP@
121 HostOS_CPP = @HostOS_CPP@
122 HostOS_Full = @HostOS_Full@
123 HostVendor_CPP = @HostVendor_CPP@
125 TargetPlatform_CPP = @TargetPlatform_CPP@
126 TargetArch_CPP = @TargetArch_CPP@
127 TargetOS_CPP = @TargetOS_CPP@
128 TargetVendor_CPP = @TargetVendor_CPP@
130 BuildPlatform_CPP = @BuildPlatform_CPP@
131 BuildArch_CPP = @BuildArch_CPP@
132 BuildOS_CPP = @BuildOS_CPP@
133 BuildVendor_CPP = @BuildVendor_CPP@
135 @HostPlatform_CPP@_HOST = 1
136 @TargetPlatform_CPP@_TARGET = 1
137 @BuildPlatform_CPP@_BUILD = 1
139 @HostArch_CPP@_HOST_ARCH = 1
140 @TargetArch_CPP@_TARGET_ARCH = 1
141 @BuildArch_CPP@_BUILD_ARCH = 1
143 @HostOS_CPP@_HOST_OS = 1
144 @TargetOS_CPP@_TARGET_OS = 1
145 @BuildOS_CPP@_BUILD_OS = 1
147 @HostVendor_CPP@_HOST_VENDOR = 1
148 @TargetVendor_CPP@_TARGET_VENDOR = 1
149 @BuildVendor_CPP@_BUILD_VENDOR = 1
151 ################################################################################
153 # Global configuration options
155 ################################################################################
157 # Leading underscores on symbol names in object files
158 # Valid options: YES/NO
160 LeadingUnderscore=@LeadingUnderscore@
162 # Pin a suffix on executables? If so, what (Windows only).
165 # Windows=YES if on a Windows platform
166 ifneq "$(findstring $(HostOS_CPP), mingw32 cygwin32)" ""
172 # BootingFromHc - build GHC and the libraries from .hc files?
173 BootingFromHc = @BootingFromHc@
175 # BootingFromUnregisterisedHc - treat .hc files as containing unregisterised
176 # rather than registerised code, i.e., disable the mangler?
177 BootingFromUnregisterisedHc = @BootingFromUnregisterisedHc@
180 # Which ways should DocBook XML documents be built?
181 # options are: dvi ps pdf html chm HxS
185 ################################################################################
187 # Variables that control how the compiler itself is built
189 ################################################################################
191 # The compiler used to build GHC is $(GHC). To change the actual compiler
192 # used, re-configure with --with-ghc=<path-to-ghc>.
194 # Extra ways in which to build the compiler (for example, you might want to
195 # build a profiled compiler so you can see where it spends its time)
198 # Extra option flags to pass to the compiler that compiles the compiler
199 # (Ones that are essential are wired into compiler/Makefile)
200 # Typical options to use here:
202 # -DDEBUG include debugging code and assertions (will make the
203 # compiler slower and produce debugging output, but useful
206 # -dcore-lint check the types after every pass of the compiler;
207 # a pretty strong internal check of the compiler being
208 # used to compile GHC. Useful when bootstrapping.
209 GhcHcOpts=-Rghc-timing
211 # Extra options added to specific stages of the compiler bootstrap.
212 # These are placed later on the command line, and may therefore
213 # override options from $(GhcHcOpts).
218 # Build a compiler that will build *unregisterised* libraries and
219 # binaries by default. Unregisterised code is supposed to compile and
220 # run without any support for architecture-specific assembly mangling,
221 # register assignment or tail-calls, and is therefore a good way to get
222 # started when porting GHC to new architectures.
224 # If this is set to NO, you can still use the unregisterised way
225 # (way 'u') to get unregisterised code, but the default way will be
228 # NOTE: the stage1 compiler will be a registerised binary (assuming
229 # the compiler you build with is generating registerised binaries), but
230 # the stage2 compiler will be an unregisterised binary.
232 ifneq "$(findstring $(HostArch_CPP), alpha hppa)" ""
233 GhcUnregisterised=YES
238 # Build a compiler with a native code generator backend
239 # (as well as a C backend)
241 # Target platforms supported:
243 # sparc has bitrotted
244 # AIX is not supported
245 ArchSupportsNCG=$(strip $(patsubst $(HostArch_CPP), YES, $(findstring $(HostArch_CPP), i386 x86_64 powerpc)))
246 OsSupportsNCG=$(strip $(patsubst $(HostOS_CPP), YES, $(patsubst aix,,$(HostOS_CPP))))
248 ifeq "$(OsSupportsNCG)$(ArchSupportsNCG)$(GhcUnregisterised)" "YESYESNO"
249 GhcWithNativeCodeGen=YES
251 GhcWithNativeCodeGen=NO
254 # Include support for generating Java
257 HaveLibDL = @HaveLibDL@
259 # Whether to include GHCi in the compiler. Depends on whether the RTS linker
260 # has support for this OS/ARCH combination.
262 OsSupportsGHCi=$(strip $(patsubst $(HostOS_CPP), YES, $(findstring $(HostOS_CPP), mingw32 cygwin32 linux solaris2 freebsd netbsd openbsd darwin)))
263 ArchSupportsGHCi=$(strip $(patsubst $(HostArch_CPP), YES, $(findstring $(HostArch_CPP), i386 x86_64 powerpc sparc sparc64)))
265 ifeq "$(OsSupportsGHCi)$(ArchSupportsGHCi)" "YESYES"
266 GhcWithInterpreter=YES
268 GhcWithInterpreter=NO
272 # Building various ways?
273 # (right now, empty if not).
274 BuildingParallel=$(subst mp,YES,$(filter mp,$(WAYS)))
275 BuildingGranSim=$(subst mg,YES,$(filter mg,$(WAYS)))
277 # Interface file version (hi-boot files only)
279 # A GHC built with HscIfaceFileVersion=n will look for
280 # M.hi-boot-n, and only then for
282 # (It'll be happy with the latter if the former doesn't exist.)
285 # This variable is used ONLY for hi-boot files. Its only purpose is
286 # to allow you to have a single directory with multiple .hi-boot files
287 # for the same module, each corresponding to a different version of
290 # HscIfaceFileVersion is propagated to hsc via
291 # compiler/main/Config.hs, which is automatically generated by
294 HscIfaceFileVersion=6
296 #------------------------------------------------------------------------------
297 # Options for Libraries
299 # What extra ways to build the libraries in
300 # In addition to the normal sequential way, the default is to also build
301 # profiled prelude libraries.
302 # When booting from .hc files, turn this off.
303 ifeq "$(BootingFromHc)" "YES"
309 # In addition, the RTS is built in some further variations. Ways that
313 # thr_p : threaded profiled
314 # debug : debugging (compile with -g for the C compiler, and -DDEBUG)
315 # debug_p : debugging profiled
316 # debug_u : debugging unregisterised
317 # thr_debug : debugging threaded
318 # thr_debug_p : debugging threaded profiled
320 ifeq "$(BootingFromHc)" "YES"
323 GhcRTSWays=thr thr_p debug thr_debug
326 # Option flags to pass to GHC when it's compiling modules in
327 # fptools/libraries. Typically these are things like -O or
328 # -dcore-lint or -H32m. The ones that are *essential* are wired into
331 # -O is pretty desirable, otherwise no inlining of prelude
332 # things (incl "+") happens when compiling with this compiler
334 # -fgenerics switches on generation of support code for
335 # derivable type classes. This is now off by default,
336 # but we switch it on for the libraries so that we generate
337 # the code in case someone importing wants it
339 GhcLibHcOpts=-O -Rghc-timing -fgenerics
341 # Win32 only: Enable the RTS and libraries to be built as DLLs
342 DLLized=@EnableWin32DLLs@
344 # Strip local symbols from libraries? This can make the libraries smaller,
345 # but makes debugging somewhat more difficult. Doesn't work with all ld's.
350 # ----------------------------------------------------------------------------
351 # Object-file splitting
353 # Set SplitObjs=YES or NO in your build.mk
355 # Don't use -split-objs in in GhcLibHcOpts, because the build
356 # system needs to do other special magic if you are
357 # doing object-file splitting
358 ifneq "$(findstring $(HostArch_CPP), i386 x86_64 powerpc sparc)" ""
364 # Don't split object files for libs if we're building DLLs, or booting from
366 ifeq "$(DLLized)" "YES"
369 ifeq "$(BootingFromHc)" "YES"
372 ifeq "$(GhcUnregisterised)" "YES"
375 ifeq "$(TargetArch_CPP)" "ia64"
379 # Build the Haskell Readline bindings?
381 GhcLibsWithReadline=@GhcLibsWithReadline@
383 # Libraries needed for linking with readline
384 LibsReadline=@LibsReadline@
386 # Include path to readline.h
387 # (no path == in standard include path)
394 # Build the ObjectIO ?
396 GhcLibsWithObjectIO=@GhcLibsWithObjectIO@
398 # .NET interop support?
400 DotnetSupport=@DotnetSupport@
402 # Build unix package?
404 GhcLibsWithUnix=@GhcLibsWithUnix@
406 # ----------------------------------------------------------------------------
407 # Options for GHC's RTS
409 # For an optimised RTS (you probably don't want to change these; we build
410 # a debugging RTS by default now. Use -debug to get it).
411 GhcRtsHcOpts=-optc-O2
412 GhcRtsCcOpts=-fomit-frame-pointer
414 # Include the front panel code? Needs GTK+.
415 GhcRtsWithFrontPanel = NO
417 ################################################################################
421 # nofib specific options
423 ################################################################################
425 WithNofibHc = $(GHC_INPLACE)
427 # NoFibSubDirs controls which set of tests should be run
428 # You can run one or more of
436 NoFibSubDirs = imaginary spectral real
438 # The different ways to build nofib. Default is just to mirror
439 # what is done for the ghc prelude libraries.
441 NoFibWays = $(GhcLibWays)
443 # Haskell compiler options for nofib
446 # Number of times to run each program
449 ################################################################################
451 # Paths (see paths.mk)
453 ################################################################################
455 # Directory used by GHC (and possibly other tools) for storing
456 # temporary files. If your TMPDIR isn't big enough, either override
457 # this in build.mk or set your environment variable "TMPDIR" to point
458 # to somewhere with more space. (TMPDIR=. is a good choice).
460 # DEFAULT_TMPDIR isn't called TMPDIR because GNU make tends to
461 # override an environment variable with the value of the make variable
462 # of the same name (if it exists) when executing sub-processes, so
463 # setting the TMPDIR env var would have no effect in the build tree.
465 DEFAULT_TMPDIR = /tmp
466 ifeq "$(TARGETPLATFORM)" "i386-unknown-cygwin32"
467 DEFAULT_TMPDIR = C:/TEMP
469 ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
470 DEFAULT_TMPDIR = C:/TEMP
473 # FPTOOLS_TOP: the top of the fptools hierarchy, absolute path. (POSIX / unix-style path).
474 FPTOOLS_TOP_ABS = @hardtop@
475 # The platform specific version of 'hardtop'.
476 FPTOOLS_TOP_ABS_PLATFORM = @hardtop_plat@
479 # Installation directories, we don't use half of these,
480 # but since the configure script has them on offer while
481 # passing through, we might as well set them.
484 exec_prefix = @exec_prefix@
488 includedir = @includedir@
489 oldincludedir = @oldincludedir@
492 ifeq "$(Windows)" "YES"
494 ifeq "$(strip $(prefix))" ""
498 # Hack: our directory layouts tend to be different on Windows, so
499 # hack around configure's bogus assumptions here.
506 # Unix: override libdir and datadir to put ghc-specific stuff in
507 # a subdirectory with the version number included.
509 libdir = $(libdir0)/ghc-$(ProjectVersion)
510 datadir = $(datadir0)/ghc-$(ProjectVersion)
514 # Default place for putting interface files is $(libdir)
515 # (overriden for packages in package.mk)
519 # Default values for most of the above are only set if
520 # they weren't configured to anything in particular
521 # via the configure script. (i.e., we make no assumption
522 # that the autoconf-generated script will assign defaults
523 # to all of the above).
525 ifeq "$(strip $(exec_prefix))" ""
526 exec_prefix = $(prefix)
528 ifeq "$(strip $(bindir))" ""
529 bindir = $(exec_prefix)/bin
533 # NOTE: by intention, libexecdir and libdir point to
535 # => Only way to override this is to set libexecdir= on the command line.
536 # (NOTE: configure script setting is ignored).
537 libexecdir = $(libdir)
539 ifeq "$(strip $(datadir))" ""
540 datadir = $(prefix)/share
542 ifeq "$(strip $(libdir))" ""
543 libdir = $(exec_prefix)/lib
545 ifeq "$(strip $(includedir))" ""
546 includedir = $(prefix)/include
548 ifeq "$(strip $(oldincludedir))" ""
549 oldincludedir = /usr/include
551 ifeq "$(strip $(mandir))" ""
552 mandir = $(prefix)/man
555 #-----------------------------------------------------------------------------
556 # install configuration
559 # Set this to have files installed with a specific owner
564 # Set this to have files installed with a specific group
569 # Invocations of `install' for the four different classes
572 INSTALL_PROGRAM = $(INSTALL) -m 755
573 INSTALL_SCRIPT = $(INSTALL) -m 755
574 INSTALL_SHLIB = $(INSTALL) -m 755
575 INSTALL_DATA = $(INSTALL) -m 644
576 INSTALL_DIR = $(MKDIRHIER)
578 # -----------------------------------------------------------------------------
579 # Utilities programs: flags
581 # If you want to give any standard flags to pretty much any utility
582 # (see utils.mk for a complete list), by adding a line here
586 # where P is the utility. For example, to add -O to all Haskell
591 SRC_HC_OPTS += -H16m -O
593 # These flags make flex 8-bit
596 SRC_INSTALL_BIN_OPTS += -s
598 # lint gets all CPP's flags too
599 SRC_LINT_OPTS += -axz -DLINT $(SRC_CPP_OPTS)
600 WAY$(_way)_LINT_OPTS += WAY$(_way)_CPP_OPTS
602 # Default fptools options for dllwrap.
603 SRC_BLD_DLL_OPTS += -mno-cygwin --target=i386-mingw32
605 # Flags for CPP when running GreenCard on .pgc files
606 GC_CPP_OPTS += -P -E -x c -traditional -D__GLASGOW_HASKELL__
609 ################################################################################
611 # Layout of the source tree
613 ################################################################################
615 # Here we provide defines for the various directories in the source tree,
616 # so we can move things around more easily. A define $(GHC_FOO_DIR_REL)
617 # indicates a directory relative to the top of the source tree, whereas
618 # $(GHC_FOO_DIR) is a directory relative to the current directory.
619 # $(GHC_FOO_DIR_ABS) is the absolute path to the directory.
621 GHC_UTILS_DIR_REL = utils
622 GHC_INCLUDE_DIR_REL = includes
623 GHC_COMPILER_DIR_REL = compiler
624 GHC_RTS_DIR_REL = rts
625 GHC_UTILS_DIR_REL = utils
626 GHC_DRIVER_DIR_REL = driver
627 GHC_COMPAT_DIR_REL = compat
629 GHC_MKDEPENDC_DIR_REL = $(GHC_UTILS_DIR_REL)/mkdependC
630 GHC_LTX_DIR_REL = $(GHC_UTILS_DIR_REL)/ltx
631 GHC_RUNTEST_DIR_REL = $(GHC_UTILS_DIR_REL)/runstdtest
632 GHC_LNDIR_DIR_REL = $(GHC_UTILS_DIR_REL)/lndir
633 GHC_MKDIRHIER_DIR_REL = $(GHC_UTILS_DIR_REL)/mkdirhier
634 GHC_DOCBOOK_DIR_REL = $(GHC_UTILS_DIR_REL)/docbook
635 GHC_UNLIT_DIR_REL = $(GHC_UTILS_DIR_REL)/unlit
636 GHC_HP2PS_DIR_REL = $(GHC_UTILS_DIR_REL)/hp2ps
637 GHC_HSTAGS_DIR_REL = $(GHC_UTILS_DIR_REL)/hasktags
638 GHC_HSC2HS_DIR_REL = $(GHC_UTILS_DIR_REL)/hsc2hs
639 GHC_TOUCHY_DIR_REL = $(GHC_UTILS_DIR_REL)/touchy
640 GHC_PKG_DIR_REL = $(GHC_UTILS_DIR_REL)/ghc-pkg
641 GHC_GENPRIMOP_DIR_REL = $(GHC_UTILS_DIR_REL)/genprimopcode
642 GHC_GENAPPLY_DIR_REL = $(GHC_UTILS_DIR_REL)/genapply
644 GHC_MANGLER_DIR_REL = $(GHC_DRIVER_DIR_REL)/mangler
645 GHC_SPLIT_DIR_REL = $(GHC_DRIVER_DIR_REL)/split
646 GHC_SYSMAN_DIR_REL = $(GHC_RTS_DIR_REL)/parallel
648 GHC_UTILS_DIR = $(FPTOOLS_TOP)/$(GHC_UTILS_DIR_REL)
649 GHC_INCLUDE_DIR = $(FPTOOLS_TOP)/$(GHC_INCLUDE_DIR_REL)
650 GHC_COMPILER_DIR = $(FPTOOLS_TOP)/$(GHC_COMPILER_DIR_REL)
651 GHC_RTS_DIR = $(FPTOOLS_TOP)/$(GHC_RTS_DIR_REL)
652 GHC_UTILS_DIR = $(FPTOOLS_TOP)/$(GHC_UTILS_DIR_REL)
653 GHC_DRIVER_DIR = $(FPTOOLS_TOP)/$(GHC_DRIVER_DIR_REL)
654 GHC_COMPAT_DIR = $(FPTOOLS_TOP)/$(GHC_COMPAT_DIR_REL)
656 GHC_MKDEPENDC_DIR = $(FPTOOLS_TOP)/$(GHC_MKDEPENDC_DIR_REL)
657 GHC_LTX_DIR = $(FPTOOLS_TOP)/$(GHC_LTX_DIR_REL)
658 GHC_RUNTEST_DIR = $(FPTOOLS_TOP)/$(GHC_RUNTEST_DIR_REL)
659 GHC_LNDIR_DIR = $(FPTOOLS_TOP)/$(GHC_LNDIR_DIR_REL)
660 GHC_MKDIRHIER_DIR = $(FPTOOLS_TOP)/$(GHC_MKDIRHIER_DIR_REL)
661 GHC_DOCBOOK_DIR = $(FPTOOLS_TOP)/$(GHC_DOCBOOK_DIR_REL)
662 GHC_UNLIT_DIR = $(FPTOOLS_TOP)/$(GHC_UNLIT_DIR_REL)
663 GHC_HP2PS_DIR = $(FPTOOLS_TOP)/$(GHC_HP2PS_DIR_REL)
664 GHC_HSTAGS_DIR = $(FPTOOLS_TOP)/$(GHC_HSTAGS_DIR_REL)
665 GHC_HSC2HS_DIR = $(FPTOOLS_TOP)/$(GHC_HSC2HS_DIR_REL)
666 GHC_TOUCHY_DIR = $(FPTOOLS_TOP)/$(GHC_TOUCHY_DIR_REL)
667 GHC_PKG_DIR = $(FPTOOLS_TOP)/$(GHC_PKG_DIR_REL)
668 GHC_GENPRIMOP_DIR = $(FPTOOLS_TOP)/$(GHC_GENPRIMOP_DIR_REL)
669 GHC_GENAPPLY_DIR = $(FPTOOLS_TOP)/$(GHC_GENAPPLY_DIR_REL)
671 GHC_MANGLER_DIR = $(FPTOOLS_TOP)/$(GHC_MANGLER_DIR_REL)
672 GHC_SPLIT_DIR = $(FPTOOLS_TOP)/$(GHC_SPLIT_DIR_REL)
673 GHC_SYSMAN_DIR = $(FPTOOLS_TOP)/$(GHC_SYSMAN_DIR_REL)
675 GHC_UTILS_DIR_ABS = $(FPTOOLS_TOP_ABS)/$(GHC_UTILS_DIR_REL)
676 GHC_INCLUDE_DIR_ABS = $(FPTOOLS_TOP_ABS)/$(GHC_INCLUDE_DIR_REL)
677 GHC_COMPILER_DIR_ABS = $(FPTOOLS_TOP_ABS)/$(GHC_COMPILER_DIR_REL)
678 GHC_RTS_DIR_ABS = $(FPTOOLS_TOP_ABS)/$(GHC_RTS_DIR_REL)
679 GHC_UTILS_DIR_ABS = $(FPTOOLS_TOP_ABS)/$(GHC_UTILS_DIR_REL)
680 GHC_DRIVER_DIR_ABS = $(FPTOOLS_TOP_ABS)/$(GHC_DRIVER_DIR_REL)
681 GHC_COMPAT_DIR_ABS = $(FPTOOLS_TOP_ABS)/$(GHC_COMPAT_DIR_REL)
683 GHC_MKDEPENDC_DIR_ABS = $(FPTOOLS_TOP_ABS)/$(GHC_MKDEPENDC_DIR_REL)
684 GHC_LTX_DIR_ABS = $(FPTOOLS_TOP_ABS)/$(GHC_LTX_DIR_REL)
685 GHC_RUNTEST_DIR_ABS = $(FPTOOLS_TOP_ABS)/$(GHC_RUNTEST_DIR_REL)
686 GHC_LNDIR_DIR_ABS = $(FPTOOLS_TOP_ABS)/$(GHC_LNDIR_DIR_REL)
687 GHC_MKDIRHIER_DIR_ABS = $(FPTOOLS_TOP_ABS)/$(GHC_MKDIRHIER_DIR_REL)
688 GHC_DOCBOOK_DIR_ABS = $(FPTOOLS_TOP_ABS)/$(GHC_DOCBOOK_DIR_REL)
689 GHC_UNLIT_DIR = $(FPTOOLS_TOP_ABS)/$(GHC_UNLIT_DIR_REL)
690 GHC_HP2PS_DIR_ABS = $(FPTOOLS_TOP_ABS)/$(GHC_HP2PS_DIR_REL)
691 GHC_HSTAGS_DIR_ABS = $(FPTOOLS_TOP_ABS)/$(GHC_HSTAGS_DIR_REL)
692 GHC_HSC2HS_DIR_ABS = $(FPTOOLS_TOP_ABS)/$(GHC_HSC2HS_DIR_REL)
693 GHC_TOUCHY_DIR_ABS = $(FPTOOLS_TOP_ABS)/$(GHC_TOUCHY_DIR_REL)
694 GHC_PKG_DIR_ABS = $(FPTOOLS_TOP_ABS)/$(GHC_PKG_DIR_REL)
695 GHC_GENPRIMOP_DIR_ABS = $(FPTOOLS_TOP_ABS)/$(GHC_GENPRIMOP_DIR_REL)
696 GHC_GENAPPLY_DIR_ABS = $(FPTOOLS_TOP_ABS)/$(GHC_GENAPPLY_DIR_REL)
698 GHC_MANGLER_DIR_ABS = $(FPTOOLS_TOP_ABS)/$(GHC_MANGLER_DIR_REL)
699 GHC_SYSMAN_DIR_ABS = $(FPTOOLS_TOP_ABS)/$(GHC_SYSMAN_DIR_REL)
700 GHC_SPLIT_DIR_ABS = $(FPTOOLS_TOP_ABS)/$(GHC_SPLIT_DIR_REL)
702 # -----------------------------------------------------------------------------
703 # Names of programs in the GHC tree
705 # xxx_PGM the name of an executable, without the path
706 # xxx the executable relative to the current dir
708 GHC_UNLIT_PGM = unlit$(exeext)
709 GHC_HSTAGS_PGM = hasktags
710 GHC_HSC2HS_INPLACE_PGM = hsc2hs-inplace
711 GHC_TOUCHY_PGM = touchy$(exeext)
712 GHC_MANGLER_PGM = ghc-asm
713 GHC_SPLIT_PGM = ghc-split
714 GHC_SYSMAN_PGM = SysMan
715 GHC_PKG_INPLACE_PGM = ghc-pkg-inplace
716 GHC_GENPRIMOP_PGM = genprimopcode
717 GHC_GENAPPLY_PGM = genapply
718 GHC_MKDEPENDC_PGM = mkdependC
720 GHC_MKDIRHIER_PGM = mkdirhier
721 GHC_LNDIR_PGM = lndir
722 GHC_RUNTEST_PGM = runstdtest
724 ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
732 UNLIT = $(GHC_UNLIT_DIR)/$(GHC_UNLIT_PGM)
733 HSTAGS = $(GHC_HSTAGS_DIR)/$(GHC_HSTAGS_PGM)
734 HSC2HS_INPLACE = $(GHC_HSC2HS_DIR)/$(GHC_HSC2HS_INPLACE_PGM)
735 MANGLER = $(GHC_MANGLER_DIR)/$(GHC_MANGLER_PGM)
736 SPLIT = $(GHC_SPLIT_DIR)/$(GHC_SPLIT_PGM)
737 SYSMAN = $(GHC_SYSMAN_DIR)/$(GHC_SYSMAN_PGM)
738 GHC_PKG_INPLACE = $(GHC_PKG_DIR)/$(GHC_PKG_INPLACE_PGM)
739 GENPRIMOP = $(GHC_GENPRIMOP_DIR)/$(GHC_GENPRIMOP_PGM)
740 GENAPPLY = $(GHC_GENAPPLY_DIR)/$(GHC_GENAPPLY_PGM)
741 MKDEPENDC = $(GHC_MKDEPENDC_DIR)/$(GHC_MKDEPENDC_PGM)
742 LTX = $(GHC_LTX_DIR)/$(GHC_LTX_PGM)
743 MKDIRHIER = $(GHC_MKDIRHIER_DIR)/$(GHC_MKDIRHIER_PGM)
744 LNDIR = $(GHC_LNDIR_DIR)/$(GHC_LNDIR_PGM)
745 RUNTEST = $(GHC_RUNTEST_DIR)/$(GHC_RUNTEST_PGM)
747 #-----------------------------------------------------------------------------
748 # Haskell compilers and mkdependHS
750 # $(GHC), $(HBC) and $(NHC) point to installed versions of the relevant
751 # compilers, if available.
753 # $(HC) is a generic Haskell 98 compiler, set to $(GHC) by default.
754 # $(MKDEPENDHS) is the Haskell dependency generator (ghc -M).
756 # NOTE: Don't override $(GHC) in build.mk, use configure --with-ghc instead
757 # (because the version numbers have to be calculated).
760 GhcDir = $(dir $(GHC))
761 GhcVersion = @GhcVersion@
762 GhcMajVersion = @GhcMajVersion@
763 GhcMinVersion = @GhcMinVersion@
764 GhcPatchLevel = @GhcPatchLevel@
766 # Set to YES if $(GHC) has the readline package installed
767 GhcHasReadline = @GhcHasReadline@
769 # Canonicalised ghc version number, used for easy (integer) version
770 # comparisons. We must expand $(GhcMinVersion) to two digits by
771 # adding a leading zero if necessary:
772 ifneq "$(findstring $(GhcMinVersion), 0 1 2 3 4 5 6 7 8 9)" ""
773 GhcCanonVersion = $(GhcMajVersion)0$(GhcMinVersion)
775 GhcCanonVersion = $(GhcMajVersion)$(GhcMinVersion)
781 # Setting UseStage1=YES forces use of the stage1 compiler to compile
782 # Haskell code, rather than the installed compiler.
783 ifeq "$(UseStage1)" "YES"
785 MKDEPENDHS =$(GHC_STAGE1)
791 # Sometimes we want to invoke ghc from the build tree in different
792 # places (eg. it's handy to have a nofib & a ghc build in the same
793 # tree). We can refer to "this ghc" as $(GHC_INPLACE):
795 GHC_INPLACE = $(GHC_COMPILER_DIR)/ghc-inplace
796 GHC_STAGE1 = $(GHC_COMPILER_DIR)/stage1/ghc-inplace
797 GHC_STAGE2 = $(GHC_COMPILER_DIR)/stage2/ghc-inplace
798 GHC_STAGE3 = $(GHC_COMPILER_DIR)/stage3/ghc-inplace
800 # Some useful GHC version predicates:
802 ifeq "$(UseStage1)" "YES"
808 ifeq "$(BootingFromHc)" "YES"
814 ghc_ge_504 = $(shell if (test $(GhcCanonVersion) -ge 504); then echo YES; else echo NO; fi)
815 ghc_ge_601 = $(shell if (test $(GhcCanonVersion) -ge 601); then echo YES; else echo NO; fi)
816 ghc_ge_602 = $(shell if (test $(GhcCanonVersion) -ge 602); then echo YES; else echo NO; fi)
817 ghc_ge_603 = $(shell if (test $(GhcCanonVersion) -ge 603); then echo YES; else echo NO; fi)
821 #-----------------------------------------------------------------------------
824 # NB. Don't override $(WhatGccIsCalled) using build.mk, re-configure using
825 # the flag --with-gcc=<blah> instead. The reason is that the configure script
826 # needs to know which gcc you're using in order to perform its tests.
830 WhatGccIsCalled = @WhatGccIsCalled@
831 GccVersion = @GccVersion@
832 ifeq "$(strip $(HaveGcc))" "YES"
833 ifneq "$(strip $(UseGcc))" "YES"
836 CC = $(WhatGccIsCalled)
837 GccDir = $(dir $(WhatGccIsCalled))
841 # default C compiler flags
842 SRC_CC_OPTS = @SRC_CC_OPTS@
844 ifeq "$(TARGETPLATFORM)" "ia64-unknown-linux"
848 #-----------------------------------------------------------------------------
849 # GMP Library (version 2.0.x or above)
851 HaveLibGmp = @HaveLibGmp@
854 #-----------------------------------------------------------------------------
855 # GMP framework (Mac OS X)
857 HaveFrameworkGMP = @HaveFrameworkGMP@
859 #-----------------------------------------------------------------------------
862 HaveLibMingwEx = @HaveLibMingwEx@
864 #-----------------------------------------------------------------------------
865 # Flex (currently unused, could be moved to glafp-utils)
868 # Don't bother with -lfl, we define our own yywrap()s anyway.
870 #WAS:FLEX_LIB = @LEXLIB@
872 #-----------------------------------------------------------------------------
873 # Other standard (ha!) Unix utilities
876 ArSupportsInput = @ArSupportsInput@
877 # Yuckage: for ghc/utils/parallel -- todo: nuke this dependency!!
878 BASH = /usr/local/bin/bash
880 CONTEXT_DIFF = @ContextDiffCmd@
882 CPP = @CPP@ @CPPFLAGS@
885 # RAWCPP_FLAGS are the flags to give to cpp (viz, gcc -E) to persuade it to
886 # behave plausibly on Haskell sources.
888 RAWCPP_FLAGS = -undef -traditional
893 # Sigh - the autoconf macro for INSTALL will subst a relative path to the fallback
894 # install-sh script (if chosen). This not terribly useful to us, so we convert
895 # it into an abs. path.
897 INSTALL := $(subst .././install-sh,$(FPTOOLS_TOP_ABS)/install-sh,$(INSTALL))
909 PREPROCESSCMD = $(CC) -E
917 # Some ld's support the -x flag and some don't, so the configure
918 # script detects which we have and sets LdXFlag to "-x" or ""
922 # GNU ld supports input via a linker script, which is useful to avoid
923 # overflowing command-line length limits.
924 LdIsGNULd = @LdIsGNULd@
927 # In emergency situations, REAL_SHELL is used to perform shell commands
928 # from within the ghc driver script, by scribbling the command line to
929 # a temp file and then having $(REAL_SHELL) execute it.
931 # The reason for having to do this is that overly long command lines
932 # cause unnecessary trouble with some shells (e.g., /bin/sh on Solaris
933 # 2.5.1), which is why this backdoor is provided. The situation of overly
934 # long command lines is either encountered while doing `make boot' in compiler/,
935 # or when linking the compiler binary (`hsc').
937 # We do not use SHELL to execute long commands, as `make' will more than likely
938 # override whatever setting you have in your environment while executing.
940 # By default, REAL_SHELL is set equal to SHELL, which is not really a smart move
941 # as it is SHELL that will show up the bogosity in the first place, but setting
942 # it to anything else isn't really portable.
944 # ====> If long command lines cause you trouble, invoke `ghc' (via `make' or otherwise)
945 # with REAL_SHELL set to something else than /bin/sh, for instance, your favourite
955 # This is special to literate/, ToDo: add literate-specific
956 # configure setup to literate/.
961 TGRIND_HELPER = /usr/local/lib/tgrind/tfontedpr # XXX
969 GTK_CONFIG = @GTK_CONFIG@
971 #-----------------------------------------------------------------------------
974 XSLTPROC = @XsltprocCmd@
975 XMLLINT = @XmllintCmd@
978 PDFXMLTEX = @PdfxmltexCmd@
981 DIR_DOCBOOK_XSL = @DIR_DOCBOOK_XSL@
983 XSLTPROC_LABEL_OPTS = --stringparam toc.section.depth 3 \
984 --stringparam section.autolabel 1 \
985 --stringparam section.label.includes.component.label 1
987 #-----------------------------------------------------------------------------
988 # FPtools support software
993 # .NET support software
1001 GHC_PKG = @GhcPkgCmd@
1006 GREENCARD = @GreenCardCmd@
1007 GREENCARD_VERSION = @GreenCardVersion@
1013 HAPPY_VERSION = @HappyVersion@
1015 # Options to pass to Happy when we're going to compile the output with GHC
1017 GHC_HAPPY_OPTS = -agc
1019 # Temp. to work around performance problems in the HEAD around 8/12/2003,
1020 # A Happy compiled with this compiler needs more stack.
1021 SRC_HAPPY_OPTS = +RTS -K2m -RTS
1027 ALEX_VERSION = @AlexVersion@
1029 # Options to pass to Happy when we're going to compile the output with GHC
1036 HADDOCK = @HaddockCmd@
1039 # Options for compiling in different `ways'.
1041 # To configure up your own way, have a look at some of the standard ways
1042 # such as profiling, and create your own set of WAY_*_OPTS defs below.
1043 # After having done that, add your way string to WAYS, and after having
1044 # run the configure script, the different projects will add the new way
1045 # to the list of ways they support.
1049 # Definitions of the different ways:
1053 # - description, e.g., profiling
1054 # * what they mean to the driver:
1055 # - WAY_p_HC_OPTS gives the list of command-line options
1060 # The ways currently defined.
1062 ALL_WAYS=p t u s mp mg a b c d e f g h i j k l m n o A B
1063 USER_WAYS=a b c d e f g h j k l m n o A B
1066 # The following ways currently have treated specially, p u t mg,
1067 # as the driver script treats these guys specially and needs to carefully be told
1068 # about the options for these. Hence, we hide the required command line options
1069 # for these in the driver, as this is the only place they are needed.
1071 # If you want to add to these default options, fill in the variables below:
1075 WAY_i_HC_OPTS= -filx -fruntime-types
1078 WAY_p_NAME=profiling
1079 WAY_p_HC_OPTS= -prof
1082 WAY_t_NAME=ticky-ticky profiling
1083 WAY_t_HC_OPTS= -ticky
1086 WAY_u_NAME=unregisterized (using portable C only)
1087 WAY_u_HC_OPTS=-unreg
1090 WAY_mp_NAME=parallel
1091 WAY_mp_HC_OPTS=-parallel
1095 WAY_mg_HC_OPTS=-gransim
1098 # These ways apply to the RTS only:
1102 WAY_thr_NAME=threaded
1103 WAY_thr_HC_OPTS=-optc-DTHREADED_RTS
1106 WAY_thr_p_NAME=threaded profiled
1107 WAY_thr_p_HC_OPTS=-optc-DTHREADED_RTS -prof
1110 WAY_debug_NAME=debug
1111 WAY_debug_HC_OPTS=-optc-DDEBUG
1114 WAY_debug_p_NAME=debug profiled
1115 WAY_debug_p_HC_OPTS=-optc-DDEBUG -prof
1118 WAY_debug_u_NAME=debug unregisterised
1119 WAY_debug_u_HC_OPTS=-optc-DDEBUG -unreg
1122 WAY_thr_debug_NAME=threaded
1123 WAY_thr_debug_HC_OPTS=-optc-DTHREADED_RTS -optc-DDEBUG
1125 # Way 'thr_debug_p':
1126 WAY_thr_debug_p_NAME=threaded
1127 WAY_thr_debug_p_HC_OPTS=-optc-DTHREADED_RTS -optc-DDEBUG -prof
1130 # Add user-way configurations here:
1180 ################################################################################
1182 # 31-bit-Int Core files
1184 ################################################################################
1187 # It is possible to configure the compiler and prelude to support 31-bit
1188 # integers, suitable for a back-end and RTS using a tag bit on a 32-bit
1189 # architecture. Currently the only useful output from this option is external Core
1190 # files. The following additions to your build.mk will produce the
1191 # 31-bit core output. Note that this is *not* just a library "way"; the
1192 # compiler must be built a special way too.
1194 # GhcCppOpts +=-DWORD_SIZE_IN_BITS=31
1195 # GhcLibHcOpts +=-fext-core -fno-code -DWORD_SIZE_IN_BITS=31
1196 # GhcLibCppOpts += -DWORD_SIZE_IN_BITS=31