-- | A description of the platform we're compiling for.--modulePlatform(Platform(..),Arch(..),OS(..),ArmISA(..),ArmISAExt(..),ArmABI(..),target32Bit,osElfTarget)where-- | Contains enough information for the native code generator to emit-- code for this platform.dataPlatform=Platform{platformArch::Arch,platformOS::OS,platformWordSize::{-# UNPACK #-}!Int,platformHasGnuNonexecStack::Bool,platformHasIdentDirective::Bool,platformHasSubsectionsViaSymbols::Bool}deriving(Read,Show,Eq)-- | Architectures that the native code generator knows about.-- TODO: It might be nice to extend these constructors with information-- about what instruction set extensions an architecture might support.--dataArch=ArchUnknown|ArchX86|ArchX86_64|ArchPPC|ArchPPC_64|ArchSPARC|ArchARM{armISA::ArmISA,armISAExt::[ArmISAExt],armABI::ArmABI}deriving(Read,Show,Eq)-- | Operating systems that the native code generator knows about.-- Having OSUnknown should produce a sensible default, but no promises.dataOS=OSUnknown|OSLinux|OSDarwin|OSSolaris2|OSMinGW32|OSFreeBSD|OSDragonFly|OSOpenBSD|OSNetBSD|OSKFreeBSD|OSHaikuderiving(Read,Show,Eq)-- | ARM Instruction Set Architecture, Extensions and ABI--dataArmISA=ARMv5|ARMv6|ARMv7deriving(Read,Show,Eq)dataArmISAExt=VFPv2|VFPv3|VFPv3D16|NEON|IWMMX2deriving(Read,Show,Eq)dataArmABI=SOFT|SOFTFP|HARDderiving(Read,Show,Eq)target32Bit::Platform->Booltarget32Bitp=platformWordSizep==4-- | This predicates tells us whether the OS supports ELF-like shared libraries.osElfTarget::OS->BoolosElfTargetOSLinux=TrueosElfTargetOSFreeBSD=TrueosElfTargetOSDragonFly=TrueosElfTargetOSOpenBSD=TrueosElfTargetOSNetBSD=TrueosElfTargetOSSolaris2=TrueosElfTargetOSDarwin=FalseosElfTargetOSMinGW32=FalseosElfTargetOSKFreeBSD=TrueosElfTargetOSHaiku=TrueosElfTargetOSUnknown=False-- Defaulting to False is safe; it means don't rely on any-- ELF-specific functionality. It is important to have a default for-- portability, otherwise we have to answer this question for every-- new platform we compile on (even unreg).