ddc-build-0.4.3.1: Disciplined Disciple Compiler build framework.

Safe HaskellSafe
LanguageHaskell98

DDC.Build.Platform

Contents

Synopsis

Documentation

data Platform Source #

Describes a build or target platform.

Constructors

Platform 

staticFileExtensionOfPlatform :: Platform -> String Source #

Get the file extension to use for a static library on this platform.

sharedFileExtensionOfPlatform :: Platform -> String Source #

Get the file extension to use for a shared library on this platform.

data Arch Source #

Processor Architecture.

Instances

Eq Arch Source # 

Methods

(==) :: Arch -> Arch -> Bool #

(/=) :: Arch -> Arch -> Bool #

Show Arch Source # 

Methods

showsPrec :: Int -> Arch -> ShowS #

show :: Arch -> String #

showList :: [Arch] -> ShowS #

Pretty Arch Source # 

Associated Types

data PrettyMode Arch :: * #

Methods

pprDefaultMode :: PrettyMode Arch #

ppr :: Arch -> Doc #

pprPrec :: Int -> Arch -> Doc #

pprModePrec :: PrettyMode Arch -> Int -> Arch -> Doc #

archPointerWidth :: Arch -> Int Source #

Get the width of a pointer on the architecture, in bits.

data Os Source #

Operating System.

Constructors

OsDarwin (Maybe (Int, Int, Int))

Darwin, including the major, minor and patch numbers, if specified.

OsLinux

Generic Linux.

OsCygwin

Cygwin on Windows.

OsMingw

MinGW on Windows.

Instances

Eq Os Source # 

Methods

(==) :: Os -> Os -> Bool #

(/=) :: Os -> Os -> Bool #

Show Os Source # 

Methods

showsPrec :: Int -> Os -> ShowS #

show :: Os -> String #

showList :: [Os] -> ShowS #

Pretty Os Source # 

Associated Types

data PrettyMode Os :: * #

Methods

pprDefaultMode :: PrettyMode Os #

ppr :: Os -> Doc #

pprPrec :: Int -> Os -> Doc #

pprModePrec :: PrettyMode Os -> Int -> Os -> Doc #

Host platform

determineHostPlatform :: IO (Maybe Platform) Source #

Determine the default host platform.

Uses the arch and uname commands which must be in the current path.

Returns Nothing if arch or uname cannot be found, returned an error, or we didn't recognise their response.

For Platforms like Darwin which can run both 32-bit and 64-bit binaries, we return whatever the default is reported by arch and uname.

determineHostArch :: IO (Maybe Arch) Source #

Determine the host archicture. Uses the arch command which must be in the current path.

determineHostOs :: IO (Maybe Os) Source #

Determine the host OS. Uses the uname command which must be in the current path.

determineHostLlvmVersion :: Maybe FilePath -> IO (Maybe String) Source #

Determine the host LLVM version string, eg "3.5.2" Takes the path to the LLVM compiler to use, or Nothing to use whatever is in the current path.