Don't build the ghc DLL on Windows; works around trac #5987
authorIan Lynagh <igloo@earth.li>
Fri, 29 Jun 2012 16:47:32 +0000 (17:47 +0100)
committerIan Lynagh <igloo@earth.li>
Fri, 29 Jun 2012 16:47:32 +0000 (17:47 +0100)
We also don't build DLLs for the dph-lifted-* packages as they depend
on ghc.

compiler/ghc.mk
ghc.mk
rules/build-package.mk

index a3005db..82d9c01 100644 (file)
@@ -423,6 +423,14 @@ compiler_stage1_SplitObjs = NO
 compiler_stage2_SplitObjs = NO
 compiler_stage3_SplitObjs = NO
 
+ifeq "$(TargetOS_CPP)" "mingw32"
+# There are too many symbols to make a Windows DLL for the ghc package,
+# so we don't build it the dyn way; see trac #5987
+compiler_stage1_EXCLUDED_WAYS := dyn
+compiler_stage2_EXCLUDED_WAYS := dyn
+compiler_stage3_EXCLUDED_WAYS := dyn
+endif
+
 # if stage is set to something other than "1" or "", disable stage 1
 ifneq "$(filter-out 1,$(stage))" ""
 compiler_stage1_NOT_NEEDED = YES
diff --git a/ghc.mk b/ghc.mk
index 903cf1f..fc7d44b 100644 (file)
--- a/ghc.mk
+++ b/ghc.mk
@@ -528,6 +528,18 @@ $(error Unknown integer library: $(INTEGER_LIBRARY))
 endif
 endif
 
+# ----------------------------------------
+# Workarounds for problems building DLLs on Windows
+
+ifeq "$(TargetOS_CPP)" "mingw32"
+# We don't build the GHC package the dyn way on Windows, so
+# we can't build these packages the dyn way either. See trac #5987
+libraries/dph/dph-lifted-base_dist-install_EXCLUDED_WAYS := dyn
+libraries/dph/dph-lifted-boxed_dist-install_EXCLUDED_WAYS := dyn
+libraries/dph/dph-lifted-copy_dist-install_EXCLUDED_WAYS := dyn
+libraries/dph/dph-lifted-vseg_dist-install_EXCLUDED_WAYS := dyn
+endif
+
 # ----------------------------------------------
 # Checking packages with 'cabal check'
 
index ccd1659..c97f8c4 100644 (file)
@@ -70,7 +70,7 @@ $(call package-config,$1,$2,$3)
 ifeq "$3" "0"
 $1_$2_WAYS = v
 else
-$1_$2_WAYS = $$(GhcLibWays)
+$1_$2_WAYS = $$(filter-out $$($1_$2_EXCLUDED_WAYS),$$(GhcLibWays))
 endif
 
 # We must use a different dependency file if $(GhcLibWays) changes, so