8001895: build-infra: Make JDK_BUILD_NUMBER and MILESTONE customizable
authorerikj
Tue, 01 Jan 2013 14:13:18 +0100
changeset 15055 25fc052ccadd
parent 15054 e649ff651503
child 15056 6a7cbe3b0f08
8001895: build-infra: Make JDK_BUILD_NUMBER and MILESTONE customizable Summary: Added configure params Reviewed-by: ohair
common/autoconf/generated-configure.sh
common/autoconf/jdk-options.m4
common/autoconf/spec.gmk.in
common/autoconf/version.numbers
--- a/common/autoconf/generated-configure.sh	Sun Dec 30 12:15:02 2012 +0100
+++ b/common/autoconf/generated-configure.sh	Tue Jan 01 14:13:18 2013 +0100
@@ -752,8 +752,7 @@
 JAVA_CHECK
 JAVAC_CHECK
 COOKED_BUILD_NUMBER
-FULL_VERSION
-RELEASE
+USER_RELEASE_SUFFIX
 JDK_VERSION
 RUNTIME_NAME
 COPYRIGHT_YEAR
@@ -969,6 +968,8 @@
 enable_hotspot_test_in_build
 with_cacerts_file
 enable_unlimited_crypto
+with_milestone
+with_build_number
 with_boot_jdk
 with_boot_jdk_jvmargs
 with_add_source_root
@@ -1698,6 +1699,8 @@
   --with-builddeps-group  chgrp the downloaded build dependencies to this
                           group
   --with-cacerts-file     specify alternative cacerts file
+  --with-milestone        Set milestone value for build [internal]
+  --with-build-number     Set build number value for build [b00]
   --with-boot-jdk         path to Boot JDK (used to bootstrap build) [probed]
   --with-boot-jdk-jvmargs specify JVM arguments to be passed to all
                           invocations of the Boot JDK, overriding the default
@@ -3679,7 +3682,7 @@
 #CUSTOM_AUTOCONF_INCLUDE
 
 # Do not change or remove the following line, it is needed for consistency checks:
-DATE_WHEN_GENERATED=1356865941
+DATE_WHEN_GENERATED=1357045896
 
 ###############################################################################
 #
@@ -10608,6 +10611,33 @@
 if test "x$OPENJDK" = "xfalse"; then
     . $AUTOCONF_DIR/closed.version.numbers
 fi
+
+
+# Check whether --with-milestone was given.
+if test "${with_milestone+set}" = set; then :
+  withval=$with_milestone;
+fi
+
+if test "x$with_milestone" = xyes; then
+    as_fn_error $? "Milestone must have a value" "$LINENO" 5
+elif test "x$with_milestone" != x; then
+    MILESTONE="$with_milestone"
+else
+    MILESTONE=internal
+fi
+
+
+# Check whether --with-build-number was given.
+if test "${with_build_number+set}" = set; then :
+  withval=$with_build_number;
+fi
+
+if test "x$with_build_number" = xyes; then
+    as_fn_error $? "Build number must have a value" "$LINENO" 5
+elif test "x$with_build_number" != x; then
+    JDK_BUILD_NUMBER="$with_build_number"
+fi
+
 # Now set the JDK version, milestone, build number etc.
 
 
@@ -10636,23 +10666,11 @@
 fi
 
 
-if test "x$MILESTONE" != x; then
-    RELEASE="${JDK_VERSION}-${MILESTONE}${BUILD_VARIANT_RELEASE}"
-else
-    RELEASE="${JDK_VERSION}${BUILD_VARIANT_RELEASE}"
-fi
-
-
-if test "x$JDK_BUILD_NUMBER" != x; then
-    FULL_VERSION="${RELEASE}-${JDK_BUILD_NUMBER}"
-else
-    JDK_BUILD_NUMBER=b00
-    BUILD_DATE=`date '+%Y_%m_%d_%H_%M'`
-    # Avoid [:alnum:] since it depends on the locale.
-    CLEAN_USERNAME=`echo "$USER" | $TR -d -c 'abcdefghijklmnopqrstuvqxyz0123456789'`
-    USER_RELEASE_SUFFIX=`echo "${CLEAN_USERNAME}_${BUILD_DATE}" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
-    FULL_VERSION="${RELEASE}-${USER_RELEASE_SUFFIX}-${JDK_BUILD_NUMBER}"
-fi
+BUILD_DATE=`date '+%Y_%m_%d_%H_%M'`
+# Avoid [:alnum:] since it depends on the locale.
+CLEAN_USERNAME=`echo "$USER" | $TR -d -c 'abcdefghijklmnopqrstuvqxyz0123456789'`
+USER_RELEASE_SUFFIX=`echo "${CLEAN_USERNAME}_${BUILD_DATE}" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+
 
 COOKED_BUILD_NUMBER=`$ECHO $JDK_BUILD_NUMBER | $SED -e 's/^b//' -e 's/^0//'`
 
--- a/common/autoconf/jdk-options.m4	Sun Dec 30 12:15:02 2012 +0100
+++ b/common/autoconf/jdk-options.m4	Tue Jan 01 14:13:18 2013 +0100
@@ -376,6 +376,25 @@
 if test "x$OPENJDK" = "xfalse"; then
     . $AUTOCONF_DIR/closed.version.numbers
 fi
