summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mk/build.mk.sample42
-rw-r--r--mk/config.mk.in15
-rw-r--r--mk/validate-settings.mk15
3 files changed, 33 insertions, 39 deletions
diff --git a/mk/build.mk.sample b/mk/build.mk.sample
index 7969b40876..3f9770226b 100644
--- a/mk/build.mk.sample
+++ b/mk/build.mk.sample
@@ -72,8 +72,6 @@ V = 1
# Uncomment the following line to enable building DPH
#BUILD_DPH=YES
-GhcLibWays = $(if $(filter $(DYNAMIC_GHC_PROGRAMS),YES),v dyn,v)
-
# Uncomment the following to force `integer-gmp` to use the in-tree GMP 5.0.4
# (other sometimes useful configure-options: `--with-gmp-{includes,libraries}`)
#libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-intree-gmp
@@ -84,40 +82,34 @@ ifeq "$(BuildFlavour)" "perf"
# perf matches the default settings, repeated here for comparison:
-SRC_HC_OPTS = -O -H64m
-GhcStage1HcOpts = -O
-GhcStage2HcOpts = -O2
-GhcLibHcOpts = -O2
+SRC_HC_OPTS = -O -H64m
+GhcStage1HcOpts = -O
+GhcStage2HcOpts = -O2
+GhcLibHcOpts = -O2
+BUILD_PROF_LIBS = YES
#SplitObjs
#HADDOCK_DOCS
#BUILD_DOCBOOK_HTML
#BUILD_DOCBOOK_PS
#BUILD_DOCBOOK_PDF
-GhcLibWays = v
-GhcLibWays += p
-ifeq "$(PlatformSupportsSharedLibs)" "YES"
-GhcLibWays += dyn
-endif
-
endif
# ---------------- Perf build using LLVM --------------------------------------
ifeq "$(BuildFlavour)" "perf-llvm"
-SRC_HC_OPTS = -O -H64m -fllvm
-GhcStage1HcOpts = -O -fllvm
-GhcStage2HcOpts = -O2 -fllvm
-GhcLibHcOpts = -O2
+SRC_HC_OPTS = -O -H64m -fllvm
+GhcStage1HcOpts = -O -fllvm
+GhcStage2HcOpts = -O2 -fllvm
+GhcLibHcOpts = -O2
+BUILD_PROF_LIBS = YES
#SplitObjs
#HADDOCK_DOCS
#BUILD_DOCBOOK_HTML
#BUILD_DOCBOOK_PS
#BUILD_DOCBOOK_PDF
-GhcLibWays += p
-
endif
# ------- A Perf build configured for cross-compilation ----------------------
@@ -128,14 +120,13 @@ SRC_HC_OPTS = -O -H64m -fllvm
GhcStage1HcOpts = -O2
GhcStage2HcOpts = -O2 -fllvm
GhcLibHcOpts = -O2
+BUILD_PROF_LIBS = YES
#SplitObjs
HADDOCK_DOCS = NO
BUILD_DOCBOOK_HTML = NO
BUILD_DOCBOOK_PS = NO
BUILD_DOCBOOK_PDF = NO
-GhcLibWays += p
-
INTEGER_LIBRARY = integer-simple
Stage1Only = YES
DYNAMIC_BY_DEFAULT = NO
@@ -151,6 +142,7 @@ SRC_HC_OPTS = -H64m -O0
GhcStage1HcOpts = -O
GhcStage2HcOpts = -O0
GhcLibHcOpts = -O0
+BUILD_PROF_LIBS = NO
SplitObjs = NO
HADDOCK_DOCS = NO
BUILD_DOCBOOK_HTML = NO
@@ -167,6 +159,7 @@ SRC_HC_OPTS = -H64m -O0
GhcStage1HcOpts = -O
GhcStage2HcOpts = -O0
GhcLibHcOpts = -O
+BUILD_PROF_LIBS = NO
SplitObjs = NO
HADDOCK_DOCS = NO
BUILD_DOCBOOK_HTML = NO
@@ -183,6 +176,7 @@ SRC_HC_OPTS = -H64m -O0 -fllvm
GhcStage1HcOpts = -O -fllvm
GhcStage2HcOpts = -O0 -fllvm
GhcLibHcOpts = -O -fllvm
+BUILD_PROF_LIBS = NO
SplitObjs = NO
HADDOCK_DOCS = NO
BUILD_DOCBOOK_HTML = NO
@@ -199,6 +193,7 @@ SRC_HC_OPTS = -H64m -O0
GhcStage1HcOpts = -O
GhcStage2HcOpts = -O0 -fllvm
GhcLibHcOpts = -O -fllvm
+BUILD_PROF_LIBS = NO
SplitObjs = NO
HADDOCK_DOCS = NO
BUILD_DOCBOOK_HTML = NO
@@ -220,13 +215,13 @@ SRC_HC_OPTS = -H64m -O0
GhcStage1HcOpts = -O
GhcStage2HcOpts = -O
GhcLibHcOpts = -O
+BUILD_PROF_LIBS = YES
SplitObjs = NO
HADDOCK_DOCS = NO
BUILD_DOCBOOK_HTML = NO
BUILD_DOCBOOK_PS = NO
BUILD_DOCBOOK_PDF = NO
-GhcLibWays += p
GhcProfiled = YES
endif
@@ -239,6 +234,7 @@ SRC_HC_OPTS = -H64m -O
GhcStage1HcOpts = -O0 -DDEBUG
GhcStage2HcOpts = -O
GhcLibHcOpts = -O -dcore-lint
+BUILD_PROF_LIBS = NO
SplitObjs = NO
HADDOCK_DOCS = NO
BUILD_DOCBOOK_HTML = NO
@@ -257,6 +253,7 @@ SRC_HC_OPTS = -H64m -O
GhcStage1HcOpts = -O
GhcStage2HcOpts = -O0 -DDEBUG
GhcLibHcOpts = -O -dcore-lint
+BUILD_PROF_LIBS = NO
SplitObjs = NO
HADDOCK_DOCS = NO
BUILD_DOCBOOK_HTML = NO
@@ -275,6 +272,7 @@ SRC_HC_OPTS = -O -H64m
GhcStage1HcOpts = -O
GhcStage2HcOpts = -O0
GhcLibHcOpts = -O2
+BUILD_PROF_LIBS = NO
SplitObjs = NO
HADDOCK_DOCS = NO
BUILD_DOCBOOK_HTML = NO
@@ -291,6 +289,7 @@ SRC_HC_OPTS = -O -H64m
GhcStage1HcOpts = -O -fllvm
GhcStage2HcOpts = -O0 -fllvm
GhcLibHcOpts = -O2 -fllvm
+BUILD_PROF_LIBS = NO
SplitObjs = NO
HADDOCK_DOCS = NO
BUILD_DOCBOOK_HTML = NO
@@ -307,6 +306,7 @@ SRC_HC_OPTS = -O -H64m
GhcStage1HcOpts = -O
GhcStage2HcOpts = -O0
GhcLibHcOpts = -O2
+BUILD_PROF_LIBS = NO
SplitObjs = NO
HADDOCK_DOCS = NO
BUILD_DOCBOOK_HTML = NO
diff --git a/mk/config.mk.in b/mk/config.mk.in
index ebc1992139..bcdebbf113 100644
--- a/mk/config.mk.in
+++ b/mk/config.mk.in
@@ -219,15 +219,20 @@ ExtraMakefileSanityChecks = NO
INTEGER_LIBRARY=integer-gmp
# We build the libraries at least the "vanilla" way (way "v")
+# Technically we don't need the v way if DYNAMIC_GHC_PROGRAMS is YES,
+# but with -dynamic-too it's cheap, and makes life easier.
GhcLibWays = v
# In addition to the normal sequential way, the default is to also build
# profiled prelude libraries
-GhcLibWays += p
-
-ifeq "$(PlatformSupportsSharedLibs)" "YES"
-GhcLibWays += dyn
-endif
+# $(if $(filter ...)) allows controlling this expression from build.mk.
+GhcLibWays += $(if $(filter $(BUILD_PROF_LIBS),NO),,p)
+
+# Backward compatibility: although it would be cleaner to test for
+# PlatformSupportsSharedLibs, or perhaps a new variable BUILD_SHARED_LIBS,
+# some users currently expect that DYNAMIC_GHC_PROGRAMS=NO in build.mk implies
+# that dyn is not added to GhcLibWays.
+GhcLibWays += $(if $(filter $(DYNAMIC_GHC_PROGRAMS),NO),,dyn)
# Handy way to test whether we're building shared libs or not.
BuildSharedLibs=$(strip $(if $(findstring dyn,$(GhcLibWays)),YES,NO))
diff --git a/mk/validate-settings.mk b/mk/validate-settings.mk
index ef3a58e9a6..c71158e0a9 100644
--- a/mk/validate-settings.mk
+++ b/mk/validate-settings.mk
@@ -14,19 +14,8 @@ GhcStage2HcOpts += -O -dcore-lint
GhcLibHcOpts += -O -dcore-lint
-# We define DefaultFastGhcLibWays in this style so that the value is
-# correct even if the user alters DYNAMIC_GHC_PROGRAMS.
-# Technically we don't need the v way if DYNAMIC_GHC_PROGRAMS is YES,
-# but with -dynamic-too it's cheap, and makes life easier.
-DefaultFastGhcLibWays = $(if $(filter $(DYNAMIC_GHC_PROGRAMS),YES),v dyn,v)
-DefaultProfGhcLibWays = $(if $(filter $(GhcProfiled),YES),p,)
-
-ifeq "$(ValidateSpeed)" "FAST"
-GhcLibWays = $(DefaultFastGhcLibWays)
-else
-GhcLibWays := $(filter v dyn,$(GhcLibWays))
-endif
-GhcLibWays += $(DefaultProfGhcLibWays)
+BUILD_PROF_LIBS = NO
+
SplitObjs = NO
NoFibWays =
STRIP_CMD = :