summaryrefslogtreecommitdiff
path: root/mk/config.mk.in
diff options
context:
space:
mode:
authorThomas Miedema <thomasmiedema@gmail.com>2015-06-29 22:42:42 +0200
committerThomas Miedema <thomasmiedema@gmail.com>2015-07-07 12:40:41 +0200
commit37de4ad76b75d403e6a8dae9539af08c859d46a4 (patch)
tree33df047c78357f0ed1ded81cca5b4bd1e9d17c3d /mk/config.mk.in
parentdb530f18784fe1a29394470a0edc56702727bcde (diff)
downloadhaskell-37de4ad76b75d403e6a8dae9539af08c859d46a4.tar.gz
Build system: don't set GhcLibWays explicitly in build.mk.sample (#10536)
We used to have the following in mk/build.mk.sample: GhcLibWays = $(if $(filter $(DYNAMIC_GHC_PROGRAMS),YES),v dyn,v) This commit removes that statement for the following reasons: 1) It depends on the variable DYNAMIC_GHC_PROGRAMS, which is set later in the file for some BuildFlavours. Although this works because `make` does multiple passes when reading Makefiles, it is confusing to users [1]. Instead, test for DYNAMIC_GHC_PROGRAMS in mk/config.mk.in. 2) Although it looks like that line is about compiling the `dyn` way, its purpose is really to not build the `prof` way. This commit introduces the variable BUILD_PROF_LIBS, to make this more explicit. This simplifies mk/build.mk.sample and mk/validate-settings.mk. Note that setting GhcLibWays explicitly still works, and DYNAMIC_GHC_PROGRAMS=NO in build.mk does not build the `dyn` way. [1] https://mail.haskell.org/pipermail/ghc-devs/2014-December/007725.html Differential Revision: https://phabricator.haskell.org/D1021
Diffstat (limited to 'mk/config.mk.in')
-rw-r--r--mk/config.mk.in15
1 files changed, 10 insertions, 5 deletions
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))