Safe Haskell | None |
---|
DDC.Build.Platform
Contents
- data Platform = Platform {
- platformArch :: Arch
- platformOs :: Os
- staticFileExtensionOfPlatform :: Platform -> String
- sharedFileExtensionOfPlatform :: Platform -> String
- data Arch
- = ArchX86_32
- | ArchX86_64
- | ArchPPC_32
- | ArchPPC_64
- archPointerWidth :: Arch -> Int
- data Os
- determineHostPlatform :: IO (Maybe Platform)
- determineHostArch :: IO (Maybe Arch)
- determineHostOs :: IO (Maybe Os)
Documentation
Describes a build or target platform.
Constructors
Platform | |
Fields
|
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.
Processor Architecture.
Constructors
ArchX86_32 | |
ArchX86_64 | |
ArchPPC_32 | |
ArchPPC_64 |
archPointerWidth :: Arch -> IntSource
Get the width of a pointer on the architecture, in bits.
Operating System.
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.