Fix bindist creation on Windows
authorIan Lynagh <igloo@earth.li>
Wed, 5 Sep 2007 16:13:54 +0000 (16:13 +0000)
committerIan Lynagh <igloo@earth.li>
Wed, 5 Sep 2007 16:13:54 +0000 (16:13 +0000)
Makefile
driver/ghci/Makefile
libraries/Makefile
libraries/installPackage.hs

index 61b49e6..486b5e0 100644 (file)
--- 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
index c3fad15..bc3d0bb 100644 (file)
@@ -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)
index a90d52c..1610875 100644 (file)
@@ -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.%
index da04e35..451fda1 100644 (file)
@@ -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