diff options
author | David Waern <david.waern@gmail.com> | 2008-10-10 20:33:38 +0000 |
---|---|---|
committer | David Waern <david.waern@gmail.com> | 2008-10-10 20:33:38 +0000 |
commit | ff03f4f8b4ac1b9ccd9ef93c294ac835871c349f (patch) | |
tree | 3cee68382d8029088b54154188c7396cf563731d /src/Main.hs | |
parent | 8a57f3d9eb971ab4957f2780ed7a0b5be0b3b6e3 (diff) |
Make Haddock build with GHC 6.8.2
Diffstat (limited to 'src/Main.hs')
-rw-r--r-- | src/Main.hs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/Main.hs b/src/Main.hs index dce204d1..d2b99f11 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -161,6 +161,7 @@ main = handleTopExceptions $ do return libdir -- from GHC.Paths #endif +#if __GLASGOW_HASKELL__ >= 609 -- initialize GHC startGhc libDir (ghcFlags flags) $ \dynflags -> do @@ -179,7 +180,25 @@ main = handleTopExceptions $ do -- last but not least, dump the interface file dumpInterfaceFile (map toInstalledIface interfaces) homeLinks flags +#else + -- initialize GHC + (session, dynflags) <- startGhc libDir (ghcFlags flags) + + -- get packages supplied with --read-interface + packages <- readInterfaceFiles (nameCacheFromGhc session) (ifacePairs flags) + -- combine the link envs of the external packages into one + let extLinks = Map.unions (map (ifLinkEnv . fst) packages) + + -- create the interfaces -- this is the core part of Haddock + (interfaces, homeLinks) <- createInterfaces session fileArgs extLinks flags + + -- render the interfaces + renderStep packages interfaces + + -- last but not least, dump the interface file + dumpInterfaceFile (map toInstalledIface interfaces) homeLinks flags +#endif else do -- get packages supplied with --read-interface packages <- readInterfaceFiles freshNameCache (ifacePairs flags) |