Cabal-1.22.5.0: A framework for packaging Haskell software

Copyright | Duncan Coutts 2007-2008
Maintainer | cabal-devel@haskell.org
Portability | portable
Safe Haskell | Safe
Language | Haskell98

Distribution.System

Contents

- Operating System
- Machine Architecture
- Platform is a pair of arch and OS

Description

Cabal often needs to do slightly different things on specific platforms. You probably know about the `os` however using that is very inconvenient because it is a string and different Haskell implementations do not agree on using the same strings for the same platforms! (In particular see the controversy over "windows" vs "ming32"). So to make it more consistent and easy to use we have an `OS` enumeration.

Synopsis

- data OS
  - = Linux
  - | Windows
  - | OSX
  - | FreeBSD
  - | OpenBSD
  - | NetBSD
  - | DragonFly
  - | Solaris
  - | AIX
  - | HPUX
  - | IRIX
  - | HaLVM
  - | IOS
  - | Ghcjs
  - | OtherOS String
- buildOS :: OS
- data Arch
  - = I386
  - | X86_64
  - | PPC
  - | PPC64
  - | Sparc
  - | Arm
  - | Mips
  - | SH
  - | IA64
  - | S390
  - | Alpha
  - | Hppa
  - | Rs6000
  - | M68k
  - | Vax
  - | JavaScript
  - | OtherArch String
- buildArch :: Arch
- data Platform = Platform Arch OS
- buildPlatform :: Platform
- platformFromTriple :: String -> Maybe Platform

# Operating System

data OS Source

Constructors

Linux |
Windows |
OSX |
FreeBSD |
OpenBSD |
NetBSD |
DragonFly |
Solaris |
AIX |
HPUX |
IRIX |
HaLVM |
IOS |
Ghcjs |
OtherOS String |

Instances

Eq OS Source |
Data OS Source |
Ord OS Source |
Read OS Source |
Show OS Source |
Generic OS Source |
Binary OS Source |
Text OS Source |
type Rep OS Source |

buildOS :: OS Source

# Machine Architecture

data Arch Source

Constructors

I386 |
X86_64 |
PPC |
PPC64 |
Sparc |
Arm |
Mips |
SH |
IA64 |
S390 |
Alpha |
Hppa |
Rs6000 |
M68k |
Vax |
JavaScript |
OtherArch String |

Instances

Eq Arch Source |
Data Arch Source |
Ord Arch Source |
Read Arch Source |
Show Arch Source |
Generic Arch Source |
Binary Arch Source |
Text Arch Source |
type Rep Arch Source |

buildArch :: Arch Source

# Platform is a pair of arch and OS

data Platform Source

Constructors

Platform Arch OS |

Instances

Eq Platform Source |
Data Platform Source |
Ord Platform Source |
Read Platform Source |
Show Platform Source |
Generic Platform Source |
Binary Platform Source |
Text Platform Source |
type Rep Platform Source |

buildPlatform :: Platform Source

The platform Cabal was compiled on. In most cases, `LocalBuildInfo.hostPlatform` should be used instead (the platform we're targeting).

platformFromTriple :: String -> Maybe Platform Source