2module IRTS.System(getDataFileName, getDataDir, getTargetDir,getCC,getLibFlags,getIdrisLibDir,
3 getIncFlags,getMvn,getExecutablePom, version) where
7import Control.Applicative ((<$>))
8import Data.Maybe (fromMaybe)
9import System.FilePath ((</>), addTrailingPathSeparator)
10import System.Environment
14import Paths_idris (version)
20getCC = fromMaybe "gcc" <$> environment "IDRIS_CC"
30getMvn = fromMaybe mvnCommand <$> environment "IDRIS_MVN"
32environment :: String -> IO (Maybe String)
33environment x = catchIO (do e <- getEnv x
35 (\_ -> return Nothing)
37getTargetDir :: IO String
38getTargetDir = environment "TARGET" >>= maybe getDataDir return
40#if defined(FREEBSD) || defined(DRAGONFLY)
41extraLib = ["-L/usr/local/lib"]
52getLibFlags = do dir <- getDataDir
53 return $ ["-L" ++ (dir </> "rts"),
54 "-lidris_rts"] ++ extraLib ++ gmpLib ++ ["-lpthread"]
56getIdrisLibDir = do libPath <- environment "IDRIS_LIBRARY_PATH"
57 dir <- maybe getDataDir return libPath
58 return $ addTrailingPathSeparator dir
60#if defined(FREEBSD) || defined(DRAGONFLY)
61extraInclude = ["-I/usr/local/include"]
65getIncFlags = do dir <- getDataDir
66 return $ ("-I" ++ dir </> "rts") : extraInclude
68getExecutablePom = do dir <- getDataDir
69 return $ dir </> "java" </> "executable_pom.xml"
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list