[project @ 2006-01-03 11:06:45 by simonmar]
[ghc-hetmet.git] / mk / config.mk.in
1 #                                                                -*-makefile-*-
2 # @configure_input@
3 #
4 ################################################################################
5 #
6 # config.mk.in
7 #
8 # This file supplies defaults for many tweakable build configuration
9 # options.  Some of the defaults are filled in by the autoconf-generated
10 # configure script.
11 #
12 # DO NOT EDIT THIS FILE!
13 #
14 #       - config.mk is auto-generated from config.mk.in by configure.
15 #         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.
18 #
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.
22 #
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.
25 #
26 # This is one of only two files that configure generates (the other is config.h)
27 #
28 # There is a section below for each project within the fptools suite
29 #
30 #       PLUS
31 #
32 # a section corresponding to each of the main .mk files 
33 # included by boilerplate.mk (see boilerplate.mk for a list).
34
35 ifneq "$(findstring 3.7, $(MAKE_VERSION))" ""
36 $(error GNU make version 3.80 or later is required.)
37 endif
38
39 ################################################################################
40 #
41 #               Project-wide platform variables
42 #
43 ################################################################################
44
45 # A "platform" is the GNU cpu-type/manufacturer/operating-system target machine
46 # specifier.  E.g. sparc-sun-solaris2
47 #
48 # Build  platform: the platform on which we are doing this build
49 # Host   platform: the platform on which these binaries will run
50 # Target platform: the platform for which this compiler will generate code
51 #
52 # We don't support build & host being different, because the build
53 # process creates binaries that are run during the build, and also
54 # installed.
55 #
56 # If host & target are different, then we are building a compiler
57 # which will generate intermediate .hc files to port to the target
58 # architecture for bootstrapping.  The libraries and stage 2 compiler
59 # will be built as HC files for the target system, and likely won't
60 # build on this host platform.
61 #
62 # An important invariant is that for any piece of source code, the
63 # platform on which the code is going to run is the HOST platform,
64 # and the platform on which we are building is the BUILD platform.
65 # Additionally for the compiler, the platform this compiler will
66 # generate code for is the TARGET.  TARGET is not meaningful outside
67 # the compiler sources.
68 #
69 # Guidelines for when to use HOST vs. TARGET:
70 #
71 #  - In the build system (Makefile, foo.mk), normally we should test
72 #    $(HOSTPLATFORM).  There are some cases (eg. installation), where
73 #    we expect $(HOSTPLATFORM)==$(TARGETPLATFORM), so in those cases it
74 #    doesn't matter which is used.
75 #
76 #  - In the compiler itself, we should test HOST or TARGET depending
77 #    on whether the conditional relates to the code being generated, or
78 #    the platform on which the compiler is running.  See the section
79 #    on "Coding Style" in the commentary for more details.
80 #
81 #  - In all other code, we should be testing HOST only.
82 #
83 # NOTE: cross-compiling is not well supported by the build system.
84 # You have to do a lot of work by hand to cross compile: see the
85 # section on "Porting GHC" in the Building Guide.
86
87 HOSTPLATFORM                    = @HostPlatform@
88 TARGETPLATFORM                  = @TargetPlatform@
89 BUILDPLATFORM                   = @BuildPlatform@
90
91 # Hack alert:
92 # in one or two places, we need to get at the OS version (major and
93 # perhaps even minor), HostOS_Full is the OS name reported by
94 # AC_CANONICAL_SYSTEM.
95 #
96 HostPlatform_CPP                = @HostPlatform_CPP@
97 HostArch_CPP                    = @HostArch_CPP@
98 HostOS_CPP                      = @HostOS_CPP@
99 HostOS_Full                     = @HostOS_Full@
100 HostVendor_CPP                  = @HostVendor_CPP@
101
102 TargetPlatform_CPP              = @TargetPlatform_CPP@
103 TargetArch_CPP                  = @TargetArch_CPP@
104 TargetOS_CPP                    = @TargetOS_CPP@
105 TargetVendor_CPP                = @TargetVendor_CPP@
106
107 BuildPlatform_CPP               = @BuildPlatform_CPP@
108 BuildArch_CPP                   = @BuildArch_CPP@
109 BuildOS_CPP                     = @BuildOS_CPP@
110 BuildVendor_CPP                 = @BuildVendor_CPP@
111
112 @HostPlatform_CPP@_HOST           = 1
113 @TargetPlatform_CPP@_TARGET       = 1
114 @BuildPlatform_CPP@_BUILD         = 1
115
116 @HostArch_CPP@_HOST_ARCH          = 1
117 @TargetArch_CPP@_TARGET_ARCH      = 1
118 @BuildArch_CPP@_BUILD_ARCH        = 1
119
120 @HostOS_CPP@_HOST_OS              = 1
121 @TargetOS_CPP@_TARGET_OS          = 1
122 @BuildOS_CPP@_BUILD_OS            = 1
123
124 @HostVendor_CPP@_HOST_VENDOR      = 1
125 @TargetVendor_CPP@_TARGET_VENDOR  = 1
126 @BuildVendor_CPP@_BUILD_VENDOR    = 1
127
128 # Leading underscores on symbol names in object files
129 # Valid options: YES/NO
130 #
131 LeadingUnderscore=@LeadingUnderscore@
132
133 # Pin a suffix on executables? If so, what (Windows only).
134 exeext=@exeext@
135
136 # Windows=YES if on a Windows platform
137 ifneq "$(findstring $(HostOS_CPP), mingw32 cygwin32)" ""
138 Windows=YES
139 else
140 Windows=NO
141 endif
142
143 ################################################################################
144 #
145 #               project-wide flags
146 #
147 #       Set of options applicable to all fptools projects
148 #
149 ################################################################################
150
151 # BootingFromHc - build GHC and the libraries from .hc files?
152 BootingFromHc = @BootingFromHc@
153
154 # BootingFromUnregisterisedHc - treat .hc files as containing unregisterised
155 # rather than registerised code, i.e., disable the mangler?
156 BootingFromUnregisterisedHc = @BootingFromUnregisterisedHc@
157
158 # Build Order: we build Happy, Haddock and Alex before GHC if they are
159 # in this source tree, just in case our GHC build depends on these
160 # local builds rather than installed versions of the tools.
161 #
162 # Build the libs first if we're bootstrapping from .hc files.
163 ifeq "$(BootingFromHc)" "YES"
164 AllProjects = glafp-utils happy alex haddock libraries hslibs ghc greencard hdirect hood nofib docs
165 else
166 AllProjects = glafp-utils happy alex haddock ghc libraries hslibs greencard hdirect hood nofib docs
167 endif
168
169 #
170 # (OPTIONAL) set ProjectsToBuild to a list of projects to be built.  If this
171 # list is empty, then all projects present in the source tree will be built.
172 #
173 ProjectsToBuild =
174
175 #
176 # set ProjectsDontInstall to a list of projects which are normally built but
177 # not installed.
178 #
179 ProjectsDontInstall = glafp-utils nofib
180
181 #
182 # Should the various project tests directories be built?
183 #
184 IncludeTestDirsInBuild=NO
185
186 #
187 # Should the various project example directories be built?
188 #
189 IncludeExampleDirsInBuild=NO
190
191 #
192 # Which ways should DocBook XML documents be built?
193 # options are: dvi ps pdf html chm HxS
194 #
195 XMLDocWays=
196
197 ################################################################################
198 #
199 #               GHC project
200
201 #       Set of (configurable) options needed by the ghc tree
202 #       plus their default options (if any).
203 #
204 ################################################################################
205
206 #---------------------------------------------------------------
207 #
208 # Variables that control how the compiler itself is built
209 #
210 #---------------------------------------------------------------
211
212 # The compiler used to build GHC is $(GHC).  To change the actual compiler
213 # used, re-configure with --with-ghc=<path-to-ghc>.
214
215 # Extra ways in which to build the compiler (for example, you might want to
216 # build a profiled compiler so you can see where it spends its time)
217 GhcCompilerWays=
218
219 # Extra option flags to pass to the compiler that compiles the compiler
220 # (Ones that are essential are wired into ghc/compiler/Makefile)
221 # Typical options to use here:
222 #
223 #       -DDEBUG         include debugging code and assertions (will make the
224 #                       compiler slower and produce debugging output, but useful
225 #                       for development)
226 #
227 #       -dcore-lint     check the types after every pass of the compiler;
228 #                       a pretty strong internal check of the compiler being
229 #                       used to compile GHC.  Useful when bootstrapping.
230 GhcHcOpts=-Rghc-timing
231
232 # Extra options added to specific stages of the compiler bootstrap.
233 # These are placed later on the command line, and may therefore
234 # override options from $(GhcHcOpts).
235 GhcStage1HcOpts=
236 GhcStage2HcOpts=
237 GhcStage3HcOpts=
238
239 # Build a compiler that will build *unregisterised* libraries and
240 # binaries by default.  Unregisterised code is supposed to compile and
241 # run without any support for architecture-specific assembly mangling,
242 # register assignment or tail-calls, and is therefore a good way to get
243 # started when porting GHC to new architectures.
244 #
245 # If this is set to NO, you can still use the unregisterised way
246 # (way 'u') to get unregisterised code, but the default way will be
247 # registerised.
248 #
249 # NOTE: the stage1 compiler will be a registerised binary (assuming
250 # the compiler you build with is generating registerised binaries), but
251 # the stage2 compiler will be an unregisterised binary.
252 #
253 GhcUnregisterised=NO
254
255 # Build a compiler with a native code generator backend
256 # (as well as a C backend)
257 #
258 # Target platforms supported:
259 #   i386, powerpc
260 #   sparc has bitrotted
261 #   AIX is not supported 
262 ArchSupportsNCG=$(strip $(patsubst $(HostArch_CPP), YES, $(findstring $(HostArch_CPP), i386 x86_64 powerpc)))
263 OsSupportsNCG=$(strip $(patsubst $(HostOS_CPP), YES, $(patsubst aix,,$(HostOS_CPP))))
264
265 ifeq "$(OsSupportsNCG)$(ArchSupportsNCG)" "YESYES"
266 GhcWithNativeCodeGen=YES
267 else
268 GhcWithNativeCodeGen=NO
269 endif
270
271 # Include support for generating Java
272 GhcWithJavaGen=NO
273
274 HaveLibDL = @HaveLibDL@
275
276 # Whether to include GHCi in the compiler.  Depends on whether the RTS linker
277 # has support for this OS/ARCH combination.
278
279 OsSupportsGHCi=$(strip $(patsubst $(HostOS_CPP), YES, $(findstring $(HostOS_CPP), mingw32 cygwin32 linux solaris2 freebsd netbsd openbsd darwin)))
280 ArchSupportsGHCi=$(strip $(patsubst $(HostArch_CPP), YES, $(findstring $(HostArch_CPP), i386 x86_64 powerpc powerpc64 sparc sparc64)))
281
282 ifeq "$(OsSupportsGHCi)$(ArchSupportsGHCi)" "YESYES"
283 GhcWithInterpreter=YES
284 else 
285 GhcWithInterpreter=NO
286 endif
287
288 #
289 # Building various ways?
290 # (right now, empty if not).
291 BuildingParallel=$(subst mp,YES,$(filter mp,$(WAYS)))
292 BuildingGranSim=$(subst mg,YES,$(filter mg,$(WAYS)))
293
294 #------------------------------------------------------------------------------
295 # Options for Libraries
296
297 # What extra ways to build the libraries in
298 # In addition to the normal sequential way, the default is to also build
299 # profiled prelude libraries.
300 # When booting from .hc files, turn this off.
301 ifeq "$(BootingFromHc)" "YES"
302 GhcLibWays=
303 else
304 GhcLibWays=p
305 endif
306
307 # In addition, the RTS is built in some further variations.  Ways that
308 # make sense here:
309
310 #   thr         : threaded
311 #   thr_p       : threaded profiled
312 #   debug       : debugging (compile with -g for the C compiler, and -DDEBUG)
313 #   debug_p     : debugging profiled
314 #   debug_u     : debugging unregisterised
315 #   thr_debug   : debugging threaded
316 #   thr_debug_p : debugging threaded profiled
317 #
318 ifeq "$(BootingFromHc)" "YES"
319 GhcRTSWays=
320 else
321 GhcRTSWays=thr thr_p debug thr_debug
322 endif
323
324 # Option flags to pass to GHC when it's compiling modules in
325 # fptools/libraries.  Typically these are things like -O or
326 # -dcore-lint or -H32m.  The ones that are *essential* are wired into
327 # the build system.
328 #
329 #       -O is pretty desirable, otherwise no inlining of prelude
330 #               things (incl "+") happens when compiling with this compiler
331 #
332 #       -fgenerics switches on generation of support code for 
333 #               derivable type classes.  This is now off by default,
334 #               but we switch it on for the libraries so that we generate
335 #               the code in case someone importing wants it
336
337 GhcLibHcOpts=-O -Rghc-timing -fgenerics
338
339 # Win32 only: Enable the RTS and libraries to be built as DLLs
340 DLLized=@EnableWin32DLLs@
341
342 # Strip local symbols from libraries?  This can make the libraries smaller,
343 # but makes debugging somewhat more difficult.  Doesn't work with all ld's.
344 #
345 StripLibraries=NO
346
347
348 # ----------------------------------------------------------------------------
349 # Object-file splitting
350 #
351 #       Set SplitObjs=YES or NO in your build.mk
352 #
353 #       Don't use -split-objs in in GhcLibHcOpts, because the build
354 #               system needs to do other special magic if you are
355 #               doing object-file splitting
356 ifneq "$(findstring $(HostArch_CPP), i386 x86_64 powerpc sparc)" ""
357 SplitObjs=YES
358 else
359 SplitObjs=NO
360 endif
361
362 # Don't split object files for libs if we're building DLLs, or booting from
363 # .hc files.
364 ifeq "$(DLLized)" "YES"
365 SplitObjs=NO
366 endif
367 ifeq "$(BootingFromHc)" "YES"
368 SplitObjs=NO
369 endif
370 ifeq "$(GhcUnregisterised)" "YES"
371 SplitObjs=NO
372 endif
373 ifeq "$(TargetArch_CPP)" "ia64"
374 SplitObjs=NO
375 endif
376
377 # ----------------------------------------------------------------------------
378 # Options for GHC's RTS
379
380 # For an optimised RTS (you probably don't want to change these; we build
381 # a debugging RTS by default now.  Use -debug to get it).
382 GhcRtsHcOpts=-optc-O2
383 GhcRtsCcOpts=-fomit-frame-pointer
384
385 # Include the front panel code?  Needs GTK+.
386 GhcRtsWithFrontPanel = NO
387
388 ################################################################################
389 #
390 # libraries project
391 #
392 ################################################################################
393
394 # Build the Haskell Readline bindings?
395 #
396 GhcLibsWithReadline=@GhcLibsWithReadline@
397
398 # Libraries needed for linking with readline
399 LibsReadline=@LibsReadline@
400
401 # Include path to readline.h
402 # (no path == in standard include path)
403 #
404 ReadlineIncludePath=
405
406 # Math library
407 LIBM=@LIBM@
408
409 # Build the ObjectIO ?
410 #
411 GhcLibsWithObjectIO=@GhcLibsWithObjectIO@
412
413 # .NET interop support?
414 #
415 DotnetSupport=@DotnetSupport@
416
417 # Build unix package?
418 #
419 GhcLibsWithUnix=@GhcLibsWithUnix@
420
421 ################################################################################
422 #
423 #               happy project
424 #
425 #       Happy specific options
426 #
427 ################################################################################
428
429 # The compiler you'd like to use to compile Happy
430 WithHappyHc = @WithHc@
431
432 # HappyHcOpts gives the flags to pass to the Haskell compiler used
433 #             to compile the Happy sources with.
434 #
435 HappyHcOpts = -O
436
437 ################################################################################
438 #
439 #               haggis project
440 #
441 #       Haggis specific options
442 #
443 ################################################################################
444
445 ################################################################################
446 #
447 #               greencard project
448 #
449 #       GreenCard specific options
450 #
451 ################################################################################
452
453 ################################################################################
454 #
455 #               nofib project
456 #
457 #       nofib specific options
458 #
459 ################################################################################
460
461 WithNofibHc = $(GHC_INPLACE)
462
463 # NoFibSubDirs controls which set of tests should be run
464 # You can run one or more of
465 #       imaginary 
466 #       spectral
467 #       real
468 #       parallel
469 #       PRIVATE
470 #       PENDING
471 #       UNUSED
472 NoFibSubDirs = imaginary spectral real
473
474 # The different ways to build nofib. Default is just to mirror
475 # what is done for the ghc prelude libraries.
476 #
477 NoFibWays = $(GhcLibWays)
478
479 # Haskell compiler options for nofib
480 NoFibHcOpts = -O
481
482 # Number of times to run each program
483 NoFibRuns = 5
484
485 # ==============================================================================
486 #
487 #                       END OF PROJECT-SPECIFIC STUFF
488 #
489 #               Now come the generic configuration options
490 #
491 # ==============================================================================
492
493 ################################################################################
494 #
495 #               Paths (see paths.mk)
496 #
497 ################################################################################
498
499 # Directory used by GHC (and possibly other tools) for storing
500 # temporary files.  If your TMPDIR isn't big enough, either override
501 # this in build.mk or set your environment variable "TMPDIR" to point
502 # to somewhere with more space.  (TMPDIR=. is a good choice).
503
504 # DEFAULT_TMPDIR isn't called TMPDIR because GNU make tends to
505 # override an environment variable with the value of the make variable
506 # of the same name (if it exists) when executing sub-processes, so
507 # setting the TMPDIR env var would have no effect in the build tree.
508
509 DEFAULT_TMPDIR          = /tmp
510 ifeq "$(TARGETPLATFORM)" "i386-unknown-cygwin32"
511 DEFAULT_TMPDIR          = C:/TEMP
512 endif
513 ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
514 DEFAULT_TMPDIR          = C:/TEMP
515 endif
516
517 # FPTOOLS_TOP: the top of the fptools hierarchy, absolute path. (POSIX / unix-style path).
518 FPTOOLS_TOP_ABS         = @hardtop@
519 # The platform specific version of 'hardtop'.
520 FPTOOLS_TOP_ABS_PLATFORM = @hardtop_plat@
521
522 #
523 # Installation directories, we don't use half of these,
524 # but since the configure script has them on offer while
525 # passing through, we might as well set them.
526
527 prefix                  = @prefix@
528 exec_prefix             = @exec_prefix@
529 bindir                  = @bindir@
530 datadir0                = @datadir@
531 libdir0                 = @libdir@
532 includedir              = @includedir@
533 oldincludedir           = @oldincludedir@
534 mandir                  = @mandir@
535
536 ifeq "$(Windows)" "YES"
537
538 ifeq "$(strip $(prefix))" ""
539 prefix          = c:/ghc
540 endif
541
542 # Hack: our directory layouts tend to be different on Windows, so
543 # hack around configure's bogus assumptions here.
544 datadir         = $(prefix)
545 libdir          = $(prefix)
546
547 else
548
549 #
550 # Unix: override libdir and datadir to put project-specific stuff in
551 # a subdirectory with the version number included.
552 #
553 libdir     = $(if $(ProjectNameShort),$(libdir0)/$(ProjectNameShort)-$(ProjectVersion),$(libdir0))
554 datadir    = $(if $(ProjectNameShort),$(datadir0)/$(ProjectNameShort)-$(ProjectVersion),$(datadir0))
555
556 endif # Windows
557
558 # Default place for putting interface files is $(libdir)
559 # (overriden for packages in package.mk)
560 ifacedir                = $(libdir)
561
562
563 # Default values for most of the above are only set if
564 # they weren't configured to anything in particular
565 # via the configure script. (i.e., we make no assumption
566 # that the autoconf-generated script will assign defaults
567 # to all of the above).
568 #
569 ifeq "$(strip $(exec_prefix))" ""
570 exec_prefix             = $(prefix)
571 endif
572 ifeq "$(strip $(bindir))" ""
573 bindir                  = $(exec_prefix)/bin
574 endif
575
576 #
577 # NOTE: by intention, libexecdir and libdir point to 
578 # the same place.
579 #  => Only way to override this is to set libexecdir= on the command line.
580 #     (NOTE: configure script setting is ignored).
581 libexecdir              = $(libdir)
582
583 ifeq "$(strip $(datadir))" ""
584 datadir         = $(prefix)/share
585 endif
586 ifeq "$(strip $(libdir))" ""
587 libdir          = $(exec_prefix)/lib
588 endif
589 ifeq "$(strip $(includedir))" ""
590 includedir      = $(prefix)/include
591 endif
592 ifeq "$(strip $(oldincludedir))" ""
593 oldincludedir   = /usr/include
594 endif
595 ifeq "$(strip $(mandir))" ""
596 mandir          = $(prefix)/man
597 endif
598
599 #-----------------------------------------------------------------------------
600 # install configuration
601
602 #
603 # Set this to have files installed with a specific owner
604 #
605 INSTALL_OWNER =
606
607
608 # Set this to have files installed with a specific group
609 #
610 INSTALL_GROUP =
611
612 #
613 # Invocations of `install' for the four different classes
614 # of targets:
615 #
616 INSTALL_PROGRAM = $(INSTALL) -m 755
617 INSTALL_SCRIPT  = $(INSTALL) -m 755
618 INSTALL_SHLIB   = $(INSTALL) -m 755
619 INSTALL_DATA    = $(INSTALL) -m 644
620 INSTALL_DIR     = $(MKDIRHIER)
621
622 # -----------------------------------------------------------------------------
623 # Utilities programs: flags 
624
625 # If you want to give any standard flags to pretty much any utility
626 # (see utils.mk for a complete list), by adding a line here
627 #
628 #       SRC_P_OPTS += ...
629 #
630 # where P is the utility. For example, to add -O to all Haskell
631 # compilations, 
632 #
633 #       SRC_HC_OPTS += -O
634
635 SRC_HC_OPTS += -H16m -O
636
637 # These flags make flex 8-bit
638 SRC_FLEX_OPTS   += -8
639
640 SRC_INSTALL_BIN_OPTS    += -s
641
642 # lint gets all CPP's flags too
643 SRC_LINT_OPTS           += -axz -DLINT $(SRC_CPP_OPTS)
644 WAY$(_way)_LINT_OPTS    += WAY$(_way)_CPP_OPTS
645
646 # Default fptools options for dllwrap.
647 SRC_BLD_DLL_OPTS += -mno-cygwin --target=i386-mingw32
648
649 # Flags for CPP when running GreenCard on .pgc files
650 GC_CPP_OPTS += -P -E -x c -traditional -D__GLASGOW_HASKELL__
651
652
653 ################################################################################
654 #
655 #               Utilities programs: where to find them
656 #
657 ################################################################################
658
659 #-----------------------------------------------------------------------------
660 # FPtools Utility locations
661
662 # By default, the various utils needed to be build ghc and chums
663 # is set up to point to the utils/ directory. Define here the
664 # path prefix for the utilities. Notice that it's a prefix with
665 # a trailing slash, so that it can be concatenated directly on
666 # front of a program name; if it's not set then we just look
667 # along the shell's $(PATH)
668 #
669 # If instead you want to use installed or your own versions of these,
670 # override the various *_PREFIX in build.mk, i.e., having the following
671 # in build.mk:
672 #
673 #   MKDEPENDC_PREFIX=
674 #
675 # will force `make' to rummage around in your PATH to find `mkdependC' (not
676 # sure it would need it in the first place, but still).
677 #
678 GLAFP_UTILS             = $(FPTOOLS_TOP)/glafp-utils
679
680 SCRIPT_PREFIX           = $(GLAFP_UTILS)/scripts/
681 MKDEPENDC_PREFIX        = $(GLAFP_UTILS)/mkdependC/
682 LTX_PREFIX              = $(GLAFP_UTILS)/ltx/
683 RUNTEST_PREFIX          = $(GLAFP_UTILS)/runstdtest/
684 VERBATIM_PREFIX         = $(GLAFP_UTILS)/verbatim/
685 SGMLVERB_PREFIX         = $(GLAFP_UTILS)/sgmlverb/
686 ETAGS_PREFIX            = $(GLAFP_UTILS)/etags/
687 LNDIR_PREFIX            = $(GLAFP_UTILS)/lndir/
688 MKDIRHIER_PREFIX        = $(GLAFP_UTILS)/mkdirhier/
689 DOCBOOK_PREFIX          = $(GLAFP_UTILS)/docbook/
690
691 HADDOCK_PREFIX          = $(FPTOOLS_TOP)/haddock/
692
693 LITERATE_PREFIX         = $(FPTOOLS_TOP)/literate/
694
695 UNLIT_PREFIX            = $(FPTOOLS_TOP)/ghc/utils/unlit/
696 HP2PS_PREFIX            = $(FPTOOLS_TOP)/ghc/utils/hp2ps/
697 HSTAGS_PREFIX           = $(FPTOOLS_TOP)/ghc/utils/hasktags/
698 HSC2HS_PREFIX           = $(FPTOOLS_TOP)/ghc/utils/hsc2hs/
699
700 #-----------------------------------------------------------------------------
701 # Haskell compilers and mkdependHS
702
703 # $(GHC), $(HBC) and $(NHC) point to installed versions of the relevant
704 # compilers, if available.
705 #
706 # $(HC) is a generic Haskell 98 compiler, set to $(GHC) by default.
707 # $(MKDEPENDHS) is the Haskell dependency generator (ghc -M).
708 #
709 # NOTE: Don't override $(GHC) in build.mk, use configure --with-ghc instead
710 # (because the version numbers have to be calculated).
711
712 GHC             = @WithGhc@
713 GhcDir          = $(dir $(GHC))
714 GhcVersion      = @GhcVersion@
715 GhcMajVersion   = @GhcMajVersion@
716 GhcMinVersion   = @GhcMinVersion@
717 GhcPatchLevel   = @GhcPatchLevel@
718
719 # Canonicalised ghc version number, used for easy (integer) version
720 # comparisons.  We must expand $(GhcMinVersion) to two digits by
721 # adding a leading zero if necessary:
722 ifneq "$(findstring $(GhcMinVersion), 0 1 2 3 4 5 6 7 8 9)" ""
723 GhcCanonVersion = $(GhcMajVersion)0$(GhcMinVersion)
724 else
725 GhcCanonVersion = $(GhcMajVersion)$(GhcMinVersion)
726 endif
727
728 HBC             = @HBC@
729 NHC             = @NHC@
730
731 HC              = @WithHc@
732 MKDEPENDHS      = $(GHC)
733
734 # Sometimes we want to invoke ghc from the build tree in different
735 # projects (eg. it's handy to have a nofib & a ghc build in the same
736 # tree).  We can refer to "this ghc" as $(GHC_INPLACE):
737
738 GHC_INPLACE     = $(FPTOOLS_TOP)/ghc/compiler/ghc-inplace
739 GHC_STAGE1      = $(FPTOOLS_TOP)/ghc/compiler/stage1/ghc-inplace
740 GHC_STAGE2      = $(FPTOOLS_TOP)/ghc/compiler/stage2/ghc-inplace
741 GHC_STAGE3      = $(FPTOOLS_TOP)/ghc/compiler/stage3/ghc-inplace
742
743 #-----------------------------------------------------------------------------
744 # C compiler
745 #
746 # NB. Don't override $(WhatGccIsCalled) using build.mk,  re-configure using
747 # the flag --with-gcc=<blah> instead.  The reason is that the configure script
748 # needs to know which gcc you're using in order to perform its tests.
749
750 HaveGcc         = @HaveGcc@
751 UseGcc          = YES
752 WhatGccIsCalled = @WhatGccIsCalled@
753 GccVersion      = @GccVersion@
754 ifeq "$(strip $(HaveGcc))" "YES"
755 ifneq "$(strip $(UseGcc))"  "YES"
756   CC    = cc
757 else
758   CC    = $(WhatGccIsCalled)
759   GccDir = $(dir $(WhatGccIsCalled))
760 endif
761 endif
762
763 # default C compiler flags
764 SRC_CC_OPTS = @SRC_CC_OPTS@
765
766 ifeq "$(TARGETPLATFORM)" "ia64-unknown-linux"
767 SRC_CC_OPTS += -G0
768 endif
769
770 #-----------------------------------------------------------------------------
771 # GMP Library (version 2.0.x or above)
772 #
773 HaveLibGmp      = @HaveLibGmp@
774 LibGmp          = @LibGmp@
775
776 #-----------------------------------------------------------------------------
777 # GMP framework (Mac OS X)
778 #
779 HaveFrameworkGMP = @HaveFrameworkGMP@
780
781 #-----------------------------------------------------------------------------
782 # Mingwex Library
783 #
784 HaveLibMingwEx  = @HaveLibMingwEx@
785
786 #-----------------------------------------------------------------------------
787 # Flex (currently unused, could be moved to glafp-utils)
788
789 # FLEX                  = @LEX@
790 # Don't bother with -lfl, we define our own yywrap()s anyway.
791 # FLEX_LIB              = 
792 #WAS:FLEX_LIB           = @LEXLIB@
793
794 #-----------------------------------------------------------------------------
795 # Other standard (ha!) Unix utilities
796
797 AR                      = @ArCmd@
798 ArSupportsInput         = @ArSupportsInput@
799 # Yuckage: for ghc/utils/parallel -- todo: nuke this dependency!!
800 BASH                    = /usr/local/bin/bash
801
802 CONTEXT_DIFF            = @ContextDiffCmd@
803 CP                      = cp
804 CPP                     = @CPP@ @CPPFLAGS@
805 CTAGS                   = $(ETAGS)
806 #
807 # RAWCPP_FLAGS are the flags to give to cpp (viz, gcc -E) to persuade it to
808 # behave plausibly on Haskell sources.
809 #
810 RAWCPP_FLAGS            = -undef -traditional
811 FIND                    = @FindCmd@
812 SORT                    = @SortCmd@
813 INSTALL                 = @INSTALL@
814 #
815 # Sigh - the autoconf macro for INSTALL will subst a relative path to the fallback
816 # install-sh script (if chosen). This not terribly useful to us, so we convert
817 # it into an abs. path.
818
819 INSTALL                 := $(subst .././install-sh,$(FPTOOLS_TOP_ABS)/install-sh,$(INSTALL))
820 LATEX                   = latex
821 HEVEA                   = hevea
822 HACHA                   = hacha
823 LN_S                    = @LN_S@
824 MANMACROS               = -man
825 MSMACROS                = -ms
826 MV                      = mv
827 NROFF                   = nroff
828 PERL                    = @PerlCmd@
829 PYTHON                  = @PythonCmd@
830 PIC                     = pic
831 PREPROCESSCMD           = $(CC) -E
832 RANLIB                  = @RANLIB@
833 RM                      = rm -f
834 SED                     = @SedCmd@
835 SHELL                   = /bin/sh
836
837 LD                      = @LdCmd@
838
839 # Some ld's support the -x flag and some don't, so the configure
840 # script detects which we have and sets LdXFlag to "-x" or ""
841 # respectively.
842 LD_X                    = @LdXFlag@
843
844 # GNU ld supports input via a linker script, which is useful to avoid
845 # overflowing command-line length limits.
846 LdIsGNULd               = @LdIsGNULd@
847
848 #
849 # In emergency situations, REAL_SHELL is used to perform shell commands
850 # from within the ghc driver script, by scribbling the command line to
851 # a temp file and then having $(REAL_SHELL) execute it. 
852 #
853 # The reason for having to do this is that overly long command lines
854 # cause unnecessary trouble with some shells (e.g., /bin/sh on Solaris
855 # 2.5.1), which is why this backdoor is provided. The situation of overly
856 # long command lines is either encountered while doing `make boot' in ghc/compiler, 
857 # or when linking the compiler binary (`hsc'). 
858 #
859 # We do not use SHELL to execute long commands, as `make' will more than likely
860 # override whatever setting you have in your environment while executing. 
861
862 # By default, REAL_SHELL is set equal to SHELL, which is not really a smart move
863 # as it is SHELL that will show up the bogosity in the first place, but setting
864 # it to anything else isn't really portable.
865 #
866 #  ====> If long command lines cause you trouble, invoke `ghc' (via `make' or otherwise)
867 # with REAL_SHELL set to something else than /bin/sh, for instance, your favourite
868 # command shell.
869 #
870 REAL_SHELL=$(SHELL)
871 SIZE                    = size
872 STRIP                   = strip
873 TAR                     = @TarCmd@
874 ZIP                     = zip
875
876 #
877 # This is special to literate/, ToDo: add literate-specific
878 # configure setup to literate/.
879 #
880 TBL                     = tbl
881 TEX                     = tex
882 TGRIND                  = tgrind
883 TGRIND_HELPER           = /usr/local/lib/tgrind/tfontedpr # XXX
884 TIB                     = tib
885
886 TIME                    = @TimeCmd@
887 TROFF                   = troff
888 UNAME                   = uname
889
890 #-----------------------------------------------------------------------------
891 # DocBook XML stuff
892
893 XSLTPROC                = @XsltprocCmd@
894 XMLLINT                 = @XmllintCmd@
895 FOP                     = @FopCmd@
896 XMLTEX                  = @XmltexCmd@
897 PDFXMLTEX               = @PdfxmltexCmd@
898 DVIPS                   = @DvipsCmd@
899
900 DIR_DOCBOOK_XSL         = @DIR_DOCBOOK_XSL@
901
902 XSLTPROC_LABEL_OPTS     = --stringparam toc.section.depth 3 \
903                           --stringparam section.autolabel 1 \
904                           --stringparam section.label.includes.component.label 1
905
906 #-----------------------------------------------------------------------------
907 #               FPtools support software
908
909 # Stuff from fptools/glafp-utils
910 MKDEPENDC               = $(MKDEPENDC_PREFIX)mkdependC
911 LTX                     = $(LTX_PREFIX)ltx
912 MKDIRHIER               = $(MKDIRHIER_PREFIX)mkdirhier
913 LNDIR                   = $(LNDIR_PREFIX)lndir
914 ETAGS                   = $(ETAGS_PREFIX)etags
915 VERBATIM                = $(VERBATIM_PREFIX)verbatim
916 SGMLVERB                = $(SGMLVERB_PREFIX)sgmlverb
917 RUNTEST                 = $(RUNTEST_PREFIX)runstdtest
918
919 BLD_DLL                 = dllwrap
920
921 #
922 # .NET support software
923 #
924 ILX2IL                  = ilx2il
925 ILASM                   = ilasm
926
927 #
928 # ghc-pkg
929 #
930 GHC_PKG                 = @GhcPkgCmd@
931
932 #
933 # GreenCard
934 #
935 GREENCARD               = @GreenCardCmd@
936 GREENCARD_VERSION       = @GreenCardVersion@            
937
938 #
939 # Happy
940 #
941 HAPPY                   = @HappyCmd@
942 HAPPY_VERSION           = @HappyVersion@                
943 #
944 # Options to pass to Happy when we're going to compile the output with GHC
945 #
946 GHC_HAPPY_OPTS          = -agc
947
948 # Temp. to work around performance problems in the HEAD around 8/12/2003,
949 # A Happy compiled with this compiler needs more stack.
950 SRC_HAPPY_OPTS          = +RTS -K2m -RTS
951
952 #
953 # Alex
954 #
955 ALEX                    = @AlexCmd@
956 ALEX_VERSION            = @AlexVersion@         
957 #
958 # Options to pass to Happy when we're going to compile the output with GHC
959 #
960 GHC_ALEX_OPTS           = -g
961
962 #
963 # Haddock
964
965 HADDOCK                 = @HaddockCmd@
966 HADDOCK_INPLACE         = $(HADDOCK_PREFIX)/src/haddock-inplace
967
968 #
969 # Stuff from fptools/literate
970 #
971 LIT2PGM                 = $(LITERATE_PREFIX)lit2pgm
972 LIT2HTML                = $(LITERATE_PREFIX)lit2html
973 LIT2LATEX               = $(LITERATE_PREFIX)lit2latex
974 MKDEPENDLIT             = $(LITERATE_PREFIX)mkdependlit
975 LIT2CHANGELOG           = $(LITERATE_PREFIX)lit2changelog
976 LIT2TEXT                = $(LITERATE_PREFIX)lit2text
977
978 #
979 # Stuff from fptools/ghc/utils
980 #
981 UNLIT                   = $(UNLIT_PREFIX)unlit$(exeext)
982 HP2PS                   = $(HP2PS_PREFIX)hp2ps$(exeext)
983 HSTAGS                  = $(HSTAGS_PREFIX)hasktags
984 HSC2HS                  = $(HSC2HS_PREFIX)hsc2hs-inplace
985
986 #
987 # Options for the compiling different `ways'. Various projects within
988 # the glorious fptools tree support building in various user-configured
989 # ways. For instance, you could set up one `way' such that the prelude
990 # libraries all were built with the option -ffoldr-build-on.
991
992 # To configure up your own way, have a look at some of the standard ways
993 # such as profiling, and create your own set of WAY_*_OPTS defs below.
994 # After having done that, add your way string to WAYS, and after having
995 # run the configure script, the different projects will add the new way
996 # to the list of ways they support.
997 #
998
999 #
1000 # IMPORTANT! The WAYS variable configures the different `ways'
1001 # you want to build a project (or maybe just parts of it, as is
1002 # the case for ghc/). This variable is intended set inside the
1003 # project mk setup, enforcing a global fptools WAYS is a bit too
1004 # much (do you *really* want to build glafp-utils the profiled-concurrent 
1005 # way?)
1006 #
1007
1008 #
1009 # Definitions of the different ways:
1010 #   
1011 #   * their name:
1012 #          - tag, e.g., p
1013 #          - description, e.g., profiling
1014 #   * what they mean to the driver:
1015 #          - WAY_p_HC_OPTS gives the list of command-line options
1016 #            to the driver.
1017 #
1018
1019 #
1020 # The ways currently defined.
1021 #
1022 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
1023 USER_WAYS=a b c d e f g h j k l m n o A B
1024
1025 #
1026 # The following ways currently have treated specially, p u t mg,
1027 # as the driver script treats these guys specially and needs to carefully be told
1028 # about the options for these. Hence, we hide the required command line options
1029 # for these in the ghc/driver, as this is the only place they are needed.
1030
1031 # If you want to add to these default options, fill in the variables below:
1032
1033 # Way 'i':
1034 WAY_i_NAME=ILX
1035 WAY_i_HC_OPTS= -filx -fruntime-types
1036
1037 # Way 'p':
1038 WAY_p_NAME=profiling
1039 WAY_p_HC_OPTS= -prof
1040
1041 # Way 't':
1042 WAY_t_NAME=ticky-ticky profiling
1043 WAY_t_HC_OPTS= -ticky
1044
1045 # Way `u':
1046 WAY_u_NAME=unregisterized (using portable C only)
1047 WAY_u_HC_OPTS=-unreg
1048
1049 # Way `s':
1050 WAY_s_NAME=threads (for SMP)
1051 WAY_s_HC_OPTS=-smp -optc-DTHREADED_RTS
1052
1053 # Way `mp': 
1054 WAY_mp_NAME=parallel
1055 WAY_mp_HC_OPTS=-parallel
1056
1057 # Way `mg': 
1058 WAY_mg_NAME=GranSim
1059 WAY_mg_HC_OPTS=-gransim
1060
1061 #
1062 # These ways apply to the RTS only:
1063 #
1064
1065 # Way 'thr':
1066 WAY_thr_NAME=threaded
1067 WAY_thr_HC_OPTS=-optc-DTHREADED_RTS
1068
1069 # Way 'thr_p':
1070 WAY_thr_p_NAME=threaded profiled
1071 WAY_thr_p_HC_OPTS=-optc-DTHREADED_RTS -prof
1072
1073 # Way 'debug':
1074 WAY_debug_NAME=debug
1075 WAY_debug_HC_OPTS=-optc-DDEBUG
1076
1077 # Way 'debug_p':
1078 WAY_debug_p_NAME=debug profiled
1079 WAY_debug_p_HC_OPTS=-optc-DDEBUG -prof
1080
1081 # Way 'debug_u':
1082 WAY_debug_u_NAME=debug unregisterised
1083 WAY_debug_u_HC_OPTS=-optc-DDEBUG -unreg
1084
1085 # Way 'debug_s':
1086 WAY_debug_s_NAME=debug SMP
1087 WAY_debug_s_HC_OPTS=-optc-DDEBUG -optc-DTHREADED_RTS -smp
1088
1089 # Way 'thr_debug':
1090 WAY_thr_debug_NAME=threaded
1091 WAY_thr_debug_HC_OPTS=-optc-DTHREADED_RTS -optc-DDEBUG
1092
1093 # Way 'thr_debug_p':
1094 WAY_thr_debug_p_NAME=threaded
1095 WAY_thr_debug_p_HC_OPTS=-optc-DTHREADED_RTS -optc-DDEBUG -prof
1096
1097 #
1098 # Add user-way configurations here:
1099 #
1100 WAY_A_NAME=
1101 WAY_A_HC_OPTS=
1102
1103 WAY_B_NAME=
1104 WAY_B_HC_OPTS=
1105
1106 WAY_a_NAME=
1107 WAY_a_HC_OPTS=
1108
1109 WAY_b_NAME=
1110 WAY_b_HC_OPTS=
1111
1112 WAY_c_NAME=
1113 WAY_c_HC_OPTS=
1114
1115 WAY_d_NAME=
1116 WAY_d_HC_OPTS=
1117
1118 WAY_e_NAME=
1119 WAY_e_HC_OPTS=
1120
1121 WAY_f_NAME=
1122 WAY_f_HC_OPTS=
1123
1124 WAY_g_NAME=
1125 WAY_g_HC_OPTS=
1126
1127 WAY_h_NAME=
1128 WAY_h_HC_OPTS=
1129
1130 WAY_j_NAME=
1131 WAY_j_HC_OPTS=
1132
1133 WAY_k_NAME=
1134 WAY_k_HC_OPTS=
1135
1136 WAY_l_NAME=
1137 WAY_l_HC_OPTS=
1138
1139 WAY_m_NAME=
1140 WAY_m_HC_OPTS=
1141
1142 WAY_n_NAME=
1143 WAY_n_HC_OPTS=
1144
1145 WAY_o_NAME=
1146 WAY_o_HC_OPTS=
1147
1148 ################################################################################
1149 #
1150 #               31-bit-Int Core files
1151 #
1152 ################################################################################
1153
1154
1155 # It is possible to configure the compiler and prelude to support 31-bit
1156 # integers, suitable for a back-end and RTS using a tag bit on a 32-bit
1157 # architecture.  Currently the only useful output from this option is external Core
1158 # files.  The following additions to your build.mk will produce the
1159 # 31-bit core output.  Note that this is *not* just a library "way"; the
1160 # compiler must be built a special way too.
1161
1162 # GhcCppOpts +=-DWORD_SIZE_IN_BITS=31
1163 # GhcLibHcOpts +=-fext-core -fno-code -DWORD_SIZE_IN_BITS=31
1164 # GhcLibCppOpts += -DWORD_SIZE_IN_BITS=31
1165 # SplitObjs=NO
1166