Commit b18545dd authored by Ian Lynagh's avatar Ian Lynagh

Fix bindist creation on Windows

parent cafb1e0f
......@@ -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
......
......@@ -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)
......
......@@ -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.%
......
......@@ -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
......
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