diff options
author | Ian Lynagh <ian@well-typed.com> | 2013-05-13 22:39:29 +0100 |
---|---|---|
committer | Ian Lynagh <ian@well-typed.com> | 2013-05-14 13:49:09 +0100 |
commit | 60b86b04b2c214ef75b01371901a040933debf31 (patch) | |
tree | ed89503ca5c5039464692d0993b3525e209c99a6 /utils | |
parent | ff1a16a0bd630f97dc507f96977eaaae9d8df9a6 (diff) | |
download | haskell-60b86b04b2c214ef75b01371901a040933debf31.tar.gz |
Fix the GHC package DLL-splitting
There's now an internal -dll-split flag, which we use to tell GHC how
the GHC package is split into 2 separate DLLs. This is used by
Packages.isDllName to determine whether a call is within the same
DLL, or whether it is a call to another DLL.
Diffstat (limited to 'utils')
-rw-r--r-- | utils/ghc-cabal/Main.hs | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/utils/ghc-cabal/Main.hs b/utils/ghc-cabal/Main.hs index 1eb8ef5b99..9a76d6b93d 100644 --- a/utils/ghc-cabal/Main.hs +++ b/utils/ghc-cabal/Main.hs @@ -50,8 +50,8 @@ main = do hSetBuffering stdout LineBuffering doRegister dir distDir ghc ghcpkg topdir myDestDir myPrefix myLibdir myDocdir relocatableBuild args' - "configure" : dir : distDir : config_args -> - generate dir distDir config_args + "configure" : dir : distDir : dll0Modules : config_args -> + generate dir distDir dll0Modules config_args "sdist" : dir : distDir : [] -> doSdist dir distDir ["--version"] -> @@ -298,8 +298,8 @@ mangleLbi "compiler" "stage2" lbi _ -> False mangleLbi _ _ lbi = lbi -generate :: FilePath -> FilePath -> [String] -> IO () -generate directory distdir config_args +generate :: FilePath -> FilePath -> String -> [String] -> IO () +generate directory distdir dll0Modules config_args = withCurrentDirectory directory $ do let verbosity = normal -- XXX We shouldn't just configure with the default flags @@ -403,9 +403,12 @@ generate directory distdir config_args wrappedLibraryDirs <- wrap libraryDirs let variablePrefix = directory ++ '_':distdir + mods = map display modules + otherMods = map display (otherModules bi) + allMods = mods ++ otherMods let xs = [variablePrefix ++ "_VERSION = " ++ display (pkgVersion (package pd)), - variablePrefix ++ "_MODULES = " ++ unwords (map display modules), - variablePrefix ++ "_HIDDEN_MODULES = " ++ unwords (map display (otherModules bi)), + variablePrefix ++ "_MODULES = " ++ unwords mods, + variablePrefix ++ "_HIDDEN_MODULES = " ++ unwords otherMods, variablePrefix ++ "_SYNOPSIS =" ++ synopsis pd, variablePrefix ++ "_HS_SRC_DIRS = " ++ unwords (hsSourceDirs bi), variablePrefix ++ "_DEPS = " ++ unwords deps, @@ -449,6 +452,11 @@ generate directory distdir config_args writeFile (distdir ++ "/haddock-prologue.txt") $ if null (description pd) then synopsis pd else description pd + unless (null dll0Modules) $ + do let dll0Mods = words dll0Modules + dllMods = allMods \\ dll0Mods + dllModSets = map unwords [dll0Mods, dllMods] + writeFile (distdir ++ "/dll-split") $ unlines dllModSets where escape = foldr (\c xs -> if c == '#' then '\\':'#':xs else c:xs) [] wrap = mapM wrap1 |