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

Safe HaskellNone

DDC.Build.Platform

Contents

Synopsis

Documentation

data Platform Source

Describes a build or target platform.

Constructors

Platform 

staticFileExtensionOfPlatform :: Platform -> StringSource

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

sharedFileExtensionOfPlatform :: Platform -> StringSource

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

data Arch Source

Processor Architecture.

Instances

archPointerWidth :: Arch -> IntSource

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

data Os Source

Operating System.

Constructors

OsDarwin 
OsLinux 
OsCygwin 

Instances

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.