From 5172586aa8f19793f8256a65b55b91ee09f67ee6 Mon Sep 17 00:00:00 2001 From: "John J. Camilleri" Date: Wed, 31 Oct 2018 11:10:05 +0100 Subject: [PATCH] Check GHC version instead of `directory` version Explanation by Thomas Hallgren: These MIN_VERSION macros are traditionally provided by Cabal, in dist/build/autogen/cabal_macros.h. It is only with ghc>=8.0 that ghc itself provides them, so with ghc<8, runghc Make.hs fails, as can be seen in the included message. Incidentally, ghc-8.0.1 also comes with directory-1.3, so I suggest using #if __GLASGOW_HASKELL__>=800 instead. Then Make.hs will work with older versions of ghc, and set the modification times if you are using ghc>=8.0. --- Make.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Make.hs b/Make.hs index 19bfd873..2a40e398 100644 --- a/Make.hs +++ b/Make.hs @@ -11,7 +11,7 @@ import System.Environment (getArgs,lookupEnv) import System.Process (rawSystem) import System.FilePath (()) -- ,takeFileName,addExtension,dropExtension) import System.Directory (createDirectoryIfMissing,copyFile,getDirectoryContents,removeDirectoryRecursive,findFile) -#if MIN_VERSION_directory(1,2,3) +#if __GLASGOW_HASKELL__>=800 import System.Directory (getModificationTime,setModificationTime) #endif import Control.Monad (when,unless) @@ -81,7 +81,7 @@ copyAll msg from to = do copyFileWithModificationTime :: FilePath -> FilePath -> IO () copyFileWithModificationTime source destination = do copyFile source destination -#if MIN_VERSION_directory(1,2,3) +#if __GLASGOW_HASKELL__>=800 getModificationTime source >>= setModificationTime destination #endif