Major patch to fix reporting of unused imports
[ghc-hetmet.git] / compiler / main / Packages.lhs
index 41ca465..505a797 100644 (file)
@@ -26,6 +26,7 @@ module Packages (
        getPreloadPackagesAnd,
 
         collectIncludeDirs, collectLibraryPaths, collectLinkOpts,
+        packageHsLibs,
 
        -- * Utils
        isDllName
@@ -50,8 +51,6 @@ import Outputable
 import System.Environment ( getEnv )
 import Distribution.InstalledPackageInfo hiding (depends)
 import Distribution.Package hiding (depends, PackageId)
-import Distribution.Text
-import Distribution.Version
 import FastString
 import ErrUtils         ( debugTraceMsg, putMsg, Message )
 import Exception
@@ -391,8 +390,7 @@ findWiredInPackages dflags pkgs preload this_package = do
                             (haskell98PackageId, [""]),
                             (thPackageId, [""]),
                             (dphSeqPackageId, [""]),
-                            (dphParPackageId, [""]),
-                            (ndpPackageId, ["-seq", "-par"]) ]
+                            (dphParPackageId, [""])]
 
         matches :: PackageConfig -> (PackageId, [String]) -> Bool
         pc `matches` (pid, suffixes)
@@ -640,14 +638,17 @@ getPackageLinkOpts dflags pkgs =
 collectLinkOpts :: DynFlags -> [PackageConfig] -> [String]
 collectLinkOpts dflags ps = concat (map all_opts ps)
   where
+       libs p     = packageHsLibs dflags p ++ extraLibraries p
+       all_opts p = map ("-l" ++) (libs p) ++ ldOptions p
+
+packageHsLibs :: DynFlags -> PackageConfig -> [String]
+packageHsLibs dflags p = map (mkDynName . addSuffix) (hsLibraries p)
+  where
         tag = buildTag dflags
         rts_tag = rtsBuildTag dflags
 
        mkDynName | opt_Static = id
                  | otherwise = (++ ("-ghc" ++ cProjectVersion))
-       libs p     = map (mkDynName . addSuffix) (hsLibraries p)
-                        ++ extraLibraries p
-       all_opts p = map ("-l" ++) (libs p) ++ ldOptions p
 
         addSuffix rts@"HSrts"    = rts       ++ (expandTag rts_tag)
         addSuffix other_lib      = other_lib ++ (expandTag tag)