summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile2
-rw-r--r--driver/ghci/Makefile2
-rw-r--r--libraries/Makefile2
-rw-r--r--libraries/installPackage.hs41
4 files changed, 27 insertions, 20 deletions
diff --git a/Makefile b/Makefile
index 61b49e6182..486b5e08d5 100644
--- a/Makefile
+++ b/Makefile
@@ -250,7 +250,7 @@ binary-dist::
ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
binary-dist::
- $(MAKE) prefix=$(BIN_DIST_DIR) install
+ $(MAKE) DESTDIR=$(BIN_DIST_DIR) prefix=/. install
binary-dist::
cd $(BIN_DIST_DIR) && ../distrib/prep-bin-dist-mingw
diff --git a/driver/ghci/Makefile b/driver/ghci/Makefile
index c3fad1541b..bc3d0bb914 100644
--- a/driver/ghci/Makefile
+++ b/driver/ghci/Makefile
@@ -17,7 +17,7 @@ endif
ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
INSTALL_PROGS += $(C_PROG)
-GHCII_SCRIPT=$(bindir)/ghcii.sh
+GHCII_SCRIPT=$(DESTDIR)$(bindir)/ghcii.sh
install::
$(RM) -f $(GHCII_SCRIPT)
echo "#!$(SHELL)" >> $(GHCII_SCRIPT)
diff --git a/libraries/Makefile b/libraries/Makefile
index a90d52cfd8..1610875010 100644
--- a/libraries/Makefile
+++ b/libraries/Makefile
@@ -322,7 +322,7 @@ $(foreach SUBDIR,$(SUBDIRS),install.library.$(SUBDIR)): \
install.library.%: installPackage/installPackage ifBuildable/ifBuildable
if ifBuildable/ifBuildable $*; then \
cd $* && \
- ../installPackage/installPackage "$(DESTDIR)" $(prefix) $(GHC_PKG_PROG) $(DESTDIR)$(libdir)/package.conf; \
+ ../installPackage/installPackage "$(DESTDIR)" $(prefix) $(datadir) $(libraryhtmldir) $(GHC_PKG_PROG) $(DESTDIR)$(libdir)/package.conf; \
fi
.PHONY: binary-dist binary-dist.library.%
diff --git a/libraries/installPackage.hs b/libraries/installPackage.hs
index da04e35821..451fda1046 100644
--- a/libraries/installPackage.hs
+++ b/libraries/installPackage.hs
@@ -9,23 +9,27 @@ import Distribution.Verbosity
import System.Environment
main :: IO ()
-main = do args <- getArgs
- case args of
- destdir : pref : ghcpkg : ghcpkgconf : args' ->
- let verbosity = case args' of
- [] -> normal
- ['-':'v':v] ->
- let m = case v of
- "" -> Nothing
- _ -> Just v
- in flagToVerbosity m
- _ -> error ("Bad arguments: " ++ show args)
- in doit destdir pref ghcpkg ghcpkgconf verbosity
- _ ->
- error "Missing arguments"
+main
+ = do args <- getArgs
+ case args of
+ destdir : pref : idatadir : idocdir : ghcpkg : ghcpkgconf : args' ->
+ let verbosity = case args' of
+ [] -> normal
+ ['-':'v':v] ->
+ let m = case v of
+ "" -> Nothing
+ _ -> Just v
+ in flagToVerbosity m
+ _ -> error ("Bad arguments: " ++ show args)
+ in doit destdir pref idatadir idocdir ghcpkg ghcpkgconf
+ verbosity
+ _ ->
+ error "Missing arguments"
-doit :: FilePath -> FilePath -> FilePath -> FilePath -> Verbosity -> IO ()
-doit destdir pref ghcpkg ghcpkgconf verbosity =
+doit :: FilePath -> FilePath -> FilePath -> FilePath -> FilePath -> FilePath
+ -> Verbosity
+ -> IO ()
+doit destdir pref idatadir idocdir ghcpkg ghcpkgconf verbosity =
do let userHooks = simpleUserHooks
copyto = if null destdir then NoCopyDest else CopyTo destdir
copyFlags = (emptyCopyFlags copyto) {
@@ -56,7 +60,10 @@ doit destdir pref ghcpkg ghcpkgconf verbosity =
pd_reg = pd { library = Just (mkLib (const True)) }
-- When coying, we need to actually give a concrete
-- directory to copy to rather than "$topdir"
- i_copy = i { prefixDirTemplate = toPathTemplate pref }
+ i_copy = i { prefixDirTemplate = toPathTemplate pref,
+ dataDirTemplate = toPathTemplate idatadir,
+ docDirTemplate = toPathTemplate idocdir
+ }
lbi_copy = lbi { installDirTemplates = i_copy }
-- When we run GHC we give it a $topdir that includes the
-- $compiler/lib/ part of libsubdir, so we only want the