+
+AC_ARG_WITH(milestone, [AS_HELP_STRING([--with-milestone], 
+                       [Set milestone value for build @<:@internal@:>@])])
+if test "x$with_milestone" = xyes; then
+    AC_MSG_ERROR([Milestone must have a value])
+elif test "x$with_milestone" != x; then
+    MILESTONE="$with_milestone"
+else
+    MILESTONE=internal
+fi
+
+AC_ARG_WITH(build-number, [AS_HELP_STRING([--with-build-number], 
+                          [Set build number value for build @<:@b00@:>@])])
+if test "x$with_build_number" = xyes; then
+    AC_MSG_ERROR([Build number must have a value])
+elif test "x$with_build_number" != x; then
+    JDK_BUILD_NUMBER="$with_build_number"
+fi
+
 # Now set the JDK version, milestone, build number etc.
 AC_SUBST(JDK_MAJOR_VERSION)
 AC_SUBST(JDK_MINOR_VERSION)
@@ -404,24 +423,12 @@
 fi
 AC_SUBST(JDK_VERSION)
 
-if test "x$MILESTONE" != x; then
-    RELEASE="${JDK_VERSION}-${MILESTONE}${BUILD_VARIANT_RELEASE}"
-else
-    RELEASE="${JDK_VERSION}${BUILD_VARIANT_RELEASE}"
-fi
-AC_SUBST(RELEASE)
+BUILD_DATE=`date '+%Y_%m_%d_%H_%M'`
+# Avoid [:alnum:] since it depends on the locale.
+CLEAN_USERNAME=`echo "$USER" | $TR -d -c 'abcdefghijklmnopqrstuvqxyz0123456789'`
+USER_RELEASE_SUFFIX=`echo "${CLEAN_USERNAME}_${BUILD_DATE}" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+AC_SUBST(USER_RELEASE_SUFFIX)
 
-if test "x$JDK_BUILD_NUMBER" != x; then
-    FULL_VERSION="${RELEASE}-${JDK_BUILD_NUMBER}"
-else
-    JDK_BUILD_NUMBER=b00
-    BUILD_DATE=`date '+%Y_%m_%d_%H_%M'`
-    # Avoid [:alnum:] since it depends on the locale.
-    CLEAN_USERNAME=`echo "$USER" | $TR -d -c 'abcdefghijklmnopqrstuvqxyz0123456789'`
-    USER_RELEASE_SUFFIX=`echo "${CLEAN_USERNAME}_${BUILD_DATE}" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
-    FULL_VERSION="${RELEASE}-${USER_RELEASE_SUFFIX}-${JDK_BUILD_NUMBER}"
-fi
-AC_SUBST(FULL_VERSION)
 COOKED_BUILD_NUMBER=`$ECHO $JDK_BUILD_NUMBER | $SED -e 's/^b//' -e 's/^0//'`
 AC_SUBST(COOKED_BUILD_NUMBER)
 ])
--- a/common/autoconf/spec.gmk.in	Sun Dec 30 12:15:02 2012 +0100
+++ b/common/autoconf/spec.gmk.in	Tue Jan 01 14:13:18 2013 +0100
@@ -164,10 +164,21 @@
 # Different version strings generated from the above information.
 JDK_VERSION:=@JDK_VERSION@
 RUNTIME_NAME:=@RUNTIME_NAME@
-FULL_VERSION:=@FULL_VERSION@
 JRE_RELEASE_VERSION:=@FULL_VERSION@
-RELEASE:=@RELEASE@
 COOKED_BUILD_NUMBER:=@COOKED_BUILD_NUMBER@
+# These variables need to be generated here so that MILESTONE and
+# JDK_BUILD_NUMBER can be overridden on the make command line.
+ifeq ($(MILESTONE),)
+  RELEASE=$(JDK_VERSION)$(BUILD_VARIANT_RELEASE)
+else
+  RELEASE=$(JDK_VERSION)-$(MILESTONE)$(BUILD_VARIANT_RELEASE)
+endif
+ifeq ($(JDK_BUILD_NUMBER),b00)
+  USER_RELEASE_SUFFIX=@USER_RELEASE_SUFFIX@
+  FULL_VERSION=$(RELEASE)-$(USER_RELEASE_SUFFIX)-$(JDK_BUILD_NUMBER)
+else
+  FULL_VERSION=$(RELEASE)-$(JDK_BUILD_NUMBER)
+endif
 
 # How to compile the code: release, fastdebug or slowdebug
 DEBUG_LEVEL:=@DEBUG_LEVEL@
--- a/common/autoconf/version.numbers	Sun Dec 30 12:15:02 2012 +0100
+++ b/common/autoconf/version.numbers	Tue Jan 01 14:13:18 2013 +0100
@@ -27,8 +27,6 @@
 JDK_MINOR_VERSION=8
 JDK_MICRO_VERSION=0
 JDK_UPDATE_VERSION=
-JDK_BUILD_NUMBER=
-MILESTONE=internal
 LAUNCHER_NAME=openjdk
 PRODUCT_NAME=OpenJDK
 PRODUCT_SUFFIX="Runtime Environment"