X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=utils%2Fghc-cabal%2Fghc-cabal.hs;h=c3a478908919c87c6a264ddb7efbe67c5894dbe3;hb=bbeb08a18156abf1f719ab7273a134f5f21e7fa6;hp=9a99ad415114331a0f0f0a5d49a366a29e351271;hpb=723eb70f31b2b413a51387bbbfbe01bb9b8c5907;p=ghc-hetmet.git diff --git a/utils/ghc-cabal/ghc-cabal.hs b/utils/ghc-cabal/ghc-cabal.hs index 9a99ad4..c3a4789 100644 --- a/utils/ghc-cabal/ghc-cabal.hs +++ b/utils/ghc-cabal/ghc-cabal.hs @@ -34,10 +34,10 @@ main = do args <- getArgs runHaddock distDir dir args' "check" : dir : [] -> doCheck dir - "install" : ghc : ghcpkg : topdir : directory : distDir + "install" : ghc : ghcpkg : strip : topdir : directory : distDir : myDestDir : myPrefix : myLibdir : myDocdir : relocatableBuild : args' -> - doInstall ghc ghcpkg topdir directory distDir + doInstall ghc ghcpkg strip topdir directory distDir myDestDir myPrefix myLibdir myDocdir relocatableBuild args' "configure" : args' -> case break (== "--") args' of @@ -139,10 +139,10 @@ runHaddock distdir directory args = f pd lbi us flags doInstall :: FilePath -> FilePath -> FilePath -> FilePath -> FilePath - -> FilePath -> FilePath -> FilePath -> FilePath -> String - -> [String] + -> FilePath -> FilePath -> FilePath -> FilePath -> FilePath + -> String -> [String] -> IO () -doInstall ghc ghcpkg topdir directory distDir +doInstall ghc ghcpkg strip topdir directory distDir myDestDir myPrefix myLibdir myDocdir relocatableBuildStr args = withCurrentDirectory directory $ do @@ -198,30 +198,41 @@ doInstall ghc ghcpkg topdir directory distDir libsubdir = toPathTemplate "$pkgid", docdir = toPathTemplate $ if relocatableBuild - then "$topdir/$pkg" - else (myDocdir "$pkg"), + then "$topdir/$pkgid" + else (myDocdir "$pkgid"), htmldir = toPathTemplate "$docdir" } progs = withPrograms lbi ghcProg = ConfiguredProgram { programId = programName ghcProgram, programVersion = Nothing, - programArgs = ["-B" ++ topdir], + programDefaultArgs = ["-B" ++ topdir], + programOverrideArgs = [], programLocation = UserSpecified ghc } ghcpkgconf = topdir "package.conf.d" ghcPkgProg = ConfiguredProgram { programId = programName ghcPkgProgram, programVersion = Nothing, - programArgs = ["--global-conf", - ghcpkgconf] + programDefaultArgs = ["--global-conf", + ghcpkgconf] ++ if not (null myDestDir) then ["--force"] else [], + programOverrideArgs = [], programLocation = UserSpecified ghcpkg } + stripProg = ConfiguredProgram { + programId = programName stripProgram, + programVersion = Nothing, + programDefaultArgs = [], + programOverrideArgs = [], + programLocation = UserSpecified strip + } progs' = updateProgram ghcProg - $ updateProgram ghcPkgProg progs + $ updateProgram ghcPkgProg + $ updateProgram stripProg + progs instInfos <- dump verbosity ghcPkgProg GlobalPackageDB let installedPkgs' = PackageIndex.fromList instInfos let mlc = libraryConfig lbi @@ -302,7 +313,10 @@ generate config_args distdir directory let ipid = InstalledPackageId (display (packageId pd) ++ "-inplace") let installedPkgInfo = inplaceInstalledPackageInfo cwd distdir pd lib lbi clbi - final_ipi = installedPkgInfo{ Installed.installedPackageId = ipid } + final_ipi = installedPkgInfo { + Installed.installedPackageId = ipid, + Installed.haddockHTMLs = ["../" ++ display (packageId pd)] + } content = Installed.showInstalledPackageInfo final_ipi ++ "\n" writeFileAtomic (distdir "inplace-pkg-config") content _ -> error "Inconsistent lib components; can't happen?" @@ -356,10 +370,11 @@ generate config_args distdir directory variablePrefix ++ "_CMM_SRCS = $(addprefix cbits/,$(notdir $(wildcard " ++ directory ++ "/cbits/*.cmm)))", -- XXX This includes things it shouldn't, like: -- -odir dist-bootstrapping/build - variablePrefix ++ "_HC_OPTS = " ++ escape (unwords - (programArgs ghcProg + variablePrefix ++ "_HC_OPTS = " ++ escape (unwords + ( programDefaultArgs ghcProg ++ hcOptions GHC bi - ++ extensionsToFlags (compiler lbi) (extensions bi))), + ++ extensionsToFlags (compiler lbi) (extensions bi) + ++ programOverrideArgs ghcProg)), variablePrefix ++ "_CC_OPTS = " ++ unwords (ccOptions bi), variablePrefix ++ "_CPP_OPTS = " ++ unwords (cppOptions bi), variablePrefix ++ "_LD_OPTS = " ++ unwords (ldOptions bi),