From f53f0f5ff6e43071a38675ac3d3ecc266b9baeee Mon Sep 17 00:00:00 2001 From: Isaac Dupree Date: Sun, 23 Aug 2009 22:27:46 +0000 Subject: Main.hs: eliminate warnings (except for OldException) --- src/Main.hs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/Main.hs b/src/Main.hs index e7f80566..9e73d4c0 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -30,7 +30,6 @@ import Haddock.InterfaceFile import Haddock.Options import Haddock.Utils import Haddock.GhcUtils -import Paths_haddock import Control.Monad import Control.OldException @@ -41,7 +40,6 @@ import qualified Data.Map as Map import System.IO import System.Exit import System.Environment -import System.FilePath import Distribution.Verbosity #if defined(mingw32_HOST_OS) @@ -50,15 +48,17 @@ import Foreign.C import Data.Int #endif -#ifndef IN_GHC_TREE +#ifdef IN_GHC_TREE +import System.FilePath +#else import GHC.Paths +import Paths_haddock #endif import GHC hiding (flags, verbosity) import Config import DynFlags hiding (flags, verbosity) import Panic (handleGhcException) -import MonadUtils ( MonadIO(..) ) -------------------------------------------------------------------------------- @@ -325,7 +325,10 @@ startGhc libDir flags ghcActs = do } dynflags''' <- parseGhcFlags dynflags'' restFlags flags defaultCleanupHandler dynflags''' $ do - setSessionDynFlags dynflags''' + -- ignore the following return-value, which is a list of packages + -- that may need to be re-linked: Haddock doesn't do any + -- dynamic or static linking at all! + _ <- setSessionDynFlags dynflags''' ghcActs dynflags''' where parseGhcFlags :: Monad m => DynFlags -> [Located String] @@ -417,6 +420,7 @@ getPrologue flags = _otherwise -> throwE "multiple -p/--prologue options" +#ifdef IN_GHC_TREE getExecDir :: IO (Maybe String) #if defined(mingw32_HOST_OS) getExecDir = allocaArray len $ \buf -> do @@ -432,4 +436,5 @@ foreign import stdcall unsafe "GetModuleFileNameA" #else getExecDir = return Nothing #endif +#endif -- cgit v1.2.3