X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fmain%2FPackages.lhs;h=bdb8cf724a522d69c2fd0c2a00f2a3f2f53e8f78;hb=a2a67cd520b9841114d69a87a423dabcb3b4368e;hp=7c1b3261900d54f518cf4b05f208002394d5ca99;hpb=0069a47ad1a539c894f66163cf30c7d98dc9b016;p=ghc-hetmet.git diff --git a/compiler/main/Packages.lhs b/compiler/main/Packages.lhs index 7c1b326..bdb8cf7 100644 --- a/compiler/main/Packages.lhs +++ b/compiler/main/Packages.lhs @@ -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 @@ -266,8 +265,8 @@ mungePackagePaths top_dir ps = map munge_pkg ps munge_paths = map munge_path munge_path p - | Just p' <- maybePrefixMatch "$topdir" p = top_dir ++ p' - | Just p' <- maybePrefixMatch "$httptopdir" p = toHttpPath top_dir ++ p' + | Just p' <- stripPrefix "$topdir" p = top_dir ++ p' + | Just p' <- stripPrefix "$httptopdir" p = toHttpPath top_dir ++ p' | otherwise = p toHttpPath p = "file:///" ++ p @@ -389,11 +388,9 @@ findWiredInPackages dflags pkgs preload this_package = do (basePackageId, [""]), (rtsPackageId, [""]), (haskell98PackageId, [""]), - (sybPackageId, [""]), (thPackageId, [""]), (dphSeqPackageId, [""]), - (dphParPackageId, [""]), - (ndpPackageId, ["-seq", "-par"]) ] + (dphParPackageId, [""])] matches :: PackageConfig -> (PackageId, [String]) -> Bool pc `matches` (pid, suffixes) @@ -641,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)