| 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 | # These options modify whether or not a built compiler for a bootstrap |
|---|
| 101 | # stage defaults to using the new code generation path. The new |
|---|
| 102 | # code generation path is a bit slower, so for development just |
|---|
| 103 | # GhcStage2DefaultNewCodegen=YES, but it's also a good idea to try |
|---|
| 104 | # building all libraries and the stage2 compiler with the |
|---|
| 105 | # new code generator, which involves GhcStage1DefaultNewCodegen=YES. |
|---|
| 106 | GhcStage1DefaultNewCodegen=NO |
|---|
| 107 | GhcStage2DefaultNewCodegen=NO |
|---|
| 108 | GhcStage3DefaultNewCodegen=NO |
|---|
| 109 | |
|---|
| 110 | GhcDebugged=NO |
|---|
| 111 | GhcDynamic=NO |
|---|
| 112 | |
|---|
| 113 | # GhcProfiled=YES means compile a profiled stage-2 compiler |
|---|
| 114 | GhcProfiled=NO |
|---|
| 115 | |
|---|
| 116 | # Do we support shared libs? |
|---|
| 117 | SharedLibsPlatformList = \ |
|---|
| 118 | i386-unknown-linux x86_64-unknown-linux \ |
|---|
| 119 | i386-unknown-freebsd x86_64-unknown-freebsd \ |
|---|
| 120 | i386-unknown-openbsd x86_64-unknown-openbsd \ |
|---|
| 121 | i386-unknown-netbsd x86_64-unknown-netbsd \ |
|---|
| 122 | i386-unknown-mingw32 x86_64-unknown-mingw32 \ |
|---|
| 123 | i386-apple-darwin x86_64-apple-darwin powerpc-apple-darwin |
|---|
| 124 | |
|---|
| 125 | ifeq "$(SOLARIS_BROKEN_SHLD)" "NO" |
|---|
| 126 | SharedLibsPlatformList += i386-unknown-solaris2 |
|---|
| 127 | endif |
|---|
| 128 | |
|---|
| 129 | PlatformSupportsSharedLibs = $(if $(filter $(TARGETPLATFORM),\ |
|---|
| 130 | $(SharedLibsPlatformList)),YES,NO) |
|---|
| 131 | |
|---|
| 132 | # Build a compiler that will build *unregisterised* libraries and |
|---|
| 133 | # binaries by default. Unregisterised code is supposed to compile and |
|---|
| 134 | # run without any support for architecture-specific assembly mangling, |
|---|
| 135 | # register assignment or tail-calls, and is therefore a good way to get |
|---|
| 136 | # started when porting GHC to new architectures. |
|---|
| 137 | # |
|---|
| 138 | # NOTE: the stage1 compiler will be a registerised binary (assuming |
|---|
| 139 | # the compiler you build with is generating registerised binaries), but |
|---|
| 140 | # the stage2 compiler will be an unregisterised binary. |
|---|
| 141 | # |
|---|
| 142 | ifneq "$(findstring $(TargetArch_CPP), i386 x86_64 powerpc arm)" "" |
|---|
| 143 | GhcUnregisterised=NO |
|---|
| 144 | else |
|---|
| 145 | GhcUnregisterised=YES |
|---|
| 146 | endif |
|---|
| 147 | |
|---|
| 148 | # Build a compiler with a native code generator backend |
|---|
| 149 | # (as well as a C backend) |
|---|
| 150 | # |
|---|
| 151 | # Target platforms supported: |
|---|
| 152 | # i386, powerpc |
|---|
| 153 | # AIX is not supported |
|---|
| 154 | ArchSupportsNCG=$(strip $(patsubst $(TargetArch_CPP), YES, $(findstring $(TargetArch_CPP), i386 x86_64 powerpc sparc))) |
|---|
| 155 | OsSupportsNCG=$(strip $(patsubst $(TargetOS_CPP), YES, $(patsubst aix,,$(TargetOS_CPP)))) |
|---|
| 156 | |
|---|
| 157 | # lazy test, because $(GhcUnregisterised) might be set in build.mk later. |
|---|
| 158 | GhcWithNativeCodeGen=$(strip\ |
|---|
| 159 | $(if $(filter YESYESNO,\ |
|---|
| 160 | $(OsSupportsNCG)$(ArchSupportsNCG)$(GhcUnregisterised)),YES,NO)) |
|---|
| 161 | |
|---|
| 162 | HaveLibDL = @HaveLibDL@ |
|---|
| 163 | |
|---|
| 164 | # ArchSupportsSMP should be set iff there is support for that arch in |
|---|
| 165 | # includes/stg/SMP.h |
|---|
| 166 | ArchSupportsSMP=$(strip $(patsubst $(TargetArch_CPP), YES, $(findstring $(TargetArch_CPP), i386 x86_64 sparc powerpc arm))) |
|---|
| 167 | |
|---|
| 168 | # lazy test, because $(GhcUnregisterised) might be set in build.mk later. |
|---|
| 169 | GhcWithSMP=$(strip $(if $(filter YESNO, $(ArchSupportsSMP)$(GhcUnregisterised)),YES,NO)) |
|---|
| 170 | |
|---|
| 171 | # Whether to include GHCi in the compiler. Depends on whether the RTS linker |
|---|
| 172 | # has support for this OS/ARCH combination. |
|---|
| 173 | |
|---|
| 174 | OsSupportsGHCi=$(strip $(patsubst $(TargetOS_CPP), YES, $(findstring $(TargetOS_CPP), mingw32 cygwin32 linux solaris2 freebsd dragonfly netbsd openbsd darwin kfreebsdgnu))) |
|---|
| 175 | ArchSupportsGHCi=$(strip $(patsubst $(TargetArch_CPP), YES, $(findstring $(TargetArch_CPP), i386 x86_64 powerpc sparc sparc64 arm))) |
|---|
| 176 | |
|---|
| 177 | ifeq "$(OsSupportsGHCi)$(ArchSupportsGHCi)" "YESYES" |
|---|
| 178 | GhcWithInterpreter=YES |
|---|
| 179 | else |
|---|
| 180 | GhcWithInterpreter=NO |
|---|
| 181 | endif |
|---|
| 182 | |
|---|
| 183 | # GhcEnableTablesNextToCode tells us whether the target architecture |
|---|
| 184 | # supports placing info tables directly before the entry code |
|---|
| 185 | # (see TABLES_NEXT_TO_CODE in the RTS). Whether we actually compile for |
|---|
| 186 | # TABLES_NEXT_TO_CODE depends on whether we're building unregisterised |
|---|
| 187 | # code or not, which may be decided by options to the compiler later. |
|---|
| 188 | ifneq "$(findstring $(TargetArch_CPP)X, ia64X powerpc64X)" "" |
|---|
| 189 | GhcEnableTablesNextToCode=NO |
|---|
| 190 | else |
|---|
| 191 | GhcEnableTablesNextToCode=YES |
|---|
| 192 | endif |
|---|
| 193 | |
|---|
| 194 | # Whether to use libffi for adjustors (foreign import "wrapper") or |
|---|
| 195 | # not. If we have built-in support (rts/Adjustor.c) then we use that, |
|---|
| 196 | # otherwise we fall back on libffi, which is slightly slower. |
|---|
| 197 | ArchHasAdjustorSupport = $(if $(findstring $(TargetArch_CPP),i386 x86_64),YES,NO) |
|---|
| 198 | ifeq "$(ArchHasAdjustorSupport)" "YES" |
|---|
| 199 | UseLibFFIForAdjustors=NO |
|---|
| 200 | else |
|---|
| 201 | UseLibFFIForAdjustors=YES |
|---|
| 202 | endif |
|---|
| 203 | |
|---|
| 204 | # On Windows we normally want to make a relocatable bindist, to we |
|---|
| 205 | # ignore flags like libdir |
|---|
| 206 | ifeq "$(Windows)" "YES" |
|---|
| 207 | RelocatableBuild = YES |
|---|
| 208 | else |
|---|
| 209 | RelocatableBuild = NO |
|---|
| 210 | endif |
|---|
| 211 | |
|---|
| 212 | # needs to be after $(RelocatableBuild) is set above |
|---|
| 213 | include $(TOP)/mk/install.mk |
|---|
| 214 | |
|---|
| 215 | # When building bindists we set this to yes so that the binaries are as |
|---|
| 216 | # portable as possible. |
|---|
| 217 | BeConservative = NO |
|---|
| 218 | |
|---|
| 219 | # |
|---|
| 220 | # Building various ways? |
|---|
| 221 | # (right now, empty if not). |
|---|
| 222 | BuildingParallel=$(subst mp,YES,$(filter mp,$(WAYS))) |
|---|
| 223 | BuildingGranSim=$(subst mg,YES,$(filter mg,$(WAYS))) |
|---|
| 224 | |
|---|
| 225 | #------------------------------------------------------------------------------ |
|---|
| 226 | # Options for Libraries |
|---|
| 227 | |
|---|
| 228 | # Which directory (in libraries/) contains the integer library? |
|---|
| 229 | INTEGER_LIBRARY=integer-gmp |
|---|
| 230 | |
|---|
| 231 | # We build the libraries at least the "vanilla" way (way "v") |
|---|
| 232 | GhcLibWays = v |
|---|
| 233 | |
|---|
| 234 | # In addition to the normal sequential way, the default is to also build |
|---|
| 235 | # profiled prelude libraries unless we are booting from .hc files |
|---|
| 236 | ifneq "$(BootingFromHc)" "YES" |
|---|
| 237 | GhcLibWays += p |
|---|
| 238 | endif |
|---|
| 239 | |
|---|
| 240 | ifeq "$(PlatformSupportsSharedLibs)" "YES" |
|---|
| 241 | GhcLibWays += dyn |
|---|
| 242 | endif |
|---|
| 243 | |
|---|
| 244 | # Handy way to test whether we're building shared libs or not. |
|---|
| 245 | BuildSharedLibs=$(strip $(if $(findstring dyn,$(GhcLibWays)),YES,NO)) |
|---|
| 246 | |
|---|
| 247 | # In addition, the RTS is built in some further variations. Ways that |
|---|
| 248 | # make sense here: |
|---|
| 249 | # |
|---|
| 250 | # thr : threaded |
|---|
| 251 | # thr_p : threaded profiled |
|---|
| 252 | # debug : debugging (compile with -g for the C compiler, and -DDEBUG) |
|---|
| 253 | # debug_p : debugging profiled |
|---|
| 254 | # thr_debug : debugging threaded |
|---|
| 255 | # thr_debug_p : debugging threaded profiled |
|---|
| 256 | # l : event logging |
|---|
| 257 | # thr_l : threaded and event logging |
|---|
| 258 | # |
|---|
| 259 | GhcRTSWays=l |
|---|
| 260 | |
|---|
| 261 | # Usually want the debug version |
|---|
| 262 | ifeq "$(BootingFromHc)" "NO" |
|---|
| 263 | GhcRTSWays += debug |
|---|
| 264 | endif |
|---|
| 265 | |
|---|
| 266 | # We always have the threaded versions, but note that SMP support may be disabled |
|---|
| 267 | # (see GhcWithSMP). |
|---|
| 268 | GhcRTSWays += thr thr_debug thr_l |
|---|
| 269 | GhcRTSWays += $(if $(findstring p, $(GhcLibWays)),thr_p,) |
|---|
| 270 | GhcRTSWays += $(if $(findstring dyn, $(GhcLibWays)),dyn debug_dyn thr_dyn thr_debug_dyn,) |
|---|
| 271 | |
|---|
| 272 | # We can only build GHCi threaded if we have a threaded RTS: |
|---|
| 273 | GhcThreaded = $(if $(findstring thr,$(GhcRTSWays)),YES,NO) |
|---|
| 274 | |
|---|
| 275 | # Option flags to pass to GHC when it's compiling modules in |
|---|
| 276 | # fptools/libraries. Typically these are things like -O or |
|---|
| 277 | # -dcore-lint or -H32m. The ones that are *essential* are wired into |
|---|
| 278 | # the build system. |
|---|
| 279 | # |
|---|
| 280 | # -O(2) is pretty desirable, otherwise no inlining of prelude |
|---|
| 281 | # things (incl "+") happens when compiling with this compiler |
|---|
| 282 | |
|---|
| 283 | GhcLibHcOpts=-O2 |
|---|
| 284 | |
|---|
| 285 | # Strip local symbols from libraries? This can make the libraries smaller, |
|---|
| 286 | # but makes debugging somewhat more difficult. Doesn't work with all ld's. |
|---|
| 287 | # |
|---|
| 288 | StripLibraries=NO |
|---|
| 289 | |
|---|
| 290 | # These are the URL patterns that Haddock uses to generate the "Source |
|---|
| 291 | # File" links on each page. |
|---|
| 292 | PackageSourceURL = http://darcs.haskell.org/packages/$(PACKAGE)/%{FILE} |
|---|
| 293 | |
|---|
| 294 | # ---------------------------------------------------------------------------- |
|---|
| 295 | # Object-file splitting |
|---|
| 296 | # |
|---|
| 297 | # Set SplitObjs=YES or NO in your build.mk |
|---|
| 298 | # |
|---|
| 299 | # Don't use -split-objs in in GhcLibHcOpts, because the build |
|---|
| 300 | # system needs to do other special magic if you are |
|---|
| 301 | # doing object-file splitting |
|---|
| 302 | |
|---|
| 303 | ArchSupportsSplitObjs=$(strip $(if $(filter $(TargetArch_CPP),i386 x86_64 powerpc sparc),YES,NO)) |
|---|
| 304 | OsSupportsSplitObjs=$(strip $(if $(filter $(TargetOS_CPP),mingw32 cygwin32 linux darwin solaris2 freebsd dragonfly netbsd openbsd),YES,NO)) |
|---|
| 305 | SplitObjsBroken = @SplitObjsBroken@ |
|---|
| 306 | |
|---|
| 307 | # lazy test, so that $(GhcUnregisterised) can be set in build.mk |
|---|
| 308 | SupportsSplitObjs=$(strip \ |
|---|
| 309 | $(if $(and $(filter YES,$(ArchSupportsSplitObjs)),\ |
|---|
| 310 | $(filter YES,$(OsSupportsSplitObjs)),\ |
|---|
| 311 | $(filter NO,$(SplitObjsBroken)),\ |
|---|
| 312 | $(filter NO,$(BootingFromHc)),\ |
|---|
| 313 | $(filter NO,$(GhcUnregisterised))),\ |
|---|
| 314 | YES,NO)) |
|---|
| 315 | |
|---|
| 316 | # By default, enable SplitObjs for the libraries if this build supports it |
|---|
| 317 | SplitObjs=$(SupportsSplitObjs) |
|---|
| 318 | |
|---|
| 319 | # ---------------------------------------------------------------------------- |
|---|
| 320 | # Package-related things |
|---|
| 321 | |
|---|
| 322 | # Extra packages to add to the build, in dependency order |
|---|
| 323 | EXTRA_PACKAGES = |
|---|
| 324 | |
|---|
| 325 | # Whether to install $(EXTRA_PACKAGES) |
|---|
| 326 | InstallExtraPackages = NO |
|---|
| 327 | |
|---|
| 328 | # Run "ghc-pkg check" on each package |
|---|
| 329 | CHECK_PACKAGES = NO |
|---|
| 330 | |
|---|
| 331 | # ---------------------------------------------------------------------------- |
|---|
| 332 | |
|---|
| 333 | # There are a number of things which technically depend on GHC (e.g. if |
|---|
| 334 | # ghc changes then Haskell files may be compiled differently, or Cabal |
|---|
| 335 | # packages may be configured differently). By default we therefore |
|---|
| 336 | # have dependencies on the compiler executable. |
|---|
| 337 | |
|---|
| 338 | # However, in practice, having a dependency on GHC is just a pain: We |
|---|
| 339 | # normally don't want to spend time recompiling other things while |
|---|
| 340 | # we're working on the compiler, and even if we did, GHC will normally |
|---|
| 341 | # decide compilation isn't needed anyway. So by setting LAX_DEPENDENCIES |
|---|
| 342 | # to YES you can turn these dependencies into order-only dependencies, |
|---|
| 343 | # i.e. GHC must exist, but if it's newer than other targets then |
|---|
| 344 | # rebuilding is not necessary. |
|---|
| 345 | |
|---|
| 346 | LAX_DEPENDENCIES = NO |
|---|
| 347 | |
|---|
| 348 | # ---------------------------------------------------------------------------- |
|---|
| 349 | # Options for GHC's RTS |
|---|
| 350 | |
|---|
| 351 | # For an optimised RTS (you probably don't want to change these; we build |
|---|
| 352 | # a debugging RTS by default now. Use -debug to get it). |
|---|
| 353 | GhcRtsHcOpts=-optc-O2 |
|---|
| 354 | GhcRtsCcOpts=-fomit-frame-pointer |
|---|
| 355 | |
|---|
| 356 | # Include the front panel code? Needs GTK+. |
|---|
| 357 | GhcRtsWithFrontPanel = NO |
|---|
| 358 | |
|---|
| 359 | # Include support for CPU performance counters via the PAPI library in the RTS? |
|---|
| 360 | # (PAPI: http://icl.cs.utk.edu/papi/) |
|---|
| 361 | GhcRtsWithPapi = NO |
|---|
| 362 | PapiLibDir= |
|---|
| 363 | PapiIncludeDir= |
|---|
| 364 | |
|---|
| 365 | ################################################################################ |
|---|
| 366 | # |
|---|
| 367 | # Paths (see paths.mk) |
|---|
| 368 | # |
|---|
| 369 | ################################################################################ |
|---|
| 370 | |
|---|
| 371 | # Directory used by GHC (and possibly other tools) for storing |
|---|
| 372 | # temporary files. If your TMPDIR isn't big enough, either override |
|---|
| 373 | # this in build.mk or set your environment variable "TMPDIR" to point |
|---|
| 374 | # to somewhere with more space. (TMPDIR=. is a good choice). |
|---|
| 375 | |
|---|
| 376 | # DEFAULT_TMPDIR isn't called TMPDIR because GNU make tends to |
|---|
| 377 | # override an environment variable with the value of the make variable |
|---|
| 378 | # of the same name (if it exists) when executing sub-processes, so |
|---|
| 379 | # setting the TMPDIR env var would have no effect in the build tree. |
|---|
| 380 | |
|---|
| 381 | DEFAULT_TMPDIR = /tmp |
|---|
| 382 | ifeq "$(TARGETPLATFORM)" "i386-unknown-cygwin32" |
|---|
| 383 | DEFAULT_TMPDIR = /C/TEMP |
|---|
| 384 | endif |
|---|
| 385 | ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32" |
|---|
| 386 | DEFAULT_TMPDIR = /C/TEMP |
|---|
| 387 | endif |
|---|
| 388 | |
|---|
| 389 | BIN_DIST_NAME = ghc-$(ProjectVersion) |
|---|
| 390 | BIN_DIST_PREP_DIR = bindistprep/$(BIN_DIST_NAME) |
|---|
| 391 | BIN_DIST_PREP_TAR = bindistprep/$(BIN_DIST_NAME)-$(TARGETPLATFORM).tar |
|---|
| 392 | BIN_DIST_PREP_TAR_BZ2 = $(BIN_DIST_PREP_TAR).bz2 |
|---|
| 393 | BIN_DIST_TAR_BZ2 = $(BIN_DIST_NAME)-$(TARGETPLATFORM).tar.bz2 |
|---|
| 394 | BIN_DIST_LIST = bindist-list |
|---|
| 395 | |
|---|
| 396 | WINDOWS_INSTALLER_BASE = ghc-$(ProjectVersion)-i386-windows |
|---|
| 397 | WINDOWS_INSTALLER = $(WINDOWS_INSTALLER_BASE)$(exeext) |
|---|
| 398 | |
|---|
| 399 | # ----------------------------------------------------------------------------- |
|---|
| 400 | # Utilities programs: flags |
|---|
| 401 | |
|---|
| 402 | # If you want to give any standard flags to pretty much any utility |
|---|
| 403 | # (see utils.mk for a complete list), by adding a line here |
|---|
| 404 | # |
|---|
| 405 | # SRC_P_OPTS += ... |
|---|
| 406 | # |
|---|
| 407 | # where P is the utility. For example, to add -O to all Haskell |
|---|
| 408 | # compilations, |
|---|
| 409 | # |
|---|
| 410 | # SRC_HC_OPTS += -O |
|---|
| 411 | |
|---|
| 412 | |
|---|
| 413 | # SRC_HC_OPTS includes flags to be added to *every* Haskell |
|---|
| 414 | # compilation. Setting SRC_HC_OPTS is a good way to set the default |
|---|
| 415 | # optimisation level (-O) and heap size (-H<size>). |
|---|
| 416 | # |
|---|
| 417 | # SRC_HC_OPTS is *not* for adding flags that are required to make your |
|---|
| 418 | # build work. Examples: |
|---|
| 419 | # |
|---|
| 420 | # - instead of using -pgmc/-pgma-/-pgml, use the --with-gcc option to configure |
|---|
| 421 | # |
|---|
| 422 | # - if you need -optc, -opta, or -optl flags, the CONF_CC_* and CONF_LD_* |
|---|
| 423 | # variables are more appropriate (set via configure) |
|---|
| 424 | # |
|---|
| 425 | # Note that SRC_HC_OPTS are added to every Haskell compilation, |
|---|
| 426 | # including when using the bootstrapping compiler (stage 0), So don't |
|---|
| 427 | # put options here that are only supported by very recent GHCs. |
|---|
| 428 | # |
|---|
| 429 | SRC_HC_OPTS += -H32m -O |
|---|
| 430 | |
|---|
| 431 | # These flags make flex 8-bit |
|---|
| 432 | SRC_FLEX_OPTS += -8 |
|---|
| 433 | |
|---|
| 434 | # Flags for CPP when running GreenCard on .pgc files |
|---|
| 435 | GC_CPP_OPTS += -P -E -x c -traditional -D__GLASGOW_HASKELL__ |
|---|
| 436 | |
|---|
| 437 | |
|---|
| 438 | # ----------------------------------------------------------------------------- |
|---|
| 439 | # Names of programs in the GHC tree |
|---|
| 440 | # |
|---|
| 441 | # xxx_PGM the name of an executable, without the path |
|---|
| 442 | # xxx the executable relative to the current dir |
|---|
| 443 | |
|---|
| 444 | GHC_UNLIT_PGM = unlit$(exeext) |
|---|
| 445 | GHC_HP2PS_PGM = hp2ps$(exeext) |
|---|
| 446 | GHC_GHCTAGS_PGM = ghctags$(exeext) |
|---|
| 447 | GHC_HSC2HS_PGM = hsc2hs$(exeext) |
|---|
| 448 | GHC_TOUCHY_PGM = touchy$(exeext) |
|---|
| 449 | GHC_SPLIT_PGM = ghc-split |
|---|
| 450 | GHC_SYSMAN_PGM = SysMan |
|---|
| 451 | GHC_GENPRIMOP_PGM = genprimopcode$(exeext) |
|---|
| 452 | GHC_GENAPPLY_PGM = genapply$(exeext) |
|---|
| 453 | GHC_CABAL_PGM = ghc-cabal$(exeext) |
|---|
| 454 | GHC_PKG_PGM = ghc-pkg$(exeext) |
|---|
| 455 | GHC_LTX_PGM = ltx$(exeext) |
|---|
| 456 | GHC_MKDIRHIER_PGM = mkdirhier |
|---|
| 457 | GHC_LNDIR_PGM = lndir |
|---|
| 458 | |
|---|
| 459 | ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32" |
|---|
| 460 | GHC_CP = "xcopy /y" |
|---|
| 461 | GHC_PERL = perl |
|---|
| 462 | else |
|---|
| 463 | GHC_CP = $(CP) |
|---|
| 464 | GHC_PERL = $(PERL) |
|---|
| 465 | endif |
|---|
| 466 | |
|---|
| 467 | HP2PS = $(GHC_HP2PS_DIR)/$(GHC_HP2PS_PGM) |
|---|
| 468 | SPLIT = $(INPLACE_LIB)/$(GHC_SPLIT_PGM) |
|---|
| 469 | SYSMAN = $(GHC_SYSMAN_DIR)/$(GHC_SYSMAN_PGM) |
|---|
| 470 | LTX = $(GHC_LTX_DIR)/$(GHC_LTX_PGM) |
|---|
| 471 | LNDIR = $(GHC_LNDIR_DIR)/$(GHC_LNDIR_PGM) |
|---|
| 472 | |
|---|
| 473 | UNLIT = $(INPLACE_LIB)/$(GHC_UNLIT_PGM) |
|---|
| 474 | TOUCHY = $(INPLACE_LIB)/$(GHC_TOUCHY_PGM) |
|---|
| 475 | MKDIRHIER = $(INPLACE_BIN)/$(GHC_MKDIRHIER_PGM) |
|---|
| 476 | GHC_CABAL_INPLACE = $(INPLACE_BIN)/$(GHC_CABAL_PGM) |
|---|
| 477 | GENAPPLY_INPLACE = $(INPLACE_BIN)/$(GHC_GENAPPLY_PGM) |
|---|
| 478 | GHC_PKG_INPLACE = $(INPLACE_BIN)/$(GHC_PKG_PGM) |
|---|
| 479 | GHCTAGS_INPLACE = $(INPLACE_BIN)/$(GHC_GHCTAGS_PGM) |
|---|
| 480 | HSC2HS_INPLACE = $(INPLACE_BIN)/$(GHC_HSC2HS_PGM) |
|---|
| 481 | GENPRIMOP_INPLACE = $(INPLACE_BIN)/$(GHC_GENPRIMOP_PGM) |
|---|
| 482 | |
|---|
| 483 | GENERATED_FILE = chmod a-w |
|---|
| 484 | EXECUTABLE_FILE = chmod +x |
|---|
| 485 | |
|---|
| 486 | #----------------------------------------------------------------------------- |
|---|
| 487 | # Installed GHC |
|---|
| 488 | |
|---|
| 489 | # $(GHC) points to installed version of the compiler. |
|---|
| 490 | # |
|---|
| 491 | # NOTE: Don't override $(GHC) in build.mk, use configure --with-ghc instead |
|---|
| 492 | # (because the version numbers have to be calculated). |
|---|
| 493 | |
|---|
| 494 | GHC := @WithGhc@ |
|---|
| 495 | # If we have a make dependency on c:/ghc/ghc, and the file is actually |
|---|
| 496 | # called c:/ghc/ghc.exe, then make will think that ghc doesn't exist |
|---|
| 497 | # and that it doesn't know how to create it. |
|---|
| 498 | ifneq "$(wildcard $(GHC).exe)" "" |
|---|
| 499 | GHC := $(GHC).exe |
|---|
| 500 | endif |
|---|
| 501 | |
|---|
| 502 | # Sometimes we want to invoke ghc from the build tree in different |
|---|
| 503 | # places (eg. it's handy to have a nofib & a ghc build in the same |
|---|
| 504 | # tree). We can refer to "this ghc" as $(GHC_INPLACE): |
|---|
| 505 | |
|---|
| 506 | GHC_INPLACE = $(GHC_STAGE1) |
|---|
| 507 | |
|---|
| 508 | GHC_STAGE0_ABS = $(GHC) |
|---|
| 509 | GHC_STAGE1_ABS = $(TOP)/$(INPLACE_BIN)/ghc-stage1$(exeext) |
|---|
| 510 | GHC_STAGE2_ABS = $(TOP)/$(INPLACE_BIN)/ghc-stage2$(exeext) |
|---|
| 511 | GHC_STAGE3_ABS = $(TOP)/$(INPLACE_BIN)/ghc-stage3$(exeext) |
|---|
| 512 | |
|---|
| 513 | GHC_STAGE0 = $(GHC) |
|---|
| 514 | GHC_STAGE1 = $(INPLACE_BIN)/ghc-stage1$(exeext) |
|---|
| 515 | GHC_STAGE2 = $(INPLACE_BIN)/ghc-stage2$(exeext) |
|---|
| 516 | GHC_STAGE3 = $(INPLACE_BIN)/ghc-stage3$(exeext) |
|---|
| 517 | |
|---|
| 518 | BOOTSTRAPPING_CONF = libraries/bootstrapping.conf |
|---|
| 519 | |
|---|
| 520 | INPLACE_PACKAGE_CONF = $(INPLACE_LIB)/package.conf.d |
|---|
| 521 | |
|---|
| 522 | GhcVersion = @GhcVersion@ |
|---|
| 523 | GhcPatchLevel = @GhcPatchLevel@ |
|---|
| 524 | GhcMajVersion = @GhcMajVersion@ |
|---|
| 525 | GhcMinVersion = @GhcMinVersion@ |
|---|
| 526 | |
|---|
| 527 | # Canonicalised ghc version number, used for easy (integer) version |
|---|
| 528 | # comparisons. We must expand $(GhcMinVersion) to two digits by |
|---|
| 529 | # adding a leading zero if necessary: |
|---|
| 530 | ifneq "$(findstring $(GhcMinVersion), 0 1 2 3 4 5 6 7 8 9)" "" |
|---|
| 531 | GhcCanonVersion = $(GhcMajVersion)0$(GhcMinVersion) |
|---|
| 532 | else |
|---|
| 533 | GhcCanonVersion = $(GhcMajVersion)$(GhcMinVersion) |
|---|
| 534 | endif |
|---|
| 535 | |
|---|
| 536 | # Work around #5453, which causes the stage1 compiler to segfault when |
|---|
| 537 | # built with 7.2.1. |
|---|
| 538 | ifeq "$(GhcVersion)" "7.2.1" |
|---|
| 539 | CONF_HC_OPTS_STAGE0 += -fno-full-laziness |
|---|
| 540 | compiler/cmm/Bitmap_HC_OPTS += -ffull-laziness |
|---|
| 541 | # urgh. Compiling cmm/Bitmap.hs with -fno-full-laziness results in |
|---|
| 542 | # "gmp: overflow in mpz type" |
|---|
| 543 | # for some unknown reason, so turn full-laziness back on for this module. |
|---|
| 544 | endif |
|---|
| 545 | |
|---|
| 546 | GHC_PACKAGE_DB_FLAG = @GHC_PACKAGE_DB_FLAG@ |
|---|
| 547 | |
|---|
| 548 | #----------------------------------------------------------------------------- |
|---|
| 549 | # C compiler |
|---|
| 550 | # |
|---|
| 551 | # NB. Don't override $(WhatGccIsCalled) using build.mk, re-configure using |
|---|
| 552 | # the flag --with-gcc=<blah> instead. The reason is that the configure script |
|---|
| 553 | # needs to know which gcc you're using in order to perform its tests. |
|---|
| 554 | |
|---|
| 555 | WhatGccIsCalled = @WhatGccIsCalled@ |
|---|
| 556 | GccVersion = @GccVersion@ |
|---|
| 557 | AlienScript = @AlienScript@ |
|---|
| 558 | ifeq "$(phase)" "0" |
|---|
| 559 | CrossCompilePrefix = |
|---|
| 560 | else |
|---|
| 561 | CrossCompilePrefix = @CrossCompilePrefix@ |
|---|
| 562 | endif |
|---|
| 563 | # TargetPlatformFull retains the string passed to configure so we have it in |
|---|
| 564 | # the necessary format to pass to libffi's configure. |
|---|
| 565 | TargetPlatformFull = @TargetPlatformFull@ |
|---|
| 566 | GccLT34 = @GccLT34@ |
|---|
| 567 | GccLT46 = @GccLT46@ |
|---|
| 568 | CC = $(WhatGccIsCalled) |
|---|
| 569 | CC_STAGE0 = @CC_STAGE0@ |
|---|
| 570 | CC_STAGE1 = $(CC) |
|---|
| 571 | CC_STAGE2 = $(CC) |
|---|
| 572 | CC_STAGE3 = $(CC) |
|---|
| 573 | AS = $(WhatGccIsCalled) |
|---|
| 574 | AS_STAGE0 = @CC_STAGE0@ |
|---|
| 575 | AS_STAGE1 = $(AS) |
|---|
| 576 | AS_STAGE2 = $(AS) |
|---|
| 577 | AS_STAGE3 = $(AS) |
|---|
| 578 | |
|---|
| 579 | # Cross-compiling options |
|---|
| 580 | # |
|---|
| 581 | # The 'toolchain' case: Cross-compiler to run locally: |
|---|
| 582 | BuildingCrossCompiler = @BuildingCrossCompiler@ |
|---|
| 583 | # The 'port' case: Porting to a foreign architecture: |
|---|
| 584 | PortingCompiler = @PortingCompiler@ |
|---|
| 585 | # BuildingCrossCompiler OR PortingCompiler |
|---|
| 586 | CrossCompiling = @CrossCompiling@ |
|---|
| 587 | |
|---|
| 588 | # Install stage 2 by default, or stage 1 in the cross compiler case. Can be changed to 3 |
|---|
| 589 | ifeq "$(BuildingCrossCompiler)" "YES" |
|---|
| 590 | INSTALL_GHC_STAGE=1 |
|---|
| 591 | else |
|---|
| 592 | INSTALL_GHC_STAGE=2 |
|---|
| 593 | endif |
|---|
| 594 | |
|---|
| 595 | # C compiler and linker flags from configure (e.g. -m<blah> to select |
|---|
| 596 | # correct C compiler backend). The stage number is the stage of GHC |
|---|
| 597 | # that is being used to compile with. |
|---|
| 598 | CONF_CC_OPTS_STAGE0 = @CONF_CC_OPTS_STAGE0@ |
|---|
| 599 | CONF_CC_OPTS_STAGE1 = @CONF_CC_OPTS_STAGE1@ |
|---|
| 600 | CONF_CC_OPTS_STAGE2 = @CONF_CC_OPTS_STAGE2@ |
|---|
| 601 | CONF_GCC_LINKER_OPTS_STAGE0 = @CONF_GCC_LINKER_OPTS_STAGE0@ |
|---|
| 602 | CONF_GCC_LINKER_OPTS_STAGE1 = @CONF_GCC_LINKER_OPTS_STAGE1@ |
|---|
| 603 | CONF_GCC_LINKER_OPTS_STAGE2 = @CONF_GCC_LINKER_OPTS_STAGE2@ |
|---|
| 604 | CONF_LD_LINKER_OPTS_STAGE0 = @CONF_LD_LINKER_OPTS_STAGE0@ |
|---|
| 605 | CONF_LD_LINKER_OPTS_STAGE1 = @CONF_LD_LINKER_OPTS_STAGE1@ |
|---|
| 606 | CONF_LD_LINKER_OPTS_STAGE2 = @CONF_LD_LINKER_OPTS_STAGE2@ |
|---|
| 607 | CONF_CPP_OPTS_STAGE0 = @CONF_CPP_OPTS_STAGE0@ |
|---|
| 608 | CONF_CPP_OPTS_STAGE1 = @CONF_CPP_OPTS_STAGE1@ |
|---|
| 609 | CONF_CPP_OPTS_STAGE2 = @CONF_CPP_OPTS_STAGE2@ |
|---|
| 610 | |
|---|
| 611 | ifeq "$(TARGETPLATFORM)" "ia64-unknown-linux" |
|---|
| 612 | CONF_CC_OPTS += -G0 |
|---|
| 613 | endif |
|---|
| 614 | |
|---|
| 615 | # The .hsc files aren't currently safe for cross-compilation on Windows: |
|---|
| 616 | # libraries\haskeline\.\System\Console\Haskeline\Backend\Win32.hsc:160 |
|---|
| 617 | # directive "let" is not safe for cross-compilation |
|---|
| 618 | ifneq "$(Windows)" "YES" |
|---|
| 619 | SRC_HSC2HS_OPTS += --cross-safe |
|---|
| 620 | endif |
|---|
| 621 | SRC_HSC2HS_OPTS += $(addprefix --cflag=,$(filter-out -O,$(SRC_CC_OPTS) $(CONF_CC_OPTS_STAGE0))) |
|---|
| 622 | SRC_HSC2HS_OPTS += $(foreach d,$(GMP_INCLUDE_DIRS),-I$(d)) |
|---|
| 623 | ifeq "$(CrossCompiling)" "YES" |
|---|
| 624 | SRC_HSC2HS_OPTS += --cross-compile |
|---|
| 625 | endif |
|---|
| 626 | |
|---|
| 627 | ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32" |
|---|
| 628 | WINDRES = $(INPLACE_MINGW)/bin/windres |
|---|
| 629 | else ifeq "$(TARGETPLATFORM)" "x86_64-unknown-mingw32" |
|---|
| 630 | WINDRES = $(INPLACE_MINGW)/bin/x86_64-w64-mingw32-windres |
|---|
| 631 | endif |
|---|
| 632 | |
|---|
| 633 | #----------------------------------------------------------------------------- |
|---|
| 634 | # Mingwex Library |
|---|
| 635 | # |
|---|
| 636 | HaveLibMingwEx = @HaveLibMingwEx@ |
|---|
| 637 | ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32" |
|---|
| 638 | DLLTOOL = inplace/mingw/bin/dlltool.exe |
|---|
| 639 | else ifeq "$(TARGETPLATFORM)" "x86_64-unknown-mingw32" |
|---|
| 640 | DLLTOOL = inplace/mingw/bin/x86_64-w64-mingw32-dlltool.exe |
|---|
| 641 | endif |
|---|
| 642 | |
|---|
| 643 | #----------------------------------------------------------------------------- |
|---|
| 644 | # Flex (currently unused, could be moved to glafp-utils) |
|---|
| 645 | |
|---|
| 646 | # FLEX = @LEX@ |
|---|
| 647 | # Don't bother with -lfl, we define our own yywrap()s anyway. |
|---|
| 648 | # FLEX_LIB = |
|---|
| 649 | #WAS:FLEX_LIB = @LEXLIB@ |
|---|
| 650 | |
|---|
| 651 | #----------------------------------------------------------------------------- |
|---|
| 652 | # Other standard (ha!) Unix utilities |
|---|
| 653 | |
|---|
| 654 | AR = @ArCmd@ |
|---|
| 655 | AR_OPTS = @ArArgs@ |
|---|
| 656 | ArSupportsAtFile = @ArSupportsAtFile@ |
|---|
| 657 | |
|---|
| 658 | AR_STAGE0 = @AR_STAGE0@ |
|---|
| 659 | AR_STAGE1 = $(AR) |
|---|
| 660 | AR_STAGE2 = $(AR) |
|---|
| 661 | AR_STAGE3 = $(AR) |
|---|
| 662 | AR_OPTS_STAGE0 = @AR_OPTS_STAGE0@ |
|---|
| 663 | AR_OPTS_STAGE1 = $(AR_OPTS) |
|---|
| 664 | AR_OPTS_STAGE2 = $(AR_OPTS) |
|---|
| 665 | AR_OPTS_STAGE3 = $(AR_OPTS) |
|---|
| 666 | EXTRA_AR_ARGS_STAGE0 = $(EXTRA_AR_ARGS) |
|---|
| 667 | EXTRA_AR_ARGS_STAGE1 = $(EXTRA_AR_ARGS) |
|---|
| 668 | EXTRA_AR_ARGS_STAGE2 = $(EXTRA_AR_ARGS) |
|---|
| 669 | EXTRA_AR_ARGS_STAGE3 = $(EXTRA_AR_ARGS) |
|---|
| 670 | ArSupportsAtFile_STAGE0 = @ArSupportsAtFile_STAGE0@ |
|---|
| 671 | ArSupportsAtFile_STAGE1 = $(ArSupportsAtFile) |
|---|
| 672 | ArSupportsAtFile_STAGE2 = $(ArSupportsAtFile) |
|---|
| 673 | ArSupportsAtFile_STAGE3 = $(ArSupportsAtFile) |
|---|
| 674 | |
|---|
| 675 | CONTEXT_DIFF = @ContextDiffCmd@ |
|---|
| 676 | CP = cp |
|---|
| 677 | # It's not easy to separate the CPP program from its flags, as |
|---|
| 678 | # AC_PROG_CPP defines CPP as "/usr/bin/gcc -E" |
|---|
| 679 | CPP = @CPP@ @CPPFLAGS@ |
|---|
| 680 | CTAGS = $(ETAGS) |
|---|
| 681 | # |
|---|
| 682 | # RAWCPP_FLAGS are the flags to give to cpp (viz, gcc -E) to persuade it to |
|---|
| 683 | # behave plausibly on Haskell sources. |
|---|
| 684 | # |
|---|
| 685 | RAWCPP_FLAGS = -undef -traditional |
|---|
| 686 | FIND = @FindCmd@ |
|---|
| 687 | SORT = @SortCmd@ |
|---|
| 688 | |
|---|
| 689 | # |
|---|
| 690 | # Sigh - the autoconf macro for INSTALL will subst a relative path to the fallback |
|---|
| 691 | # install-sh script (if chosen). This not terribly useful to us, so we convert |
|---|
| 692 | # it into an abs. path. |
|---|
| 693 | # |
|---|
| 694 | INSTALL = @INSTALL@ |
|---|
| 695 | INSTALL := $(subst .././install-sh,$(TOP)/install-sh,$(INSTALL)) |
|---|
| 696 | |
|---|
| 697 | LATEX = latex |
|---|
| 698 | PDFLATEX = pdflatex |
|---|
| 699 | BIBTEX = bibtex |
|---|
| 700 | LN_S = @LN_S@ |
|---|
| 701 | MV = mv |
|---|
| 702 | NROFF = nroff |
|---|
| 703 | PERL = @PerlCmd@ |
|---|
| 704 | PYTHON = @PythonCmd@ |
|---|
| 705 | PIC = pic |
|---|
| 706 | RANLIB = @RANLIB@ |
|---|
| 707 | SED = @SedCmd@ |
|---|
| 708 | TR = tr |
|---|
| 709 | SHELL = /bin/sh |
|---|
| 710 | |
|---|
| 711 | HaveDtrace = @HaveDtrace@ |
|---|
| 712 | USE_DTRACE = $(HaveDtrace) |
|---|
| 713 | DTRACE = @DtraceCmd@ |
|---|
| 714 | |
|---|
| 715 | LD = @LdCmd@ |
|---|
| 716 | NM = @NmCmd@ |
|---|
| 717 | |
|---|
| 718 | LLC = @LlcCmd@ |
|---|
| 719 | OPT = @OptCmd@ |
|---|
| 720 | |
|---|
| 721 | # Some ld's support the -x flag and some don't, so the configure |
|---|
| 722 | # script detects which we have and sets LdXFlag to "-x" or "" |
|---|
| 723 | # respectively. |
|---|
| 724 | LD_X = @LdXFlag@ |
|---|
| 725 | |
|---|
| 726 | # GNU ld supports input via a linker script, which is useful to avoid |
|---|
| 727 | # overflowing command-line length limits. |
|---|
| 728 | LdIsGNULd = @LdIsGNULd@ |
|---|
| 729 | |
|---|
| 730 | # Set to YES if ld has the --build-id flag. Sometimes we need to |
|---|
| 731 | # disable it with --build-id=none. |
|---|
| 732 | LdHasBuildId = @LdHasBuildId@ |
|---|
| 733 | |
|---|
| 734 | # Set to YES if ld has the --no_compact_unwind flag. See #5019 |
|---|
| 735 | # and compiler/main/DriverPipeline.hs. |
|---|
| 736 | LdHasNoCompactUnwind = @LdHasNoCompactUnwind@ |
|---|
| 737 | |
|---|
| 738 | # On MSYS, building with SplitObjs=YES fails with |
|---|
| 739 | # ar: Bad file number |
|---|
| 740 | # see #3201. We need to specify a smaller max command-line size |
|---|
| 741 | # to work around it. 32767 doesn't work; 30000 does, but says |
|---|
| 742 | # xargs: value for -s option should be < 28153 |
|---|
| 743 | # so we now use 20000 to be comfortably below this bound |
|---|
| 744 | XARGS = xargs |
|---|
| 745 | ifeq "$(Windows)" "YES" |
|---|
| 746 | XARGS_OPTS = -s 20000 |
|---|
| 747 | endif |
|---|
| 748 | |
|---|
| 749 | # |
|---|
| 750 | # In emergency situations, REAL_SHELL is used to perform shell commands |
|---|
| 751 | # from within the ghc driver script, by scribbling the command line to |
|---|
| 752 | # a temp file and then having $(REAL_SHELL) execute it. |
|---|
| 753 | # |
|---|
| 754 | # The reason for having to do this is that overly long command lines |
|---|
| 755 | # cause unnecessary trouble with some shells (e.g., /bin/sh on Solaris |
|---|
| 756 | # 2.5.1), which is why this backdoor is provided. The situation of overly |
|---|
| 757 | # long command lines is either encountered while doing `make boot' in compiler/, |
|---|
| 758 | # or when linking the compiler binary (`hsc'). |
|---|
| 759 | # |
|---|
| 760 | # We do not use SHELL to execute long commands, as `make' will more than likely |
|---|
| 761 | # override whatever setting you have in your environment while executing. |
|---|
| 762 | |
|---|
| 763 | # By default, REAL_SHELL is set equal to SHELL, which is not really a smart move |
|---|
| 764 | # as it is SHELL that will show up the bogosity in the first place, but setting |
|---|
| 765 | # it to anything else isn't really portable. |
|---|
| 766 | # |
|---|
| 767 | # ====> If long command lines cause you trouble, invoke `ghc' (via `make' or otherwise) |
|---|
| 768 | # with REAL_SHELL set to something else than /bin/sh, for instance, your favourite |
|---|
| 769 | # command shell. |
|---|
| 770 | # |
|---|
| 771 | REAL_SHELL = $(SHELL) |
|---|
| 772 | |
|---|
| 773 | ifeq "$(TARGETPLATFORM)" "x86_64-unknown-mingw32" |
|---|
| 774 | STRIP_CMD = $(TOP)/inplace/mingw/bin/x86_64-w64-mingw32-strip.exe |
|---|
| 775 | else |
|---|
| 776 | STRIP_CMD = strip |
|---|
| 777 | endif |
|---|
| 778 | PATCH_CMD = @PatchCmd@ |
|---|
| 779 | TAR_CMD = @TarCmd@ |
|---|
| 780 | BZIP2_CMD = bzip2 |
|---|
| 781 | GZIP_CMD = gzip |
|---|
| 782 | |
|---|
| 783 | ifeq "$(Windows)" "YES" |
|---|
| 784 | TOUCH_CMD = $(utils/touchy_dist_INPLACE) |
|---|
| 785 | TOUCH_DEP = $(TOUCH_CMD) |
|---|
| 786 | else |
|---|
| 787 | TOUCH_CMD = touch |
|---|
| 788 | TOUCH_DEP = |
|---|
| 789 | endif |
|---|
| 790 | |
|---|
| 791 | HSCOLOUR_CMD = @HSCOLOUR@ |
|---|
| 792 | |
|---|
| 793 | TIME_CMD = @TimeCmd@ |
|---|
| 794 | |
|---|
| 795 | # GTK+ |
|---|
| 796 | GTK_CONFIG_CMD = @GTK_CONFIG@ |
|---|
| 797 | |
|---|
| 798 | # Set this if you want to use Inno Setup to build a Windows installer |
|---|
| 799 | # when you make a bindist |
|---|
| 800 | ISCC_CMD = |
|---|
| 801 | |
|---|
| 802 | #----------------------------------------------------------------------------- |
|---|
| 803 | # DocBook XML stuff |
|---|
| 804 | |
|---|
| 805 | BUILD_DOCBOOK_HTML = @BUILD_DOCBOOK_HTML@ |
|---|
| 806 | BUILD_DOCBOOK_PS = @BUILD_DOCBOOK_PS@ |
|---|
| 807 | BUILD_DOCBOOK_PDF = @BUILD_DOCBOOK_PDF@ |
|---|
| 808 | DBLATEX = @DblatexCmd@ |
|---|
| 809 | XSLTPROC = @XsltprocCmd@ |
|---|
| 810 | XMLLINT = @XmllintCmd@ |
|---|
| 811 | HAVE_DOCBOOK_XSL = @HAVE_DOCBOOK_XSL@ |
|---|
| 812 | XSLTPROC_HTML_STYLESHEET = http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl |
|---|
| 813 | XSLTPROC_LABEL_OPTS = --stringparam toc.section.depth 3 \ |
|---|
| 814 | --stringparam section.autolabel 1 \ |
|---|
| 815 | --stringparam section.label.includes.component.label 1 |
|---|
| 816 | |
|---|
| 817 | #----------------------------------------------------------------------------- |
|---|
| 818 | # FPtools support software |
|---|
| 819 | |
|---|
| 820 | # |
|---|
| 821 | # ghc-pkg |
|---|
| 822 | # |
|---|
| 823 | GHC_PKG = @GhcPkgCmd@ |
|---|
| 824 | |
|---|
| 825 | # |
|---|
| 826 | # Happy |
|---|
| 827 | # |
|---|
| 828 | HAPPY = @HappyCmd@ |
|---|
| 829 | HAPPY_VERSION = @HappyVersion@ |
|---|
| 830 | # |
|---|
| 831 | # Options to pass to Happy when we're going to compile the output with GHC |
|---|
| 832 | # |
|---|
| 833 | SRC_HAPPY_OPTS = -agc --strict |
|---|
| 834 | |
|---|
| 835 | # |
|---|
| 836 | # Alex |
|---|
| 837 | # |
|---|
| 838 | ALEX = @AlexCmd@ |
|---|
| 839 | ALEX_VERSION = @AlexVersion@ |
|---|
| 840 | Alex3 = @Alex3@ |
|---|
| 841 | # |
|---|
| 842 | # Options to pass to Happy when we're going to compile the output with GHC |
|---|
| 843 | # |
|---|
| 844 | ifeq "$(Alex3)" "YES" |
|---|
| 845 | # We aren't using the Unicode support in Alex 3.0 yet, in fact we do our own |
|---|
| 846 | # Unicode handling, so diable Alex's. |
|---|
| 847 | SRC_ALEX_OPTS = -g --latin1 |
|---|
| 848 | else |
|---|
| 849 | SRC_ALEX_OPTS = -g |
|---|
| 850 | endif |
|---|
| 851 | |
|---|
| 852 | # Should we build haddock docs? |
|---|
| 853 | HADDOCK_DOCS = YES |
|---|
| 854 | # And HsColour the sources? |
|---|
| 855 | ifeq "$(HSCOLOUR_CMD)" "" |
|---|
| 856 | HSCOLOUR_SRCS = NO |
|---|
| 857 | else |
|---|
| 858 | HSCOLOUR_SRCS = YES |
|---|
| 859 | endif |
|---|
| 860 | |
|---|
| 861 | ################################################################################ |
|---|
| 862 | # |
|---|
| 863 | # 31-bit-Int Core files |
|---|
| 864 | # |
|---|
| 865 | ################################################################################ |
|---|
| 866 | |
|---|
| 867 | # |
|---|
| 868 | # It is possible to configure the compiler and prelude to support 31-bit |
|---|
| 869 | # integers, suitable for a back-end and RTS using a tag bit on a 32-bit |
|---|
| 870 | # architecture. Currently the only useful output from this option is external Core |
|---|
| 871 | # files. The following additions to your build.mk will produce the |
|---|
| 872 | # 31-bit core output. Note that this is *not* just a library "way"; the |
|---|
| 873 | # compiler must be built a special way too. |
|---|
| 874 | |
|---|
| 875 | # GhcCppOpts +=-DWORD_SIZE_IN_BITS=31 |
|---|
| 876 | # GhcLibHcOpts +=-fext-core -fno-code -DWORD_SIZE_IN_BITS=31 |
|---|
| 877 | # GhcLibCppOpts += -DWORD_SIZE_IN_BITS=31 |
|---|
| 878 | # SplitObjs=NO |
|---|
| 879 | |
|---|
| 880 | ################################################################################ |
|---|
| 881 | # |
|---|
| 882 | # Library configure arguments |
|---|
| 883 | # |
|---|
| 884 | ################################################################################ |
|---|
| 885 | |
|---|
| 886 | CONFIGURE_ARGS = @CONFIGURE_ARGS@ |
|---|
| 887 | |
|---|
| 888 | ################################################################################ |
|---|
| 889 | # |
|---|
| 890 | # To be passed to sub-builds |
|---|
| 891 | # |
|---|
| 892 | ################################################################################ |
|---|
| 893 | |
|---|
| 894 | ICONV_INCLUDE_DIRS = @ICONV_INCLUDE_DIRS@ |
|---|
| 895 | ICONV_LIB_DIRS = @ICONV_LIB_DIRS@ |
|---|
| 896 | |
|---|
| 897 | GMP_INCLUDE_DIRS = @GMP_INCLUDE_DIRS@ |
|---|
| 898 | GMP_LIB_DIRS = @GMP_LIB_DIRS@ |
|---|