From: Ian Lynagh Date: Wed, 5 Sep 2007 16:13:54 +0000 (+0000) Subject: Fix bindist creation on Windows X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=b18545dd4fc38d2c78d18966d1d9e38474c799e9 Fix bindist creation on Windows --- diff --git a/Makefile b/Makefile index 61b49e6..486b5e0 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 c3fad15..bc3d0bb 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 a90d52c..1610875 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 da04e35..451fda1 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