Enable the native code generator for SPARC
[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
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.)
32 endif
33 endif
34
35 ################################################################################
36 #
37 # GHC Version
38 #
39
40 # ProjectVersion    is treated as a *string*
41 # ProjectVersionInt is treated as an *integer* (for cpp defines)
42
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.
47 #
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).
51 #
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
57
58 ProjectName       = @ProjectName@
59 ProjectTags       =
60 ProjectVersion    = @ProjectVersion@$(ProjectTags)
61 ProjectVersionInt = @ProjectVersionInt@
62 ProjectPatchLevel = @ProjectPatchLevel@
63
64 ################################################################################
65 #
66 #               Platform variables
67 #
68 ################################################################################
69
70 # A "platform" is the GNU cpu-type/manufacturer/operating-system target machine
71 # specifier.  E.g. sparc-sun-solaris2
72 #
73 # Build  platform: the platform on which we are doing this build
74 # Host   platform: the platform on which these binaries will run
75 # Target platform: the platform for which this compiler will generate code
76 #
77 # We don't support build & host being different, because the build
78 # process creates binaries that are run during the build, and also
79 # installed.
80 #
81 # If host & target are different, then we are building a compiler
82 # which will generate intermediate .hc files to port to the target
83 # architecture for bootstrapping.  The libraries and stage 2 compiler
84 # will be built as HC files for the target system, and likely won't
85 # build on this host platform.
86 #
87 # An important invariant is that for any piece of source code, the
88 # platform on which the code is going to run is the HOST platform,
89 # and the platform on which we are building is the BUILD platform.
90 # Additionally for the compiler, the platform this compiler will
91 # generate code for is the TARGET.  TARGET is not meaningful outside
92 # the compiler sources.
93 #
94 # Guidelines for when to use HOST vs. TARGET:
95 #
96 #  - In the build system (Makefile, foo.mk), normally we should test
97 #    $(HOSTPLATFORM).  There are some cases (eg. installation), where
98 #    we expect $(HOSTPLATFORM)==$(TARGETPLATFORM), so in those cases it
99 #    doesn't matter which is used.
100 #
101 #  - In the compiler itself, we should test HOST or TARGET depending
102 #    on whether the conditional relates to the code being generated, or
103 #    the platform on which the compiler is running.  See the section
104 #    on "Coding Style" in the commentary for more details.
105 #
106 #  - In all other code, we should be testing HOST only.
107 #
108 # NOTE: cross-compiling is not well supported by the build system.
109 # You have to do a lot of work by hand to cross compile: see the
110 # section on "Porting GHC" in the Building Guide.
111
112 HOSTPLATFORM                    = @HostPlatform@
113 TARGETPLATFORM                  = @TargetPlatform@
114 BUILDPLATFORM                   = @BuildPlatform@
115
116 # Hack alert:
117 # in one or two places, we need to get at the OS version (major and
118 # perhaps even minor), HostOS_Full is the OS name reported by
119 # AC_CANONICAL_SYSTEM.
120 #
121 HostPlatform_CPP                = @HostPlatform_CPP@
122 HostArch_CPP                    = @HostArch_CPP@
123 HostOS_CPP                      = @HostOS_CPP@
124 HostOS_Full                     = @HostOS_Full@
125 HostVendor_CPP                  = @HostVendor_CPP@
126
127 TargetPlatform_CPP              = @TargetPlatform_CPP@
128 TargetArch_CPP                  = @TargetArch_CPP@
129 TargetOS_CPP                    = @TargetOS_CPP@
130 TargetVendor_CPP                = @TargetVendor_CPP@
131
132 BuildPlatform_CPP               = @BuildPlatform_CPP@
133 BuildArch_CPP                   = @BuildArch_CPP@
134 BuildOS_CPP                     = @BuildOS_CPP@
135 BuildVendor_CPP                 = @BuildVendor_CPP@
136
137 @HostPlatform_CPP@_HOST           = 1
138 @TargetPlatform_CPP@_TARGET       = 1
139 @BuildPlatform_CPP@_BUILD         = 1
140
141 @HostArch_CPP@_HOST_ARCH          = 1
142 @TargetArch_CPP@_TARGET_ARCH      = 1
143 @BuildArch_CPP@_BUILD_ARCH        = 1
144
145 @HostOS_CPP@_HOST_OS              = 1
146 @TargetOS_CPP@_TARGET_OS          = 1
147 @BuildOS_CPP@_BUILD_OS            = 1
148
149 @HostVendor_CPP@_HOST_VENDOR      = 1
150 @TargetVendor_CPP@_TARGET_VENDOR  = 1
151 @BuildVendor_CPP@_BUILD_VENDOR    = 1
152
153 ################################################################################
154 #
155 #               Global configuration options
156 #
157 ################################################################################
158
159 # Leading underscores on symbol names in object files
160 # Valid options: YES/NO
161 #
162 LeadingUnderscore=@LeadingUnderscore@
163
164 # Pin a suffix on executables? If so, what (Windows only).
165 exeext=@exeext@
166 soext=@soext@
167
168 # Windows=YES if on a Windows platform
169 ifneq "$(findstring $(HostOS_CPP), mingw32 cygwin32)" ""
170 Windows=YES
171 else
172 Windows=NO
173 endif
174
175 # BootingFromHc - build GHC and the libraries from .hc files?
176 BootingFromHc = @BootingFromHc@
177
178 # BootingFromUnregisterisedHc - treat .hc files as containing unregisterised
179 # rather than registerised code, i.e., disable the mangler?
180 BootingFromUnregisterisedHc = @BootingFromUnregisterisedHc@
181
182 #
183 # Which ways should DocBook XML documents be built?
184 # options are: dvi ps pdf html chm HxS
185 #
186 XMLDocWays=
187
188 # Should we build haddock docs?
189 HADDOCK_DOCS = YES
190 # And HsColour the sources?
191 HSCOLOUR_SRCS = YES
192
193 # Should we build latex docs?
194 LATEX_DOCS = NO
195
196 # Mac OS X deployment target (to cross-compile for older OS versions)
197 #
198 MACOSX_DEPLOYMENT_VERSION = @MACOSX_DEPLOYMENT_VERSION@
199 MACOSX_DEPLOYMENT_SDK = @MACOSX_DEPLOYMENT_SDK@
200
201 ifneq "$(MACOSX_DEPLOYMENT_VERSION)" ""
202 MACOSX_DEPLOYMENT_CC_OPTS = -mmacosx-version-min=$(MACOSX_DEPLOYMENT_VERSION) \
203                             -isysroot $(MACOSX_DEPLOYMENT_SDK) \
204                             --no-builtin-fprintf
205 MACOSX_DEPLOYMENT_LD_OPTS = -mmacosx-version-min=$(MACOSX_DEPLOYMENT_VERSION) \
206                             -Wl,-syslibroot,$(MACOSX_DEPLOYMENT_SDK)
207 # We don't extend SRC_CC_OPTS and friends here directly, as (a) they may get
208 # overwritten in build.mk and (b) we must not use the deployment options in
209 # stage 1 or we get a linker error if the bootstrap compiler is for a more 
210 # recent OS version.
211 #
212 # We need --no-builtin-fprintf, as the use of the builtin function optimisation
213 # for fprintf together with #include "PosixSource" in the RTS leads to the
214 # use of fwrite$UNIX2003 (with GCC 4.0.1 on Mac OS X 10.5.2).
215 endif
216
217 ################################################################################
218 #
219 # Variables that control how the compiler itself is built
220 #
221 ################################################################################
222
223 # The compiler used to build GHC is $(GHC).  To change the actual compiler
224 # used, re-configure with --with-ghc=<path-to-ghc>.
225
226 # Extra ways in which to build the compiler (for example, you might want to
227 # build a profiled compiler so you can see where it spends its time)
228 GhcCompilerWays=
229
230 # Extra option flags to pass to the compiler that compiles the compiler
231 # (Ones that are essential are wired into compiler/Makefile)
232 # Typical options to use here:
233 #
234 #       -DDEBUG         include debugging code and assertions (will make the
235 #                       compiler slower and produce debugging output, but useful
236 #                       for development)
237 #
238 #       -dcore-lint     check the types after every pass of the compiler;
239 #                       a pretty strong internal check of the compiler being
240 #                       used to compile GHC.  Useful when bootstrapping.
241 GhcHcOpts=-Rghc-timing
242
243 # Extra options added to specific stages of the compiler bootstrap.
244 # These are placed later on the command line, and may therefore
245 # override options from $(GhcHcOpts).
246 GhcStage1HcOpts=
247 GhcStage2HcOpts=-O2
248 GhcStage3HcOpts=-O2
249
250 GhcProfiled=NO
251 GhcDebugged=NO
252 GhcLibProfiled=$(if $(filter p,$(GhcLibWays)),YES,NO)
253
254 # Build shared and/or static libs?
255 BuildSharedLibs=@BuildSharedLibs@
256 # ToDo later:
257 # BuildStaticLibs=@BuildStaticLibs@
258
259 # Build a compiler that will build *unregisterised* libraries and
260 # binaries by default.  Unregisterised code is supposed to compile and
261 # run without any support for architecture-specific assembly mangling,
262 # register assignment or tail-calls, and is therefore a good way to get
263 # started when porting GHC to new architectures.
264 #
265 # If this is set to NO, you can still use the unregisterised way
266 # (way 'u') to get unregisterised code, but the default way will be
267 # registerised.
268 #
269 # NOTE: the stage1 compiler will be a registerised binary (assuming
270 # the compiler you build with is generating registerised binaries), but
271 # the stage2 compiler will be an unregisterised binary.
272 #
273 ifneq "$(findstring $(HostArch_CPP), alpha hppa)" ""
274 GhcUnregisterised=YES
275 else
276 GhcUnregisterised=NO
277 endif
278
279 # Build a compiler with a native code generator backend
280 # (as well as a C backend)
281 #
282 # Target platforms supported:
283 #   i386, powerpc
284 #   AIX is not supported 
285 ArchSupportsNCG=$(strip $(patsubst $(HostArch_CPP), YES, $(findstring $(HostArch_CPP), i386 x86_64 powerpc sparc)))
286 OsSupportsNCG=$(strip $(patsubst $(HostOS_CPP), YES, $(patsubst aix,,$(HostOS_CPP))))
287
288 # lazy test, because $(GhcUnregisterised) might be set in build.mk later.
289 GhcWithNativeCodeGen=$(strip\
290     $(if $(filter YESYESNO,\
291                   $(OsSupportsNCG)$(ArchSupportsNCG)$(GhcUnregisterised)),YES,NO))
292
293 HaveLibDL = @HaveLibDL@
294
295 # ArchSupportsSMP should be set iff there is support for that arch in
296 # includes/SMP.h
297 ArchSupportsSMP=$(strip $(patsubst $(HostArch_CPP), YES, $(findstring $(HostArch_CPP), i386 x86_64 sparc powerpc)))
298
299 # lazy test, because $(GhcUnregisterised) might be set in build.mk later.
300 GhcWithSMP=$(strip $(if $(filter YESNO, $(ArchSupportsSMP)$(GhcUnregisterised)),YES,NO))
301
302 # Whether to include GHCi in the compiler.  Depends on whether the RTS linker
303 # has support for this OS/ARCH combination.
304
305 OsSupportsGHCi=$(strip $(patsubst $(HostOS_CPP), YES, $(findstring $(HostOS_CPP), mingw32 cygwin32 linux solaris2 freebsd netbsd openbsd darwin)))
306 ArchSupportsGHCi=$(strip $(patsubst $(HostArch_CPP), YES, $(findstring $(HostArch_CPP), i386 x86_64 powerpc sparc sparc64)))
307
308 ifeq "$(OsSupportsGHCi)$(ArchSupportsGHCi)" "YESYES"
309 GhcWithInterpreter=YES
310 else 
311 GhcWithInterpreter=NO
312 endif
313
314 # GhcEnableTablesNextToCode tells us whether the target architecture
315 # supports placing info tables directly before the entry code
316 # (see TABLES_NEXT_TO_CODE in the RTS).  Whether we actually compile for
317 # TABLES_NEXT_TO_CODE depends on whether we're building unregisterised
318 # code or not, which may be decided by options to the compiler later.
319 ifneq "$(findstring $(TargetArch_CPP)X, ia64X powerpc64X)" ""
320 GhcEnableTablesNextToCode=NO
321 else
322 GhcEnableTablesNextToCode=YES
323 endif
324
325 # On Windows we normally want to make a relocatable bindist, to we
326 # ignore flags like libdir
327 ifeq "$(Windows)" "YES"
328 RelocatableBuild = YES
329 else
330 RelocatableBuild = NO
331 endif
332
333 # When building bindists we set this to yes so that the binaries are as
334 # portable as possible.
335 BeConservative = NO
336
337 #
338 # Building various ways?
339 # (right now, empty if not).
340 BuildingParallel=$(subst mp,YES,$(filter mp,$(WAYS)))
341 BuildingGranSim=$(subst mg,YES,$(filter mg,$(WAYS)))
342
343 # Interface file version (hi-boot files only)
344 #
345 # A GHC built with HscIfaceFileVersion=n will look for 
346 #       M.hi-boot-n, and only then for 
347 #       M.hi-boot.
348 # (It'll be happy with the latter if the former doesn't exist.)
349 #
350 #
351 # This variable is used ONLY for hi-boot files.  Its only purpose is
352 # to allow you to have a single directory with multiple .hi-boot files
353 # for the same module, each corresponding to a different version of
354 # GHC.
355 #
356 # HscIfaceFileVersion is propagated to hsc via
357 # compiler/main/Config.hs, which is automatically generated by
358 # compiler/Makefile.
359
360 HscIfaceFileVersion=6
361
362 #------------------------------------------------------------------------------
363 # Options for Libraries
364
365 # Which directory (in libraries/) contains the integer library?
366 INTEGER_LIBRARY=integer-gmp
367
368 # What extra ways to build the libraries in
369 # In addition to the normal sequential way, the default is to also build
370 # profiled prelude libraries.
371 # When booting from .hc files, turn this off.
372 ifeq "$(BootingFromHc)" "YES"
373 GhcLibWays=
374 else
375 GhcLibWays=p
376 endif
377
378 ifeq "$(BuildSharedLibs)" "YES"
379 GhcLibWays += dyn
380 endif
381
382 # In addition, the RTS is built in some further variations.  Ways that
383 # make sense here:
384
385 #   thr         : threaded
386 #   thr_p       : threaded profiled
387 #   debug       : debugging (compile with -g for the C compiler, and -DDEBUG)
388 #   debug_p     : debugging profiled
389 #   thr_debug   : debugging threaded
390 #   thr_debug_p : debugging threaded profiled
391 #   t           : ticky-ticky profiling
392 #   debug_t     : debugging ticky-ticky profiling
393 #
394 GhcRTSWays=
395
396 # Usually want the debug version
397 ifeq "$(BootingFromHc)" "NO"
398 GhcRTSWays += debug 
399 endif
400
401 ifeq "$(BuildSharedLibs)" "YES"
402 GhcRTSWays += dyn debug_dyn thr_dyn thr_debug_dyn
403 endif
404
405 # Want the threaded versions unless we're unregisterised
406 # Defer the check until later by using $(if..), because GhcUnregisterised might
407 # be set in build.mk, which hasn't been read yet.
408 GhcRTSWays += $(if $(findstring NO, $(GhcUnregisterised)),thr thr_p thr_debug,)
409
410 # We can only build GHCi threaded if we have a threaded RTS:
411 GhcThreaded = $(if $(findstring thr,$(GhcRTSWays)),YES,NO)
412
413 # Option flags to pass to GHC when it's compiling modules in
414 # fptools/libraries.  Typically these are things like -O or
415 # -dcore-lint or -H32m.  The ones that are *essential* are wired into
416 # the build system.
417 #
418 #       -O(2) is pretty desirable, otherwise no inlining of prelude
419 #               things (incl "+") happens when compiling with this compiler
420 #
421 #       -XGenerics switches on generation of support code for 
422 #               derivable type classes.  This is now off by default,
423 #               but we switch it on for the libraries so that we generate
424 #               the code in case someone importing wants it
425
426 GhcLibHcOpts=-O2 -Rghc-timing -XGenerics
427
428 # Win32 only: Enable the RTS and libraries to be built as DLLs
429 DLLized=@EnableWin32DLLs@
430
431 # Strip local symbols from libraries?  This can make the libraries smaller,
432 # but makes debugging somewhat more difficult.  Doesn't work with all ld's.
433 #
434 StripLibraries=NO
435
436 # These are the URL patterns that Haddock uses to generate the "Source
437 # File" links on each page.
438 PackageSourceURL = http://darcs.haskell.org/packages/$(PACKAGE)/%{FILE}
439
440 # ----------------------------------------------------------------------------
441 # Object-file splitting
442 #
443 #       Set SplitObjs=YES or NO in your build.mk
444 #
445 #       Don't use -split-objs in in GhcLibHcOpts, because the build
446 #               system needs to do other special magic if you are
447 #               doing object-file splitting
448
449 # lazy test, so that $(GhcUnregisterised) can be set in build.mk
450 SplitObjs=$(strip $(if $(filter $(TargetArch_CPP),i386 x86_64 powerpc sparc),\
451                     $(if $(filter YES,$(BootingFromHC)),\
452                       NO,\
453                       $(if $(filter NO,$(GhcUnregisterised)),\
454                         YES,\
455                         NO)),\
456                     NO))
457
458 # Math library
459 LIBM=@LIBM@
460
461 # .NET interop support?
462 #
463 DotnetSupport=NO
464
465 # Build unix package?
466 #
467 GhcLibsWithUnix=@GhcLibsWithUnix@
468
469 # ----------------------------------------------------------------------------
470 # Options for GHC's RTS
471
472 # For an optimised RTS (you probably don't want to change these; we build
473 # a debugging RTS by default now.  Use -debug to get it).
474 GhcRtsHcOpts=-optc-O2
475 GhcRtsCcOpts=-fomit-frame-pointer
476
477 # Include the front panel code?  Needs GTK+.
478 GhcRtsWithFrontPanel = NO
479
480 # Include support for CPU performance counters via the PAPI library in the RTS?
481 # (PAPI: http://icl.cs.utk.edu/papi/)
482 GhcRtsWithPapi = NO
483 PapiLibDir=
484 PapiIncludeDir=
485
486 ################################################################################
487 #
488 #               nofib
489 #
490 #       nofib specific options
491 #
492 ################################################################################
493
494 WithNofibHc = $(GHC_INPLACE)
495
496 # NoFibSubDirs controls which set of tests should be run
497 # You can run one or more of
498 #       imaginary 
499 #       spectral
500 #       real
501 #       parallel
502 #       PRIVATE
503 #       PENDING
504 #       UNUSED
505 NoFibSubDirs = imaginary spectral real
506
507 # The different ways to build nofib. Default is just to mirror
508 # what is done for the ghc prelude libraries.
509 #
510 NoFibWays = $(GhcLibWays)
511
512 # Haskell compiler options for nofib
513 NoFibHcOpts = -O
514
515 # Number of times to run each program
516 NoFibRuns = 5
517
518 ################################################################################
519 #
520 #               Paths (see paths.mk)
521 #
522 ################################################################################
523
524 # Directory used by GHC (and possibly other tools) for storing
525 # temporary files.  If your TMPDIR isn't big enough, either override
526 # this in build.mk or set your environment variable "TMPDIR" to point
527 # to somewhere with more space.  (TMPDIR=. is a good choice).
528
529 # DEFAULT_TMPDIR isn't called TMPDIR because GNU make tends to
530 # override an environment variable with the value of the make variable
531 # of the same name (if it exists) when executing sub-processes, so
532 # setting the TMPDIR env var would have no effect in the build tree.
533
534 DEFAULT_TMPDIR          = /tmp
535 ifeq "$(TARGETPLATFORM)" "i386-unknown-cygwin32"
536 DEFAULT_TMPDIR          = /C/TEMP
537 endif
538 ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
539 DEFAULT_TMPDIR          = /C/TEMP
540 endif
541
542 # FPTOOLS_TOP_ABS: the top of the fptools hierarchy, absolute path.
543 # On Windows this is a c:/foo/bar style path.
544 FPTOOLS_TOP_ABS         = @hardtop@
545
546 BIN_DIST_TOPDIR_ABS=$(FPTOOLS_TOP_ABS)
547 BIN_DIST_DIR=$(BIN_DIST_TOPDIR_ABS)/$(BIN_DIST_NAME)
548
549 BIN_DIST_NAME=ghc-$(ProjectVersion)
550 BIN_DIST_TAR=$(FPTOOLS_TOP_ABS)/$(BIN_DIST_NAME)-$(TARGETPLATFORM).tar
551 BIN_DIST_TAR_BZ2=$(BIN_DIST_TAR).bz2
552 BIN_DIST_PREP_DIR=$(FPTOOLS_TOP_ABS)/bindist-prep
553 BIN_DIST_PREP=$(BIN_DIST_PREP_DIR)/$(BIN_DIST_NAME)
554 BIN_DIST_LIST=$(FPTOOLS_TOP_ABS)/bindist-list
555
556 # Definition of installation directories, we don't use half of these, but since
557 # the configure script has them on offer while passing through, we might as well
558 # set them. Note that we have to be careful, because the GNU coding standards
559 # have changed a bit over the course of time, and autoconf development reflects
560 # this.
561 #
562 # A little bit of history regarding autoconf and GNU coding standards, use this
563 # as a cheat-sheet for the stuff below:
564 #
565 # variable    | default < 2.60     | default >= 2.60
566 # ------------+--------------------+--------------------------------------
567 # exec_prefix | ${prefix}          | ${prefix}
568 # libdir      | ${exec_prefix}/lib | ${exec_prefix}/lib
569 # datarootdir | NONE!              | ${prefix}/share
570 # datadir     | ${prefix}/share    | ${datarootdir}
571 # infodir     | ${prefix}/info     | ${datarootdir}/info
572 # mandir      | ${prefix}/man      | ${datarootdir}/man
573 # docdir      | NONE!              | ${datarootdir}/doc/${PACKAGE_TARNAME}
574 # htmldir     | NONE!              | ${docdir}
575 # dvidir      | NONE!              | ${docdir}
576 # pdfdir      | NONE!              | ${docdir}
577 # psdir       | NONE!              | ${docdir}
578 #
579 # NOTE: The default e.g. ${docdir} above means that autoconf substitutes the
580 # string "${docdir}", not the value of docdir! This is crucial for the GNU
581 # coding standards.
582
583 # This gets used in the default docdir when autoconf >= 2.60 is used
584 PACKAGE_TARNAME := @PACKAGE_TARNAME@
585
586 prefix          := @prefix@
587
588 # New autoconf (>= 2.60?) make a configure with a --datarootdir=DIR flag.
589 # However, in order to support older autoconf's we don't use it.
590 # datarootdir is set lower down instead.
591 # But, as datadir is defined in terms of datarootdir, we also need to
592 # set it to the value (if any) that configure gives it here.
593 datarootdir     := @datarootdir@
594
595 exec_prefix     := @exec_prefix@
596 bindir          := @bindir@
597 datadir0        := @datadir@
598 libdir0         := @libdir@
599 includedir      := @includedir@
600 mandir          := @mandir@
601 dynlibdir       := @libdir@
602
603 ifeq "$(RelocatableBuild)" "YES"
604
605 # Hack: our directory layouts tend to be different on Windows, so
606 # hack around configure's bogus assumptions here.
607 datarootdir := $(prefix)
608 datadir     := $(prefix)
609 libdir      := $(prefix)
610
611 docdir    := $(prefix)/doc
612 htmldir   := $(docdir)
613 dvidir    := $(docdir)
614 pdfdir    := $(docdir)
615 psdir     := $(docdir)
616
617 else
618
619 # Unix: override libdir and datadir to put ghc-specific stuff in
620 # a subdirectory with the version number included.
621 #
622 # datadir is set to libdir here as GHC needs package.conf and unlit
623 # to be in the same place (and things like ghc-pkg need to agree on
624 # where package.conf is, so we just set it globally).
625 #
626 datarootdir := $(datadir0)
627 libdir      := $(libdir0)/ghc-$(ProjectVersion)
628 datadir     := $(libdir)
629
630 # New autoconf (>= 2.60?) make a configure with --docdir=DIR etc flags.
631 # However, in order to support older autoconf's we don't use them.
632
633 #docdir    := @docdir@
634 #htmldir   := @htmldir@
635 #dvidir    := @dvidir@
636 #pdfdir    := @pdfdir@
637 #psdir     := @psdir@
638
639 docdir    := $(datarootdir)/doc/ghc
640 htmldir   := $(docdir)
641 dvidir    := $(docdir)
642 pdfdir    := $(docdir)
643 psdir     := $(docdir)
644
645 endif # Windows
646
647 headerdir := $(libdir)/include
648
649 # Default place for putting interface files is $(libdir)
650 # (overriden for packages in package.mk)
651 ifacedir                = $(libdir)
652
653 # NOTE: by intention, libexecdir and libdir point to 
654 # the same place.
655 #  => Only way to override this is to set libexecdir= on the command line.
656 #     (NOTE: configure script setting is ignored).
657 libexecdir              = $(libdir)
658
659 GHC_PKG_PROG = $(FPTOOLS_TOP_ABS)/$(GHC_PKG_DIR_REL)/install-inplace/bin/ghc-pkg
660
661 #-----------------------------------------------------------------------------
662 # install configuration
663
664 #
665 # Set this to have files installed with a specific owner
666 #
667 INSTALL_OWNER =
668
669
670 # Set this to have files installed with a specific group
671 #
672 INSTALL_GROUP =
673
674 #
675 # Invocations of `install' for the four different classes
676 # of targets:
677 #
678 INSTALL_PROGRAM = $(INSTALL) -m 755
679 INSTALL_SCRIPT  = $(INSTALL) -m 755
680 INSTALL_SHLIB   = $(INSTALL) -m 755
681 INSTALL_DATA    = $(INSTALL) -m 644
682 INSTALL_HEADER  = $(INSTALL) -m 644
683 INSTALL_MAN     = $(INSTALL) -m 644
684 INSTALL_DIR     = $(MKDIRHIER)
685
686 #
687 # runhaskell and hsc2hs are special, in that other compilers besides
688 # GHC might provide them.  Systems with a package manager often come
689 # with tools to manage this kind of clash, e.g. RPM's
690 # update-alternatives.  When building a distribution for such a system,
691 # we recommend setting both of the following to 'YES'.
692 #
693 # NO_INSTALL_RUNHASKELL = YES
694 # NO_INSTALL_HSC2HS     = YES
695 #
696 # NB. we use negative tests here because for binary-distributions we cannot
697 # test build-time variables at install-time, so they must default to on.
698
699 # -----------------------------------------------------------------------------
700 # Utilities programs: flags 
701
702 # If you want to give any standard flags to pretty much any utility
703 # (see utils.mk for a complete list), by adding a line here
704 #
705 #       SRC_P_OPTS += ...
706 #
707 # where P is the utility. For example, to add -O to all Haskell
708 # compilations, 
709 #
710 #       SRC_HC_OPTS += -O
711
712 SRC_HC_OPTS += -H32m -O
713
714 # These flags make flex 8-bit
715 SRC_FLEX_OPTS   += -8
716
717 # lint gets all CPP's flags too
718 SRC_LINT_OPTS           += -axz -DLINT $(SRC_CPP_OPTS)
719 WAY$(_way)_LINT_OPTS    += WAY$(_way)_CPP_OPTS
720
721 # Default fptools options for dllwrap.
722 SRC_BLD_DLL_OPTS += --target=i386-mingw32
723
724 # Flags for CPP when running GreenCard on .pgc files
725 GC_CPP_OPTS += -P -E -x c -traditional -D__GLASGOW_HASKELL__
726
727
728 ################################################################################
729 #
730 #       Layout of the source tree
731 #
732 ################################################################################
733
734 # Here we provide defines for the various directories in the source tree,
735 # so we can move things around more easily.  A define $(GHC_FOO_DIR_REL)
736 # indicates a directory relative to the top of the source tree, whereas
737 # $(GHC_FOO_DIR) is a directory relative to the current directory.
738 # $(GHC_FOO_DIR_ABS) is the absolute path to the directory.
739
740 GHC_UTILS_DIR_REL       = utils
741 GHC_INCLUDE_DIR_REL     = includes
742 GHC_COMPILER_DIR_REL = ghc
743 GHC_RTS_DIR_REL         = rts
744 GHC_UTILS_DIR_REL       = utils
745 GHC_DRIVER_DIR_REL      = driver
746 GHC_COMPAT_DIR_REL      = compat
747
748 GHC_MKDEPENDC_DIR_REL   = $(GHC_UTILS_DIR_REL)/mkdependC
749 GHC_LTX_DIR_REL         = $(GHC_UTILS_DIR_REL)/ltx
750 GHC_RUNTEST_DIR_REL     = $(GHC_UTILS_DIR_REL)/runstdtest
751 GHC_LNDIR_DIR_REL       = $(GHC_UTILS_DIR_REL)/lndir
752 GHC_MKDIRHIER_DIR_REL   = $(GHC_UTILS_DIR_REL)/mkdirhier
753 GHC_DOCBOOK_DIR_REL     = $(GHC_UTILS_DIR_REL)/docbook
754 GHC_UNLIT_DIR_REL       = $(GHC_UTILS_DIR_REL)/unlit
755 GHC_HP2PS_DIR_REL       = $(GHC_UTILS_DIR_REL)/hp2ps
756 GHC_HSTAGS_DIR_REL      = $(GHC_UTILS_DIR_REL)/hasktags
757 GHC_GHCTAGS_DIR_REL     = $(GHC_UTILS_DIR_REL)/ghctags
758 GHC_HSC2HS_DIR_REL      = $(GHC_UTILS_DIR_REL)/hsc2hs
759 GHC_TOUCHY_DIR_REL      = $(GHC_UTILS_DIR_REL)/touchy
760 GHC_PKG_DIR_REL         = $(GHC_UTILS_DIR_REL)/ghc-pkg
761 GHC_GENPRIMOP_DIR_REL   = $(GHC_UTILS_DIR_REL)/genprimopcode
762 GHC_GENAPPLY_DIR_REL    = $(GHC_UTILS_DIR_REL)/genapply
763
764 GHC_MANGLER_DIR_REL     = $(GHC_DRIVER_DIR_REL)/mangler
765 GHC_SPLIT_DIR_REL       = $(GHC_DRIVER_DIR_REL)/split
766 GHC_SYSMAN_DIR_REL      = $(GHC_RTS_DIR_REL)/parallel
767
768 INPLACE_DATA_DIR        = $(FPTOOLS_TOP_ABS)/inplace-datadir
769
770 GHC_UTILS_DIR           = $(FPTOOLS_TOP)/$(GHC_UTILS_DIR_REL)
771 GHC_INCLUDE_DIR         = $(FPTOOLS_TOP)/$(GHC_INCLUDE_DIR_REL)
772 GHC_COMPILER_DIR        = $(FPTOOLS_TOP)/$(GHC_COMPILER_DIR_REL)
773 GHC_RTS_DIR             = $(FPTOOLS_TOP)/$(GHC_RTS_DIR_REL)
774 GHC_UTILS_DIR           = $(FPTOOLS_TOP)/$(GHC_UTILS_DIR_REL)
775 GHC_DRIVER_DIR          = $(FPTOOLS_TOP)/$(GHC_DRIVER_DIR_REL)
776 GHC_COMPAT_DIR          = $(FPTOOLS_TOP)/$(GHC_COMPAT_DIR_REL)
777
778 GHC_MKDEPENDC_DIR       = $(FPTOOLS_TOP)/$(GHC_MKDEPENDC_DIR_REL)
779 GHC_LTX_DIR             = $(FPTOOLS_TOP)/$(GHC_LTX_DIR_REL)
780 GHC_RUNTEST_DIR         = $(FPTOOLS_TOP)/$(GHC_RUNTEST_DIR_REL)
781 GHC_LNDIR_DIR           = $(FPTOOLS_TOP)/$(GHC_LNDIR_DIR_REL)
782 GHC_MKDIRHIER_DIR       = $(FPTOOLS_TOP)/$(GHC_MKDIRHIER_DIR_REL)
783 GHC_DOCBOOK_DIR         = $(FPTOOLS_TOP)/$(GHC_DOCBOOK_DIR_REL)
784 GHC_UNLIT_DIR           = $(FPTOOLS_TOP)/$(GHC_UNLIT_DIR_REL)
785 GHC_HP2PS_DIR           = $(FPTOOLS_TOP)/$(GHC_HP2PS_DIR_REL)
786 GHC_HSTAGS_DIR          = $(FPTOOLS_TOP)/$(GHC_HSTAGS_DIR_REL)
787 GHC_GHCTAGS_DIR         = $(FPTOOLS_TOP)/$(GHC_GHCTAGS_DIR_REL)
788 GHC_HSC2HS_DIR          = $(FPTOOLS_TOP_ABS)/$(GHC_HSC2HS_DIR_REL)
789 GHC_TOUCHY_DIR          = $(FPTOOLS_TOP)/$(GHC_TOUCHY_DIR_REL)
790 GHC_PKG_DIR             = $(FPTOOLS_TOP)/$(GHC_PKG_DIR_REL)
791 GHC_GENPRIMOP_DIR       = $(FPTOOLS_TOP)/$(GHC_GENPRIMOP_DIR_REL)
792 GHC_GENAPPLY_DIR        = $(FPTOOLS_TOP)/$(GHC_GENAPPLY_DIR_REL)
793
794 GHC_MANGLER_DIR         = $(FPTOOLS_TOP)/$(GHC_MANGLER_DIR_REL)
795 GHC_SPLIT_DIR           = $(FPTOOLS_TOP)/$(GHC_SPLIT_DIR_REL)
796 GHC_SYSMAN_DIR          = $(FPTOOLS_TOP)/$(GHC_SYSMAN_DIR_REL)
797
798 GHC_UTILS_DIR_ABS       = $(FPTOOLS_TOP_ABS)/$(GHC_UTILS_DIR_REL)
799 GHC_INCLUDE_DIR_ABS     = $(FPTOOLS_TOP_ABS)/$(GHC_INCLUDE_DIR_REL)
800 GHC_COMPILER_DIR_ABS    = $(FPTOOLS_TOP_ABS)/$(GHC_COMPILER_DIR_REL)
801 GHC_RTS_DIR_ABS         = $(FPTOOLS_TOP_ABS)/$(GHC_RTS_DIR_REL)
802 GHC_UTILS_DIR_ABS       = $(FPTOOLS_TOP_ABS)/$(GHC_UTILS_DIR_REL)
803 GHC_DRIVER_DIR_ABS      = $(FPTOOLS_TOP_ABS)/$(GHC_DRIVER_DIR_REL)
804 GHC_COMPAT_DIR_ABS      = $(FPTOOLS_TOP_ABS)/$(GHC_COMPAT_DIR_REL)
805
806 GHC_MKDEPENDC_DIR_ABS   = $(FPTOOLS_TOP_ABS)/$(GHC_MKDEPENDC_DIR_REL)
807 GHC_LTX_DIR_ABS         = $(FPTOOLS_TOP_ABS)/$(GHC_LTX_DIR_REL)
808 GHC_RUNTEST_DIR_ABS     = $(FPTOOLS_TOP_ABS)/$(GHC_RUNTEST_DIR_REL)
809 GHC_LNDIR_DIR_ABS       = $(FPTOOLS_TOP_ABS)/$(GHC_LNDIR_DIR_REL)
810 GHC_MKDIRHIER_DIR_ABS   = $(FPTOOLS_TOP_ABS)/$(GHC_MKDIRHIER_DIR_REL)
811 GHC_DOCBOOK_DIR_ABS     = $(FPTOOLS_TOP_ABS)/$(GHC_DOCBOOK_DIR_REL)
812 GHC_UNLIT_DIR           = $(FPTOOLS_TOP_ABS)/$(GHC_UNLIT_DIR_REL)
813 GHC_HP2PS_DIR_ABS       = $(FPTOOLS_TOP_ABS)/$(GHC_HP2PS_DIR_REL)
814 GHC_HSTAGS_DIR_ABS      = $(FPTOOLS_TOP_ABS)/$(GHC_HSTAGS_DIR_REL)
815 GHC_GHCTAGS_DIR_ABS     = $(FPTOOLS_TOP_ABS)/$(GHC_GHCTAGS_DIR_REL)
816 GHC_HSC2HS_DIR_ABS      = $(FPTOOLS_TOP_ABS)/$(GHC_HSC2HS_DIR_REL)
817 GHC_TOUCHY_DIR_ABS      = $(FPTOOLS_TOP_ABS)/$(GHC_TOUCHY_DIR_REL)
818 GHC_PKG_DIR_ABS         = $(FPTOOLS_TOP_ABS)/$(GHC_PKG_DIR_REL)
819 GHC_GENPRIMOP_DIR_ABS   = $(FPTOOLS_TOP_ABS)/$(GHC_GENPRIMOP_DIR_REL)
820 GHC_GENAPPLY_DIR_ABS    = $(FPTOOLS_TOP_ABS)/$(GHC_GENAPPLY_DIR_REL)
821 GHC_COMPILER_DIR_ABS    = $(FPTOOLS_TOP_ABS)/$(GHC_COMPILER_DIR_REL)
822
823 GHC_MANGLER_DIR_ABS     = $(FPTOOLS_TOP_ABS)/$(GHC_MANGLER_DIR_REL)
824 GHC_SYSMAN_DIR_ABS      = $(FPTOOLS_TOP_ABS)/$(GHC_SYSMAN_DIR_REL)
825 GHC_SPLIT_DIR_ABS       = $(FPTOOLS_TOP_ABS)/$(GHC_SPLIT_DIR_REL)
826
827 # -----------------------------------------------------------------------------
828 # Names of programs in the GHC tree
829 #
830 #      xxx_PGM          the name of an executable, without the path
831 #      xxx              the executable relative to the current dir
832
833 GHC_UNLIT_PGM           = unlit$(exeext)
834 GHC_HP2PS_PGM           = hp2ps
835 GHC_HSTAGS_PGM          = hasktags
836 GHC_GHCTAGS_INPLACE_PGM = ghctags-inplace
837 GHC_HSC2HS_INPLACE_PGM  = hsc2hs
838 GHC_TOUCHY_PGM          = touchy$(exeext)
839 GHC_MANGLER_PGM         = ghc-asm
840 GHC_SPLIT_PGM           = ghc-split
841 GHC_SYSMAN_PGM          = SysMan
842 GHC_GENPRIMOP_PGM       = genprimopcode
843 GHC_GENAPPLY_PGM        = genapply
844 GHC_MKDEPENDC_PGM       = mkdependC
845 GHC_LTX_PGM             = ltx
846 GHC_MKDIRHIER_PGM       = mkdirhier
847 GHC_LNDIR_PGM           = lndir
848 GHC_RUNTEST_PGM         = runstdtest
849
850 ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
851 GHC_CP                  = "xcopy /y"
852 GHC_PERL                = perl
853 else
854 GHC_CP                  = $(CP)
855 GHC_PERL                = $(PERL)
856 endif
857
858 UNLIT                   = $(GHC_UNLIT_DIR)/$(GHC_UNLIT_PGM)
859 HP2PS                   = $(GHC_HP2PS_DIR)/$(GHC_HP2PS_PGM)
860 HSTAGS                  = $(GHC_HSTAGS_DIR)/$(GHC_HSTAGS_PGM)
861 GHCTAGS_INPLACE         = $(GHC_GHCTAGS_DIR)/$(GHC_GHCTAGS_INPLACE_PGM)
862 HSC2HS_INPLACE          = $(GHC_HSC2HS_DIR)/install-inplace/bin/$(GHC_HSC2HS_INPLACE_PGM)
863 MANGLER                 = $(GHC_MANGLER_DIR)/$(GHC_MANGLER_PGM)
864 SPLIT                   = $(GHC_SPLIT_DIR)/$(GHC_SPLIT_PGM)
865 SYSMAN                  = $(GHC_SYSMAN_DIR)/$(GHC_SYSMAN_PGM)
866 GHC_PKG_INPLACE         = $(GHC_PKG_PROG)
867 GENPRIMOP               = $(GHC_GENPRIMOP_DIR)/$(GHC_GENPRIMOP_PGM)
868 GENAPPLY                = $(GHC_GENAPPLY_DIR)/$(GHC_GENAPPLY_PGM)
869 MKDEPENDC               = $(GHC_MKDEPENDC_DIR)/$(GHC_MKDEPENDC_PGM)
870 LTX                     = $(GHC_LTX_DIR)/$(GHC_LTX_PGM)
871 MKDIRHIER               = $(GHC_MKDIRHIER_DIR)/$(GHC_MKDIRHIER_PGM)
872 LNDIR                   = $(GHC_LNDIR_DIR)/$(GHC_LNDIR_PGM)
873 RUNTEST                 = $(GHC_RUNTEST_DIR)/$(GHC_RUNTEST_PGM)
874
875 GENERATED_FILE  = chmod a-w
876 EXECUTABLE_FILE = chmod +x
877
878 #-----------------------------------------------------------------------------
879 # Haskell compilers and mkdependHS
880
881 # $(GHC), $(HBC) and $(NHC) point to installed versions of the relevant
882 # compilers, if available.
883 #
884 # $(HC) is a generic Haskell 98 compiler, set to $(GHC) by default.
885 # $(MKDEPENDHS) is the Haskell dependency generator (ghc -M).
886 #
887 # NOTE: Don't override $(GHC) in build.mk, use configure --with-ghc instead
888 # (because the version numbers have to be calculated).
889
890 GHC             = @WithGhc@
891 GhcDir          = $(dir $(GHC))
892
893 # Set to YES if $(GHC) has the editline package installed
894 GhcHasEditline  = @GhcHasEditline@
895
896 HBC             = @HBC@
897 NHC             = @NHC@
898
899 # Sometimes we want to invoke ghc from the build tree in different
900 # places (eg. it's handy to have a nofib & a ghc build in the same
901 # tree).  We can refer to "this ghc" as $(GHC_INPLACE):
902
903 GHC_INPLACE = $(GHC_STAGE1)
904 GHC_STAGE1  = $(GHC_COMPILER_DIR_ABS)/stage1-inplace/ghc
905 GHC_STAGE2  = $(GHC_COMPILER_DIR_ABS)/stage2-inplace/ghc
906 GHC_STAGE3  = $(GHC_COMPILER_DIR_ABS)/stage3-inplace/ghc
907 # XXX All those used to have -no-user-package-conf, but then we can't
908 # pass them to Cabal
909
910 BOOTSTRAPPING_CONF = $(FPTOOLS_TOP_ABS)/libraries/bootstrapping.conf
911
912 # NOTE: add -no-user-package-conf for stage 1-3 above, so that
913 # we avoid picking up any packages the user might happen to have
914 # installed for this GHC version.  They are bound to be incompatible
915 # with the packages we built in the tree.
916
917 ifeq "$(stage)" "2"
918   UseStage1 = YES
919 endif
920 ifneq "$(findstring YES, $(UseStage1) $(BootingFromHc))" ""
921
922 # We are using the stage1 compiler to compile Haskell code, set up
923 # some variables appropriately:
924 HC              =$(GHC_STAGE1)
925 MKDEPENDHS      =$(GHC_STAGE1)
926 USE_NEW_MKDEPEND_FLAGS = YES
927 GhcVersion      = @ProjectVersion@
928 GhcPatchLevel   = @ProjectPatchLevel@
929 # oops, these are wrong:
930 GhcMajVersion   = @GhcMajVersion@
931 GhcMinVersion   = @GhcMinVersion@
932
933 ghc_ge_607 = YES
934 ghc_ge_609 = YES
935
936 else # not UseStage1 or BootingFromHc
937
938 # Some useful GHC version predicates:
939 ghc_ge_607 = @ghc_ge_607@
940 ghc_ge_609 = @ghc_ge_609@
941
942 HC              = @WithHc@
943 MKDEPENDHS      = $(GHC)
944 USE_NEW_MKDEPEND_FLAGS = $(ghc_ge_609)
945 GhcVersion      = @GhcVersion@
946 GhcPatchLevel   = @GhcPatchLevel@
947 GhcMajVersion   = @GhcMajVersion@
948 GhcMinVersion   = @GhcMinVersion@
949
950 # We build a few packages using the installed GHC as part of the
951 # bootstrapping process.  These are installed into a local
952 # package.conf file, $(BOOTSTRAPPING_CONF).  When we invoke the
953 # installed GHC we need to pass it -package-conf $(BOOTSTRAPPING_CONF).
954 # So the following variables expand to -package-conf $(BOOTSTRAPPING_CONF)
955 # when $(HC) does *not* point to one of the GHC binaries built in
956 # the local tree.
957 #
958 BOOTSTRAPPING_PACKAGE_CONF_HC_OPTS =$(if $(findstring inplace, $(HC)),,-package-conf $(BOOTSTRAPPING_CONF))
959 BOOTSTRAPPING_PACKAGE_CONF_MKDEPENDHS_OPTS =$(if $(findstring inplace, $(MKDEPENDHS)),,-package-conf $(BOOTSTRAPPING_CONF))
960 endif
961
962 # Canonicalised ghc version number, used for easy (integer) version
963 # comparisons.  We must expand $(GhcMinVersion) to two digits by
964 # adding a leading zero if necessary:
965 ifneq "$(findstring $(GhcMinVersion), 0 1 2 3 4 5 6 7 8 9)" ""
966 GhcCanonVersion = $(GhcMajVersion)0$(GhcMinVersion)
967 else
968 GhcCanonVersion = $(GhcMajVersion)$(GhcMinVersion)
969 endif
970
971 #-----------------------------------------------------------------------------
972 # C compiler
973 #
974 # NB. Don't override $(WhatGccIsCalled) using build.mk,  re-configure using
975 # the flag --with-gcc=<blah> instead.  The reason is that the configure script
976 # needs to know which gcc you're using in order to perform its tests.
977
978 HaveGcc         = @HaveGcc@
979 UseGcc          = YES
980 WhatGccIsCalled = @WhatGccIsCalled@
981 GccVersion      = @GccVersion@
982 ifeq "$(strip $(HaveGcc))" "YES"
983 ifneq "$(strip $(UseGcc))"  "YES"
984   CC    = cc
985 else
986   CC    = $(WhatGccIsCalled)
987   GccDir = $(dir $(WhatGccIsCalled))
988 endif
989 endif
990
991 # default C compiler flags
992 SRC_CC_OPTS = @SRC_CC_OPTS@
993
994 ifeq "$(TARGETPLATFORM)" "ia64-unknown-linux"
995 SRC_CC_OPTS += -G0
996 endif
997
998 SRC_HSC2HS_OPTS += $(addprefix --cflag=,$(filter-out -O,$(SRC_CC_OPTS)))
999 SRC_HSC2HS_OPTS += $(foreach d,$(GMP_INCLUDE_DIRS),-I$(d))
1000
1001 #-----------------------------------------------------------------------------
1002 # GMP Library (version 2.0.x or above)
1003 #
1004 HaveLibGmp      = @HaveLibGmp@
1005 LibGmp          = @LibGmp@
1006
1007 GMP_INCLUDE_DIRS=@GMP_INCLUDE_DIRS@
1008 GMP_LIB_DIRS=@GMP_LIB_DIRS@
1009
1010 #-----------------------------------------------------------------------------
1011 # GMP framework (Mac OS X)
1012 #
1013 HaveFrameworkGMP = @HaveFrameworkGMP@
1014
1015 #-----------------------------------------------------------------------------
1016 # Mingwex Library
1017 #
1018 HaveLibMingwEx  = @HaveLibMingwEx@
1019
1020 #-----------------------------------------------------------------------------
1021 # Flex (currently unused, could be moved to glafp-utils)
1022
1023 # FLEX                  = @LEX@
1024 # Don't bother with -lfl, we define our own yywrap()s anyway.
1025 # FLEX_LIB              = 
1026 #WAS:FLEX_LIB           = @LEXLIB@
1027
1028 #-----------------------------------------------------------------------------
1029 # Other standard (ha!) Unix utilities
1030
1031 AR                      = @ArCmd@
1032 ArSupportsInput         = @ArSupportsInput@
1033 # Yuckage: for ghc/utils/parallel -- todo: nuke this dependency!!
1034 BASH                    = /usr/local/bin/bash
1035
1036 CONTEXT_DIFF            = @ContextDiffCmd@
1037 CP                      = cp
1038 CPP                     = @CPP@ @CPPFLAGS@
1039 CTAGS                   = $(ETAGS)
1040 #
1041 # RAWCPP_FLAGS are the flags to give to cpp (viz, gcc -E) to persuade it to
1042 # behave plausibly on Haskell sources.
1043 #
1044 RAWCPP_FLAGS            = -undef -traditional
1045 FIND                    = @FindCmd@
1046 SORT                    = @SortCmd@
1047 INSTALL                 = @INSTALL@
1048 #
1049 # Sigh - the autoconf macro for INSTALL will subst a relative path to the fallback
1050 # install-sh script (if chosen). This not terribly useful to us, so we convert
1051 # it into an abs. path.
1052
1053 INSTALL                 := $(subst .././install-sh,$(FPTOOLS_TOP_ABS)/install-sh,$(INSTALL))
1054 LATEX                   = latex
1055 HEVEA                   = hevea
1056 HACHA                   = hacha
1057 LN_S                    = @LN_S@
1058 MANMACROS               = -man
1059 MSMACROS                = -ms
1060 MV                      = mv
1061 NROFF                   = nroff
1062 PERL                    = @PerlCmd@
1063 PYTHON                  = @PythonCmd@
1064 PIC                     = pic
1065 PREPROCESSCMD           = $(CC) -E
1066 RANLIB                  = @RANLIB@
1067 RM                      = rm -f
1068 SED                     = @SedCmd@
1069 SHELL                   = /bin/sh
1070
1071 LD                      = @LdCmd@
1072
1073 # Some ld's support the -x flag and some don't, so the configure
1074 # script detects which we have and sets LdXFlag to "-x" or ""
1075 # respectively.
1076 LD_X                    = @LdXFlag@
1077
1078 # GNU ld supports input via a linker script, which is useful to avoid
1079 # overflowing command-line length limits.
1080 LdIsGNULd               = @LdIsGNULd@
1081
1082 #
1083 # In emergency situations, REAL_SHELL is used to perform shell commands
1084 # from within the ghc driver script, by scribbling the command line to
1085 # a temp file and then having $(REAL_SHELL) execute it. 
1086 #
1087 # The reason for having to do this is that overly long command lines
1088 # cause unnecessary trouble with some shells (e.g., /bin/sh on Solaris
1089 # 2.5.1), which is why this backdoor is provided. The situation of overly
1090 # long command lines is either encountered while doing `make boot' in compiler/, 
1091 # or when linking the compiler binary (`hsc'). 
1092 #
1093 # We do not use SHELL to execute long commands, as `make' will more than likely
1094 # override whatever setting you have in your environment while executing. 
1095
1096 # By default, REAL_SHELL is set equal to SHELL, which is not really a smart move
1097 # as it is SHELL that will show up the bogosity in the first place, but setting
1098 # it to anything else isn't really portable.
1099 #
1100 #  ====> If long command lines cause you trouble, invoke `ghc' (via `make' or otherwise)
1101 # with REAL_SHELL set to something else than /bin/sh, for instance, your favourite
1102 # command shell.
1103 #
1104 REAL_SHELL=$(SHELL)
1105 SIZE                    = size
1106 STRIP                   = strip
1107 TAR                     = @TarCmd@
1108 ZIP                     = zip
1109
1110 HSCOLOUR = @HSCOLOUR@
1111
1112 #
1113 # This is special to literate/, ToDo: add literate-specific
1114 # configure setup to literate/.
1115 #
1116 TBL                     = tbl
1117 TEX                     = tex
1118 TGRIND                  = tgrind
1119 TGRIND_HELPER           = /usr/local/lib/tgrind/tfontedpr # XXX
1120 TIB                     = tib
1121
1122 TIME                    = @TimeCmd@
1123 TROFF                   = troff
1124 UNAME                   = uname
1125
1126 # GTK+
1127 GTK_CONFIG = @GTK_CONFIG@
1128
1129 # Set this if you want to use Inno Setup to build a Windows installer
1130 # when you make a bindist
1131 ISCC                    =
1132
1133 #-----------------------------------------------------------------------------
1134 # DocBook XML stuff
1135
1136 XSLTPROC                = @XsltprocCmd@
1137 XMLLINT                 = @XmllintCmd@
1138 FOP                     = @FopCmd@
1139 XMLTEX                  = @XmltexCmd@
1140 PDFXMLTEX               = @PdfxmltexCmd@
1141 DVIPS                   = @DvipsCmd@
1142
1143 DIR_DOCBOOK_XSL         = @DIR_DOCBOOK_XSL@
1144
1145 XSLTPROC_LABEL_OPTS     = --stringparam toc.section.depth 3 \
1146                           --stringparam section.autolabel 1 \
1147                           --stringparam section.label.includes.component.label 1
1148
1149 #-----------------------------------------------------------------------------
1150 #               FPtools support software
1151
1152 BLD_DLL                 = dllwrap
1153
1154 #
1155 # .NET support software
1156 #
1157 ILX2IL                  = ilx2il
1158 ILASM                   = ilasm
1159
1160 #
1161 # ghc-pkg
1162 #
1163 GHC_PKG                 = @GhcPkgCmd@
1164
1165 #
1166 # GreenCard
1167 #
1168 GREENCARD               = @GreenCardCmd@
1169 GREENCARD_VERSION       = @GreenCardVersion@            
1170
1171 #
1172 # Happy
1173 #
1174 HAPPY                   = @HappyCmd@
1175 HAPPY_VERSION           = @HappyVersion@                
1176 #
1177 # Options to pass to Happy when we're going to compile the output with GHC
1178 #
1179 GHC_HAPPY_OPTS          = -agc --strict
1180
1181 # Temp. to work around performance problems in the HEAD around 8/12/2003,
1182 # A Happy compiled with this compiler needs more stack.
1183 SRC_HAPPY_OPTS          = +RTS -K2m -RTS
1184
1185 #
1186 # Alex
1187 #
1188 ALEX                    = @AlexCmd@
1189 ALEX_VERSION            = @AlexVersion@         
1190 #
1191 # Options to pass to Happy when we're going to compile the output with GHC
1192 #
1193 GHC_ALEX_OPTS           = -g
1194
1195 #
1196 # Options for compiling in different `ways'. 
1197
1198 # To configure up your own way, have a look at some of the standard ways
1199 # such as profiling, and create your own set of WAY_*_OPTS defs below.
1200 # After having done that, add your way string to WAYS, and after having
1201 # run the configure script, the different projects will add the new way
1202 # to the list of ways they support.
1203 #
1204
1205 #
1206 # Definitions of the different ways:
1207 #   
1208 #   * their name:
1209 #          - tag, e.g., p
1210 #          - description, e.g., profiling
1211 #   * what they mean to the driver:
1212 #          - WAY_p_HC_OPTS gives the list of command-line options
1213 #            to the driver.
1214 #
1215
1216 #
1217 # The ways currently defined.
1218 #
1219 ALL_WAYS=p t s mp mg a b c d e f g h i j k l m n o A B
1220 USER_WAYS=a b c d e f g h j k l m n o A B
1221
1222 #
1223 # The following ways currently have treated specially, p t mg,
1224 # as the driver script treats these guys specially and needs to carefully be told
1225 # about the options for these. Hence, we hide the required command line options
1226 # for these in the driver, as this is the only place they are needed.
1227
1228 # If you want to add to these default options, fill in the variables below:
1229
1230 # Way 'i':
1231 WAY_i_NAME=ILX
1232 WAY_i_HC_OPTS= -filx -fruntime-types
1233
1234 # Way 'p':
1235 WAY_p_NAME=profiling
1236 WAY_p_HC_OPTS= -prof
1237
1238 # Way 't':
1239 WAY_t_NAME=ticky-ticky profiling
1240 WAY_t_HC_OPTS= -ticky
1241
1242 # Way `mp': 
1243 WAY_mp_NAME=parallel
1244 WAY_mp_HC_OPTS=-parallel
1245
1246 # Way `mg': 
1247 WAY_mg_NAME=GranSim
1248 WAY_mg_HC_OPTS=-gransim
1249
1250 #
1251 # These ways apply to the RTS only:
1252 #
1253
1254 # Way 'thr':
1255 WAY_thr_NAME=threaded
1256 WAY_thr_HC_OPTS=-optc-DTHREADED_RTS
1257
1258 # Way 'thr_p':
1259 WAY_thr_p_NAME=threaded profiled
1260 WAY_thr_p_HC_OPTS=-optc-DTHREADED_RTS -prof
1261
1262 # Way 'debug':
1263 WAY_debug_NAME=debug
1264 WAY_debug_HC_OPTS=-optc-DDEBUG
1265
1266 # Way 'debug_p':
1267 WAY_debug_p_NAME=debug profiled
1268 WAY_debug_p_HC_OPTS=-optc-DDEBUG -prof
1269
1270 # Way 'debug_t':
1271 WAY_debug_t_NAME=debug ticky-ticky profiling
1272 WAY_debug_t_HC_OPTS= -ticky -optc-DDEBUG
1273
1274 # Way 'thr_debug':
1275 WAY_thr_debug_NAME=threaded
1276 WAY_thr_debug_HC_OPTS=-optc-DTHREADED_RTS -optc-DDEBUG
1277
1278 # Way 'thr_debug_p':
1279 WAY_thr_debug_p_NAME=threaded debug profiling
1280 WAY_thr_debug_p_HC_OPTS=-optc-DTHREADED_RTS -optc-DDEBUG -prof
1281
1282 # Way 'dyn': build dynamic shared libraries
1283 WAY_dyn_NAME=dyn
1284 WAY_dyn_HC_OPTS=-fPIC -dynamic
1285 WAY_dyn_LIB_TARGET=libHSrts-gcc661.so
1286
1287 # Way 'thr_dyn':
1288 WAY_thr_dyn_NAME=thr_dyn
1289 WAY_thr_dyn_HC_OPTS=-fPIC -dynamic -optc-DTHREADED_RTS
1290
1291 # Way 'thr_debug_dyn':
1292 WAY_thr_debug_dyn_NAME=thr_dyn
1293 WAY_thr_debug_dyn_HC_OPTS=-fPIC -dynamic -optc-DTHREADED_RTS -optc-DDEBUG
1294
1295 # Way 'debug_dyn':
1296 WAY_debug_dyn_NAME=thr_dyn
1297 WAY_debug_dyn_HC_OPTS=-fPIC -dynamic -optc-DDEBUG
1298
1299 #
1300 # Add user-way configurations here:
1301 #
1302 WAY_A_NAME=
1303 WAY_A_HC_OPTS=
1304
1305 WAY_B_NAME=
1306 WAY_B_HC_OPTS=
1307
1308 WAY_a_NAME=
1309 WAY_a_HC_OPTS=
1310
1311 WAY_b_NAME=
1312 WAY_b_HC_OPTS=
1313
1314 WAY_c_NAME=
1315 WAY_c_HC_OPTS=
1316
1317 WAY_d_NAME=
1318 WAY_d_HC_OPTS=
1319
1320 WAY_e_NAME=
1321 WAY_e_HC_OPTS=
1322
1323 WAY_f_NAME=
1324 WAY_f_HC_OPTS=
1325
1326 WAY_g_NAME=
1327 WAY_g_HC_OPTS=
1328
1329 WAY_h_NAME=
1330 WAY_h_HC_OPTS=
1331
1332 WAY_j_NAME=
1333 WAY_j_HC_OPTS=
1334
1335 WAY_k_NAME=
1336 WAY_k_HC_OPTS=
1337
1338 WAY_l_NAME=
1339 WAY_l_HC_OPTS=
1340
1341 WAY_m_NAME=
1342 WAY_m_HC_OPTS=
1343
1344 WAY_n_NAME=
1345 WAY_n_HC_OPTS=
1346
1347 WAY_o_NAME=
1348 WAY_o_HC_OPTS=
1349
1350 ################################################################################
1351 #
1352 #               31-bit-Int Core files
1353 #
1354 ################################################################################
1355
1356
1357 # It is possible to configure the compiler and prelude to support 31-bit
1358 # integers, suitable for a back-end and RTS using a tag bit on a 32-bit
1359 # architecture.  Currently the only useful output from this option is external Core
1360 # files.  The following additions to your build.mk will produce the
1361 # 31-bit core output.  Note that this is *not* just a library "way"; the
1362 # compiler must be built a special way too.
1363
1364 # GhcCppOpts +=-DWORD_SIZE_IN_BITS=31
1365 # GhcLibHcOpts +=-fext-core -fno-code -DWORD_SIZE_IN_BITS=31
1366 # GhcLibCppOpts += -DWORD_SIZE_IN_BITS=31
1367 # SplitObjs=NO
1368
1369 ################################################################################
1370 #
1371 #    Library configure arguments
1372 #
1373 ################################################################################
1374
1375 CONFIGURE_ARGS = @CONFIGURE_ARGS@
1376
1377 ################################################################################
1378 #
1379 #    Bindist testing directory
1380 #
1381 ################################################################################
1382
1383 ifeq "$(Windows)" "YES"
1384 BIN_DIST_INST_SUBDIR = "install dir"
1385 else
1386 # I very much doubt that paths with spaces will work on Unix
1387 BIN_DIST_INST_SUBDIR = installed
1388 endif
1389
1390 BIN_DIST_INST_DIR = $(FPTOOLS_TOP_ABS)/bindisttest/$(BIN_DIST_INST_SUBDIR)
1391