summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2010-03-20 23:14:14 +0000
committerIan Lynagh <igloo@earth.li>2010-03-20 23:14:14 +0000
commit624e821201ed68425c906358f8d45a69f4e61093 (patch)
tree7b5f7144826dd344b4a186cadac6ff6fb0e10242
parente95140a5c350360b1f8e3f1e789ec4a5eebf95f3 (diff)
downloadhaskell-624e821201ed68425c906358f8d45a69f4e61093.tar.gz
Enable shared libraries on Windows; fixes trac #3879
-rw-r--r--mk/config.mk.in2
-rw-r--r--rts/PrimOps.cmm2
-rw-r--r--rts/RtsDllMain.c5
-rw-r--r--rts/RtsDllMain.h17
4 files changed, 23 insertions, 3 deletions
diff --git a/mk/config.mk.in b/mk/config.mk.in
index d3b656a326..a640c3e2ad 100644
--- a/mk/config.mk.in
+++ b/mk/config.mk.in
@@ -102,7 +102,7 @@ GhcDebugged=NO
GhcLibProfiled=$(if $(filter p,$(GhcLibWays)),YES,NO)
# Do we support shared libs?
-PlatformSupportsSharedLibs = $(if $(filter $(TARGETPLATFORM),i386-unknown-linux x86_64-unknown-linux i386-unknown-freebsd amd64-unknown-freebsd),YES,NO)
+PlatformSupportsSharedLibs = $(if $(filter $(TARGETPLATFORM),i386-unknown-linux x86_64-unknown-linux i386-unknown-freebsd amd64-unknown-freebsd i386-unknown-mingw32),YES,NO)
# ToDo later:
# BuildStaticLibs=@BuildStaticLibs@
diff --git a/rts/PrimOps.cmm b/rts/PrimOps.cmm
index bf81eeece1..4b5e106710 100644
--- a/rts/PrimOps.cmm
+++ b/rts/PrimOps.cmm
@@ -35,7 +35,9 @@ import base_ControlziExceptionziBase_nestedAtomically_closure;
import EnterCriticalSection;
import LeaveCriticalSection;
import ghczmprim_GHCziBool_False_closure;
+#if !defined(mingw32_HOST_OS)
import sm_mutex;
+#endif
/*-----------------------------------------------------------------------------
Array Primitives
diff --git a/rts/RtsDllMain.c b/rts/RtsDllMain.c
index 3e5af6864e..592eb09d26 100644
--- a/rts/RtsDllMain.c
+++ b/rts/RtsDllMain.c
@@ -9,6 +9,7 @@
#include "PosixSource.h"
#include "Rts.h"
#include "RtsAPI.h"
+#include "RtsDllMain.h"
#ifdef HAVE_WINDOWS_H
#include <windows.h>
@@ -18,9 +19,9 @@
#if defined(__PIC__) && defined(mingw32_TARGET_OS)
BOOL
WINAPI
-DllMain ( HINSTANCE hInstance
+DllMain ( HINSTANCE hInstance STG_UNUSED
, DWORD reason
- , LPVOID reserved
+ , LPVOID reserved STG_UNUSED
)
{
/*
diff --git a/rts/RtsDllMain.h b/rts/RtsDllMain.h
new file mode 100644
index 0000000000..df5fde9c12
--- /dev/null
+++ b/rts/RtsDllMain.h
@@ -0,0 +1,17 @@
+
+#include "Rts.h"
+
+#ifdef HAVE_WINDOWS_H
+#include <windows.h>
+#endif
+
+/* I'd be mildly surprised if this wasn't defined, but still. */
+#if defined(__PIC__) && defined(mingw32_TARGET_OS)
+BOOL
+WINAPI
+DllMain ( HINSTANCE hInstance
+ , DWORD reason
+ , LPVOID reserved
+ );
+#endif
+