summaryrefslogtreecommitdiff
path: root/mk/config.mk.in
diff options
context:
space:
mode:
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))