From 0e7b8c87f32cbdbb931a01537a578ee30ac2e026 Mon Sep 17 00:00:00 2001 From: krasimir Date: Thu, 5 Aug 2004 18:29:47 +0000 Subject: [PATCH] [project @ 2004-08-05 18:29:47 by krasimir] Bugfix. --auto-ghci-libs doesn't work if the package was previously installed. --- ghc/utils/ghc-pkg/Main.hs | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/ghc/utils/ghc-pkg/Main.hs b/ghc/utils/ghc-pkg/Main.hs index 05c92e3..29040e4 100644 --- a/ghc/utils/ghc-pkg/Main.hs +++ b/ghc/utils/ghc-pkg/Main.hs @@ -349,16 +349,15 @@ doesLibExistIn lib d | otherwise = doesFileExist (d ++ '/':lib) checkGHCiLib :: [String] -> String -> String -> String -> Bool -> IO () -checkGHCiLib dirs batch_lib_dir batch_lib_file lib auto_build = do - let ghci_lib_file = lib ++ ".o" - bs <- mapM (doesLibExistIn ghci_lib_file) dirs - case [ dir | (exists,dir) <- zip bs dirs, exists ] of - [] | auto_build -> - autoBuildGHCiLib batch_lib_dir batch_lib_file ghci_lib_file - | otherwise -> - hPutStrLn stderr ("warning: can't find GHCi lib `" - ++ ghci_lib_file ++ "'") +checkGHCiLib dirs batch_lib_dir batch_lib_file lib auto_build + | auto_build = autoBuildGHCiLib batch_lib_dir batch_lib_file ghci_lib_file + | otherwise = do + bs <- mapM (doesLibExistIn ghci_lib_file) dirs + case [dir | (exists,dir) <- zip bs dirs, exists] of + [] -> hPutStrLn stderr ("warning: can't find GHCi lib `" ++ ghci_lib_file ++ "'") (_:_) -> return () + where + ghci_lib_file = lib ++ ".o" -- automatically build the GHCi version of a batch lib, -- using ld --whole-archive. -- 1.7.10.4