From 9181d6e98088505d25703b6fbd753b449ca8e5a8 Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Sat, 14 Jun 2008 20:26:40 +0000 Subject: [PATCH] Remove some ifdeffery --- compiler/ghci/Linker.lhs | 20 ++++++++------------ compiler/utils/Util.lhs | 16 +++++++++++++++- 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/compiler/ghci/Linker.lhs b/compiler/ghci/Linker.lhs index ad90900..804d6c0 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 217a450..9bae07f 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} %************************************************************************ -- 1.7.10.4