Add configure flags for the location of GMP includes/library; fixes #4022
[ghc.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 # If you edit config.mk your changes will be spammed.
16 #
17 # - Settings in this file may be overriden by giving replacement
18 # definitions in build.mk. See build.mk.sample for a good
19 # starting point for a build.mk file.
20 #
21 # If you don't have a build.mk file then you get defaults for everything.
22 # The defaults should provide a reasonable vanilla build.
23
24 # TOP: the top of the fptools hierarchy, absolute path.
25 # On Windows this is a c:/foo/bar style path.
26 TOP = @hardtop@
27
28 include $(TOP)/mk/project.mk
29
30 ################################################################################
31 #
32 # Global configuration options
33 #
34 ################################################################################
35
36 # BootingFromHc - build GHC and the libraries from .hc files?
37 # (unregisterised only)
38 BootingFromHc = @BootingFromHc@
39
40 NO_INCLUDE_DEPS = NO
41 NO_INCLUDE_PKGDATA = NO
42
43 # Should we build latex docs?
44 LATEX_DOCS = NO
45
46 # Mac OS X deployment target (to cross-compile for older OS versions)
47 #
48 MACOSX_DEPLOYMENT_VERSION = @MACOSX_DEPLOYMENT_VERSION@
49 MACOSX_DEPLOYMENT_SDK = @MACOSX_DEPLOYMENT_SDK@
50
51 ifneq "$(MACOSX_DEPLOYMENT_VERSION)" ""
52 MACOSX_DEPLOYMENT_CC_OPTS = -mmacosx-version-min=$(MACOSX_DEPLOYMENT_VERSION) \
53 -isysroot $(MACOSX_DEPLOYMENT_SDK) \
54 --no-builtin-fprintf
55 MACOSX_DEPLOYMENT_LD_OPTS = -mmacosx-version-min=$(MACOSX_DEPLOYMENT_VERSION) \
56 -Wl,-syslibroot,$(MACOSX_DEPLOYMENT_SDK)
57 # We don't extend SRC_CC_OPTS and friends here directly, as (a) they may get
58 # overwritten in build.mk and (b) we must not use the deployment options in
59 # stage 1 or we get a linker error if the bootstrap compiler is for a more
60 # recent OS version.
61 #
62 # We need --no-builtin-fprintf, as the use of the builtin function optimisation
63 # for fprintf together with #include "PosixSource" in the RTS leads to the
64 # use of fwrite$UNIX2003 (with GCC 4.0.1 on Mac OS X 10.5.2).
65 endif
66
67 ################################################################################
68 #
69 # Variables that control how the compiler itself is built
70 #
71 ################################################################################
72
73 # The compiler used to build GHC is $(GHC). To change the actual compiler
74 # used, re-configure with --with-ghc=<path-to-ghc>.
75
76 # Extra ways in which to build the compiler (for example, you might want to
77 # build a profiled compiler so you can see where it spends its time)
78 GhcCompilerWays=
79
80 # Extra option flags to pass to the compiler that compiles the compiler
81 # (Ones that are essential are wired into compiler/Makefile)
82 # Typical options to use here:
83 #
84 # -DDEBUG include debugging code and assertions (will make the
85 # compiler slower and produce debugging output, but useful
86 # for development)
87 #
88 # -dcore-lint check the types after every pass of the compiler;
89 # a pretty strong internal check of the compiler being
90 # used to compile GHC. Useful when bootstrapping.
91 GhcHcOpts=-Rghc-timing
92
93 # Extra options added to specific stages of the compiler bootstrap.
94 # These are placed later on the command line, and may therefore
95 # override options from $(GhcHcOpts).
96 GhcStage1HcOpts=
97 GhcStage2HcOpts=-O2
98 GhcStage3HcOpts=-O2
99
100 GhcProfiled=NO
101 GhcDebugged=NO
102 GhcDynamic=NO
103 GhcLibProfiled=$(if $(filter p,$(GhcLibWays)),YES,NO)
104
105 # Do we support shared libs?
106 PlatformSupportsSharedLibs = $(if $(filter $(TARGETPLATFORM),i386-unknown-linux x86_64-unknown-linux i386-unknown-freebsd x86_64-unknown-freebsd i386-unknown-mingw32 i386-apple-darwin),YES,NO)
107
108 # Build a compiler that will build *unregisterised* libraries and
109 # binaries by default. Unregisterised code is supposed to compile and
110 # run without any support for architecture-specific assembly mangling,
111 # register assignment or tail-calls, and is therefore a good way to get
112 # started when porting GHC to new architectures.
113 #
114 # If this is set to NO, you can still use the unregisterised way
115 # (way 'u') to get unregisterised code, but the default way will be
116 # registerised.
117 #
118 # NOTE: the stage1 compiler will be a registerised binary (assuming
119 # the compiler you build with is generating registerised binaries), but
120 # the stage2 compiler will be an unregisterised binary.
121 #
122 ifneq "$(findstring $(HostArch_CPP), alpha hppa)" ""
123 GhcUnregisterised=YES
124 else
125 GhcUnregisterised=NO
126 endif
127
128 # Build a compiler with a native code generator backend
129 # (as well as a C backend)
130 #
131 # Target platforms supported:
132 # i386, powerpc
133 # AIX is not supported
134 ArchSupportsNCG=$(strip $(patsubst $(HostArch_CPP), YES, $(findstring $(HostArch_CPP), i386 x86_64 powerpc sparc)))
135 OsSupportsNCG=$(strip $(patsubst $(HostOS_CPP), YES, $(patsubst aix,,$(HostOS_CPP))))
136
137 # lazy test, because $(GhcUnregisterised) might be set in build.mk later.
138 GhcWithNativeCodeGen=$(strip\
139 $(if $(filter YESYESNO,\
140 $(OsSupportsNCG)$(ArchSupportsNCG)$(GhcUnregisterised)),YES,NO))
141
142 HaveLibDL = @HaveLibDL@
143
144 # ArchSupportsSMP should be set iff there is support for that arch in
145 # includes/stg/SMP.h
146 ArchSupportsSMP=$(strip $(patsubst $(HostArch_CPP), YES, $(findstring $(HostArch_CPP), i386 x86_64 sparc powerpc)))
147
148 # lazy test, because $(GhcUnregisterised) might be set in build.mk later.
149 GhcWithSMP=$(strip $(if $(filter YESNO, $(ArchSupportsSMP)$(GhcUnregisterised)),YES,NO))
150
151 # Whether to include GHCi in the compiler. Depends on whether the RTS linker
152 # has support for this OS/ARCH combination.
153
154 OsSupportsGHCi=$(strip $(patsubst $(HostOS_CPP), YES, $(findstring $(HostOS_CPP), mingw32 cygwin32 linux solaris2 freebsd dragonfly netbsd openbsd darwin)))
155 ArchSupportsGHCi=$(strip $(patsubst $(HostArch_CPP), YES, $(findstring $(HostArch_CPP), i386 x86_64 powerpc sparc sparc64)))
156
157 ifeq "$(OsSupportsGHCi)$(ArchSupportsGHCi)" "YESYES"
158 GhcWithInterpreter=YES
159 else
160 GhcWithInterpreter=NO
161 endif
162
163 # GhcEnableTablesNextToCode tells us whether the target architecture
164 # supports placing info tables directly before the entry code
165 # (see TABLES_NEXT_TO_CODE in the RTS). Whether we actually compile for
166 # TABLES_NEXT_TO_CODE depends on whether we're building unregisterised
167 # code or not, which may be decided by options to the compiler later.
168 ifneq "$(findstring $(TargetArch_CPP)X, ia64X powerpc64X)" ""
169 GhcEnableTablesNextToCode=NO
170 else
171 GhcEnableTablesNextToCode=YES
172 endif
173
174 # Whether to use libffi for adjustors (foreign import "wrapper") or
175 # not. If we have built-in support (rts/Adjustor.c) then we use that,
176 # otherwise we fall back on libffi, which is slightly slower.
177 ArchHasAdjustorSupport=$(strip $(if $(findstring $(HostArch_CPP),i386 x86_64 alpha powerpc ia64,),YES,NO))
178 ifeq "$(ArchHasAdjustorSupport)" "YES"
179 UseLibFFIForAdjustors=NO
180 else
181 UseLibFFIForAdjustors=YES
182 endif
183
184 # On Windows we normally want to make a relocatable bindist, to we
185 # ignore flags like libdir
186 ifeq "$(Windows)" "YES"
187 RelocatableBuild = YES
188 else
189 RelocatableBuild = NO
190 endif
191
192 # needs to be after $(RelocatableBuild) is set above
193 include $(TOP)/mk/install.mk
194
195 # When building bindists we set this to yes so that the binaries are as
196 # portable as possible.
197 BeConservative = NO
198
199 #
200 # Building various ways?
201 # (right now, empty if not).
202 BuildingParallel=$(subst mp,YES,$(filter mp,$(WAYS)))
203 BuildingGranSim=$(subst mg,YES,$(filter mg,$(WAYS)))
204
205 #------------------------------------------------------------------------------
206 # Options for Libraries
207
208 # Which directory (in libraries/) contains the integer library?
209 INTEGER_LIBRARY=integer-gmp
210
211 # We build the libraries at least the "vanilla" way (way "v")
212 GhcLibWays = v
213
214 # In addition to the normal sequential way, the default is to also build
215 # profiled prelude libraries unless we are booting from .hc files
216 ifneq "$(BootingFromHc)" "YES"
217 GhcLibWays += p
218 endif
219
220 ifeq "$(PlatformSupportsSharedLibs)" "YES"
221 GhcLibWays += dyn
222 endif
223
224 # Handy way to test whether we're building shared libs or not.
225 BuildSharedLibs=$(strip $(if $(findstring dyn,$(GhcLibWays)),YES,NO))
226
227 # In addition, the RTS is built in some further variations. Ways that
228 # make sense here:
229 #
230 # thr : threaded
231 # thr_p : threaded profiled
232 # debug : debugging (compile with -g for the C compiler, and -DDEBUG)
233 # debug_p : debugging profiled
234 # thr_debug : debugging threaded
235 # thr_debug_p : debugging threaded profiled
236 # l : event logging
237 # thr_l : threaded and event logging
238 #
239 GhcRTSWays=l
240
241 # Usually want the debug version
242 ifeq "$(BootingFromHc)" "NO"
243 GhcRTSWays += debug
244 endif
245
246 # Want the threaded versions unless we're unregisterised
247 # Defer the check until later by using $(if..), because GhcUnregisterised might
248 # be set in build.mk, which hasn't been read yet.
249 GhcRTSWays += $(if $(findstring NO, $(GhcUnregisterised)),thr thr_debug thr_l,)
250 GhcRTSWays += $(if $(findstring p, $(GhcLibWays)),$(if $(findstring NO, $(GhcUnregisterised)),thr_p,),)
251 GhcRTSWays += $(if $(findstring dyn, $(GhcLibWays)), dyn debug_dyn $(if $(findstring NO, $(GhcUnregisterised)),thr_dyn thr_debug_dyn),)
252
253 # We can only build GHCi threaded if we have a threaded RTS:
254 GhcThreaded = $(if $(findstring thr,$(GhcRTSWays)),YES,NO)
255
256 # Option flags to pass to GHC when it's compiling modules in
257 # fptools/libraries. Typically these are things like -O or
258 # -dcore-lint or -H32m. The ones that are *essential* are wired into
259 # the build system.
260 #
261 # -O(2) is pretty desirable, otherwise no inlining of prelude
262 # things (incl "+") happens when compiling with this compiler
263 #
264 # -XGenerics switches on generation of support code for
265 # derivable type classes. This is now off by default,
266 # but we switch it on for the libraries so that we generate
267 # the code in case someone importing wants it
268
269 GhcLibHcOpts=-O2 -XGenerics
270
271 # Strip local symbols from libraries? This can make the libraries smaller,
272 # but makes debugging somewhat more difficult. Doesn't work with all ld's.
273 #
274 StripLibraries=NO
275
276 # These are the URL patterns that Haddock uses to generate the "Source
277 # File" links on each page.
278 PackageSourceURL = http://darcs.haskell.org/packages/$(PACKAGE)/%{FILE}
279
280 # ----------------------------------------------------------------------------
281 # Object-file splitting
282 #
283 # Set SplitObjs=YES or NO in your build.mk
284 #
285 # Don't use -split-objs in in GhcLibHcOpts, because the build
286 # system needs to do other special magic if you are
287 # doing object-file splitting
288
289 ArchSupportsSplitObjs=$(strip $(if $(filter $(TargetArch_CPP),i386 x86_64 powerpc sparc),YES,NO))
290
291 # lazy test, so that $(GhcUnregisterised) can be set in build.mk
292 SupportsSplitObjs=$(strip $(if $(filter YES,$(ArchSupportsSplitObjs)),\
293 $(if $(filter NO,$(BootingFromHc)),\
294 $(if $(filter NO,$(GhcUnregisterised)),\
295 YES,\
296 NO),\
297 NO),\
298 NO))
299
300 # By default, enable SplitObjs for the libraries if this build supports it
301 SplitObjs=$(SupportsSplitObjs)
302
303 # ----------------------------------------------------------------------------
304 # Package-related things
305
306 # Extra packages to add to the build, in dependency order
307 EXTRA_PACKAGES =
308
309 # Whether to install $(EXTRA_PACKAGES)
310 InstallExtraPackages = NO
311
312 # Run "ghc-pkg check" on each package
313 CHECK_PACKAGES = NO
314
315 # ----------------------------------------------------------------------------
316 # Options for GHC's RTS
317
318 # For an optimised RTS (you probably don't want to change these; we build
319 # a debugging RTS by default now. Use -debug to get it).
320 GhcRtsHcOpts=-optc-O2
321 GhcRtsCcOpts=-fomit-frame-pointer
322
323 # Include the front panel code? Needs GTK+.
324 GhcRtsWithFrontPanel = NO
325
326 # Include support for CPU performance counters via the PAPI library in the RTS?
327 # (PAPI: http://icl.cs.utk.edu/papi/)
328 GhcRtsWithPapi = NO
329 PapiLibDir=
330 PapiIncludeDir=
331
332 ################################################################################
333 #
334 # Paths (see paths.mk)
335 #
336 ################################################################################
337
338 # Directory used by GHC (and possibly other tools) for storing
339 # temporary files. If your TMPDIR isn't big enough, either override
340 # this in build.mk or set your environment variable "TMPDIR" to point
341 # to somewhere with more space. (TMPDIR=. is a good choice).
342
343 # DEFAULT_TMPDIR isn't called TMPDIR because GNU make tends to
344 # override an environment variable with the value of the make variable
345 # of the same name (if it exists) when executing sub-processes, so
346 # setting the TMPDIR env var would have no effect in the build tree.
347
348 DEFAULT_TMPDIR = /tmp
349 ifeq "$(TARGETPLATFORM)" "i386-unknown-cygwin32"
350 DEFAULT_TMPDIR = /C/TEMP
351 endif
352 ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
353 DEFAULT_TMPDIR = /C/TEMP
354 endif
355
356 BIN_DIST_NAME = ghc-$(ProjectVersion)
357 BIN_DIST_PREP_DIR = bindistprep/$(BIN_DIST_NAME)
358 BIN_DIST_PREP_TAR = bindistprep/$(BIN_DIST_NAME)-$(TARGETPLATFORM).tar
359 BIN_DIST_PREP_TAR_BZ2 = $(BIN_DIST_PREP_TAR).bz2
360 BIN_DIST_TAR_BZ2 = $(BIN_DIST_NAME)-$(TARGETPLATFORM).tar.bz2
361 BIN_DIST_LIST = bindist-list
362
363 WINDOWS_INSTALLER_BASE = ghc-$(ProjectVersion)-i386-windows
364 WINDOWS_INSTALLER = $(WINDOWS_INSTALLER_BASE)$(exeext)
365
366 # -----------------------------------------------------------------------------
367 # Utilities programs: flags
368
369 # If you want to give any standard flags to pretty much any utility
370 # (see utils.mk for a complete list), by adding a line here
371 #
372 # SRC_P_OPTS += ...
373 #
374 # where P is the utility. For example, to add -O to all Haskell
375 # compilations,
376 #
377 # SRC_HC_OPTS += -O
378
379 SRC_HC_OPTS += -H32m -O
380
381 # These flags make flex 8-bit
382 SRC_FLEX_OPTS += -8
383
384 # Default fptools options for dllwrap.
385 SRC_BLD_DLL_OPTS += --target=i386-mingw32
386
387 # Flags for CPP when running GreenCard on .pgc files
388 GC_CPP_OPTS += -P -E -x c -traditional -D__GLASGOW_HASKELL__
389
390
391 # -----------------------------------------------------------------------------
392 # Names of programs in the GHC tree
393 #
394 # xxx_PGM the name of an executable, without the path
395 # xxx the executable relative to the current dir
396
397 GHC_UNLIT_PGM = unlit$(exeext)
398 GHC_HP2PS_PGM = hp2ps$(exeext)
399 GHC_GHCTAGS_PGM = ghctags$(exeext)
400 GHC_HSC2HS_PGM = hsc2hs$(exeext)
401 GHC_TOUCHY_PGM = touchy$(exeext)
402 GHC_MANGLER_PGM = ghc-asm
403 GHC_SPLIT_PGM = ghc-split
404 GHC_SYSMAN_PGM = SysMan
405 GHC_GENPRIMOP_PGM = genprimopcode$(exeext)
406 GHC_GENAPPLY_PGM = genapply$(exeext)
407 GHC_CABAL_PGM = ghc-cabal$(exeext)
408 GHC_PKG_PGM = ghc-pkg$(exeext)
409 GHC_LTX_PGM = ltx$(exeext)
410 GHC_MKDIRHIER_PGM = mkdirhier
411 GHC_LNDIR_PGM = lndir
412 GHC_DUMMY_GHC_PGM = dummy-ghc$(exeext)
413
414 ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
415 GHC_CP = "xcopy /y"
416 GHC_PERL = perl
417 else
418 GHC_CP = $(CP)
419 GHC_PERL = $(PERL)
420 endif
421
422 HP2PS = $(GHC_HP2PS_DIR)/$(GHC_HP2PS_PGM)
423 MANGLER = $(INPLACE_LIB)/$(GHC_MANGLER_PGM)
424 SPLIT = $(INPLACE_LIB)/$(GHC_SPLIT_PGM)
425 SYSMAN = $(GHC_SYSMAN_DIR)/$(GHC_SYSMAN_PGM)
426 LTX = $(GHC_LTX_DIR)/$(GHC_LTX_PGM)
427 LNDIR = $(GHC_LNDIR_DIR)/$(GHC_LNDIR_PGM)
428
429 UNLIT = $(INPLACE_LIB)/$(GHC_UNLIT_PGM)
430 TOUCHY = $(INPLACE_LIB)/$(GHC_TOUCHY_PGM)
431 MKDIRHIER = $(INPLACE_BIN)/$(GHC_MKDIRHIER_PGM)
432 GHC_CABAL_INPLACE = $(INPLACE_BIN)/$(GHC_CABAL_PGM)
433 GENAPPLY_INPLACE = $(INPLACE_BIN)/$(GHC_GENAPPLY_PGM)
434 GHC_PKG_INPLACE = $(INPLACE_BIN)/$(GHC_PKG_PGM)
435 GHCTAGS_INPLACE = $(INPLACE_BIN)/$(GHC_GHCTAGS_PGM)
436 HSC2HS_INPLACE = $(INPLACE_BIN)/$(GHC_HSC2HS_PGM)
437 GENPRIMOP_INPLACE = $(INPLACE_BIN)/$(GHC_GENPRIMOP_PGM)
438 DUMMY_GHC_INPLACE = $(INPLACE_BIN)/$(GHC_DUMMY_GHC_PGM)
439
440 GENERATED_FILE = chmod a-w
441 EXECUTABLE_FILE = chmod +x
442
443 #-----------------------------------------------------------------------------
444 # Haskell compilers and mkdependHS
445
446 # $(GHC), $(HBC) and $(NHC) point to installed versions of the relevant
447 # compilers, if available.
448 #
449 # $(HC) is a generic Haskell 98 compiler, set to $(GHC) by default.
450 # $(MKDEPENDHS) is the Haskell dependency generator (ghc -M).
451 #
452 # NOTE: Don't override $(GHC) in build.mk, use configure --with-ghc instead
453 # (because the version numbers have to be calculated).
454
455 GHC := @WithGhc@
456 # If we have a make dependency on c:/ghc/ghc, and the file is actually
457 # called c:/ghc/ghc.exe, then make will think that ghc doesn't exist
458 # and that it doesn't know how to create it.
459 ifneq "$(wildcard $(GHC).exe)" ""
460 GHC := $(GHC).exe
461 endif
462
463 GhcDir = $(dir $(GHC))
464
465 # Set to YES if $(GHC) has the editline package installed
466 GhcHasEditline = @GhcHasEditline@
467
468 HBC = @HBC@
469 NHC = @NHC@
470
471 # Sometimes we want to invoke ghc from the build tree in different
472 # places (eg. it's handy to have a nofib & a ghc build in the same
473 # tree). We can refer to "this ghc" as $(GHC_INPLACE):
474
475 GHC_INPLACE = $(GHC_STAGE1)
476
477 GHC_STAGE0_ABS = $(GHC)
478 GHC_STAGE1_ABS = $(TOP)/$(INPLACE_BIN)/ghc-stage1$(exeext)
479 GHC_STAGE2_ABS = $(TOP)/$(INPLACE_BIN)/ghc-stage2$(exeext)
480 GHC_STAGE3_ABS = $(TOP)/$(INPLACE_BIN)/ghc-stage3$(exeext)
481
482 GHC_STAGE0 = $(GHC)
483 GHC_STAGE1 = $(INPLACE_BIN)/ghc-stage1$(exeext)
484 GHC_STAGE2 = $(INPLACE_BIN)/ghc-stage2$(exeext)
485 GHC_STAGE3 = $(INPLACE_BIN)/ghc-stage3$(exeext)
486
487 # Install stage 2 by default, can be changed to 3
488 INSTALL_GHC_STAGE=2
489
490 BOOTSTRAPPING_CONF = libraries/bootstrapping.conf
491
492 INPLACE_PACKAGE_CONF = $(INPLACE_LIB)/package.conf.d
493
494 GhcVersion = @GhcVersion@
495 GhcPatchLevel = @GhcPatchLevel@
496 GhcMajVersion = @GhcMajVersion@
497 GhcMinVersion = @GhcMinVersion@
498
499 # Keep this in sync with the variables in package-config.mk
500 ghc_ge_6102 = @ghc_ge_6102@
501 ghc_ge_611 = @ghc_ge_611@
502 ghc_ge_613 = @ghc_ge_613@
503
504 # Canonicalised ghc version number, used for easy (integer) version
505 # comparisons. We must expand $(GhcMinVersion) to two digits by
506 # adding a leading zero if necessary:
507 ifneq "$(findstring $(GhcMinVersion), 0 1 2 3 4 5 6 7 8 9)" ""
508 GhcCanonVersion = $(GhcMajVersion)0$(GhcMinVersion)
509 else
510 GhcCanonVersion = $(GhcMajVersion)$(GhcMinVersion)
511 endif
512
513 #-----------------------------------------------------------------------------
514 # C compiler
515 #
516 # NB. Don't override $(WhatGccIsCalled) using build.mk, re-configure using
517 # the flag --with-gcc=<blah> instead. The reason is that the configure script
518 # needs to know which gcc you're using in order to perform its tests.
519
520 HaveGcc = @HaveGcc@
521 UseGcc = YES
522 WhatGccIsCalled = @WhatGccIsCalled@
523 GccVersion = @GccVersion@
524 GccLT34 = @GccLT34@
525 ifeq "$(strip $(HaveGcc))" "YES"
526 ifneq "$(strip $(UseGcc))" "YES"
527 CC = cc
528 else
529 CC = $(WhatGccIsCalled)
530 endif
531 endif
532
533 # C compiler and linker flags from configure (e.g. -m<blah> to select
534 # correct C compiler backend).
535 CONF_CC_OPTS = @CONF_CC_OPTS@
536 CONF_LD_OPTS = @CONF_LD_OPTS@
537
538 ifeq "$(TARGETPLATFORM)" "ia64-unknown-linux"
539 CONF_CC_OPTS += -G0
540 endif
541
542 SRC_HSC2HS_OPTS += $(addprefix --cflag=,$(filter-out -O,$(SRC_CC_OPTS) $(CONF_CC_OPTS)))
543 SRC_HSC2HS_OPTS += $(foreach d,$(GMP_INCLUDE_DIRS),-I$(d))
544
545 #-----------------------------------------------------------------------------
546 # Mingwex Library
547 #
548 HaveLibMingwEx = @HaveLibMingwEx@
549 DLLTOOL = inplace/mingw/bin/dlltool.exe
550
551 #-----------------------------------------------------------------------------
552 # Flex (currently unused, could be moved to glafp-utils)
553
554 # FLEX = @LEX@
555 # Don't bother with -lfl, we define our own yywrap()s anyway.
556 # FLEX_LIB =
557 #WAS:FLEX_LIB = @LEXLIB@
558
559 #-----------------------------------------------------------------------------
560 # Other standard (ha!) Unix utilities
561
562 AR = @ArCmd@
563 AR_OPTS = @ArArgs@
564 ArSupportsInput = @ArSupportsInput@
565 ArSupportsAtFile = @ArSupportsAtFile@
566 # Yuckage: for ghc/utils/parallel -- todo: nuke this dependency!!
567 BASH = /usr/local/bin/bash
568
569 CONTEXT_DIFF = @ContextDiffCmd@
570 CP = cp
571 # It's not easy to separate the CPP program from its flags, as
572 # AC_PROG_CPP defines CPP as "/usr/bin/gcc -E"
573 CPP = @CPP@ @CPPFLAGS@
574 CTAGS = $(ETAGS)
575 #
576 # RAWCPP_FLAGS are the flags to give to cpp (viz, gcc -E) to persuade it to
577 # behave plausibly on Haskell sources.
578 #
579 RAWCPP_FLAGS = -undef -traditional
580 FIND = @FindCmd@
581 SORT = @SortCmd@
582 INSTALL = @INSTALL@
583 #
584 # Sigh - the autoconf macro for INSTALL will subst a relative path to the fallback
585 # install-sh script (if chosen). This not terribly useful to us, so we convert
586 # it into an abs. path.
587 #
588 INSTALL := $(subst .././install-sh,$(TOP)/install-sh,$(INSTALL))
589 LATEX = latex
590 PDFLATEX = pdflatex
591 BIBTEX = bibtex
592 HEVEA = hevea
593 HACHA = hacha
594 LN_S = @LN_S@
595 MANMACROS = -man
596 MSMACROS = -ms
597 MV = mv
598 NROFF = nroff
599 PERL = @PerlCmd@
600 PYTHON = @PythonCmd@
601 PIC = pic
602 PREPROCESSCMD = $(CC) -E
603 RANLIB = @RANLIB@
604 SED = @SedCmd@
605 TR = tr
606 SHELL = /bin/sh
607
608 HaveDtrace = @HaveDtrace@
609 DTRACE = @DtraceCmd@
610
611 LD = @LdCmd@
612 NM = @NmCmd@
613
614 # Some ld's support the -x flag and some don't, so the configure
615 # script detects which we have and sets LdXFlag to "-x" or ""
616 # respectively.
617 LD_X = @LdXFlag@
618
619 # GNU ld supports input via a linker script, which is useful to avoid
620 # overflowing command-line length limits.
621 LdIsGNULd = @LdIsGNULd@
622
623 # On MSYS, building with SplitObjs=YES fails with
624 # ar: Bad file number
625 # see #3201. We need to specify a smaller max command-line size
626 # to work around it. 32767 doesn't work; 30000 does.
627 XARGS = xargs
628 ifeq "$(Windows)" "YES"
629 XARGS_OPTS = -s 30000
630 endif
631
632 #
633 # In emergency situations, REAL_SHELL is used to perform shell commands
634 # from within the ghc driver script, by scribbling the command line to
635 # a temp file and then having $(REAL_SHELL) execute it.
636 #
637 # The reason for having to do this is that overly long command lines
638 # cause unnecessary trouble with some shells (e.g., /bin/sh on Solaris
639 # 2.5.1), which is why this backdoor is provided. The situation of overly
640 # long command lines is either encountered while doing `make boot' in compiler/,
641 # or when linking the compiler binary (`hsc').
642 #
643 # We do not use SHELL to execute long commands, as `make' will more than likely
644 # override whatever setting you have in your environment while executing.
645
646 # By default, REAL_SHELL is set equal to SHELL, which is not really a smart move
647 # as it is SHELL that will show up the bogosity in the first place, but setting
648 # it to anything else isn't really portable.
649 #
650 # ====> If long command lines cause you trouble, invoke `ghc' (via `make' or otherwise)
651 # with REAL_SHELL set to something else than /bin/sh, for instance, your favourite
652 # command shell.
653 #
654 REAL_SHELL=$(SHELL)
655 SIZE = size
656 STRIP = strip
657 PATCH = @PatchCmd@
658 TAR = @TarCmd@
659 BZIP2 = bzip2
660 GZIP = gzip
661 ZIP = zip
662
663 HSCOLOUR = @HSCOLOUR@
664
665 #
666 # This is special to literate/, ToDo: add literate-specific
667 # configure setup to literate/.
668 #
669 TBL = tbl
670 TEX = tex
671 TGRIND = tgrind
672 TGRIND_HELPER = /usr/local/lib/tgrind/tfontedpr # XXX
673 TIB = tib
674
675 TIME = @TimeCmd@
676 TROFF = troff
677 UNAME = uname
678
679 # GTK+
680 GTK_CONFIG = @GTK_CONFIG@
681
682 # Set this if you want to use Inno Setup to build a Windows installer
683 # when you make a bindist
684 ISCC =
685
686 #-----------------------------------------------------------------------------
687 # DocBook XML stuff
688
689 BUILD_DOCBOOK_HTML = @BUILD_DOCBOOK_HTML@
690 BUILD_DOCBOOK_PS = @BUILD_DOCBOOK_PS@
691 BUILD_DOCBOOK_PDF = @BUILD_DOCBOOK_PDF@
692 DBLATEX = @DblatexCmd@
693 XSLTPROC = @XsltprocCmd@
694 XMLLINT = @XmllintCmd@
695 HAVE_DOCBOOK_XSL = @HAVE_DOCBOOK_XSL@
696 XSLTPROC_HTML_STYLESHEET = http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl
697 XSLTPROC_LABEL_OPTS = --stringparam toc.section.depth 3 \
698 --stringparam section.autolabel 1 \
699 --stringparam section.label.includes.component.label 1
700
701 #-----------------------------------------------------------------------------
702 # FPtools support software
703
704 BLD_DLL = dllwrap
705
706 #
707 # ghc-pkg
708 #
709 GHC_PKG = @GhcPkgCmd@
710
711 #
712 # GreenCard
713 #
714 GREENCARD = @GreenCardCmd@
715 GREENCARD_VERSION = @GreenCardVersion@
716
717 #
718 # Happy
719 #
720 HAPPY = @HappyCmd@
721 HAPPY_VERSION = @HappyVersion@
722 #
723 # Options to pass to Happy when we're going to compile the output with GHC
724 #
725 SRC_HAPPY_OPTS = -agc --strict
726
727 # Temp. to work around performance problems in the HEAD around 8/12/2003,
728 # A Happy compiled with this compiler needs more stack.
729 SRC_HAPPY_OPTS += +RTS -K2m -RTS
730
731 #
732 # Alex
733 #
734 ALEX = @AlexCmd@
735 ALEX_VERSION = @AlexVersion@
736 #
737 # Options to pass to Happy when we're going to compile the output with GHC
738 #
739 SRC_ALEX_OPTS = -g
740
741 HSTAGS = @HstagsCmd@
742
743 # Should we build haddock docs?
744 HADDOCK_DOCS = $(GhcWithInterpreter)
745 # And HsColour the sources?
746 ifeq "$(HSCOLOUR)" ""
747 HSCOLOUR_SRCS = NO
748 else
749 HSCOLOUR_SRCS = YES
750 endif
751
752 ################################################################################
753 #
754 # 31-bit-Int Core files
755 #
756 ################################################################################
757
758 #
759 # It is possible to configure the compiler and prelude to support 31-bit
760 # integers, suitable for a back-end and RTS using a tag bit on a 32-bit
761 # architecture. Currently the only useful output from this option is external Core
762 # files. The following additions to your build.mk will produce the
763 # 31-bit core output. Note that this is *not* just a library "way"; the
764 # compiler must be built a special way too.
765
766 # GhcCppOpts +=-DWORD_SIZE_IN_BITS=31
767 # GhcLibHcOpts +=-fext-core -fno-code -DWORD_SIZE_IN_BITS=31
768 # GhcLibCppOpts += -DWORD_SIZE_IN_BITS=31
769 # SplitObjs=NO
770
771 ################################################################################
772 #
773 # Library configure arguments
774 #
775 ################################################################################
776
777 CONFIGURE_ARGS = @CONFIGURE_ARGS@
778
779 ################################################################################
780 #
781 # To be passed to sub-builds
782 #
783 ################################################################################
784
785 ICONV_INCLUDE_DIRS = @ICONV_INCLUDE_DIRS@
786 ICONV_LIB_DIRS = @ICONV_LIB_DIRS@
787
788 GMP_INCLUDE_DIRS = @GMP_INCLUDE_DIRS@
789 GMP_LIB_DIRS = @GMP_LIB_DIRS@