diff options
author | Simon Marlow <marlowsd@gmail.com> | 2009-09-09 11:57:57 +0000 |
---|---|---|
committer | Simon Marlow <marlowsd@gmail.com> | 2009-09-09 11:57:57 +0000 |
commit | d6d0a196363d44008a4850cddf727f06b42644f9 (patch) | |
tree | 1ff8a7a7ca25ea454aeb730298e841556f62e8da | |
parent | a4f81c1d128c5a77f47d37c6fe069186c128a37d (diff) | |
download | haskell-d6d0a196363d44008a4850cddf727f06b42644f9.tar.gz |
Fix up logic to decide whether shared libs are being built or not
Now, adding dyn to $(GhcLibWays) is how shared libs are enabled.
Everything else keys off that, rather than testing
$(BuildSharedLibs).
-rw-r--r-- | mk/build.mk.sample | 4 | ||||
-rw-r--r-- | mk/config.mk.in | 18 |
2 files changed, 11 insertions, 11 deletions
diff --git a/mk/build.mk.sample b/mk/build.mk.sample index 5b61d16f4b..b43ef94dc8 100644 --- a/mk/build.mk.sample +++ b/mk/build.mk.sample @@ -40,6 +40,10 @@ GhcHcOpts = -Rghc-timing GhcLibHcOpts = -O2 -XGenerics GhcLibWays += p +ifeq "$(PlatformSupportsSharedLibs)" "YES" +GhcLibWays += dyn +endif + endif # -------- A Fast build ------------------------------------------------------ diff --git a/mk/config.mk.in b/mk/config.mk.in index 53d7f81dc5..813a91220a 100644 --- a/mk/config.mk.in +++ b/mk/config.mk.in @@ -102,13 +102,9 @@ GhcProfiled=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) -ifeq "$(PlatformSupportsSharedLibs)" "YES" -BuildSharedLibs = YES -else -BuildSharedLibs = NO -endif + # ToDo later: # BuildStaticLibs=@BuildStaticLibs@ @@ -221,10 +217,13 @@ ifneq "$(BootingFromHc)" "YES" GhcLibWays += p endif -ifeq "$(BuildSharedLibs)" "YES" +ifeq "$(PlatformSupportsSharedLibs)" "YES" GhcLibWays += dyn endif +# 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: # @@ -246,15 +245,12 @@ ifeq "$(BootingFromHc)" "NO" 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,),) +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) |