diff options
| -rw-r--r-- | src/Main.hs | 13 | 
1 files changed, 8 insertions, 5 deletions
diff --git a/src/Main.hs b/src/Main.hs index 99887bbe..8bb58a34 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -144,13 +144,16 @@ main = handleTopExceptions $ do    if not (null fileArgs)      then do -      let libDir -            | Just dir <- getGhcLibDir flags = dir -            | otherwise = +      libDir <- case getGhcLibDir flags of +                Just dir -> return dir +                Nothing ->  #ifdef IN_GHC_TREE -                error "No GhcLibDir found" +                    do m <- getExecDir +                       case m of +                           Nothing -> error "No GhcLibDir found" +                           Just d -> return (d </> "..")  #else -                libdir -- from GHC.Paths +                    return libdir -- from GHC.Paths  #endif        -- initialize GHC  | 
