summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lynagh <ian@well-typed.com>2013-05-14 16:41:05 +0100
committerIan Lynagh <ian@well-typed.com>2013-05-14 16:41:05 +0100
commit69a343af10f70fcc5a7977968cbceac55114c2ee (patch)
tree7342648e8755d141db435aac56be6afc1a274de1
parentbb2795db36b36966697c228315ae20767c4a8753 (diff)
downloadhaskell-69a343af10f70fcc5a7977968cbceac55114c2ee.tar.gz
Fix ghci on Windows when GHC is dynamically linked
On Windows, we need to prepend "lib" to Haskell DLLs. (maybe we should be naming the DLLs without the prefix instead? But this works for now).
-rw-r--r--compiler/ghci/Linker.lhs2
-rw-r--r--compiler/main/HscTypes.lhs5
2 files changed, 5 insertions, 2 deletions
diff --git a/compiler/ghci/Linker.lhs b/compiler/ghci/Linker.lhs
index ffe43e07ba..2de130acd1 100644
--- a/compiler/ghci/Linker.lhs
+++ b/compiler/ghci/Linker.lhs
@@ -1195,7 +1195,7 @@ locateLib dflags is_hs dirs lib
mk_arch_path dir = dir </> ("lib" ++ lib <.> "a")
hs_dyn_lib_name = lib ++ "-ghc" ++ cProjectVersion
- mk_hs_dyn_lib_path dir = dir </> mkSOName platform hs_dyn_lib_name
+ mk_hs_dyn_lib_path dir = dir </> mkHsSOName platform hs_dyn_lib_name
so_name = mkSOName platform lib
mk_dyn_lib_path dir = dir </> so_name
diff --git a/compiler/main/HscTypes.lhs b/compiler/main/HscTypes.lhs
index d9fe88bb80..28134e1545 100644
--- a/compiler/main/HscTypes.lhs
+++ b/compiler/main/HscTypes.lhs
@@ -37,7 +37,7 @@ module HscTypes (
PackageInstEnv, PackageRuleBase,
- mkSOName, soExt,
+ mkSOName, mkHsSOName, soExt,
-- * Annotations
prepareAnnotations,
@@ -1796,6 +1796,9 @@ mkSOName platform root
OSMinGW32 -> root <.> "dll"
_ -> ("lib" ++ root) <.> "so"
+mkHsSOName :: Platform -> FilePath -> FilePath
+mkHsSOName platform root = ("lib" ++ root) <.> soExt platform
+
soExt :: Platform -> FilePath
soExt platform
= case platformOS platform of