[commit: packages/time] master: get building on Windows (89e52b0)

git at git.haskell.org git at git.haskell.org
Sun Dec 20 07:52:28 UTC 2015


Repository : ssh://git@git.haskell.org/time

On branch  : master
Link       : http://git.haskell.org/packages/time.git/commitdiff/89e52b024e4b9600af3bb30debd6ac43711cdc04

>---------------------------------------------------------------

commit 89e52b024e4b9600af3bb30debd6ac43711cdc04
Author: ashley <ashley at semantic.org>
Date:   Fri Apr 17 00:58:14 2009 -0700

    get building on Windows
    
    Ignore-this: 7f61aa6f76736ff855aa665991f2a2c6
    
    darcs-hash:20090417075814-ca2d0-d459b191878a61b0ac33b05230ecba1d94f93e69


>---------------------------------------------------------------

89e52b024e4b9600af3bb30debd6ac43711cdc04
 Setup.hs         |  7 ++++---
 include/HsTime.h |  3 ++-
 time.cabal       | 10 +++++++---
 3 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/Setup.hs b/Setup.hs
index ac50db8..cdd46de 100644
--- a/Setup.hs
+++ b/Setup.hs
@@ -10,9 +10,10 @@ import System.Directory
 import System.Info
 
 main :: IO ()
-main = if os == "windows"
- then defaultMain
- else let hooks = autoconfUserHooks { runTests = runTestScript } in defaultMainWithHooks hooks
+main = case os of
+    "windows" -> defaultMain
+    "mingw32" -> defaultMain
+    _ -> let hooks = autoconfUserHooks { runTests = runTestScript } in defaultMainWithHooks hooks
 
 withCurrentDirectory :: FilePath -> IO a -> IO a
 withCurrentDirectory path f = do
diff --git a/include/HsTime.h b/include/HsTime.h
index 12d45bd..5296437 100644
--- a/include/HsTime.h
+++ b/include/HsTime.h
@@ -2,6 +2,7 @@
 #define __HSTIME_H__
 
 #if defined(_MSC_VER) || defined(__MINGW32__) || defined(_WIN32)
+#define HAVE_TIME_H 1
 #else
 
 #include "HsTimeConfig.h"
@@ -11,11 +12,11 @@
 #undef PACKAGE_STRING
 #undef PACKAGE_TARNAME
 #undef PACKAGE_VERSION
+#endif
 
 #if HAVE_TIME_H
 #include <time.h>
 #endif
-#endif
 
 long int get_current_timezone_seconds (time_t,int* pdst,char const* * pname);
 
diff --git a/time.cabal b/time.cabal
index 2850397..9c74c9e 100644
--- a/time.cabal
+++ b/time.cabal
@@ -65,8 +65,12 @@ library
         Data.Time.LocalTime.LocalTime,
         Data.Time.Format.Parse
     include-dirs:    include
-    install-includes:
-        HsTime.h
-        HsTimeConfig.h
+    if os(windows)
+        install-includes:
+            HsTime.h
+    else
+        install-includes:
+            HsTime.h
+            HsTimeConfig.h
 }
 



More information about the ghc-commits mailing list