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

Safe HaskellNone
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.

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.

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.