OpenJDK / portola / portola
changeset 6310:8affde0eeeb4
6932743: Makefiles not parsing version strings with - from uname -r
Reviewed-by: mchung
author | ohair |
---|---|
date | Wed, 18 Aug 2010 13:46:39 -0700 |
parents | d3955f70aad3 |
children | 1448d18935b5 |
files | jdk/make/common/shared/Defs.gmk |
diffstat | 1 files changed, 8 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/jdk/make/common/shared/Defs.gmk Wed Aug 18 13:46:02 2010 -0700 +++ b/jdk/make/common/shared/Defs.gmk Wed Aug 18 13:46:39 2010 -0700 @@ -136,15 +136,20 @@ $(shell echo $1 | sed -e 's@[^0-9]*\([0-9][0-9]*\.[0-9][.0-9]*\).*@\1@' ) endef +# Return one part of the version numbers, watch out for non digits. +define VersionWord # Number Version +$(word $1,$(subst ., ,$(subst -, ,$2))) +endef + # Given a major.minor.micro version, return the major, minor, or micro number define MajorVersion -$(if $(word 1, $(subst ., ,$1)),$(word 1, $(subst ., ,$1)),0) +$(if $(call VersionWord,1,$1),$(call VersionWord,1,$1),0) endef define MinorVersion -$(if $(word 2, $(subst ., ,$1)),$(word 2, $(subst ., ,$1)),0) +$(if $(call VersionWord,2,$1),$(call VersionWord,2,$1),0) endef define MicroVersion -$(if $(word 3, $(subst ., ,$1)),$(word 3, $(subst ., ,$1)),0) +$(if $(call VersionWord,3,$1),$(call VersionWord,3,$1),0) endef # Macro that returns missing, same, newer, or older $1=version $2=required