Commit 0b47b7e4 authored by Ian Lynagh's avatar Ian Lynagh

"ghc-cabal install" now needs to know where GHC is, to get the ABI hash

parent e8842f6d
......@@ -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'
......
......@@ -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'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment