From: Ian Lynagh Date: Wed, 26 Aug 2009 13:33:59 +0000 (+0000) Subject: "ghc-cabal install" now needs to know where GHC is, to get the ABI hash X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=0b47b7e429eb562c571fc36c0f032d3808ab9b01 "ghc-cabal install" now needs to know where GHC is, to get the ABI hash --- diff --git a/ghc.mk b/ghc.mk index 0f479e1..9ce17a3 100644 --- a/ghc.mk +++ b/ghc.mk @@ -777,8 +777,10 @@ INSTALLED_PACKAGE_CONF=$(DESTDIR)$(topdir)/package.conf # Install packages in the right order, so that ghc-pkg doesn't complain. # Also, install ghc-pkg first. ifeq "$(Windows)" "NO" +INSTALLED_GHC_REAL=$(DESTDIR)$(ghclibexecdir)/ghc-stage2 INSTALLED_GHC_PKG_REAL=$(DESTDIR)$(ghclibexecdir)/ghc-pkg else +INSTALLED_GHC_REAL=$(DESTDIR)$(bindir)/ghc-stage2.exe INSTALLED_GHC_PKG_REAL=$(DESTDIR)$(bindir)/ghc-pkg.exe endif @@ -792,13 +794,15 @@ install_packages: libffi/package.conf.install rts/package.conf.install "$(INSTALLED_GHC_PKG_REAL)" --force --global-conf $(INSTALLED_PACKAGE_CONF) update rts/package.conf.install $(foreach p, $(PACKAGES) $(PACKAGES_STAGE2),\ "$(GHC_CABAL_INPLACE)" install \ + $(INSTALLED_GHC_REAL) \ $(INSTALLED_GHC_PKG_REAL) \ - $(INSTALLED_PACKAGE_CONF) \ + $(DESTDIR)$(topdir) \ libraries/$p dist-install \ '$(DESTDIR)' '$(prefix)' '$(ghclibdir)' '$(docdir)/html/libraries' &&) true "$(GHC_CABAL_INPLACE)" install \ + $(INSTALLED_GHC_REAL) \ $(INSTALLED_GHC_PKG_REAL) \ - $(INSTALLED_PACKAGE_CONF) \ + $(DESTDIR)$(topdir) \ compiler stage2 \ '$(DESTDIR)' '$(prefix)' '$(ghclibdir)' '$(docdir)/html/libraries' diff --git a/utils/ghc-cabal/ghc-cabal.hs b/utils/ghc-cabal/ghc-cabal.hs index 8ee1304..d113ec3 100644 --- a/utils/ghc-cabal/ghc-cabal.hs +++ b/utils/ghc-cabal/ghc-cabal.hs @@ -34,9 +34,9 @@ main = do args <- getArgs runHaddock distDir dir args' "check" : dir : [] -> doCheck dir - "install" : ghcpkg : ghcpkgconfig : directory : distDir + "install" : ghc : ghcpkg : topdir : directory : distDir : myDestDir : myPrefix : myLibdir : myDocdir : args' -> - doInstall ghcpkg ghcpkgconfig directory distDir + doInstall ghc ghcpkg topdir directory distDir myDestDir myPrefix myLibdir myDocdir args' "configure" : args' -> case break (== "--") args' of (config_args, "--" : distdir : directories) -> @@ -111,8 +111,9 @@ runHaddock distdir directory args = f pd lbi us flags doInstall :: FilePath -> FilePath -> FilePath -> FilePath -> FilePath - -> FilePath -> FilePath -> FilePath -> [String] -> IO () -doInstall ghcpkg ghcpkgconf directory distDir myDestDir myPrefix myLibdir myDocdir args + -> FilePath -> FilePath -> FilePath -> FilePath -> [String] + -> IO () +doInstall ghc ghcpkg topdir directory distDir myDestDir myPrefix myLibdir myDocdir args = withCurrentDirectory directory $ do defaultMainWithHooksArgs hooks (["copy", "--builddir", distDir] ++ (if null myDestDir then [] @@ -146,16 +147,25 @@ doInstall ghcpkg ghcpkgconf directory distDir myDestDir myPrefix myLibdir myDocd docdir = toPathTemplate (myDocdir "$pkg"), htmldir = toPathTemplate "$docdir" } progs = withPrograms lbi - prog = ConfiguredProgram { - programId = programName ghcPkgProgram, - programVersion = Nothing, - programArgs = ["--global-conf", ghcpkgconf] - ++ if not (null myDestDir) - then ["--force"] - else [], - programLocation = UserSpecified ghcpkg - } - progs' = updateProgram prog progs + ghcProg = ConfiguredProgram { + programId = programName ghcProgram, + programVersion = Nothing, + programArgs = ["-B" ++ topdir], + programLocation = UserSpecified ghc + } + ghcpkgconf = topdir "package.conf" + ghcPkgProg = ConfiguredProgram { + programId = programName ghcPkgProgram, + programVersion = Nothing, + programArgs = ["--global-conf", + ghcpkgconf] + ++ if not (null myDestDir) + then ["--force"] + else [], + programLocation = UserSpecified ghcpkg + } + progs' = updateProgram ghcProg + $ updateProgram ghcPkgProg progs lbi' = lbi { installDirTemplates = idts', withPrograms = progs'