X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2FnativeGen%2FPlatform.hs;h=afbf0b2ae2614b3dd8ee683aae7bef5374f52d37;hp=8b01f5cbb3acc8a8f9642731852829d79101200c;hb=0af418beb1aadcae1df036240151556895d00321;hpb=5e91c7ce494b63565e58588066c4c72b28e1cd59 diff --git a/compiler/nativeGen/Platform.hs b/compiler/nativeGen/Platform.hs index 8b01f5c..afbf0b2 100644 --- a/compiler/nativeGen/Platform.hs +++ b/compiler/nativeGen/Platform.hs @@ -9,7 +9,8 @@ module Platform ( Arch(..), OS(..), - defaultTargetPlatform + defaultTargetPlatform, + osElfTarget ) where @@ -47,9 +48,16 @@ data OS | OSDarwin | OSSolaris | OSMinGW32 + | OSFreeBSD deriving (Show, Eq) +-- | This predicates tells us whether the OS supports ELF-like shared libraries. +osElfTarget :: OS -> Bool +osElfTarget OSLinux = True +osElfTarget OSFreeBSD = True +osElfTarget _ = False + -- | This is the target platform as far as the #ifdefs are concerned. -- These are set in includes/ghcplatform.h by the autoconf scripts defaultTargetPlatform :: Platform @@ -86,6 +94,8 @@ defaultTargetOS = OSDarwin defaultTargetOS = OSSolaris #elif mingw32_TARGET_OS defaultTargetOS = OSMinGW32 +#elif freebsd_TARGET_OS +defaultTargetOS = OSFreeBSD #else defaultTargetOS = OSUnknown #endif