@@ -1,4 +1,3 @@
1−{-# LANGUAGE TemplateHaskell #-}
21import Distribution.Simple
32import Distribution.Simple.LocalBuildInfo
43import Distribution.Simple.Setup
@@ -10,7 +9,6 @@ import System.Process
109import System.Directory
1110import System.FilePath
1211import System.Exit
13−import Language.Haskell.TH (appE, varE, mkName, conE)
1412
1513main = defaultMainWithHooks hk
1614 where
@@ -34,11 +32,7 @@ cArgsHC = map ("-optc" ++) cArgs
3432
3533canUseRDRAND :: FilePath -> IO Bool
3634canUseRDRAND cc = do
37− -- Template haskell to call withTempDirectory in a backward compatible way
38− -- withTempDirectory normal False "" "testRDRAND" $ \tmpDir -> do
39− $(if cabalVersion >= Version [1,17,0] []
40− then appE (appE (varE $ mkName "withTempDirectory") (varE 'normal)) (conE (mkName "False"))
41− else appE (varE $ mkName "withTempDirectory") (varE 'normal)) "" "testRDRAND" $ \tmpDir -> do
35+ withTempDirectory normal "" "testRDRAND" $ \tmpDir -> do
4236 writeFile (tmpDir ++ "/testRDRAND.c")
4337 (unlines [ "#include <stdint.h>"
4438 , "int main() {"