aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Haddock/GHC.hs3
-rw-r--r--src/Main.hs9
2 files changed, 10 insertions, 2 deletions
diff --git a/src/Haddock/GHC.hs b/src/Haddock/GHC.hs
index d5b59e0e..66bd3b1f 100644
--- a/src/Haddock/GHC.hs
+++ b/src/Haddock/GHC.hs
@@ -25,6 +25,7 @@ import GHC
import DynFlags hiding (Option)
import Packages hiding (package)
import StaticFlags
+import SrcLoc
-- | Start a GHC session with the -haddock flag set. Also turn off
@@ -33,7 +34,7 @@ startGhc :: String -> [String] -> IO (Session, DynFlags)
startGhc libDir flags = do
-- TODO: handle warnings?
#if __GLASGOW_HASKELL__ >= 609
- (restFlags, _) <- parseStaticFlags flags
+ (restFlags, _) <- parseStaticFlags (map noLoc flags)
#else
restFlags <- parseStaticFlags flags
#endif
diff --git a/src/Main.hs b/src/Main.hs
index f9820243..310214c6 100644
--- a/src/Main.hs
+++ b/src/Main.hs
@@ -38,7 +38,9 @@ import System.Exit
import System.Environment
import GHC
+#ifdef GHC_PATHS
import GHC.Paths
+#endif
import DynFlags
import Bag
import ErrUtils
@@ -137,7 +139,12 @@ main = handleTopExceptions $ do
let libDir
| Just dir <- getGhcLibDir flags = dir
- | otherwise = libdir -- from GHC.Paths
+ | otherwise =
+#ifdef GHC_PATHS
+ libdir -- from GHC.Paths
+#else
+ error "No GhcLibDir"
+#endif
-- initialize GHC
(session, dynflags) <- startGhc libDir (ghcFlags flags)