Now, adding dyn to $(GhcLibWays) is how shared libs are enabled.
Everything else keys off that, rather than testing
$(BuildSharedLibs).
GhcLibHcOpts = -O2 -XGenerics
GhcLibWays += p
GhcLibHcOpts = -O2 -XGenerics
GhcLibWays += p
+ifeq "$(PlatformSupportsSharedLibs)" "YES"
+GhcLibWays += dyn
+endif
+
endif
# -------- A Fast build ------------------------------------------------------
endif
# -------- A Fast build ------------------------------------------------------
GhcDebugged=NO
GhcLibProfiled=$(if $(filter p,$(GhcLibWays)),YES,NO)
GhcDebugged=NO
GhcLibProfiled=$(if $(filter p,$(GhcLibWays)),YES,NO)
-# Build shared and/or static libs?
+# Do we support shared libs?
PlatformSupportsSharedLibs = $(if $(filter $(TARGETPLATFORM),i386-unknown-linux x86_64-unknown-linux),YES,NO)
PlatformSupportsSharedLibs = $(if $(filter $(TARGETPLATFORM),i386-unknown-linux x86_64-unknown-linux),YES,NO)
-ifeq "$(PlatformSupportsSharedLibs)" "YES"
-BuildSharedLibs = YES
-else
-BuildSharedLibs = NO
-endif
# ToDo later:
# BuildStaticLibs=@BuildStaticLibs@
# ToDo later:
# BuildStaticLibs=@BuildStaticLibs@
-ifeq "$(BuildSharedLibs)" "YES"
+ifeq "$(PlatformSupportsSharedLibs)" "YES"
+# Handy way to test whether we're building shared libs or not.
+BuildSharedLibs=$(strip $(if $(findstring dyn,$(GhcLibWays)),YES,NO))
+
# In addition, the RTS is built in some further variations. Ways that
# make sense here:
#
# In addition, the RTS is built in some further variations. Ways that
# make sense here:
#
GhcRTSWays += debug
endif
GhcRTSWays += debug
endif
-ifeq "$(BuildSharedLibs)" "YES"
-GhcRTSWays += dyn debug_dyn $(if $(findstring NO, $(GhcUnregisterised)),thr_dyn thr_debug_dyn)
-endif
-
# Want the threaded versions unless we're unregisterised
# Defer the check until later by using $(if..), because GhcUnregisterised might
# be set in build.mk, which hasn't been read yet.
GhcRTSWays += $(if $(findstring NO, $(GhcUnregisterised)),thr thr_debug thr_l,)
GhcRTSWays += $(if $(findstring p, $(GhcLibWays)),$(if $(findstring NO, $(GhcUnregisterised)),thr_p,),)
# Want the threaded versions unless we're unregisterised
# Defer the check until later by using $(if..), because GhcUnregisterised might
# be set in build.mk, which hasn't been read yet.
GhcRTSWays += $(if $(findstring NO, $(GhcUnregisterised)),thr thr_debug thr_l,)
GhcRTSWays += $(if $(findstring p, $(GhcLibWays)),$(if $(findstring NO, $(GhcUnregisterised)),thr_p,),)
+GhcRTSWays += $(if $(findstring dyn, $(GhcLibWays)), dyn debug_dyn $(if $(findstring NO, $(GhcUnregisterised)),thr_dyn thr_debug_dyn),)
# We can only build GHCi threaded if we have a threaded RTS:
GhcThreaded = $(if $(findstring thr,$(GhcRTSWays)),YES,NO)
# We can only build GHCi threaded if we have a threaded RTS:
GhcThreaded = $(if $(findstring thr,$(GhcRTSWays)),YES,NO)