diff options
author | David Waern <david.waern@gmail.com> | 2011-11-06 15:35:48 +0100 |
---|---|---|
committer | David Waern <david.waern@gmail.com> | 2011-11-06 19:09:53 +0100 |
commit | 5484ece0904d04eb913d4a6025a6f34010875d97 (patch) | |
tree | 4668cab81782ddc42111e34b8cb231246fb855d6 /src/Main.hs | |
parent | f19cc291ca05b0a7fc8f716007224216c74e22a2 (diff) |
Fix build.
Diffstat (limited to 'src/Main.hs')
-rw-r--r-- | src/Main.hs | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/src/Main.hs b/src/Main.hs index cc5d1302..787b5574 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -329,7 +329,7 @@ getHaddockLibDir flags = case [str | Flag_Lib str <- flags] of [] -> #ifdef IN_GHC_TREE - fmap snd getInTreeDirs + getInTreeDir #else getDataDir -- provided by Cabal #endif @@ -338,15 +338,21 @@ getHaddockLibDir flags = getGhcDirs :: [Flag] -> IO (String, String) getGhcDirs flags = do - (ghcPath, libDir) <- + case [ dir | Flag_GhcLibDir dir <- flags ] of + [] -> do #ifdef IN_GHC_TREE - getInTreeDirs + libDir <- getInTreeDir + return (ghcPath, libDir) #else - return (GhcPaths.ghc, GhcPaths.libdir) + return (ghcPath, GhcPaths.libdir) #endif - case [ dir | Flag_GhcLibDir dir <- flags ] of - [] -> return (ghcPath, libDir) xs -> return (ghcPath, last xs) + where +#ifdef IN_GHC_TREE + ghcPath = "not available" +#else + ghcPath = GhcPaths.ghc +#endif shortcutFlags :: [Flag] -> IO () @@ -409,12 +415,12 @@ getPrologue flags = #ifdef IN_GHC_TREE -getInTreeDirs :: IO (String, String) -getInTreeDirs = do +getInTreeDir :: IO String +getInTreeDir = do m <- getExecDir case m of Nothing -> error "No GhcDir found" - Just d -> let p = d </> ".." in return (p </> "bin" </> "ghc", p </> "lib") + Just d -> return (d </> ".." </> "lib") getExecDir :: IO (Maybe String) |