summaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2008-06-26 20:27:49 +0000
committerIan Lynagh <igloo@earth.li>2008-06-26 20:27:49 +0000
commita11bb49b97eaba892730baf1565e922715dbc07f (patch)
treeb9ebdf37ef6329cd8c836aec5a2aca78b55ba70a /compiler
parentabd113f06ebf3ac29f852e80c5a8c0060f979202 (diff)
downloadhaskell-a11bb49b97eaba892730baf1565e922715dbc07f.tar.gz
Follow Cabal changes
Diffstat (limited to 'compiler')
-rw-r--r--compiler/ghci/Linker.lhs9
-rw-r--r--compiler/main/Packages.lhs6
-rw-r--r--compiler/main/ParsePkgConf.y13
3 files changed, 19 insertions, 9 deletions
diff --git a/compiler/ghci/Linker.lhs b/compiler/ghci/Linker.lhs
index d7f3da3d5b..ac92975259 100644
--- a/compiler/ghci/Linker.lhs
+++ b/compiler/ghci/Linker.lhs
@@ -72,6 +72,8 @@ import System.FilePath
import System.IO
import System.Directory
+import Distribution.Package hiding (depends)
+
import Control.Exception
import Data.Maybe
\end{code}
@@ -944,10 +946,11 @@ data LibrarySpec
-- of DLL handles that rts/Linker.c maintains, and that in turn is
-- used by lookupSymbol. So we must call addDLL for each library
-- just to get the DLL handle into the list.
-partOfGHCi :: [String]
+partOfGHCi :: [PackageName]
partOfGHCi
| isWindowsTarget || isDarwinTarget = []
- | otherwise = [ "base", "haskell98", "template-haskell", "editline" ]
+ | otherwise = map PackageName
+ ["base", "haskell98", "template-haskell", "editline"]
showLS :: LibrarySpec -> String
showLS (Object nm) = "(static) " ++ nm
@@ -1022,7 +1025,7 @@ linkPackage dflags pkg
maybePutStr dflags ("Loading package " ++ display (package pkg) ++ " ... ")
-- See comments with partOfGHCi
- when (pkgName (package pkg) `notElem` partOfGHCi) $ do
+ when (packageName pkg `notElem` partOfGHCi) $ do
loadFrameworks pkg
-- When a library A needs symbols from a library B, the order in
-- extra_libraries/extra_ld_opts is "-lA -lB", because that's the
diff --git a/compiler/main/Packages.lhs b/compiler/main/Packages.lhs
index 712682eaaf..41a760af36 100644
--- a/compiler/main/Packages.lhs
+++ b/compiler/main/Packages.lhs
@@ -318,7 +318,7 @@ matchingPackages str pkgs
-- version, or just the name if it is unambiguous.
matches str p
= str == display (package p)
- || str == pkgName (package p)
+ || str == display (pkgName (package p))
pickPackages :: [PackageConfig] -> [String] -> [PackageConfig]
pickPackages pkgs strs =
@@ -387,7 +387,7 @@ findWiredInPackages dflags pkgs preload this_package = do
matches :: PackageConfig -> (PackageId, [String]) -> Bool
pc `matches` (pid, suffixes)
- = pkgName (package pc) `elem`
+ = display (pkgName (package pc)) `elem`
(map (packageIdString pid ++) suffixes)
-- find which package corresponds to each wired-in package
@@ -445,7 +445,7 @@ findWiredInPackages dflags pkgs preload this_package = do
upd_pid pid = case filter ((== pid) . fst) wired_in_ids of
[] -> pid
- ((x, y):_) -> x{ pkgName = packageIdString y,
+ ((x, y):_) -> x{ pkgName = PackageName (packageIdString y),
pkgVersion = Version [] [] }
pkgs1 = deleteOtherWiredInPackages pkgs
diff --git a/compiler/main/ParsePkgConf.y b/compiler/main/ParsePkgConf.y
index ac0cebbf64..ea515dbc47 100644
--- a/compiler/main/ParsePkgConf.y
+++ b/compiler/main/ParsePkgConf.y
@@ -10,6 +10,7 @@ module ParsePkgConf( loadPackageConfig ) where
#include "HsVersions.h"
+import Distribution.Package hiding ( depends )
import PackageConfig
import Lexer
import Module
@@ -112,9 +113,15 @@ field :: { PackageConfig -> PackageConfig }
}
pkgid :: { PackageIdentifier }
- : CONID '{' VARID '=' STRING ',' VARID '=' version '}'
- { PackageIdentifier{ pkgName = unpackFS $5,
- pkgVersion = $9 } }
+ : CONID '{' VARID '=' CONID STRING ',' VARID '=' version '}'
+ {% case unpackFS $5 of
+ "PackageName" ->
+ return $ PackageIdentifier {
+ pkgName = PackageName (unpackFS $6),
+ pkgVersion = $10
+ }
+ _ -> happyError
+ }
version :: { Version }
: CONID '{' VARID '=' intlist ',' VARID '=' strlist '}'