c8fa245ed7f98e48770ad00bc802940bbc0372ff
[ghc-hetmet.git] / mk / config.mk.in
1 #
2 # @configure_input@
3 #
4 #################################################################################
5 #
6 #                       config.mk.in-template
7 #
8 #       This file defines all the variables that set the configuration of
9 #       a particular build.
10 #
11 #
12 #################################################################################
13
14 # The configuration is defined in two steps:
15 #
16 #       1. The builder (i.e. the person doing the build)
17 #          copies this file, config.mk.in-template
18 #          to config.mk.in
19 #
20 #       2. S/he then edits it manually (gasp) to reflect any configuration
21 #          options s/he wants.
22 #
23 #       3. Then s/he runs "configure", which generates config.mk from
24 #          config.mk.in, substituting for system/platform-dependent things
25 #          enclosed in @at-signs@.
26 #
27 # This is one of only two files that configure generates (the other is config.h)
28 #
29 # Note that after subsequent edits of config.mk.in for a build, the configure script
30 # will have to be re-run manually to have the change reflected in config.mk. 
31 #
32
33 # There is a section below for each project within the fptools suite
34 #
35 #       PLUS
36 #
37 # a section corresponding to each of the main .mk files 
38 # included by boilerplate.mk (see boilerplate.mk for a list).
39
40
41
42 #################################################################################
43 #
44 #               project-wide flags
45 #
46 #       Set of options applicable to all fptools projects
47 #
48 #################################################################################
49
50 #
51 # What parts to build: An fptools build tree does not have to be built
52 # all in one go. By setting the list of ProjectsToBuild in build.mk you can
53 # control which projects are built.
54 #
55 # Caution: the projects are built in the order given here, so if some
56 # projects use others you must list them in the correct order.
57 #
58 # Generally:    * glafp-utils should be first
59 #               * literate next
60 #               * happy next
61 #               * ghc&hslibs next
62 #               then it's up to you
63
64 ProjectsToBuild =  glafp-utils literate ghc hslibs
65
66 #
67 # Should the various project tests directories be built?
68 #
69 IncludeTestDirsInBuild=NO
70
71 #################################################################################
72 #
73 #               GHC project
74
75 #       Set of (configurable) options needed by the ghc tree
76 #       plus their default options (if any).
77 #
78 #################################################################################
79
80 #
81 # Name variables for ghc:
82
83 GhcProjectName       =The Glorious Glasgow Haskell Compilation System
84 GhcProjectNameShort  =ghc
85 GhcProjectVersion    =2.02
86 GhcProjectPatchLevel =0
87 GhcBuildeeVersion    =202
88 GhcBuilderVersion    =29
89
90 #
91 # Name variables for the fptools, for now equal to the above
92 # ghc stuff
93 #
94 ProjectName       =$(GhcProjectName)
95 ProjectNameShort  =$(GhcProjectNameShort)
96 ProjectVersion    =$(GhcProjectVersion)
97 ProjectPatchLevel =$(GhcProjectPatchLevel)
98
99
100 #---------------------------------------------------------------
101 #
102 # Variables that control how the compiler itself is built
103
104 # Specify the Haskell compiler to be used to compile the compiler itself
105 #   WithGhcHc   Path name of the compiler to use
106 #   Ghc2_0      Whether this compiler is GHC 2.0 or later
107 #               (which affects gruesome details about
108 #                how mutually recursive modules are handled)
109 #   WithGhcHcType       What "type" of compiler is being used
110 #                       Valid options:
111 #                            HC_CHALMERS_HBC
112 #                            HC_GLASGOW_GHC
113 #                            HC_ROJEMO_NHC
114 #                            HC_UNSPECIFIED
115 WithGhcHc = ghc-0.29
116 Ghc2_0=NO
117 # Unused, we think
118 # WithGhcHcType=HC_GLASGOW_GHC
119
120 # Extra ways in which to build the compiler (for example, you might want to
121 # build a profiled compiler so you can see where it spends its time)
122 GhcCompilerWays=
123
124 # Extra option flags to pass to the compiler that compiles the compiler
125 # (Ones that are essential are wired into ghc/compiler/Makefile)
126 # Typical ones:
127 #       -O              compiler an optimised compiler
128 #       -DDEBUG         include consistency/assertion checks in the compiled compiler
129 #       -fshow-import-specs     show import specialisations
130 GhcHcOpts=
131
132 # GhcWithHscBuiltViaC - build GHC compiler proper (\`hsc') from .hc files?
133 GhcWithHscBuiltViaC=NO
134
135 # Build hsc with -O and turn optimising flag on when compiling
136 # the intermediate C file
137 GhcUseGccForOptAsm=YES
138
139 # Compile intermediate C file with debugging options set.
140 GhcUseGccForDebuggingAsm=YES
141
142 # Build a registerised version of hsc and runtime
143 # (you'd be desperate or silly not to).
144 GhcWithRegisterised=YES
145
146 # Build a compiler with a native code generator backend
147 # (as well as a C backend)
148 #
149 # Target platforms supported:
150 #   i386, alpha & sparc
151 GhcWithNativeCodeGen=YES
152
153 # Build the compiler with the deforester included?
154 GhcWithDeforester=NO
155
156
157 #---------------------------------------------------------------
158 #
159 # Variables that control how the prelude libararies and runtime system are built
160
161 # What extra ways to build the libraries in
162 # In addition to the normal sequential way, the default is to also build
163 # profiled prelude libraries.
164 GhcLibWays=p
165
166 # Option flags to pass to GHC when it's compiling prelude modules
167 # Typically these are things like -O or -dcore-lint
168 # The ones that are *essential* are wired into ghc/lib/Makefile
169 GhcLibHcOpts= -split-objs -odir $(basename $*)
170
171
172 #################################################################################
173 #
174 #               hslibs project
175 #
176 #       Set of (configurable) options needed by the Haskell libraries (hslibs)
177 #       plus their default options (if any).
178 #
179 #################################################################################
180
181 # Build the Haskell Readline bindings?
182 #
183 HsLibsWithReadline=YES
184
185 # Build the socket libraries?
186 #
187 HsLibsWithSockets=YES
188
189 #
190 # The different ways to build hslibs. Default is just to mirror
191 # what is done for the ghc prelude libraries.
192 #
193 HsLibWays=$(GhcLibWays)
194
195
196 #################################################################################
197 #
198 #               happy project
199 #
200 #       Happy specific options
201 #
202 #################################################################################
203
204
205
206 #################################################################################
207 #
208 #               haggis project
209 #
210 #       Haggis specific options
211 #
212 #################################################################################
213
214
215
216 #################################################################################
217 #
218 #               green-card project
219 #
220 #       Green-card specific options
221 #
222 #################################################################################
223
224
225 #################################################################################
226 #
227 #               nofib project
228 #
229 #       nofib specific options
230 #
231 #################################################################################
232
233
234 # NoFibSubDirs controls which set of tests should be run
235 # You can run one or more of
236 #       imaginary 
237 #       spectral
238 #       real
239 #       parallel
240 #       PRIVATE
241 #       GHC_ONLY
242 #       PENDING
243 #       UNUSED
244 NoFibSubDirs = imaginary spectral real GHC_ONLY PRIVATE
245
246 # The different ways to build nofib. Default is just to mirror
247 # what is done for the ghc prelude libraries.
248 #
249 NoFibWays=$(GhcLibWays)
250
251 # Haskell compiler options for nofib
252 NoFibHcOpts=
253
254 # ==============================================================================
255 #
256 #                       END OF PROJECT-SPECIFIC STUFF
257 #
258 #               Now come the generic configuration options
259 #
260 # ==============================================================================
261
262 #################################################################################
263 #
264 #               Paths (see paths.mk)
265 #
266 #################################################################################
267
268 # These variables are all ":=" variables so that you can easily attach
269 # extra stuff to the end of them, like this:
270 #
271 #       libdir := $(libdir)/ghc
272
273 TMPDIR                  := /tmp
274
275 # FPTOOLS_TOP: the top of the fptools hierarchy, absolute path.
276
277 FPTOOLS_TOP_ABS         := @hardtop@
278
279 #
280 # Installation directories, we don't use half of these,
281 # but since the configure script has them on offer while
282 # passing through, we might as well set them.
283
284 prefix                  := @prefix@
285 exec_prefix             := @exec_prefix@
286 bindir                  := @bindir@
287 sbindir                 := @sbindir@
288 libexecdir              := @libexecdir@
289 datadir                 := @datadir@
290 sysconfdir              := @datadir@
291 sharedstatedir          := @sharedstatedir@
292 localstatedir           := @localstatedir@
293 libdir                  := @libdir@
294 infodir                 := @infodir@
295 includedir              := @includedir@
296 oldincludedir           := @oldincludedir@
297 mandir                  := @mandir@
298 srcdir                  := @srcdir@
299
300 #################################################################################
301 #
302 #               Utilities programs: flags
303 #
304 #################################################################################
305
306 # If you want to give any standard flags to pretty much any utility
307 # (see utils.mk for a complete list), by adding a line here
308 #
309 #       SRC_P_OPTS += ...
310 #
311 # where P is the utility. For example, to add -O to all Haskell
312 # compilations, 
313 #
314 #       SRC_HC_OPTS += -O
315
316
317 #################################################################################
318 #
319 #               Platform
320 #
321 #################################################################################
322
323 # A "platform" is the GNU cpu-type/manufacturer/operating-system target machine
324 # specifier.  E.g. sparc-sun-solaris2
325
326 HOSTPLATFORM                    = @HostPlatform@
327 TARGETPLATFORM                  = @TargetPlatform@
328 BUILDPLATFORM                   = @HostPlatform@
329
330 HostPlatform_CPP                = @HostPlatform_CPP@
331 HostArch_CPP                    = @HostArch_CPP@
332 HostOS_CPP                      = @HostOS_CPP@
333 HostVendor_CPP                  = @HostVendor_CPP@
334
335 #
336 # ToDo: check if these can be purged now. -- sof
337 #
338
339 @HostPlatform_CPP@_HOST        = 1
340 @HostPlatform_CPP@_TARGET      = 1
341 @HostPlatform_CPP@_BUILD       = 1
342
343 @HostArch_CPP@_HOST_ARCH       = 1
344 @HostArch_CPP@_TARGET_ARCH      = 1
345 @HostArch_CPP@_BUILD_ARCH      = 1
346
347 @HostOS_CPP@_HOST_OS           = 1
348 @HostOS_CPP@_TARGET_OS         = 1
349 @HostOS_CPP@_BUILD_OS          = 1
350
351 @HostVendor_CPP@_HOST_VENDOR    = 1
352 @HostVendor_CPP@_TARGET_VENDOR  = 1
353 @HostVendor_CPP@_BUILD_VENDOR   = 1
354
355 # Leading underscores on symbol names in object files
356 # Valid options: YES/NO
357 #
358 LeadingUnderscore=@LeadingUnderscore@
359
360 #################################################################################
361 #
362 #               Utilities programs: where to find them
363 #
364 #################################################################################
365
366 #-----------------------------------------------------------------------------
367 # FPtools Utility locations
368
369 # By default, the various utils needed to be build ghc and chums
370 # is set up to point to the utils/ directory. Define here the
371 # path prefix for the utilities. Notice that it's a prefix with
372 # a trailing slash, so that it can be concatenated directly on
373 # front of a program name; if it's not set then we just look
374 # along the shell's $(PATH)
375 #
376 # If instead you want to use installed or your own versions of these,
377 # override the various *_PREFIX in build.mk, i.e., having the following
378 # in build.mk:
379 #
380 #   FASTMAKE_PREFIX=
381 #
382 # will force `make' to rummage around in your PATH to find `fastmake' (not
383 # sure it would need it in the first place, but still).
384 #
385 GLAFP_UTILS             = $(FPTOOLS_TOP)/glafp-utils
386
387 SCRIPT_PREFIX           = $(GLAFP_UTILS)/scripts/
388 FASTMAKE_PREFIX         = $(GLAFP_UTILS)/fastmake/
389 MKDEPENDC_PREFIX        = $(GLAFP_UTILS)/mkdependC/
390 LTX_PREFIX              = $(GLAFP_UTILS)/ltx/
391 RUNTEST_PREFIX          = $(GLAFP_UTILS)/runstdtest/
392 VERBATIM_PREFIX         = $(GLAFP_UTILS)/verbatim/
393 ETAGS_PREFIX            = $(GLAFP_UTILS)/etags/
394 MSUB_PREFIX             = $(GLAFP_UTILS)/msub/
395 LNDIR_PREFIX            = $(GLAFP_UTILS)/lndir/
396 MKDIRHIER_PREFIX        = $(GLAFP_UTILS)/mkdirhier/
397
398 # Still used?
399 LITERATE                = $(FPTOOLS_TOP)/literate
400
401 LITERATE_PREFIX         = $(FPTOOLS_TOP)/literate/
402 TEXI2HTML_PREFIX        = $(LITERATE_PREFIX)texi2html/
403
404 HAPPY_PREFIX            = $(FPTOOLS_TOP)/happy/src/
405
406 UNLIT_PREFIX            = $(FPTOOLS_TOP)/ghc/utils/unlit/
407 UGEN_PREFIX             = $(FPTOOLS_TOP)/ghc/utils/ugen/
408 STAT2RESID_PREFIX       = $(FPTOOLS_TOP)/ghc/utils/stat2resid/
409 HP2PS_PREFIX            = $(FPTOOLS_TOP)/ghc/utils/hp2ps/
410 HSCPP_PREFIX            = $(FPTOOLS_TOP)/ghc/utils/hscpp/
411 HSTAGS_PREFIX           = $(FPTOOLS_TOP)/ghc/utils/hstags/
412
413
414 #-----------------------------------------------------------------------------
415 # Haskell compiler and mkdependHS
416
417 HC              = $(FPTOOLS_TOP)/ghc/driver/ghc
418 MKDEPENDHS      = $(HC)
419
420 #
421 # The compiler proper is built with the 1.2 compiler,
422 # so when building the dependencies, we need mkdependHS
423 # for the 1.2 compiler.
424 #
425 MKDEPENDHS_1_2  = mkdependHS-1.2
426
427 #-----------------------------------------------------------------------------
428 # C compiler
429 #
430 #
431 HaveGcc         = @HaveGcc@
432 UseGcc          = YES
433 WhatGccIsCalled = gcc
434 ifeq "$(strip $(HaveGcc))" "YES"
435 ifneq "$(strip $(UseGcc))"  "YES"
436   CC    = cc
437 else
438   CC    = $(WhatGccIsCalled)
439 endif
440 endif
441
442 #-----------------------------------------------------------------------------
443 # Flex
444
445 FLEX                    = @LEX@
446 FLEX_LIB                = @LEXLIB@
447
448 #-----------------------------------------------------------------------------
449 # Other standard (ha!) Unix utilities
450
451 AR                      = @ArCmd@
452 # Yuckage: for ghc/utils/parallel -- todo: nuke this dependency!!
453 BASH                    = /usr/local/bin/bash
454 #
455 # Could be either gzip or compress
456 #
457 COMPRESS                = @CompressCmd@
458 COMPRESS_SUFFIX         = @CompressSuffix@
459
460 CONTEXT_DIFF            = @ContextDiffCmd@
461 CP                      = cp
462 CPP                     = @RAWCPP@
463 CTAGS                   = $(ETAGS)
464 RAWCPP                  = @RAWCPP@
465 GNUCPP                  = @GNUCPP@
466 INSTALL                 = @INSTALL@
467 LATEX                   = latex
468 LN_S                    = @LN_S@
469 MANMACROS               = -man
470 MSMACROS                = -ms
471 MV                      = mv
472 NROFF                   = nroff
473 PERL                    = @PerlCmd@
474 PIC                     = pic
475 PREPROCESSCMD           = $(CC) -E
476 PRINTER                 = lpr
477 RANLIB                  = @RANLIB@
478 RM                      = rm -f
479 SED                     = @SedCmd@
480 SHELL                   = /bin/sh
481 SIZE                    = size
482 STRIP                   = strip
483 TAR                     = @TarCmd@
484 #
485 # This is special to literate/, ToDo: add literate-specific
486 # configure setup to literate/.
487 #
488 TBL                     = tbl
489 TEX                     = tex
490 TGRIND                  = tgrind
491 TGRIND_HELPER           = /usr/local/lib/tgrind/tfontedpr # XXX
492 TIB                     = tib
493
494 TIME                    = @TimeCmd@
495 TROFF                   = troff
496 UNAME                   = uname
497 YACC                    = @YaccCmd@
498
499
500 #-----------------------------------------------------------------------------
501 #               FPtools support software
502
503 # Stuff from fptools/glafp-utils
504 MKDEPENDC               = $(MKDEPENDC_PREFIX)mkdependC
505 FASTMAKE                = $(FASTMAKE_PREFIX)fastmake
506 LTX                     = $(LTX_PREFIX)ltx
507 MKDIRHIER               = $(MKDIRHIER_PREFIX)mkdirhier
508 LNDIR                   = $(LNDIR_PREFIX)lndir
509 MSUB                    = $(MSUB_PREFIX)msub
510 ETAGS                   = $(ETAGS_PREFIX)etags
511 VERBATIM                = $(VERBATIM_PREFIX)verbatim
512 RUNTEST                 = $(RUNTEST_PREFIX)runstdtest
513 HAPPY                   = @HappyCmd@
514 LX                      = @LxCmd@
515
516 ifneq "$(HAPPY)" ""
517 HAPPY                   = $(HAPPY_PREFIX)happy
518 endif
519
520 #
521 # Stuff from fptools/literate
522 #
523 INFO                    = $(UTIL_PREFIX)info
524 MAKEINFO                = $(INFO_PREFIX)makeinfo
525 POSTMAKEINFO            = $(INFO_PREFIX)postmakeinfo
526 LIT2PGM                 = $(LITERATE_PREFIX)lit2pgm
527 LIT2TEXI                = $(LITERATE_PREFIX)lit2texi
528 LIT2HTML                = $(LITERATE_PREFIX)lit2html
529 LIT2LATEX               = $(LITERATE_PREFIX)lit2latex
530 MKDEPENDLIT             = $(LITERATE_PREFIX)mkdependlit
531 LIT2CHANGELOG           = $(LITERATE_PREFIX)lit2changelog
532 LIT2TEXT                = $(LITERATE_PREFIX)lit2text
533 TEXI2HTML               = $(TEXI2HTML_PREFIX)texi2html
534
535 #
536 # Stuff from fptools/ghc/utils
537 #
538 UNLIT                   = $(UNLIT_PREFIX)unlit
539 UGEN                    = $(UGEN_PREFIX)ugen
540 STAT2RESID              = $(STAT2RESID_PREFIX)stat2resid
541 HP2PS                   = $(HP2PS_PREFIX)hp2ps
542 HSCPP                   = $(HSCPP_PREFIX)hscpp
543 HSTAGS                  = $(HSTAGS_PREFIX)hstags
544
545 #
546 # Options for the compiling different `ways'. Various projects within
547 # the glorious fptools tree support building in various user-configured
548 # ways. For instance, you could set up one `way' such that the prelude
549 # libraries and hslibs all were built with the option -ffoldr-build-on.
550
551 # To configure up your own way, have a look at some of the standard ways
552 # such as profiling, and create your own set of WAY_*_OPTS defs below.
553 # After having done that, add your way string to WAYS, and after having
554 # run the configure script, the different projects will add the new way
555 # to the list of ways they support.
556 #
557
558 #
559 # IMPORTANT! The WAYS variable configures the different `ways'
560 # you want to build a project (or maybe just parts of it, as is
561 # the case for ghc/). This variable is intended set inside the
562 # project mk setup, enforcing a global fptools WAYS is a bit too
563 # much (do you *really* want to build glafp-utils the profiled-concurrent 
564 # way?)
565 #
566
567 #
568 # Definitions of the different ways:
569 #   
570 #   * their name:
571 #          - tag, e.g., p
572 #          - description, e.g., profiling
573 #   * what they mean to the driver:
574 #          - WAY_p_HC_OPTS gives the list of command-line options
575 #            to the driver.
576 #
577
578 #
579 # The ways currently defined.
580 #
581 ALL_WAYS=p t u mc mr mt mp mg 1s 2s du a b c d e f g h i j k l m n o A B
582
583 #
584 # The following ways currently have treated specially, p u t mc mt my mp mg 1s 2d du,
585 # as the driver script treats these guys specially and needs to carefully be told
586 # about the options for these. Hence, we hide the required command line options
587 # for these in the ghc/driver, as this is the only place they are needed.
588
589 # If you want to add to these default options, fill in the variables below:
590
591 WAY_p_NAME=profiling
592 WAY_p_HC_OPTS= -prof
593
594 # Way t:
595 WAY_t_NAME=ticky-ticky profiling
596 WAY_t_HC_OPTS= -ticky
597
598 # Way `u':
599 WAY_u_NAME=unregisterized (using portable C only)
600 WAY_u_HC_OPTS=
601
602 # Way `mc': concurrent
603 WAY_mc_NAME=concurrent
604 WAY_mc_HC_OPTS=-concurrent
605
606 # Way `mr': 
607 WAY_mr_NAME=profiled concurrent
608 WAY_mr_HC_OPTS=-prof -concurrent
609
610 # Way `mt': 
611 WAY_mt_NAME=ticky-ticky concurrent
612 WAY_mt_HC_OPTS=-ticky -concurrent
613
614 # Way `mp': 
615 WAY_mp_NAME=parallel
616 WAY_mp_HC_OPTS=-parallel
617
618 #
619 # Way `mg': 
620 #
621 WAY_mg_NAME=GranSim
622 WAY_mg_HC_OPTS=-gransim
623
624 #
625 # Ways for different garbage collectors
626 #
627 WAY_2s_NAME=2-space GC
628 WAY_2s_HC_OPTS=-2s
629
630 WAY_1s_NAME=1-space GC
631 WAY_1s_HC_OPTS=-1s
632
633 WAY_du_NAME=dual-mode GC
634 WAY_du_HC_OPTS=-du
635
636 #
637 # Add user-way configurations here:
638 #
639 WAY_A_NAME=
640 WAY_A_HC_OPTS=
641
642 WAY_B_NAME=
643 WAY_B_HC_OPTS=
644
645 WAY_a_NAME=
646 WAY_a_HC_OPTS=
647
648 WAY_b_NAME=
649 WAY_b_HC_OPTS=
650
651 WAY_c_NAME=
652 WAY_c_HC_OPTS=
653
654 WAY_d_NAME=
655 WAY_d_HC_OPTS=
656
657 WAY_e_NAME=
658 WAY_e_HC_OPTS=
659
660 WAY_f_NAME=
661 WAY_f_HC_OPTS=
662
663 WAY_g_NAME=
664 WAY_g_HC_OPTS=
665
666 WAY_h_NAME=
667 WAY_h_HC_OPTS=
668
669 WAY_i_NAME=
670 WAY_i_HC_OPTS=
671
672 WAY_j_NAME=
673 WAY_j_HC_OPTS=
674
675 WAY_k_NAME=
676 WAY_k_HC_OPTS=
677
678 WAY_l_NAME=
679 WAY_l_HC_OPTS=
680
681 WAY_m_NAME=
682 WAY_m_HC_OPTS=
683
684 WAY_n_NAME=
685 WAY_n_HC_OPTS=
686
687 WAY_o_NAME=
688 WAY_o_HC_OPTS=