git.iko.soy/typeable/entropy
on main help sign in
Revert "Try to fix cc detection"
e072eb4Thomas M. DuBuisson
Setup.hs+2−7
@@ -1,4 +1,3 @@
1−import Control.Monad
2import Distribution.Simple
1import Distribution.Simple
3import Distribution.Simple.LocalBuildInfo
2import Distribution.Simple.LocalBuildInfo
4import Distribution.Simple.Setup
3import Distribution.Simple.Setup
@@ -14,13 +13,10 @@ import System.Exit
14main = defaultMainWithHooks hk
13main = defaultMainWithHooks hk
15 where
14 where
16 hk = simpleUserHooks { buildHook = \pd lbi uh bf -> do
15 hk = simpleUserHooks { buildHook = \pd lbi uh bf -> do
17− let ccProg0 = Program "gcc" undefined undefined undefined
16+ let ccProg = Program "gcc" undefined undefined undefined
18− ccProg1 = Program "clang" undefined undefined undefined
19− f x = lookupProgram x (withPrograms lbi)
17+ mConf = lookupProgram ccProg (withPrograms lbi)
20− mConf = f ccProg0 `mplus` f ccProg1
21 err = error "Could not determine C compiler"
18 err = error "Could not determine C compiler"
22 cc = locationPath . programLocation . maybe err id $ mConf
19 cc = locationPath . programLocation . maybe err id $ mConf
23− print (withPrograms lbi)
24 b <- canUseRDRAND cc
20 b <- canUseRDRAND cc
25 let newWithPrograms1 = userSpecifyArgs "gcc" cArgs (withPrograms lbi)
21 let newWithPrograms1 = userSpecifyArgs "gcc" cArgs (withPrograms lbi)
26 newWithPrograms = userSpecifyArgs "ghc" cArgsHC newWithPrograms1
22 newWithPrograms = userSpecifyArgs "ghc" cArgsHC newWithPrograms1
@@ -37,7 +33,6 @@ cArgsHC = map ("-optc" ++) cArgs
37canUseRDRAND :: FilePath -> IO Bool
33canUseRDRAND :: FilePath -> IO Bool
38canUseRDRAND cc = do
34canUseRDRAND cc = do
39 withTempDirectory normal "" "testRDRAND" $ \tmpDir -> do
35 withTempDirectory normal "" "testRDRAND" $ \tmpDir -> do
40− -- withTempDirectory normal False "" "testRDRAND" $ \tmpDir -> do
41 writeFile (tmpDir ++ "/testRDRAND.c")
36 writeFile (tmpDir ++ "/testRDRAND.c")
42 (unlines [ "#include <stdint.h>"
37 (unlines [ "#include <stdint.h>"
43 , "int main() {"
38 , "int main() {"
System/Entropy.hs+6−6
@@ -9,12 +9,12 @@
9-}
9-}
10
10
11module System.Entropy
11module System.Entropy
12− ( getEntropy
12+ ( getEntropy
13− , CryptHandle
13+ , CryptHandle
14− , openHandle
14+ , openHandle
15− , hGetEntropy
15+ , hGetEntropy
16− , closeHandle
16+ , closeHandle
17− ) where
17+ ) where
18
18
19import Control.Monad (liftM)
19import Control.Monad (liftM)
20import Data.ByteString as B
20import Data.ByteString as B