| 1 | # ----------------------------------------------------------------------------- |
| 2 | # MacPorts GHC build configuration |
| 3 | # |
| 4 | # Uncomment one of the following BuildFlavour settings to get the desired |
| 5 | # overall build type. |
| 6 | |
| 7 | # Disable building the documentation, we want to avoid the dependency |
| 8 | BUILD_DOCBOOK_HTML = NO |
| 9 | BUILD_DOCBOOK_PS = NO |
| 10 | BUILD_DOCBOOK_PDF = NO |
| 11 | |
| 12 | # -------- Build profiles ----------------------------------------------------- |
| 13 | # Uncomment one of these to select a build profile below: |
| 14 | |
| 15 | # Full build with max optimisation and everything enabled (very slow build) |
| 16 | #BuildFlavour = perf |
| 17 | |
| 18 | # As above but build GHC using the LLVM backend |
| 19 | #BuildFlavour = perf-llvm |
| 20 | |
| 21 | # Perf build configured for a cross-compiler |
| 22 | #BuildFlavour = perf-cross |
| 23 | |
| 24 | # Fast build with optimised libraries, no profiling (RECOMMENDED): |
| 25 | BuildFlavour = quick |
| 26 | |
| 27 | # Fast build with optimised libraries, no profiling, with LLVM: |
| 28 | #BuildFlavour = quick-llvm |
| 29 | |
| 30 | # Fast build configured for a cross compiler |
| 31 | #BuildFlavour = quick-cross |
| 32 | |
| 33 | # Even faster build. NOT RECOMMENDED: the libraries will be |
| 34 | # completely unoptimised, so any code built with this compiler |
| 35 | # (including stage2) will run very slowly: |
| 36 | #BuildFlavour = quickest |
| 37 | |
| 38 | # Profile the stage2 compiler: |
| 39 | #BuildFlavour = prof |
| 40 | |
| 41 | # A development build, working on the stage 1 compiler: |
| 42 | #BuildFlavour = devel1 |
| 43 | |
| 44 | # A development build, working on the stage 2 compiler: |
| 45 | #BuildFlavour = devel2 |
| 46 | |
| 47 | # A build with max optimisation that still builds the stage2 compiler |
| 48 | # quickly. Compiled code will be the same as with "perf". Programs |
| 49 | # will compile more slowly. |
| 50 | #BuildFlavour = bench |
| 51 | |
| 52 | # As above but build GHC using the LLVM backend |
| 53 | #BuildFlavour = bench-llvm |
| 54 | |
| 55 | # Bench build configured for a cross-compiler |
| 56 | #BuildFlavour = bench-cross |
| 57 | |
| 58 | # Use the same settings as validate. |
| 59 | #BuildFlavour = validate |
| 60 | |
| 61 | ifneq "$(BuildFlavour)" "" |
| 62 | include mk/flavours/$(BuildFlavour).mk |
| 63 | endif |
| 64 | |
| 65 | # -------- Miscellaneous variables -------------------------------------------- |
| 66 | |
| 67 | # Set to V = 0 to get prettier build output. |
| 68 | # Please use V=1 (the default) when reporting GHC bugs. |
| 69 | V = 0 |
| 70 | |
| 71 | # Should all enabled warnings (see mk/warnings.mk) be turned into errors while |
| 72 | # building stage 2? |
| 73 | #WERROR=-Werror |
| 74 | |
| 75 | # After stage 1 and the libraries have been built, you can uncomment this line: |
| 76 | #stage=2 |
| 77 | |
| 78 | # Then stage 1 will not be touched by the build system, until |
| 79 | # you comment the line again. This is a useful trick for when you're |
| 80 | # working on stage 2 and want to freeze stage 1 and the libraries for |
| 81 | # a while. |
| 82 | |
| 83 | # Build the "extra" packages (see ./packages). This enables more tests. See: |
| 84 | # https://ghc.haskell.org/trac/ghc/wiki/Building/RunningTests/Running#AdditionalPackages |
| 85 | #BUILD_EXTRA_PKGS=YES |
| 86 | |
| 87 | # Uncomment the following line to enable building DPH |
| 88 | #BUILD_DPH=YES |
| 89 | |
| 90 | # Uncomment the following to force `integer-gmp` to use the in-tree GMP 5.0.4 |
| 91 | # (other sometimes useful configure-options: `--with-gmp-{includes,libraries}`) |
| 92 | #libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-intree-gmp |
| 93 | |
| 94 | GhcLibWays = $(if $(filter $(DYNAMIC_GHC_PROGRAMS),YES),v dyn,v) |
| 95 | |
| 96 | # Only use -fasm by default on platforms that support it. |
| 97 | GhcFAsm = $(if $(filter $(GhcWithNativeCodeGen),YES),-fasm,) |
| 98 | |
| 99 | # ----------- A Performance/Distribution build -------------------------------- |
| 100 | |
| 101 | ifeq "$(BuildFlavour)" "perf" |
| 102 | |
| 103 | # perf matches the default settings, repeated here for comparison: |
| 104 | |
| 105 | SRC_HC_OPTS = -O -H64m |
| 106 | GhcStage1HcOpts = -O $(GhcFAsm) |
| 107 | GhcStage2HcOpts = -O2 $(GhcFAsm) |
| 108 | GhcHcOpts = -Rghc-timing |
| 109 | GhcLibHcOpts = -O2 |
| 110 | GhcLibWays += p |
| 111 | |
| 112 | ifeq "$(PlatformSupportsSharedLibs)" "YES" |
| 113 | GhcLibWays += dyn |
| 114 | endif |
| 115 | |
| 116 | endif |
| 117 | |
| 118 | # ---------------- Perf build using LLVM -------------------------------------- |
| 119 | |
| 120 | ifeq "$(BuildFlavour)" "perf-llvm" |
| 121 | |
| 122 | SRC_HC_OPTS = -O -H64m -fllvm |
| 123 | GhcStage1HcOpts = -O -fllvm |
| 124 | GhcStage2HcOpts = -O2 -fllvm |
| 125 | GhcHcOpts = -Rghc-timing |
| 126 | GhcLibHcOpts = -O2 |
| 127 | GhcLibWays += p |
| 128 | |
| 129 | endif |
| 130 | |
| 131 | # ------- A Perf build configured for cross-compilation ---------------------- |
| 132 | |
| 133 | ifeq "$(BuildFlavour)" "perf-cross" |
| 134 | |
| 135 | SRC_HC_OPTS = -O -H64m -fllvm |
| 136 | GhcStage1HcOpts = -O2 |
| 137 | GhcStage2HcOpts = -O2 -fllvm |
| 138 | GhcHcOpts = -Rghc-timing |
| 139 | GhcLibHcOpts = -O2 |
| 140 | GhcLibWays += p |
| 141 | INTEGER_LIBRARY = integer-simple |
| 142 | Stage1Only = YES |
| 143 | |
| 144 | HADDOCK_DOCS = NO |
| 145 | BUILD_DOCBOOK_HTML = NO |
| 146 | BUILD_DOCBOOK_PS = NO |
| 147 | BUILD_DOCBOOK_PDF = NO |
| 148 | |
| 149 | DYNAMIC_BY_DEFAULT = NO |
| 150 | DYNAMIC_GHC_PROGRAMS = NO |
| 151 | |
| 152 | endif |
| 153 | |
| 154 | # -------- A Fast build ------------------------------------------------------- |
| 155 | |
| 156 | ifeq "$(BuildFlavour)" "quickest" |
| 157 | |
| 158 | SRC_HC_OPTS = -H64m -O0 $(GhcFAsm) |
| 159 | GhcStage1HcOpts = -O $(GhcFAsm) |
| 160 | GhcStage2HcOpts = -O0 $(GhcFAsm) |
| 161 | GhcLibHcOpts = -O0 $(GhcFAsm) |
| 162 | SplitObjs = NO |
| 163 | HADDOCK_DOCS = NO |
| 164 | BUILD_DOCBOOK_HTML = NO |
| 165 | BUILD_DOCBOOK_PS = NO |
| 166 | BUILD_DOCBOOK_PDF = NO |
| 167 | |
| 168 | endif |
| 169 | |
| 170 | # -------- A Fast build with optimised libs ----------------------------------- |
| 171 | |
| 172 | ifeq "$(BuildFlavour)" "quick" |
| 173 | |
| 174 | SRC_HC_OPTS = -H64m -O0 $(GhcFAsm) |
| 175 | GhcStage1HcOpts = -O $(GhcFAsm) |
| 176 | GhcStage2HcOpts = -O0 $(GhcFAsm) |
| 177 | GhcLibHcOpts = -O $(GhcFAsm) |
| 178 | SplitObjs = NO |
| 179 | HADDOCK_DOCS = NO |
| 180 | BUILD_DOCBOOK_HTML = NO |
| 181 | BUILD_DOCBOOK_PS = NO |
| 182 | BUILD_DOCBOOK_PDF = NO |
| 183 | |
| 184 | endif |
| 185 | |
| 186 | # -------- A Fast build with optimised libs using LLVM ------------------------ |
| 187 | |
| 188 | ifeq "$(BuildFlavour)" "quick-llvm" |
| 189 | |
| 190 | SRC_HC_OPTS = -H64m -O0 -fllvm |
| 191 | GhcStage1HcOpts = -O -fllvm |
| 192 | GhcStage2HcOpts = -O0 -fllvm |
| 193 | GhcLibHcOpts = -O -fllvm |
| 194 | SplitObjs = NO |
| 195 | HADDOCK_DOCS = NO |
| 196 | BUILD_DOCBOOK_HTML = NO |
| 197 | BUILD_DOCBOOK_PS = NO |
| 198 | BUILD_DOCBOOK_PDF = NO |
| 199 | |
| 200 | endif |
| 201 | |
| 202 | # -------- A Fast build configured for cross-compilation ---------------------- |
| 203 | |
| 204 | ifeq "$(BuildFlavour)" "quick-cross" |
| 205 | |
| 206 | SRC_HC_OPTS = -H64m -O0 |
| 207 | GhcStage1HcOpts = -O |
| 208 | GhcStage2HcOpts = -O0 -fllvm |
| 209 | GhcLibHcOpts = -O -fllvm |
| 210 | SplitObjs = NO |
| 211 | HADDOCK_DOCS = NO |
| 212 | BUILD_DOCBOOK_HTML = NO |
| 213 | BUILD_DOCBOOK_PS = NO |
| 214 | BUILD_DOCBOOK_PDF = NO |
| 215 | INTEGER_LIBRARY = integer-simple |
| 216 | Stage1Only = YES |
| 217 | |
| 218 | DYNAMIC_BY_DEFAULT = NO |
| 219 | DYNAMIC_GHC_PROGRAMS = NO |
| 220 | |
| 221 | endif |
| 222 | |
| 223 | # -------- Profile the stage2 compiler ---------------------------------------- |
| 224 | |
| 225 | ifeq "$(BuildFlavour)" "prof" |
| 226 | |
| 227 | SRC_HC_OPTS = -H64m -O0 $(GhcFAsm) |
| 228 | GhcStage1HcOpts = -O $(GhcFAsm) |
| 229 | GhcStage2HcOpts = -O $(GhcFAsm) |
| 230 | GhcLibHcOpts = -O $(GhcFAsm) |
| 231 | |
| 232 | GhcLibWays += p |
| 233 | GhcProfiled = YES |
| 234 | |
| 235 | SplitObjs = NO |
| 236 | HADDOCK_DOCS = NO |
| 237 | BUILD_DOCBOOK_HTML = NO |
| 238 | BUILD_DOCBOOK_PS = NO |
| 239 | BUILD_DOCBOOK_PDF = NO |
| 240 | |
| 241 | endif |
| 242 | |
| 243 | # -------- A Development build (stage 1) -------------------------------------- |
| 244 | |
| 245 | ifeq "$(BuildFlavour)" "devel1" |
| 246 | |
| 247 | SRC_HC_OPTS = -H64m -O $(GhcFAsm) |
| 248 | GhcLibHcOpts = -O -dcore-lint |
| 249 | GhcStage1HcOpts = -Rghc-timing -O0 -DDEBUG |
| 250 | GhcStage2HcOpts = -Rghc-timing -O $(GhcFAsm) |
| 251 | SplitObjs = NO |
| 252 | HADDOCK_DOCS = NO |
| 253 | BUILD_DOCBOOK_HTML = NO |
| 254 | BUILD_DOCBOOK_PS = NO |
| 255 | BUILD_DOCBOOK_PDF = NO |
| 256 | LAX_DEPENDENCIES = YES |
| 257 | |
| 258 | endif |
| 259 | |
| 260 | # -------- A Development build (stage 2) -------------------------------------- |
| 261 | |
| 262 | ifeq "$(BuildFlavour)" "devel2" |
| 263 | |
| 264 | SRC_HC_OPTS = -H64m -O $(GhcFAsm) |
| 265 | GhcLibHcOpts = -O -dcore-lint |
| 266 | GhcStage1HcOpts = -Rghc-timing -O $(GhcFAsm) |
| 267 | GhcStage2HcOpts = -Rghc-timing -O0 -DDEBUG |
| 268 | SplitObjs = NO |
| 269 | HADDOCK_DOCS = NO |
| 270 | BUILD_DOCBOOK_HTML = NO |
| 271 | BUILD_DOCBOOK_PS = NO |
| 272 | BUILD_DOCBOOK_PDF = NO |
| 273 | LAX_DEPENDENCIES = YES |
| 274 | |
| 275 | endif |
| 276 | |
| 277 | # -------- A bench build with optimised libs ----------------------------------- |
| 278 | |
| 279 | ifeq "$(BuildFlavour)" "bench" |
| 280 | |
| 281 | SRC_HC_OPTS = -O -H64m |
| 282 | GhcStage1HcOpts = -O $(GhcFAsm) |
| 283 | GhcStage2HcOpts = -O0 $(GhcFAsm) |
| 284 | GhcLibHcOpts = -O2 $(GhcFAsm) |
| 285 | SplitObjs = NO |
| 286 | HADDOCK_DOCS = NO |
| 287 | BUILD_DOCBOOK_HTML = NO |
| 288 | BUILD_DOCBOOK_PS = NO |
| 289 | BUILD_DOCBOOK_PDF = NO |
| 290 | |
| 291 | endif |
| 292 | |
| 293 | # ---------------- Bench build using LLVM -------------------------------------- |
| 294 | |
| 295 | ifeq "$(BuildFlavour)" "bench-llvm" |
| 296 | |
| 297 | SRC_HC_OPTS = -O -H64m |
| 298 | GhcStage1HcOpts = -O -fllvm |
| 299 | GhcStage2HcOpts = -O0 -fllvm |
| 300 | GhcLibHcOpts = -O2 -fllvm |
| 301 | SplitObjs = NO |
| 302 | HADDOCK_DOCS = NO |
| 303 | BUILD_DOCBOOK_HTML = NO |
| 304 | BUILD_DOCBOOK_PS = NO |
| 305 | BUILD_DOCBOOK_PDF = NO |
| 306 | |
| 307 | endif |
| 308 | |
| 309 | # ------- A Bench build configured for cross-compilation ---------------------- |
| 310 | |
| 311 | ifeq "$(BuildFlavour)" "bench-cross" |
| 312 | |
| 313 | SRC_HC_OPTS = -O -H64m |
| 314 | GhcStage1HcOpts = -O $(GhcFAsm) |
| 315 | GhcStage2HcOpts = -O0 $(GhcFAsm) |
| 316 | GhcLibHcOpts = -O2 $(GhcFAsm) |
| 317 | SplitObjs = NO |
| 318 | INTEGER_LIBRARY = integer-simple |
| 319 | Stage1Only = YES |
| 320 | HADDOCK_DOCS = NO |
| 321 | BUILD_DOCBOOK_HTML = NO |
| 322 | BUILD_DOCBOOK_PS = NO |
| 323 | BUILD_DOCBOOK_PDF = NO |
| 324 | |
| 325 | DYNAMIC_BY_DEFAULT = NO |
| 326 | DYNAMIC_GHC_PROGRAMS = NO |
| 327 | |
| 328 | endif |
| 329 | |
| 330 | # ----------------------------------------------------------------------------- |
| 331 | # Other settings that might be useful |
| 332 | |
| 333 | # NoFib settings |
| 334 | NoFibWays = |
| 335 | STRIP_CMD = : |
| 336 | |
| 337 | # ghc-pwd needs to link against /usr/lib/libiconv.dylib explicitly, because |
| 338 | # ghc-bootstrap's base library .a archive expects it |
| 339 | utils/ghc-pwd_EXTRA_LIBRARIES += "/usr/lib/libiconv.dylib" |