projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Remove duplicated #defines for FreeBSD
[ghc-hetmet.git]
/
compiler
/
nativeGen
/
Platform.hs
diff --git
a/compiler/nativeGen/Platform.hs
b/compiler/nativeGen/Platform.hs
index
8b01f5c
..
afbf0b2
100644
(file)
--- a/
compiler/nativeGen/Platform.hs
+++ b/
compiler/nativeGen/Platform.hs
@@
-9,7
+9,8
@@
module Platform (
Arch(..),
OS(..),
Arch(..),
OS(..),
- defaultTargetPlatform
+ defaultTargetPlatform,
+ osElfTarget
)
where
)
where
@@
-47,9
+48,16
@@
data OS
| OSDarwin
| OSSolaris
| OSMinGW32
| OSDarwin
| OSSolaris
| OSMinGW32
+ | OSFreeBSD
deriving (Show, Eq)
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
-- | 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
defaultTargetOS = OSSolaris
#elif mingw32_TARGET_OS
defaultTargetOS = OSMinGW32
+#elif freebsd_TARGET_OS
+defaultTargetOS = OSFreeBSD
#else
defaultTargetOS = OSUnknown
#endif
#else
defaultTargetOS = OSUnknown
#endif