jdk/make/common/shared/Defs.gmk
changeset 2158 68869a085470
parent 1163 0de695c3558f
child 2188 a1417beb3de8
--- a/jdk/make/common/shared/Defs.gmk	Wed Jul 05 16:45:38 2017 +0200
+++ b/jdk/make/common/shared/Defs.gmk	Sat Jan 31 17:31:21 2009 -0800
@@ -116,9 +116,9 @@
   fi)
 endef
 
-# Given a line of text, get the major.minor version number from it
+# Given a line of text, get the version number from it
 define GetVersion
-$(shell echo $1 | sed -e 's@[^1-9]*\([1-9][0-9]*\.[0-9][0-9]*\).*@\1@' )
+$(shell echo $1 | sed -e 's@[^0-9]*\([0-9][0-9]*\.[0-9][.0-9]*\).*@\1@' )
 endef
 
 # Given a major.minor.micro version, return the major, minor, or micro number
@@ -133,26 +133,26 @@
 endef
 
 # Macro that returns missing, same, newer, or older $1=version $2=required
-#  (currently does not check the micro number)
 define CheckVersions
 $(shell \
   if [ "$1" = "" -o "$2" = "" ]; then \
     echo missing; \
+  elif [ "$1" = "$2" ]; then \
+    echo same; \
+  elif [ $(call MajorVersion,$1) -lt $(call MajorVersion,$2) ] ; then \
+    echo older; \
+  elif [ $(call MajorVersion,$1) -gt $(call MajorVersion,$2) ] ; then \
+    echo newer; \
+  elif [ $(call MinorVersion,$1) -lt $(call MinorVersion,$2) ]; then \
+    echo older; \
+  elif [ $(call MinorVersion,$1) -gt $(call MinorVersion,$2) ]; then \
+    echo newer; \
+  elif [ $(call MicroVersion,$1) -lt $(call MicroVersion,$2) ]; then \
+    echo older; \
+  elif [ $(call MicroVersion,$1) -gt $(call MicroVersion,$2) ]; then \
+    echo newer; \
   else \
-    if [ "$1" = "$2" ]; then \
-      echo same; \
-    else \
-      if [ $(call MajorVersion,$1) -lt $(call MajorVersion,$2) ] ; then \
-        echo older; \
-      else \
-	if [ $(call MajorVersion,$1) -eq $(call MajorVersion,$2) -a \
-	     $(call MinorVersion,$1) -lt $(call MinorVersion,$2) ]; then \
-          echo older; \
-        else \
-          echo newer; \
-        fi; \
-      fi; \
-    fi; \
+    echo same; \
   fi)
 endef
 
@@ -561,3 +561,6 @@
 # Get shared compiler settings
 include $(JDK_MAKE_SHARED_DIR)/Compiler.gmk
 
+# Get the REQUIRED versions
+include $(JDK_MAKE_SHARED_DIR)/Defs-versions.gmk
+