3Description : Utilities for interacting with the System.
6Maintainer : The Idris Community.
9module IRTS.System( getDataFileName
22import Control.Applicative ((<$>))
23import Data.Maybe (fromMaybe)
24import System.FilePath ((</>), addTrailingPathSeparator)
25import System.Environment
29import Paths_idris (version)
34overrideDataDirWith :: String -> IO FilePath
35overrideDataDirWith envVar = do
36 envValue <- lookupEnv envVar
40 return (ddir </> "libs")
41 Just ddir -> return ddir
44getCC = fromMaybe "gcc" <$> lookupEnv "IDRIS_CC"
46getEnvFlags :: IO [String]
47getEnvFlags = maybe [] (splitOn " ") <$> lookupEnv "IDRIS_CFLAGS"
49getTargetDir :: IO String
50getTargetDir = overrideDataDirWith "TARGET"
52#if defined(freebsd_HOST_OS) || defined(dragonfly_HOST_OS)\
53 || defined(openbsd_HOST_OS) || defined(netbsd_HOST_OS)
54extraLib = ["-L/usr/local/lib"]
55extraInclude = ["-I/usr/local/include"]
67getLibFlags = do dir <- getDataDir
68 return $ ["-L" ++ (dir </> "rts"),
69 "-lidris_rts"] ++ extraLib ++ gmpLib ++ ["-lpthread"]
71getIdrisLibDir = addTrailingPathSeparator <$> overrideDataDirWith "IDRIS_LIBRARY_PATH"
73getIncFlags = do dir <- getDataDir
74 return $ ("-I" ++ dir </> "rts") : extraInclude
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