From: Ian Lynagh Date: Sat, 20 Mar 2010 23:14:14 +0000 (+0000) Subject: Enable shared libraries on Windows; fixes trac #3879 X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=624e821201ed68425c906358f8d45a69f4e61093 Enable shared libraries on Windows; fixes trac #3879 --- diff --git a/mk/config.mk.in b/mk/config.mk.in index d3b656a..a640c3e 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 bf81eee..4b5e106 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 3e5af68..592eb09 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 @@ -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 0000000..df5fde9 --- /dev/null +++ b/rts/RtsDllMain.h @@ -0,0 +1,17 @@ + +#include "Rts.h" + +#ifdef HAVE_WINDOWS_H +#include +#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 +