summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2008-06-14 20:26:40 +0000
committerIan Lynagh <igloo@earth.li>2008-06-14 20:26:40 +0000
commit9181d6e98088505d25703b6fbd753b449ca8e5a8 (patch)
tree3fe3bdef99984f6fa610ee8b1e209e61ecc41fdf
parenta8624a9d185bd3d08d318596e134042224859a6b (diff)
downloadhaskell-9181d6e98088505d25703b6fbd753b449ca8e5a8.tar.gz
Remove some ifdeffery
-rw-r--r--compiler/ghci/Linker.lhs20
-rw-r--r--compiler/utils/Util.lhs16
2 files changed, 23 insertions, 13 deletions
diff --git a/compiler/ghci/Linker.lhs b/compiler/ghci/Linker.lhs
index ad90900422..804d6c097a 100644
--- a/compiler/ghci/Linker.lhs
+++ b/compiler/ghci/Linker.lhs
@@ -397,13 +397,12 @@ reallyInitDynLinker dflags
; classified_ld_inputs <- mapM classifyLdInput cmdline_ld_inputs
-- (e) Link any MacOS frameworks
-#ifdef darwin_TARGET_OS
- ; let framework_paths = frameworkPaths dflags
- ; let frameworks = cmdlineFrameworks dflags
-#else
- ; let frameworks = []
- ; let framework_paths = []
-#endif
+ ; let framework_paths
+ | isDarwinTarget = frameworkPaths dflags
+ | otherwise = []
+ ; let frameworks
+ | isDarwinTarget = cmdlineFrameworks dflags
+ | otherwise = []
-- Finally do (c),(d),(e)
; let cmdline_lib_specs = [ l | Just l <- classified_ld_inputs ]
++ map DLL minus_ls
@@ -950,11 +949,8 @@ data LibrarySpec
-- used by lookupSymbol. So we must call addDLL for each library
-- just to get the DLL handle into the list.
partOfGHCi
-# if defined(mingw32_TARGET_OS) || defined(darwin_TARGET_OS)
- = [ ]
-# else
- = [ "base", "haskell98", "template-haskell", "editline" ]
-# endif
+ | isWindowsTarget || isDarwinTarget = []
+ | otherwise = [ "base", "haskell98", "template-haskell", "editline" ]
showLS (Object nm) = "(static) " ++ nm
showLS (DLL nm) = "(dynamic) " ++ nm
diff --git a/compiler/utils/Util.lhs b/compiler/utils/Util.lhs
index 217a4503c7..9bae07fc0d 100644
--- a/compiler/utils/Util.lhs
+++ b/compiler/utils/Util.lhs
@@ -6,7 +6,7 @@
\begin{code}
module Util (
- debugIsOn, isWindowsHost,
+ debugIsOn, isWindowsHost, isWindowsTarget, isDarwinTarget,
-- general list processing
zipEqual, zipWithEqual, zipWith3Equal, zipWith4Equal,
@@ -124,6 +124,20 @@ isWindowsHost = True
#else
isWindowsHost = False
#endif
+
+isWindowsTarget :: Bool
+#ifdef mingw32_TARGET_OS
+isWindowsTarget = True
+#else
+isWindowsTarget = False
+#endif
+
+isDarwinTarget :: Bool
+#ifdef darwin_TARGET_OS
+isDarwinTarget = True
+#else
+isDarwinTarget = False
+#endif
\end{code}
%************************************************************************