Make Windows bindists and installers work in the new build system
authorIan Lynagh <>
Wed, 10 Jun 2009 18:18:25 +0000 (18:18 +0000)
committerIan Lynagh <>
Wed, 10 Jun 2009 18:18:25 +0000 (18:18 +0000)
distrib/ [moved from distrib/ghc.iss with 79% similarity]

index 28328b3..f51b9a8 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -68,9 +68,14 @@ endif
        $(MAKE) -r --no-print-directory -f $@
+ifeq "$(mingw32_TARGET_OS)" "1"
+       $(MAKE) -r --no-print-directory -f windows-binary-dist
+       $(MAKE) -r --no-print-directory -f windows-installer
        rm -f bindist-list
        $(MAKE) -r --no-print-directory -f bindist BINDIST=YES
        $(MAKE) -r --no-print-directory -f binary-dist
 clean distclean maintainer-clean:
        $(MAKE) -r --no-print-directory -f $@ CLEANING=YES
index f1cd4ca..d2cea57 100644 (file)
@@ -941,7 +941,7 @@ fi
-AC_CONFIG_FILES([mk/ mk/ compiler/ghc.cabal ghc/ghc-bin.cabal ghc.spec extra-gcc-opts docs/users_guide/ug-book.xml])
+AC_CONFIG_FILES([mk/ mk/ compiler/ghc.cabal ghc/ghc-bin.cabal ghc.spec extra-gcc-opts docs/users_guide/ug-book.xml distrib/ghc.iss])
 AC_CONFIG_COMMANDS([mk/stamp-h],[echo timestamp > mk/stamp-h])
similarity index 79%
rename from distrib/ghc.iss
rename to distrib/
index c137f32..f7a4803 100644 (file)
@@ -1,8 +1,8 @@
+AppVerName=GHC @ProjectVersion@
@@ -14,13 +14,13 @@ ChangesEnvironment=yes
-Source: "ghc-@VERSION@\*"; DestDir: "{app}"; Flags: recursesubdirs
+Source: "ghc-@ProjectVersion@\*"; DestDir: "{app}"; Flags: recursesubdirs
-Name: "{group}\@VERSION@\GHCi"; Filename: "{app}\bin\ghci.exe"
-Name: "{group}\@VERSION@\GHC Documentation"; Filename: "{app}\doc\index.html"
-Name: "{group}\@VERSION@\GHC Library Documentation"; Filename: "{app}\doc\libraries\index.html"
-Name: "{group}\@VERSION@\GHC Flag Reference"; Filename: "{app}\doc\users_guide\flag-reference.html"
+Name: "{group}\@ProjectVersion@\GHCi"; Filename: "{app}\bin\ghci.exe"
+Name: "{group}\@ProjectVersion@\GHC Documentation"; Filename: "{app}\doc\index.html"
+Name: "{group}\@ProjectVersion@\GHC Library Documentation"; Filename: "{app}\doc\libraries\index.html"
+Name: "{group}\@ProjectVersion@\GHC Flag Reference"; Filename: "{app}\doc\users_guide\flag-reference.html"
 ; set up icon associations
@@ -34,7 +34,7 @@ Root: HKCR; Subkey: "ghc_haskell\shell\open\command"; ValueType: string; ValueNa
 ; these flags were always set in the past, by the installer
 ; some programs may rely on them to find GHC
-Root: HKCU; Subkey: "Software\Haskell\GHC\ghc-@VERSION@"; ValueType: string; ValueName: "InstallDir"; ValueData: "{app}"; Flags: uninsdeletekey
+Root: HKCU; Subkey: "Software\Haskell\GHC\ghc-@ProjectVersion@"; ValueType: string; ValueName: "InstallDir"; ValueData: "{app}"; Flags: uninsdeletekey
 Root: HKCU; Subkey: "Software\Haskell\GHC"; ValueType: string; ValueName: "InstallDir"; ValueData: "{app}"; Flags: uninsdeletevalue
 ; set the PATH variable, for both GHC and Cabal
diff --git a/ b/
index 1ff9cbb..c4e0686 100644 (file)
--- a/
+++ b/
@@ -772,13 +772,24 @@ binary-dist:
        "$(RM)" $(RM_OPTS) $(BIN_DIST_TAR)
 # h means "follow symlinks", e.g. if aclocal.m4 is a symlink to a source
 # tree then we want to include the real file, not a symlink to it
-       "$(TAR)" hcf - -T $(BIN_DIST_LIST) | bzip2 -c >$(BIN_DIST_TAR_BZ2)
+       "$(TAR)" hcf - -T $(BIN_DIST_LIST) | bzip2 -c > $(BIN_DIST_TAR_BZ2)
+       "$(RM)" $(RM_OPTS) -r $(BIN_DIST_NAME)
+       $(MAKE) prefix=$(BIN_DIST_DIR) install
+       "$(TAR)" cf - $(BIN_DIST_NAME) | bzip2 -c > $(BIN_DIST_TAR_BZ2)
+       "$(ISCC)" /O. /F$(WINDOWS_INSTALLER_BASE) - < distrib/ghc.iss
 nTimes = set -e; for i in `seq 1 $(1)`; do echo Try "$$i: $(2)"; if $(2); then break; fi; done
 .PHONY: publish-binary-dist
        $(call nTimes,10,$(PublishCp) $(BIN_DIST_TAR_BZ2) $(PublishLocation)/dist)
+ifeq "$(mingw32_TARGET_OS)" "1"
+       $(call nTimes,10,$(PublishCp) $(WINDOWS_INSTALLER) $(PublishLocation)/dist)
 # -----------------------------------------------------------------------------
 # Source distributions
index 1e2bde0..eefb00d 100644 (file)
@@ -380,6 +380,9 @@ BIN_DIST_PREP_DIR=$(TOP)/bindist-prep
+WINDOWS_INSTALLER_BASE = ghc-$(ProjectVersion)-i386-windows
 # Definition of installation directories, we don't use half of these, but since
 # the configure script has them on offer while passing through, we might as well
 # set them. Note that we have to be careful, because the GNU coding standards