summaryrefslogtreecommitdiff
path: root/compiler/ghc.mk
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2009-12-09 15:17:15 +0000
committerIan Lynagh <igloo@earth.li>2009-12-09 15:17:15 +0000
commitf041c305d30b04fea6b3b784ca3cc5151a52e06d (patch)
tree1cbc3d738355e95d50b7876c83ce49bae1502dad /compiler/ghc.mk
parente6fb8c9e66351ea240a3b4eb36c40e4c42b91da5 (diff)
downloadhaskell-f041c305d30b04fea6b3b784ca3cc5151a52e06d.tar.gz
Fix the stage1 version number munging
It was munging 6.12.1 into 62
Diffstat (limited to 'compiler/ghc.mk')
-rw-r--r--compiler/ghc.mk9
1 files changed, 7 insertions, 2 deletions
diff --git a/compiler/ghc.mk b/compiler/ghc.mk
index abc3788705..b6592f24ef 100644
--- a/compiler/ghc.mk
+++ b/compiler/ghc.mk
@@ -419,8 +419,13 @@ compiler_PACKAGE = ghc
# Note: we also have to tweak the version number of the package itself
# when it gets registered; see Note [munge-stage1-package-config]
# below.
-ifneq "$(ProjectPatchLevel)" "0"
+# The ProjectPatchLevel > 20000000 iff it's a date. If it's e.g. 6.12.1
+# then we don't want to remove it
+ifeq "$(shell [ $(ProjectPatchLevel) -gt 20000000 ] && echo YES)" "YES"
+compiler_stage1_VERSION_MUNGED = YES
+endif
+ifeq "$(compiler_stage1_VERSION_MUNGED)" "YES"
define compiler_PACKAGE_MAGIC
compiler_stage1_VERSION = $(subst .$(ProjectPatchLevel),,$(ProjectVersion))
endef
@@ -481,7 +486,7 @@ compiler/main/Constants_HC_OPTS += -fforce-recomp
# Note [munge-stage1-package-config]
# Strip the date/patchlevel from the version of stage1. See Note
# [fiddle-stage1-version] above.
-ifneq "$(ProjectPatchLevel)" "0"
+ifeq "$(compiler_stage1_VERSION_MUNGED)" "YES"
compiler/stage1/inplace-pkg-config-munged: compiler/stage1/inplace-pkg-config
sed -e 's/^\(version: .*\)\.$(ProjectPatchLevel)$$/\1/' \
-e 's/^\(id: .*\)\.$(ProjectPatchLevel)$$/\1/' \