aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIsaac Dupree <id@isaac.cedarswampstudios.org>2009-08-23 22:27:46 +0000
committerIsaac Dupree <id@isaac.cedarswampstudios.org>2009-08-23 22:27:46 +0000
commitf53f0f5ff6e43071a38675ac3d3ecc266b9baeee (patch)
treef8a8b7bc899d91b01f1972e9b850b2f582bf53ed
parent2744ad2503d90657435945b6e45760e46ef3c251 (diff)
Main.hs: eliminate warnings (except for OldException)
-rw-r--r--src/Main.hs15
1 files 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