on master help sign in
Fix Util.System so that it compiles again...
a41e971Edwin Brady
src/Util/System.hs+14−1
@@ -1,5 +1,6 @@
1{-# LANGUAGE CPP #-}
1{-# LANGUAGE CPP #-}
2+module Util.System(tempfile,environment,getCC,
2−module Util.System(tempfile,environment,getCC,getLibFlags,getIdrisLibDir,getIncFlags,rmFile) where
3+ getLibFlags,getIdrisLibDir,getIncFlags,rmFile) where
3
4
4-- System helper functions.
5-- System helper functions.
5
6
@@ -11,6 +12,8 @@ import System.IO
11import Control.Exception as CE
12import Control.Exception as CE
12#endif
13#endif
13
14
15+import Paths_idris
16+
14#if MIN_VERSION_base(4,0,0)
17#if MIN_VERSION_base(4,0,0)
15catchIO :: IO a -> (IOError -> IO a) -> IO a
18catchIO :: IO a -> (IOError -> IO a) -> IO a
16catchIO = CE.catch
19catchIO = CE.catch
@@ -38,3 +41,13 @@ rmFile f = do putStrLn $ "Removing " ++ f
38 catchIO (removeFile f)
41 catchIO (removeFile f)
39 (\ioerr -> putStrLn $ "WARNING: Cannot remove file "
42 (\ioerr -> putStrLn $ "WARNING: Cannot remove file "
40 ++ f ++ ", Error msg:" ++ show ioerr)
43 ++ f ++ ", Error msg:" ++ show ioerr)
44+
45+
46+getLibFlags = do dir <- getDataDir
47+ return $ "-L" ++ (dir </> "rts") ++ " -lidris_rts -lgmp -lpthread"
48+
49+getIdrisLibDir = do dir <- getDataDir
50+ return $ addTrailingPathSeparator dir
51+
52+getIncFlags = do dir <- getDataDir
53+ return $ "-I" ++ dir </> "rts"