From 89e52b024e4b9600af3bb30debd6ac43711cdc04 Mon Sep 17 00:00:00 2001 From: ashley <ashley@semantic.org> Date: Fri, 17 Apr 2009 00:58:14 -0700 Subject: [PATCH] get building on Windows Ignore-this: 7f61aa6f76736ff855aa665991f2a2c6 darcs-hash:20090417075814-ca2d0-d459b191878a61b0ac33b05230ecba1d94f93e69 --- 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 } -- GitLab