From: Ian Lynagh Date: Wed, 10 Jun 2009 18:18:25 +0000 (+0000) Subject: Make Windows bindists and installers work in the new build system X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;ds=inline;h=de4cc55e97ca2011ab3889a9e2dab9a745839a66;p=ghc-hetmet.git Make Windows bindists and installers work in the new build system --- diff --git a/Makefile b/Makefile index 28328b3..f51b9a8 100644 --- a/Makefile +++ b/Makefile @@ -68,9 +68,14 @@ endif $(MAKE) -r --no-print-directory -f ghc.mk $@ binary-dist: +ifeq "$(mingw32_TARGET_OS)" "1" + $(MAKE) -r --no-print-directory -f ghc.mk windows-binary-dist + $(MAKE) -r --no-print-directory -f ghc.mk windows-installer +else rm -f bindist-list $(MAKE) -r --no-print-directory -f ghc.mk bindist BINDIST=YES $(MAKE) -r --no-print-directory -f ghc.mk binary-dist +endif clean distclean maintainer-clean: $(MAKE) -r --no-print-directory -f ghc.mk $@ CLEANING=YES diff --git a/configure.ac b/configure.ac index f1cd4ca..d2cea57 100644 --- a/configure.ac +++ b/configure.ac @@ -941,7 +941,7 @@ fi AC_SUBST(BUILD_DOCBOOK_PS) AC_SUBST(BUILD_DOCBOOK_PDF) -AC_CONFIG_FILES([mk/config.mk mk/project.mk compiler/ghc.cabal ghc/ghc-bin.cabal ghc.spec extra-gcc-opts docs/users_guide/ug-book.xml]) +AC_CONFIG_FILES([mk/config.mk mk/project.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]) AC_OUTPUT diff --git a/distrib/ghc.iss b/distrib/ghc.iss.in similarity index 79% rename from distrib/ghc.iss rename to distrib/ghc.iss.in index c137f32..f7a4803 100644 --- a/distrib/ghc.iss +++ b/distrib/ghc.iss.in @@ -1,8 +1,8 @@ [Setup] AppName=GHC -AppVerName=GHC @VERSION@ -DefaultDirName={sd}\ghc\ghc-@VERSION@ +AppVerName=GHC @ProjectVersion@ +DefaultDirName={sd}\ghc\ghc-@ProjectVersion@ UsePreviousAppDir=no DefaultGroupName=GHC UninstallDisplayIcon={app}\bin\ghci.exe @@ -14,13 +14,13 @@ ChangesEnvironment=yes [Files] -Source: "ghc-@VERSION@\*"; DestDir: "{app}"; Flags: recursesubdirs +Source: "ghc-@ProjectVersion@\*"; DestDir: "{app}"; Flags: recursesubdirs [Icons] -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" [Registry] ; 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/ghc.mk b/ghc.mk index 1ff9cbb..c4e0686 100644 --- a/ghc.mk +++ b/ghc.mk @@ -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) + +windows-binary-dist: + "$(RM)" $(RM_OPTS) -r $(BIN_DIST_NAME) + $(MAKE) prefix=$(BIN_DIST_DIR) install + "$(TAR)" cf - $(BIN_DIST_NAME) | bzip2 -c > $(BIN_DIST_TAR_BZ2) + +windows-installer: + "$(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 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) +endif # ----------------------------------------------------------------------------- # Source distributions diff --git a/mk/config.mk.in b/mk/config.mk.in index 1e2bde0..eefb00d 100644 --- a/mk/config.mk.in +++ b/mk/config.mk.in @@ -380,6 +380,9 @@ BIN_DIST_PREP_DIR=$(TOP)/bindist-prep BIN_DIST_PREP=$(BIN_DIST_PREP_DIR)/$(BIN_DIST_NAME) BIN_DIST_LIST=$(TOP)/bindist-list +WINDOWS_INSTALLER_BASE = ghc-$(ProjectVersion)-i386-windows +WINDOWS_INSTALLER = $(WINDOWS_INSTALLER_BASE)$(exeext) + # 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