Arch(..),
OS(..),
- defaultTargetPlatform
+ defaultTargetPlatform,
+ osElfTarget
)
where
= OSUnknown
| OSLinux
| OSDarwin
- | OSSolaris
+ | OSSolaris2
| OSMinGW32
+ | OSFreeBSD
+ | OSOpenBSD
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 OSOpenBSD = True
+osElfTarget OSSolaris2 = 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
defaultTargetOS = OSLinux
#elif darwin_TARGET_OS
defaultTargetOS = OSDarwin
-#elif solaris_TARGET_OS
-defaultTargetOS = OSSolaris
+#elif solaris2_TARGET_OS
+defaultTargetOS = OSSolaris2
#elif mingw32_TARGET_OS
defaultTargetOS = OSMinGW32
+#elif freebsd_TARGET_OS
+defaultTargetOS = OSFreeBSD
+#elif openbsd_TARGET_OS
+defaultTargetOS = OSOpenBSD
#else
defaultTargetOS = OSUnknown
#endif