make/autoconf/jdk-version.m4
author jvernee
Thu, 14 Nov 2019 10:55:46 +0100
changeset 59075 355f4f42dda5
parent 58842 6c255334120d
permissions -rw-r--r--
8233920: MethodHandles::tryFinally generates illegal bytecode for long/double return type Reviewed-by: redestad, vlivanov, jrose
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
54565
3b2101f56cdd 8222627: Remove sneaky token 'Name' in jdk-version.m4
clanger
parents: 54546
diff changeset
     1
#
54452
0d7fb7f07134 8221880: Better customization for Windows RC properties FileDescription and ProductName
clanger
parents: 54326
diff changeset
     2
# Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
33926
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
     4
#
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
     7
# published by the Free Software Foundation.  Oracle designates this
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
     8
# particular file as subject to the "Classpath" exception as provided
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
     9
# by Oracle in the LICENSE file that accompanied this code.
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
    10
#
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
    11
# This code is distributed in the hope that it will be useful, but WITHOUT
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
    12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
    13
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
    14
# version 2 for more details (a copy is included in the LICENSE file that
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
    15
# accompanied this code).
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
    16
#
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
    17
# You should have received a copy of the GNU General Public License version
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
    18
# 2 along with this work; if not, write to the Free Software Foundation,
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
    19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
    20
#
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
    21
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
    22
# or visit www.oracle.com if you need additional information or have any
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
    23
# questions.
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
    24
#
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
    25
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
    26
###############################################################################
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
    27
#
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
    28
# Setup version numbers
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
    29
#
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
    30
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
    31
# Verify that a given string represents a valid version number, and assign it
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
    32
# to a variable.
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
    33
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
    34
# Argument 1: the variable to assign to
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
    35
# Argument 2: the value given by the user
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
    36
AC_DEFUN([JDKVER_CHECK_AND_SET_NUMBER],
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
    37
[
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
    38
  # Additional [] needed to keep m4 from mangling shell constructs.
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
    39
  if [ ! [[ "$2" =~ ^0*([1-9][0-9]*)|(0)$ ]] ] ; then
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
    40
    AC_MSG_ERROR(["$2" is not a valid numerical value for $1])
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
    41
  fi
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
    42
  # Extract the version number without leading zeros.
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
    43
  cleaned_value=${BASH_REMATCH[[1]]}
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
    44
  if test "x$cleaned_value" = x; then
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
    45
    # Special case for zero
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
    46
    cleaned_value=${BASH_REMATCH[[2]]}
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
    47
  fi
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
    48
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
    49
  if test $cleaned_value -gt 255; then
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
    50
    AC_MSG_ERROR([$1 is given as $2. This is greater than 255 which is not allowed.])
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
    51
  fi
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
    52
  if test "x$cleaned_value" != "x$2"; then
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
    53
    AC_MSG_WARN([Value for $1 has been sanitized from '$2' to '$cleaned_value'])
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
    54
  fi
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
    55
  $1=$cleaned_value
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
    56
])
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
    57
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
    58
AC_DEFUN_ONCE([JDKVER_SETUP_JDK_VERSION_NUMBERS],
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
    59
[
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
    60
  # Source the version numbers file
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
    61
  . $AUTOCONF_DIR/version-numbers
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
    62
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
    63
  # Some non-version number information is set in that file
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
    64
  AC_SUBST(LAUNCHER_NAME)
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
    65
  AC_SUBST(PRODUCT_NAME)
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
    66
  AC_SUBST(PRODUCT_SUFFIX)
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
    67
  AC_SUBST(JDK_RC_PLATFORM_NAME)
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 35444
diff changeset
    68
  AC_SUBST(HOTSPOT_VM_DISTRO)
54546
460996cd27f9 8222522: Add configure options for Mac Bundle creation
clanger
parents: 54452
diff changeset
    69
460996cd27f9 8222522: Add configure options for Mac Bundle creation
clanger
parents: 54452
diff changeset
    70
  # Set the MACOSX Bundle Name base
460996cd27f9 8222522: Add configure options for Mac Bundle creation
clanger
parents: 54452
diff changeset
    71
  AC_ARG_WITH(macosx-bundle-name-base, [AS_HELP_STRING([--with-macosx-bundle-name-base],
460996cd27f9 8222522: Add configure options for Mac Bundle creation
clanger
parents: 54452
diff changeset
    72
      [Set the MacOSX Bundle Name base. This is the base name for calculating MacOSX Bundle Names.
460996cd27f9 8222522: Add configure options for Mac Bundle creation
clanger
parents: 54452
diff changeset
    73
      @<:@not specified@:>@])])
460996cd27f9 8222522: Add configure options for Mac Bundle creation
clanger
parents: 54452
diff changeset
    74
  if test "x$with_macosx_bundle_name_base" = xyes; then
460996cd27f9 8222522: Add configure options for Mac Bundle creation
clanger
parents: 54452
diff changeset
    75
    AC_MSG_ERROR([--with-macosx-bundle-name-base must have a value])
460996cd27f9 8222522: Add configure options for Mac Bundle creation
clanger
parents: 54452
diff changeset
    76
  elif [ ! [[ $with_macosx_bundle_name_base =~ ^[[:print:]]*$ ]] ]; then
460996cd27f9 8222522: Add configure options for Mac Bundle creation
clanger
parents: 54452
diff changeset
    77
    AC_MSG_ERROR([--with-macosx-bundle-name-base contains non-printing characters: $with_macosx_bundle_name_base])
460996cd27f9 8222522: Add configure options for Mac Bundle creation
clanger
parents: 54452
diff changeset
    78
  elif test "x$with_macosx_bundle_name_base" != x; then
460996cd27f9 8222522: Add configure options for Mac Bundle creation
clanger
parents: 54452
diff changeset
    79
    # Set MACOSX_BUNDLE_NAME_BASE to the configured value.
460996cd27f9 8222522: Add configure options for Mac Bundle creation
clanger
parents: 54452
diff changeset
    80
    MACOSX_BUNDLE_NAME_BASE="$with_macosx_bundle_name_base"
460996cd27f9 8222522: Add configure options for Mac Bundle creation
clanger
parents: 54452
diff changeset
    81
  fi
33926
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
    82
  AC_SUBST(MACOSX_BUNDLE_NAME_BASE)
54546
460996cd27f9 8222522: Add configure options for Mac Bundle creation
clanger
parents: 54452
diff changeset
    83
460996cd27f9 8222522: Add configure options for Mac Bundle creation
clanger
parents: 54452
diff changeset
    84
  # Set the MACOSX Bundle ID base
460996cd27f9 8222522: Add configure options for Mac Bundle creation
clanger
parents: 54452
diff changeset
    85
  AC_ARG_WITH(macosx-bundle-id-base, [AS_HELP_STRING([--with-macosx-bundle-id-base],
460996cd27f9 8222522: Add configure options for Mac Bundle creation
clanger
parents: 54452
diff changeset
    86
      [Set the MacOSX Bundle ID base. This is the base ID for calculating MacOSX Bundle IDs.
460996cd27f9 8222522: Add configure options for Mac Bundle creation
clanger
parents: 54452
diff changeset
    87
      @<:@not specified@:>@])])
460996cd27f9 8222522: Add configure options for Mac Bundle creation
clanger
parents: 54452
diff changeset
    88
  if test "x$with_macosx_bundle_id_base" = xyes; then
460996cd27f9 8222522: Add configure options for Mac Bundle creation
clanger
parents: 54452
diff changeset
    89
    AC_MSG_ERROR([--with-macosx-bundle-id-base must have a value])
460996cd27f9 8222522: Add configure options for Mac Bundle creation
clanger
parents: 54452
diff changeset
    90
  elif [ ! [[ $with_macosx_bundle_id_base =~ ^[[:print:]]*$ ]] ]; then
460996cd27f9 8222522: Add configure options for Mac Bundle creation
clanger
parents: 54452
diff changeset
    91
    AC_MSG_ERROR([--with-macosx-bundle-id-base contains non-printing characters: $with_macosx_bundle_id_base])
460996cd27f9 8222522: Add configure options for Mac Bundle creation
clanger
parents: 54452
diff changeset
    92
  elif test "x$with_macosx_bundle_id_base" != x; then
460996cd27f9 8222522: Add configure options for Mac Bundle creation
clanger
parents: 54452
diff changeset
    93
    # Set MACOSX_BUNDLE_ID_BASE to the configured value.
460996cd27f9 8222522: Add configure options for Mac Bundle creation
clanger
parents: 54452
diff changeset
    94
    MACOSX_BUNDLE_ID_BASE="$with_macosx_bundle_id_base"
460996cd27f9 8222522: Add configure options for Mac Bundle creation
clanger
parents: 54452
diff changeset
    95
  fi
33926
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
    96
  AC_SUBST(MACOSX_BUNDLE_ID_BASE)
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
    97
54452
0d7fb7f07134 8221880: Better customization for Windows RC properties FileDescription and ProductName
clanger
parents: 54326
diff changeset
    98
  # Set the JDK RC name
0d7fb7f07134 8221880: Better customization for Windows RC properties FileDescription and ProductName
clanger
parents: 54326
diff changeset
    99
  AC_ARG_WITH(jdk-rc-name, [AS_HELP_STRING([--with-jdk-rc-name],
0d7fb7f07134 8221880: Better customization for Windows RC properties FileDescription and ProductName
clanger
parents: 54326
diff changeset
   100
      [Set JDK RC name. This is used for FileDescription and ProductName properties
0d7fb7f07134 8221880: Better customization for Windows RC properties FileDescription and ProductName
clanger
parents: 54326
diff changeset
   101
       of MS Windows binaries. @<:@not specified@:>@])])
0d7fb7f07134 8221880: Better customization for Windows RC properties FileDescription and ProductName
clanger
parents: 54326
diff changeset
   102
  if test "x$with_jdk_rc_name" = xyes; then
0d7fb7f07134 8221880: Better customization for Windows RC properties FileDescription and ProductName
clanger
parents: 54326
diff changeset
   103
    AC_MSG_ERROR([--with-jdk-rc-name must have a value])
0d7fb7f07134 8221880: Better customization for Windows RC properties FileDescription and ProductName
clanger
parents: 54326
diff changeset
   104
  elif [ ! [[ $with_jdk_rc_name =~ ^[[:print:]]*$ ]] ]; then
0d7fb7f07134 8221880: Better customization for Windows RC properties FileDescription and ProductName
clanger
parents: 54326
diff changeset
   105
    AC_MSG_ERROR([--with-jdk-rc-name contains non-printing characters: $with_jdk_rc_name])
0d7fb7f07134 8221880: Better customization for Windows RC properties FileDescription and ProductName
clanger
parents: 54326
diff changeset
   106
  elif test "x$with_jdk_rc_name" != x; then
0d7fb7f07134 8221880: Better customization for Windows RC properties FileDescription and ProductName
clanger
parents: 54326
diff changeset
   107
    # Set JDK_RC_NAME to a custom value if '--with-jdk-rc-name' was used and is not empty.
0d7fb7f07134 8221880: Better customization for Windows RC properties FileDescription and ProductName
clanger
parents: 54326
diff changeset
   108
    JDK_RC_NAME="$with_jdk_rc_name"
0d7fb7f07134 8221880: Better customization for Windows RC properties FileDescription and ProductName
clanger
parents: 54326
diff changeset
   109
  else
0d7fb7f07134 8221880: Better customization for Windows RC properties FileDescription and ProductName
clanger
parents: 54326
diff changeset
   110
    # Otherwise calculate from "version-numbers" included above.
0d7fb7f07134 8221880: Better customization for Windows RC properties FileDescription and ProductName
clanger
parents: 54326
diff changeset
   111
    JDK_RC_NAME="$PRODUCT_NAME $JDK_RC_PLATFORM_NAME"
0d7fb7f07134 8221880: Better customization for Windows RC properties FileDescription and ProductName
clanger
parents: 54326
diff changeset
   112
  fi
0d7fb7f07134 8221880: Better customization for Windows RC properties FileDescription and ProductName
clanger
parents: 54326
diff changeset
   113
  AC_SUBST(JDK_RC_NAME)
0d7fb7f07134 8221880: Better customization for Windows RC properties FileDescription and ProductName
clanger
parents: 54326
diff changeset
   114
48378
e8e8db4f8194 8193764: Cannot set COMPANY_NAME when configuring a build
mr
parents: 48327
diff changeset
   115
  # The vendor name, if any
e8e8db4f8194 8193764: Cannot set COMPANY_NAME when configuring a build
mr
parents: 48327
diff changeset
   116
  AC_ARG_WITH(vendor-name, [AS_HELP_STRING([--with-vendor-name],
48598
c7eea4b541d1 8189761: COMPANY_NAME, IMPLEMENTOR, BUNDLE_VENDOR, VENDOR, but no configure flag
simonis
parents: 48378
diff changeset
   117
      [Set vendor name. Among others, used to set the 'java.vendor'
c7eea4b541d1 8189761: COMPANY_NAME, IMPLEMENTOR, BUNDLE_VENDOR, VENDOR, but no configure flag
simonis
parents: 48378
diff changeset
   118
       and 'java.vm.vendor' system properties. @<:@not specified@:>@])])
48378
e8e8db4f8194 8193764: Cannot set COMPANY_NAME when configuring a build
mr
parents: 48327
diff changeset
   119
  if test "x$with_vendor_name" = xyes; then
e8e8db4f8194 8193764: Cannot set COMPANY_NAME when configuring a build
mr
parents: 48327
diff changeset
   120
    AC_MSG_ERROR([--with-vendor-name must have a value])
e8e8db4f8194 8193764: Cannot set COMPANY_NAME when configuring a build
mr
parents: 48327
diff changeset
   121
  elif [ ! [[ $with_vendor_name =~ ^[[:print:]]*$ ]] ]; then
48598
c7eea4b541d1 8189761: COMPANY_NAME, IMPLEMENTOR, BUNDLE_VENDOR, VENDOR, but no configure flag
simonis
parents: 48378
diff changeset
   122
    AC_MSG_ERROR([--with-vendor-name contains non-printing characters: $with_vendor_name])
c7eea4b541d1 8189761: COMPANY_NAME, IMPLEMENTOR, BUNDLE_VENDOR, VENDOR, but no configure flag
simonis
parents: 48378
diff changeset
   123
  elif test "x$with_vendor_name" != x; then
c7eea4b541d1 8189761: COMPANY_NAME, IMPLEMENTOR, BUNDLE_VENDOR, VENDOR, but no configure flag
simonis
parents: 48378
diff changeset
   124
    # Only set COMPANY_NAME if '--with-vendor-name' was used and is not empty.
c7eea4b541d1 8189761: COMPANY_NAME, IMPLEMENTOR, BUNDLE_VENDOR, VENDOR, but no configure flag
simonis
parents: 48378
diff changeset
   125
    # Otherwise we will use the value from "version-numbers" included above.
48378
e8e8db4f8194 8193764: Cannot set COMPANY_NAME when configuring a build
mr
parents: 48327
diff changeset
   126
    COMPANY_NAME="$with_vendor_name"
e8e8db4f8194 8193764: Cannot set COMPANY_NAME when configuring a build
mr
parents: 48327
diff changeset
   127
  fi
e8e8db4f8194 8193764: Cannot set COMPANY_NAME when configuring a build
mr
parents: 48327
diff changeset
   128
  AC_SUBST(COMPANY_NAME)
e8e8db4f8194 8193764: Cannot set COMPANY_NAME when configuring a build
mr
parents: 48327
diff changeset
   129
48598
c7eea4b541d1 8189761: COMPANY_NAME, IMPLEMENTOR, BUNDLE_VENDOR, VENDOR, but no configure flag
simonis
parents: 48378
diff changeset
   130
  # The vendor URL, if any
c7eea4b541d1 8189761: COMPANY_NAME, IMPLEMENTOR, BUNDLE_VENDOR, VENDOR, but no configure flag
simonis
parents: 48378
diff changeset
   131
  AC_ARG_WITH(vendor-url, [AS_HELP_STRING([--with-vendor-url],
c7eea4b541d1 8189761: COMPANY_NAME, IMPLEMENTOR, BUNDLE_VENDOR, VENDOR, but no configure flag
simonis
parents: 48378
diff changeset
   132
      [Set the 'java.vendor.url' system property @<:@not specified@:>@])])
c7eea4b541d1 8189761: COMPANY_NAME, IMPLEMENTOR, BUNDLE_VENDOR, VENDOR, but no configure flag
simonis
parents: 48378
diff changeset
   133
  if test "x$with_vendor_url" = xyes; then
c7eea4b541d1 8189761: COMPANY_NAME, IMPLEMENTOR, BUNDLE_VENDOR, VENDOR, but no configure flag
simonis
parents: 48378
diff changeset
   134
    AC_MSG_ERROR([--with-vendor-url must have a value])
c7eea4b541d1 8189761: COMPANY_NAME, IMPLEMENTOR, BUNDLE_VENDOR, VENDOR, but no configure flag
simonis
parents: 48378
diff changeset
   135
  elif [ ! [[ $with_vendor_url =~ ^[[:print:]]*$ ]] ]; then
c7eea4b541d1 8189761: COMPANY_NAME, IMPLEMENTOR, BUNDLE_VENDOR, VENDOR, but no configure flag
simonis
parents: 48378
diff changeset
   136
    AC_MSG_ERROR([--with-vendor-url contains non-printing characters: $with_vendor_url])
52724
0bdbf854472f 4947890: Minimize JNI upcalls in system-properties initialization
rriggs
parents: 51586
diff changeset
   137
  elif test "x$with_vendor_url" != x; then
0bdbf854472f 4947890: Minimize JNI upcalls in system-properties initialization
rriggs
parents: 51586
diff changeset
   138
    # Only set VENDOR_URL if '--with-vendor-url' was used and is not empty.
0bdbf854472f 4947890: Minimize JNI upcalls in system-properties initialization
rriggs
parents: 51586
diff changeset
   139
    # Otherwise we will use the value from "version-numbers" included above.
48598
c7eea4b541d1 8189761: COMPANY_NAME, IMPLEMENTOR, BUNDLE_VENDOR, VENDOR, but no configure flag
simonis
parents: 48378
diff changeset
   140
    VENDOR_URL="$with_vendor_url"
c7eea4b541d1 8189761: COMPANY_NAME, IMPLEMENTOR, BUNDLE_VENDOR, VENDOR, but no configure flag
simonis
parents: 48378
diff changeset
   141
  fi
c7eea4b541d1 8189761: COMPANY_NAME, IMPLEMENTOR, BUNDLE_VENDOR, VENDOR, but no configure flag
simonis
parents: 48378
diff changeset
   142
  AC_SUBST(VENDOR_URL)
c7eea4b541d1 8189761: COMPANY_NAME, IMPLEMENTOR, BUNDLE_VENDOR, VENDOR, but no configure flag
simonis
parents: 48378
diff changeset
   143
c7eea4b541d1 8189761: COMPANY_NAME, IMPLEMENTOR, BUNDLE_VENDOR, VENDOR, but no configure flag
simonis
parents: 48378
diff changeset
   144
  # The vendor bug URL, if any
c7eea4b541d1 8189761: COMPANY_NAME, IMPLEMENTOR, BUNDLE_VENDOR, VENDOR, but no configure flag
simonis
parents: 48378
diff changeset
   145
  AC_ARG_WITH(vendor-bug-url, [AS_HELP_STRING([--with-vendor-bug-url],
c7eea4b541d1 8189761: COMPANY_NAME, IMPLEMENTOR, BUNDLE_VENDOR, VENDOR, but no configure flag
simonis
parents: 48378
diff changeset
   146
      [Set the 'java.vendor.url.bug' system property @<:@not specified@:>@])])
c7eea4b541d1 8189761: COMPANY_NAME, IMPLEMENTOR, BUNDLE_VENDOR, VENDOR, but no configure flag
simonis
parents: 48378
diff changeset
   147
  if test "x$with_vendor_bug_url" = xyes; then
c7eea4b541d1 8189761: COMPANY_NAME, IMPLEMENTOR, BUNDLE_VENDOR, VENDOR, but no configure flag
simonis
parents: 48378
diff changeset
   148
    AC_MSG_ERROR([--with-vendor-bug-url must have a value])
c7eea4b541d1 8189761: COMPANY_NAME, IMPLEMENTOR, BUNDLE_VENDOR, VENDOR, but no configure flag
simonis
parents: 48378
diff changeset
   149
  elif [ ! [[ $with_vendor_bug_url =~ ^[[:print:]]*$ ]] ]; then
c7eea4b541d1 8189761: COMPANY_NAME, IMPLEMENTOR, BUNDLE_VENDOR, VENDOR, but no configure flag
simonis
parents: 48378
diff changeset
   150
    AC_MSG_ERROR([--with-vendor-bug-url contains non-printing characters: $with_vendor_bug_url])
52724
0bdbf854472f 4947890: Minimize JNI upcalls in system-properties initialization
rriggs
parents: 51586
diff changeset
   151
  elif test "x$with_vendor_bug_url" != x; then
0bdbf854472f 4947890: Minimize JNI upcalls in system-properties initialization
rriggs
parents: 51586
diff changeset
   152
    # Only set VENDOR_URL_BUG if '--with-vendor-bug-url' was used and is not empty.
0bdbf854472f 4947890: Minimize JNI upcalls in system-properties initialization
rriggs
parents: 51586
diff changeset
   153
    # Otherwise we will use the value from "version-numbers" included above.
48598
c7eea4b541d1 8189761: COMPANY_NAME, IMPLEMENTOR, BUNDLE_VENDOR, VENDOR, but no configure flag
simonis
parents: 48378
diff changeset
   154
    VENDOR_URL_BUG="$with_vendor_bug_url"
c7eea4b541d1 8189761: COMPANY_NAME, IMPLEMENTOR, BUNDLE_VENDOR, VENDOR, but no configure flag
simonis
parents: 48378
diff changeset
   155
  fi
c7eea4b541d1 8189761: COMPANY_NAME, IMPLEMENTOR, BUNDLE_VENDOR, VENDOR, but no configure flag
simonis
parents: 48378
diff changeset
   156
  AC_SUBST(VENDOR_URL_BUG)
c7eea4b541d1 8189761: COMPANY_NAME, IMPLEMENTOR, BUNDLE_VENDOR, VENDOR, but no configure flag
simonis
parents: 48378
diff changeset
   157
c7eea4b541d1 8189761: COMPANY_NAME, IMPLEMENTOR, BUNDLE_VENDOR, VENDOR, but no configure flag
simonis
parents: 48378
diff changeset
   158
  # The vendor VM bug URL, if any
c7eea4b541d1 8189761: COMPANY_NAME, IMPLEMENTOR, BUNDLE_VENDOR, VENDOR, but no configure flag
simonis
parents: 48378
diff changeset
   159
  AC_ARG_WITH(vendor-vm-bug-url, [AS_HELP_STRING([--with-vendor-vm-bug-url],
c7eea4b541d1 8189761: COMPANY_NAME, IMPLEMENTOR, BUNDLE_VENDOR, VENDOR, but no configure flag
simonis
parents: 48378
diff changeset
   160
      [Sets the bug URL which will be displayed when the VM crashes @<:@not specified@:>@])])
c7eea4b541d1 8189761: COMPANY_NAME, IMPLEMENTOR, BUNDLE_VENDOR, VENDOR, but no configure flag
simonis
parents: 48378
diff changeset
   161
  if test "x$with_vendor_vm_bug_url" = xyes; then
c7eea4b541d1 8189761: COMPANY_NAME, IMPLEMENTOR, BUNDLE_VENDOR, VENDOR, but no configure flag
simonis
parents: 48378
diff changeset
   162
    AC_MSG_ERROR([--with-vendor-vm-bug-url must have a value])
c7eea4b541d1 8189761: COMPANY_NAME, IMPLEMENTOR, BUNDLE_VENDOR, VENDOR, but no configure flag
simonis
parents: 48378
diff changeset
   163
  elif [ ! [[ $with_vendor_vm_bug_url =~ ^[[:print:]]*$ ]] ]; then
c7eea4b541d1 8189761: COMPANY_NAME, IMPLEMENTOR, BUNDLE_VENDOR, VENDOR, but no configure flag
simonis
parents: 48378
diff changeset
   164
    AC_MSG_ERROR([--with-vendor-vm-bug-url contains non-printing characters: $with_vendor_vm_bug_url])
58842
6c255334120d 8232080: jlink plugins for vendor information and run-time options
mr
parents: 54565
diff changeset
   165
  elif test "x$with_vendor_vm_bug_url" != x; then
6c255334120d 8232080: jlink plugins for vendor information and run-time options
mr
parents: 54565
diff changeset
   166
    # Only set VENDOR_URL_VM_BUG if '--with-vendor-vm-bug-url' was used and is not empty.
6c255334120d 8232080: jlink plugins for vendor information and run-time options
mr
parents: 54565
diff changeset
   167
    # Otherwise we will use the value from "version-numbers" included above.
48598
c7eea4b541d1 8189761: COMPANY_NAME, IMPLEMENTOR, BUNDLE_VENDOR, VENDOR, but no configure flag
simonis
parents: 48378
diff changeset
   168
    VENDOR_URL_VM_BUG="$with_vendor_vm_bug_url"
c7eea4b541d1 8189761: COMPANY_NAME, IMPLEMENTOR, BUNDLE_VENDOR, VENDOR, but no configure flag
simonis
parents: 48378
diff changeset
   169
  fi
c7eea4b541d1 8189761: COMPANY_NAME, IMPLEMENTOR, BUNDLE_VENDOR, VENDOR, but no configure flag
simonis
parents: 48378
diff changeset
   170
  AC_SUBST(VENDOR_URL_VM_BUG)
c7eea4b541d1 8189761: COMPANY_NAME, IMPLEMENTOR, BUNDLE_VENDOR, VENDOR, but no configure flag
simonis
parents: 48378
diff changeset
   171
33926
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   172
  # Override version from arguments
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   173
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   174
  # If --with-version-string is set, process it first. It is possible to
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   175
  # override parts with more specific flags, since these are processed later.
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   176
  AC_ARG_WITH(version-string, [AS_HELP_STRING([--with-version-string],
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   177
      [Set version string @<:@calculated@:>@])])
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   178
  if test "x$with_version_string" = xyes; then
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   179
    AC_MSG_ERROR([--with-version-string must have a value])
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   180
  elif test "x$with_version_string" != x; then
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   181
    # Additional [] needed to keep m4 from mangling shell constructs.
51184
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   182
    if [ [[ $with_version_string =~ ^([0-9]+)(\.([0-9]+))?(\.([0-9]+))?(\.([0-9]+))?(\.([0-9]+))?(\.([0-9]+))?(\.([0-9]+))?(-([a-zA-Z]+))?((\+)([0-9]+)?(-([-a-zA-Z0-9.]+))?)?$ ]] ]; then
48327
d2a837cf9ff1 8192833: JEP 322: Time-Based Release Versioning
mr
parents: 47216
diff changeset
   183
      VERSION_FEATURE=${BASH_REMATCH[[1]]}
d2a837cf9ff1 8192833: JEP 322: Time-Based Release Versioning
mr
parents: 47216
diff changeset
   184
      VERSION_INTERIM=${BASH_REMATCH[[3]]}
d2a837cf9ff1 8192833: JEP 322: Time-Based Release Versioning
mr
parents: 47216
diff changeset
   185
      VERSION_UPDATE=${BASH_REMATCH[[5]]}
33926
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   186
      VERSION_PATCH=${BASH_REMATCH[[7]]}
51184
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   187
      VERSION_EXTRA1=${BASH_REMATCH[[9]]}
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   188
      VERSION_EXTRA2=${BASH_REMATCH[[11]]}
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   189
      VERSION_EXTRA3=${BASH_REMATCH[[13]]}
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   190
      VERSION_PRE=${BASH_REMATCH[[15]]}
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   191
      version_plus_separator=${BASH_REMATCH[[17]]}
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   192
      VERSION_BUILD=${BASH_REMATCH[[18]]}
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   193
      VERSION_OPT=${BASH_REMATCH[[20]]}
33926
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   194
      # Unspecified numerical fields are interpreted as 0.
48327
d2a837cf9ff1 8192833: JEP 322: Time-Based Release Versioning
mr
parents: 47216
diff changeset
   195
      if test "x$VERSION_INTERIM" = x; then
d2a837cf9ff1 8192833: JEP 322: Time-Based Release Versioning
mr
parents: 47216
diff changeset
   196
        VERSION_INTERIM=0
33926
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   197
      fi
48327
d2a837cf9ff1 8192833: JEP 322: Time-Based Release Versioning
mr
parents: 47216
diff changeset
   198
      if test "x$VERSION_UPDATE" = x; then
d2a837cf9ff1 8192833: JEP 322: Time-Based Release Versioning
mr
parents: 47216
diff changeset
   199
        VERSION_UPDATE=0
33926
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   200
      fi
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   201
      if test "x$VERSION_PATCH" = x; then
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   202
        VERSION_PATCH=0
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   203
      fi
51184
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   204
      if test "x$VERSION_EXTRA1" = x; then
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   205
        VERSION_EXTRA1=0
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   206
      fi
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   207
      if test "x$VERSION_EXTRA2" = x; then
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   208
        VERSION_EXTRA2=0
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   209
      fi
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   210
      if test "x$VERSION_EXTRA3" = x; then
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   211
        VERSION_EXTRA3=0
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   212
      fi
33928
d2c9fee88260 8087328: Move debuglevel info in version string from PRE to OPT
erikj
parents: 33926
diff changeset
   213
      if test "x$version_plus_separator" != x \
33948
9dedf718fe33 8139951: Do not store debug level in OPT part of Verona string
ihse
parents: 33929
diff changeset
   214
          && test "x$VERSION_BUILD$VERSION_OPT" = x; then
33926
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   215
        AC_MSG_ERROR([Version string contains + but both 'BUILD' and 'OPT' are missing])
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   216
      fi
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   217
      # Stop the version part process from setting default values.
42300
218374d35efd 8039103: "explicitly" is misspelled as "explicitely" in configure scripts
ihse
parents: 41458
diff changeset
   218
      # We still allow them to explicitly override though.
33926
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   219
      NO_DEFAULT_VERSION_PARTS=true
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   220
    else
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   221
      AC_MSG_ERROR([--with-version-string fails to parse as a valid version string: $with_version_string])
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   222
    fi
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   223
  fi
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   224
33928
d2c9fee88260 8087328: Move debuglevel info in version string from PRE to OPT
erikj
parents: 33926
diff changeset
   225
  AC_ARG_WITH(version-pre, [AS_HELP_STRING([--with-version-pre],
33926
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   226
      [Set the base part of the version 'PRE' field (pre-release identifier) @<:@'internal'@:>@])],
33928
d2c9fee88260 8087328: Move debuglevel info in version string from PRE to OPT
erikj
parents: 33926
diff changeset
   227
      [with_version_pre_present=true], [with_version_pre_present=false])
33926
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   228
33928
d2c9fee88260 8087328: Move debuglevel info in version string from PRE to OPT
erikj
parents: 33926
diff changeset
   229
  if test "x$with_version_pre_present" = xtrue; then
d2c9fee88260 8087328: Move debuglevel info in version string from PRE to OPT
erikj
parents: 33926
diff changeset
   230
    if test "x$with_version_pre" = xyes; then
d2c9fee88260 8087328: Move debuglevel info in version string from PRE to OPT
erikj
parents: 33926
diff changeset
   231
      AC_MSG_ERROR([--with-version-pre must have a value])
d2c9fee88260 8087328: Move debuglevel info in version string from PRE to OPT
erikj
parents: 33926
diff changeset
   232
    elif test "x$with_version_pre" = xno; then
33926
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   233
      # Interpret --without-* as empty string instead of the literal "no"
33928
d2c9fee88260 8087328: Move debuglevel info in version string from PRE to OPT
erikj
parents: 33926
diff changeset
   234
      VERSION_PRE=
33926
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   235
    else
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   236
      # Only [a-zA-Z] is allowed in the VERSION_PRE. Outer [ ] to quote m4.
33928
d2c9fee88260 8087328: Move debuglevel info in version string from PRE to OPT
erikj
parents: 33926
diff changeset
   237
      [ VERSION_PRE=`$ECHO "$with_version_pre" | $TR -c -d '[a-z][A-Z]'` ]
d2c9fee88260 8087328: Move debuglevel info in version string from PRE to OPT
erikj
parents: 33926
diff changeset
   238
      if test "x$VERSION_PRE" != "x$with_version_pre"; then
d2c9fee88260 8087328: Move debuglevel info in version string from PRE to OPT
erikj
parents: 33926
diff changeset
   239
        AC_MSG_WARN([--with-version-pre value has been sanitized from '$with_version_pre' to '$VERSION_PRE'])
33926
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   240
      fi
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   241
    fi
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   242
  else
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   243
    if test "x$NO_DEFAULT_VERSION_PARTS" != xtrue; then
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   244
      # Default is to use "internal" as pre
33928
d2c9fee88260 8087328: Move debuglevel info in version string from PRE to OPT
erikj
parents: 33926
diff changeset
   245
      VERSION_PRE="internal"
33926
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   246
    fi
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   247
  fi
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   248
33948
9dedf718fe33 8139951: Do not store debug level in OPT part of Verona string
ihse
parents: 33929
diff changeset
   249
  AC_ARG_WITH(version-opt, [AS_HELP_STRING([--with-version-opt],
9dedf718fe33 8139951: Do not store debug level in OPT part of Verona string
ihse
parents: 33929
diff changeset
   250
      [Set version 'OPT' field (build metadata) @<:@<timestamp>.<user>.<dirname>@:>@])],
9dedf718fe33 8139951: Do not store debug level in OPT part of Verona string
ihse
parents: 33929
diff changeset
   251
      [with_version_opt_present=true], [with_version_opt_present=false])
33926
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   252
33948
9dedf718fe33 8139951: Do not store debug level in OPT part of Verona string
ihse
parents: 33929
diff changeset
   253
  if test "x$with_version_opt_present" = xtrue; then
9dedf718fe33 8139951: Do not store debug level in OPT part of Verona string
ihse
parents: 33929
diff changeset
   254
    if test "x$with_version_opt" = xyes; then
9dedf718fe33 8139951: Do not store debug level in OPT part of Verona string
ihse
parents: 33929
diff changeset
   255
      AC_MSG_ERROR([--with-version-opt must have a value])
9dedf718fe33 8139951: Do not store debug level in OPT part of Verona string
ihse
parents: 33929
diff changeset
   256
    elif test "x$with_version_opt" = xno; then
33926
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   257
      # Interpret --without-* as empty string instead of the literal "no"
33948
9dedf718fe33 8139951: Do not store debug level in OPT part of Verona string
ihse
parents: 33929
diff changeset
   258
      VERSION_OPT=
33926
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   259
    else
33948
9dedf718fe33 8139951: Do not store debug level in OPT part of Verona string
ihse
parents: 33929
diff changeset
   260
      # Only [-.a-zA-Z0-9] is allowed in the VERSION_OPT. Outer [ ] to quote m4.
9dedf718fe33 8139951: Do not store debug level in OPT part of Verona string
ihse
parents: 33929
diff changeset
   261
      [ VERSION_OPT=`$ECHO "$with_version_opt" | $TR -c -d '[a-z][A-Z][0-9].-'` ]
9dedf718fe33 8139951: Do not store debug level in OPT part of Verona string
ihse
parents: 33929
diff changeset
   262
      if test "x$VERSION_OPT" != "x$with_version_opt"; then
9dedf718fe33 8139951: Do not store debug level in OPT part of Verona string
ihse
parents: 33929
diff changeset
   263
        AC_MSG_WARN([--with-version-opt value has been sanitized from '$with_version_opt' to '$VERSION_OPT'])
33926
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   264
      fi
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   265
    fi
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   266
  else
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   267
    if test "x$NO_DEFAULT_VERSION_PARTS" != xtrue; then
42423
bc717b8b1123 8170632: Stop modifying VERSION_OPT for adhoc builds on reconfigure
ihse
parents: 42300
diff changeset
   268
      # Default is to calculate a string like this 'adhoc.<username>.<base dir name>'
33926
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   269
      # Outer [ ] to quote m4.
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   270
      [ basedirname=`$BASENAME "$TOPDIR" | $TR -d -c '[a-z][A-Z][0-9].-'` ]
42423
bc717b8b1123 8170632: Stop modifying VERSION_OPT for adhoc builds on reconfigure
ihse
parents: 42300
diff changeset
   271
      VERSION_OPT="adhoc.$USERNAME.$basedirname"
33926
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   272
    fi
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   273
  fi
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   274
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   275
  AC_ARG_WITH(version-build, [AS_HELP_STRING([--with-version-build],
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   276
      [Set version 'BUILD' field (build number) @<:@not specified@:>@])],
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   277
      [with_version_build_present=true], [with_version_build_present=false])
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   278
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   279
  if test "x$with_version_build_present" = xtrue; then
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   280
    if test "x$with_version_build" = xyes; then
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   281
      AC_MSG_ERROR([--with-version-build must have a value])
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   282
    elif test "x$with_version_build" = xno; then
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   283
      # Interpret --without-* as empty string instead of the literal "no"
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   284
      VERSION_BUILD=
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   285
    elif test "x$with_version_build" = x; then
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   286
      VERSION_BUILD=
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   287
    else
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   288
      JDKVER_CHECK_AND_SET_NUMBER(VERSION_BUILD, $with_version_build)
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   289
    fi
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   290
  else
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   291
    if test "x$NO_DEFAULT_VERSION_PARTS" != xtrue; then
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   292
      # Default is to not have a build number.
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   293
      VERSION_BUILD=""
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   294
      # FIXME: Until all code can cope with an empty VERSION_BUILD, set it to 0.
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   295
      VERSION_BUILD=0
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   296
    fi
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   297
  fi
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   298
48327
d2a837cf9ff1 8192833: JEP 322: Time-Based Release Versioning
mr
parents: 47216
diff changeset
   299
  AC_ARG_WITH(version-feature, [AS_HELP_STRING([--with-version-feature],
d2a837cf9ff1 8192833: JEP 322: Time-Based Release Versioning
mr
parents: 47216
diff changeset
   300
      [Set version 'FEATURE' field (first number) @<:@current source value@:>@])],
d2a837cf9ff1 8192833: JEP 322: Time-Based Release Versioning
mr
parents: 47216
diff changeset
   301
      [with_version_feature_present=true], [with_version_feature_present=false])
33926
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   302
48327
d2a837cf9ff1 8192833: JEP 322: Time-Based Release Versioning
mr
parents: 47216
diff changeset
   303
  if test "x$with_version_feature_present" = xtrue; then
d2a837cf9ff1 8192833: JEP 322: Time-Based Release Versioning
mr
parents: 47216
diff changeset
   304
    if test "x$with_version_feature" = xyes; then
d2a837cf9ff1 8192833: JEP 322: Time-Based Release Versioning
mr
parents: 47216
diff changeset
   305
      AC_MSG_ERROR([--with-version-feature must have a value])
33926
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   306
    else
48327
d2a837cf9ff1 8192833: JEP 322: Time-Based Release Versioning
mr
parents: 47216
diff changeset
   307
      JDKVER_CHECK_AND_SET_NUMBER(VERSION_FEATURE, $with_version_feature)
33926
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   308
    fi
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   309
  else
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   310
    if test "x$NO_DEFAULT_VERSION_PARTS" != xtrue; then
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   311
      # Default is to get value from version-numbers
48327
d2a837cf9ff1 8192833: JEP 322: Time-Based Release Versioning
mr
parents: 47216
diff changeset
   312
      VERSION_FEATURE="$DEFAULT_VERSION_FEATURE"
33926
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   313
    fi
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   314
  fi
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   315
48327
d2a837cf9ff1 8192833: JEP 322: Time-Based Release Versioning
mr
parents: 47216
diff changeset
   316
  AC_ARG_WITH(version-interim, [AS_HELP_STRING([--with-version-interim],
d2a837cf9ff1 8192833: JEP 322: Time-Based Release Versioning
mr
parents: 47216
diff changeset
   317
      [Set version 'INTERIM' field (second number) @<:@current source value@:>@])],
d2a837cf9ff1 8192833: JEP 322: Time-Based Release Versioning
mr
parents: 47216
diff changeset
   318
      [with_version_interim_present=true], [with_version_interim_present=false])
33926
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   319
48327
d2a837cf9ff1 8192833: JEP 322: Time-Based Release Versioning
mr
parents: 47216
diff changeset
   320
  if test "x$with_version_interim_present" = xtrue; then
d2a837cf9ff1 8192833: JEP 322: Time-Based Release Versioning
mr
parents: 47216
diff changeset
   321
    if test "x$with_version_interim" = xyes; then
d2a837cf9ff1 8192833: JEP 322: Time-Based Release Versioning
mr
parents: 47216
diff changeset
   322
      AC_MSG_ERROR([--with-version-interim must have a value])
d2a837cf9ff1 8192833: JEP 322: Time-Based Release Versioning
mr
parents: 47216
diff changeset
   323
    elif test "x$with_version_interim" = xno; then
33926
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   324
      # Interpret --without-* as empty string (i.e. 0) instead of the literal "no"
48327
d2a837cf9ff1 8192833: JEP 322: Time-Based Release Versioning
mr
parents: 47216
diff changeset
   325
      VERSION_INTERIM=0
d2a837cf9ff1 8192833: JEP 322: Time-Based Release Versioning
mr
parents: 47216
diff changeset
   326
    elif test "x$with_version_interim" = x; then
d2a837cf9ff1 8192833: JEP 322: Time-Based Release Versioning
mr
parents: 47216
diff changeset
   327
      VERSION_INTERIM=0
33926
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   328
    else
48327
d2a837cf9ff1 8192833: JEP 322: Time-Based Release Versioning
mr
parents: 47216
diff changeset
   329
      JDKVER_CHECK_AND_SET_NUMBER(VERSION_INTERIM, $with_version_interim)
33926
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   330
    fi
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   331
  else
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   332
    if test "x$NO_DEFAULT_VERSION_PARTS" != xtrue; then
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   333
      # Default is 0, if unspecified
48327
d2a837cf9ff1 8192833: JEP 322: Time-Based Release Versioning
mr
parents: 47216
diff changeset
   334
      VERSION_INTERIM=$DEFAULT_VERSION_INTERIM
33926
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   335
    fi
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   336
  fi
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   337
48327
d2a837cf9ff1 8192833: JEP 322: Time-Based Release Versioning
mr
parents: 47216
diff changeset
   338
  AC_ARG_WITH(version-update, [AS_HELP_STRING([--with-version-update],
d2a837cf9ff1 8192833: JEP 322: Time-Based Release Versioning
mr
parents: 47216
diff changeset
   339
      [Set version 'UPDATE' field (third number) @<:@current source value@:>@])],
d2a837cf9ff1 8192833: JEP 322: Time-Based Release Versioning
mr
parents: 47216
diff changeset
   340
      [with_version_update_present=true], [with_version_update_present=false])
33926
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   341
48327
d2a837cf9ff1 8192833: JEP 322: Time-Based Release Versioning
mr
parents: 47216
diff changeset
   342
  if test "x$with_version_update_present" = xtrue; then
d2a837cf9ff1 8192833: JEP 322: Time-Based Release Versioning
mr
parents: 47216
diff changeset
   343
    if test "x$with_version_update" = xyes; then
d2a837cf9ff1 8192833: JEP 322: Time-Based Release Versioning
mr
parents: 47216
diff changeset
   344
      AC_MSG_ERROR([--with-version-update must have a value])
d2a837cf9ff1 8192833: JEP 322: Time-Based Release Versioning
mr
parents: 47216
diff changeset
   345
    elif test "x$with_version_update" = xno; then
33926
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   346
      # Interpret --without-* as empty string (i.e. 0) instead of the literal "no"
48327
d2a837cf9ff1 8192833: JEP 322: Time-Based Release Versioning
mr
parents: 47216
diff changeset
   347
      VERSION_UPDATE=0
d2a837cf9ff1 8192833: JEP 322: Time-Based Release Versioning
mr
parents: 47216
diff changeset
   348
    elif test "x$with_version_update" = x; then
d2a837cf9ff1 8192833: JEP 322: Time-Based Release Versioning
mr
parents: 47216
diff changeset
   349
      VERSION_UPDATE=0
33926
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   350
    else
48327
d2a837cf9ff1 8192833: JEP 322: Time-Based Release Versioning
mr
parents: 47216
diff changeset
   351
      JDKVER_CHECK_AND_SET_NUMBER(VERSION_UPDATE, $with_version_update)
33926
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   352
    fi
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   353
  else
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   354
    if test "x$NO_DEFAULT_VERSION_PARTS" != xtrue; then
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   355
      # Default is 0, if unspecified
48327
d2a837cf9ff1 8192833: JEP 322: Time-Based Release Versioning
mr
parents: 47216
diff changeset
   356
      VERSION_UPDATE=$DEFAULT_VERSION_UPDATE
33926
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   357
    fi
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   358
  fi
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   359
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   360
  AC_ARG_WITH(version-patch, [AS_HELP_STRING([--with-version-patch],
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   361
      [Set version 'PATCH' field (fourth number) @<:@not specified@:>@])],
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   362
      [with_version_patch_present=true], [with_version_patch_present=false])
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   363
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   364
  if test "x$with_version_patch_present" = xtrue; then
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   365
    if test "x$with_version_patch" = xyes; then
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   366
      AC_MSG_ERROR([--with-version-patch must have a value])
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   367
    elif test "x$with_version_patch" = xno; then
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   368
      # Interpret --without-* as empty string (i.e. 0) instead of the literal "no"
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   369
      VERSION_PATCH=0
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   370
    elif test "x$with_version_patch" = x; then
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   371
      VERSION_PATCH=0
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   372
    else
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   373
      JDKVER_CHECK_AND_SET_NUMBER(VERSION_PATCH, $with_version_patch)
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   374
    fi
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   375
  else
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   376
    if test "x$NO_DEFAULT_VERSION_PARTS" != xtrue; then
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   377
      # Default is 0, if unspecified
42848
27ad8b2418f7 8170741: Enable uploading of built artifacts through Jib
erikj
parents: 42423
diff changeset
   378
      VERSION_PATCH=$DEFAULT_VERSION_PATCH
33926
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   379
    fi
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   380
  fi
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   381
51184
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   382
  # The 1st version extra number, if any
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   383
  AC_ARG_WITH(version-extra1, [AS_HELP_STRING([--with-version-extra1],
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   384
      [Set 1st version extra number @<:@not specified@:>@])],
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   385
      [with_version_extra1_present=true], [with_version_extra1_present=false])
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   386
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   387
  if test "x$with_version_extra1_present" = xtrue; then
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   388
    if test "x$with_version_extra1" = xyes; then
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   389
      AC_MSG_ERROR([--with-version-extra1 must have a value])
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   390
    elif test "x$with_version_extra1" = xno; then
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   391
      # Interpret --without-* as empty string (i.e. 0) instead of the literal "no"
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   392
      VERSION_EXTRA1=0
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   393
    elif test "x$with_version_extra1" = x; then
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   394
      VERSION_EXTRA1=0
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   395
    else
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   396
      JDKVER_CHECK_AND_SET_NUMBER(VERSION_EXTRA1, $with_version_extra1)
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   397
    fi
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   398
  else
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   399
    if test "x$NO_DEFAULT_VERSION_PARTS" != xtrue; then
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   400
      VERSION_EXTRA1=$DEFAULT_VERSION_EXTRA1
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   401
    fi
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   402
  fi
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   403
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   404
  # The 2nd version extra number, if any
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   405
  AC_ARG_WITH(version-extra2, [AS_HELP_STRING([--with-version-extra2],
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   406
      [Set 2nd version extra number @<:@not specified@:>@])],
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   407
      [with_version_extra2_present=true], [with_version_extra2_present=false])
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   408
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   409
  if test "x$with_version_extra2_present" = xtrue; then
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   410
    if test "x$with_version_extra2" = xyes; then
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   411
      AC_MSG_ERROR([--with-version-extra2 must have a value])
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   412
    elif test "x$with_version_extra2" = xno; then
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   413
      # Interpret --without-* as empty string (i.e. 0) instead of the literal "no"
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   414
      VERSION_EXTRA2=0
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   415
    elif test "x$with_version_extra2" = x; then
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   416
      VERSION_EXTRA2=0
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   417
    else
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   418
      JDKVER_CHECK_AND_SET_NUMBER(VERSION_EXTRA2, $with_version_extra2)
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   419
    fi
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   420
  else
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   421
    if test "x$NO_DEFAULT_VERSION_PARTS" != xtrue; then
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   422
      VERSION_EXTRA2=$DEFAULT_VERSION_EXTRA2
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   423
    fi
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   424
  fi
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   425
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   426
  # The 3rd version extra number, if any
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   427
  AC_ARG_WITH(version-extra3, [AS_HELP_STRING([--with-version-extra3],
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   428
      [Set 3rd version extra number @<:@not specified@:>@])],
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   429
      [with_version_extra3_present=true], [with_version_extra3_present=false])
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   430
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   431
  if test "x$with_version_extra3_present" = xtrue; then
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   432
    if test "x$with_version_extra3" = xyes; then
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   433
      AC_MSG_ERROR([--with-version-extra3 must have a value])
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   434
    elif test "x$with_version_extra3" = xno; then
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   435
      # Interpret --without-* as empty string (i.e. 0) instead of the literal "no"
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   436
      VERSION_EXTRA3=0
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   437
    elif test "x$with_version_extra3" = x; then
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   438
      VERSION_EXTRA3=0
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   439
    else
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   440
      JDKVER_CHECK_AND_SET_NUMBER(VERSION_EXTRA3, $with_version_extra3)
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   441
    fi
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   442
  else
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   443
    if test "x$NO_DEFAULT_VERSION_PARTS" != xtrue; then
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   444
      VERSION_EXTRA3=$DEFAULT_VERSION_EXTRA3
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   445
    fi
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   446
  fi
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   447
33926
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   448
  # Calculate derived version properties
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   449
33929
b6f2e71b26c5 8087329: Introduce VERSION_IS_GA
erikj
parents: 33928
diff changeset
   450
  # Set VERSION_IS_GA based on if VERSION_PRE has a value
b6f2e71b26c5 8087329: Introduce VERSION_IS_GA
erikj
parents: 33928
diff changeset
   451
  if test "x$VERSION_PRE" = x; then
b6f2e71b26c5 8087329: Introduce VERSION_IS_GA
erikj
parents: 33928
diff changeset
   452
    VERSION_IS_GA=true
b6f2e71b26c5 8087329: Introduce VERSION_IS_GA
erikj
parents: 33928
diff changeset
   453
  else
b6f2e71b26c5 8087329: Introduce VERSION_IS_GA
erikj
parents: 33928
diff changeset
   454
    VERSION_IS_GA=false
b6f2e71b26c5 8087329: Introduce VERSION_IS_GA
erikj
parents: 33928
diff changeset
   455
  fi
b6f2e71b26c5 8087329: Introduce VERSION_IS_GA
erikj
parents: 33928
diff changeset
   456
33926
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   457
  # VERSION_NUMBER but always with exactly 4 positions, with 0 for empty positions.
48327
d2a837cf9ff1 8192833: JEP 322: Time-Based Release Versioning
mr
parents: 47216
diff changeset
   458
  VERSION_NUMBER_FOUR_POSITIONS=$VERSION_FEATURE.$VERSION_INTERIM.$VERSION_UPDATE.$VERSION_PATCH
33926
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   459
51184
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   460
  # VERSION_NUMBER but always with all positions, with 0 for empty positions.
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   461
  VERSION_NUMBER_ALL_POSITIONS=$VERSION_NUMBER_FOUR_POSITIONS.$VERSION_EXTRA1.$VERSION_EXTRA2.$VERSION_EXTRA3
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   462
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   463
  stripped_version_number=$VERSION_NUMBER_ALL_POSITIONS
33926
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   464
  # Strip trailing zeroes from stripped_version_number
51184
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   465
  for i in 1 2 3 4 5 6 ; do stripped_version_number=${stripped_version_number%.0} ; done
33926
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   466
  VERSION_NUMBER=$stripped_version_number
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   467
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   468
  # The complete version string, with additional build information
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   469
  if test "x$VERSION_BUILD$VERSION_OPT" = x; then
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   470
    VERSION_STRING=$VERSION_NUMBER${VERSION_PRE:+-$VERSION_PRE}
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   471
  else
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   472
    # If either build or opt is set, we need a + separator
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   473
    VERSION_STRING=$VERSION_NUMBER${VERSION_PRE:+-$VERSION_PRE}+$VERSION_BUILD${VERSION_OPT:+-$VERSION_OPT}
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   474
  fi
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   475
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   476
  # The short version string, just VERSION_NUMBER and PRE, if present.
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   477
  VERSION_SHORT=$VERSION_NUMBER${VERSION_PRE:+-$VERSION_PRE}
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   478
48327
d2a837cf9ff1 8192833: JEP 322: Time-Based Release Versioning
mr
parents: 47216
diff changeset
   479
  # The version date
d2a837cf9ff1 8192833: JEP 322: Time-Based Release Versioning
mr
parents: 47216
diff changeset
   480
  AC_ARG_WITH(version-date, [AS_HELP_STRING([--with-version-date],
d2a837cf9ff1 8192833: JEP 322: Time-Based Release Versioning
mr
parents: 47216
diff changeset
   481
      [Set version date @<:@current source value@:>@])])
d2a837cf9ff1 8192833: JEP 322: Time-Based Release Versioning
mr
parents: 47216
diff changeset
   482
  if test "x$with_version_date" = xyes; then
d2a837cf9ff1 8192833: JEP 322: Time-Based Release Versioning
mr
parents: 47216
diff changeset
   483
    AC_MSG_ERROR([--with-version-date must have a value])
d2a837cf9ff1 8192833: JEP 322: Time-Based Release Versioning
mr
parents: 47216
diff changeset
   484
  elif test "x$with_version_date" != x; then
d2a837cf9ff1 8192833: JEP 322: Time-Based Release Versioning
mr
parents: 47216
diff changeset
   485
    if [ ! [[ $with_version_date =~ ^[0-9]{4}-[0-9]{2}-[0-9]{2}$ ]] ]; then
51586
eaa569eeb856 8210160: Remove deprecated configure arguments
ihse
parents: 51184
diff changeset
   486
      AC_MSG_ERROR(["$with_version_date" is not a valid version date])
48327
d2a837cf9ff1 8192833: JEP 322: Time-Based Release Versioning
mr
parents: 47216
diff changeset
   487
    else
d2a837cf9ff1 8192833: JEP 322: Time-Based Release Versioning
mr
parents: 47216
diff changeset
   488
      VERSION_DATE="$with_version_date"
d2a837cf9ff1 8192833: JEP 322: Time-Based Release Versioning
mr
parents: 47216
diff changeset
   489
    fi
d2a837cf9ff1 8192833: JEP 322: Time-Based Release Versioning
mr
parents: 47216
diff changeset
   490
  else
d2a837cf9ff1 8192833: JEP 322: Time-Based Release Versioning
mr
parents: 47216
diff changeset
   491
    VERSION_DATE="$DEFAULT_VERSION_DATE"
d2a837cf9ff1 8192833: JEP 322: Time-Based Release Versioning
mr
parents: 47216
diff changeset
   492
  fi
d2a837cf9ff1 8192833: JEP 322: Time-Based Release Versioning
mr
parents: 47216
diff changeset
   493
d2a837cf9ff1 8192833: JEP 322: Time-Based Release Versioning
mr
parents: 47216
diff changeset
   494
  # The vendor version string, if any
d2a837cf9ff1 8192833: JEP 322: Time-Based Release Versioning
mr
parents: 47216
diff changeset
   495
  AC_ARG_WITH(vendor-version-string, [AS_HELP_STRING([--with-vendor-version-string],
d2a837cf9ff1 8192833: JEP 322: Time-Based Release Versioning
mr
parents: 47216
diff changeset
   496
      [Set vendor version string @<:@not specified@:>@])])
d2a837cf9ff1 8192833: JEP 322: Time-Based Release Versioning
mr
parents: 47216
diff changeset
   497
  if test "x$with_vendor_version_string" = xyes; then
d2a837cf9ff1 8192833: JEP 322: Time-Based Release Versioning
mr
parents: 47216
diff changeset
   498
    AC_MSG_ERROR([--with-vendor-version-string must have a value])
d2a837cf9ff1 8192833: JEP 322: Time-Based Release Versioning
mr
parents: 47216
diff changeset
   499
  elif [ ! [[ $with_vendor_version_string =~ ^[[:graph:]]*$ ]] ]; then
d2a837cf9ff1 8192833: JEP 322: Time-Based Release Versioning
mr
parents: 47216
diff changeset
   500
    AC_MSG_ERROR([--with--vendor-version-string contains non-graphical characters: $with_vendor_version_string])
d2a837cf9ff1 8192833: JEP 322: Time-Based Release Versioning
mr
parents: 47216
diff changeset
   501
  else
d2a837cf9ff1 8192833: JEP 322: Time-Based Release Versioning
mr
parents: 47216
diff changeset
   502
    VENDOR_VERSION_STRING="$with_vendor_version_string"
d2a837cf9ff1 8192833: JEP 322: Time-Based Release Versioning
mr
parents: 47216
diff changeset
   503
  fi
d2a837cf9ff1 8192833: JEP 322: Time-Based Release Versioning
mr
parents: 47216
diff changeset
   504
48355
4944950606ef 8191913: Bump classfile version number to 55
psandoz
parents: 48327
diff changeset
   505
  # We could define --with flags for these, if really needed
4944950606ef 8191913: Bump classfile version number to 55
psandoz
parents: 48327
diff changeset
   506
  VERSION_CLASSFILE_MAJOR="$DEFAULT_VERSION_CLASSFILE_MAJOR"
4944950606ef 8191913: Bump classfile version number to 55
psandoz
parents: 48327
diff changeset
   507
  VERSION_CLASSFILE_MINOR="$DEFAULT_VERSION_CLASSFILE_MINOR"
54326
eb7f2c367f73 8205934: Define jdk -source/-target version in version-numbers file
erikj
parents: 52804
diff changeset
   508
  JDK_SOURCE_TARGET_VERSION="$DEFAULT_JDK_SOURCE_TARGET_VERSION"
48355
4944950606ef 8191913: Bump classfile version number to 55
psandoz
parents: 48327
diff changeset
   509
33926
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   510
  AC_MSG_CHECKING([for version string])
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   511
  AC_MSG_RESULT([$VERSION_STRING])
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   512
48327
d2a837cf9ff1 8192833: JEP 322: Time-Based Release Versioning
mr
parents: 47216
diff changeset
   513
  AC_SUBST(VERSION_FEATURE)
d2a837cf9ff1 8192833: JEP 322: Time-Based Release Versioning
mr
parents: 47216
diff changeset
   514
  AC_SUBST(VERSION_INTERIM)
d2a837cf9ff1 8192833: JEP 322: Time-Based Release Versioning
mr
parents: 47216
diff changeset
   515
  AC_SUBST(VERSION_UPDATE)
33926
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   516
  AC_SUBST(VERSION_PATCH)
51184
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   517
  AC_SUBST(VERSION_EXTRA1)
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   518
  AC_SUBST(VERSION_EXTRA2)
1edc62f9ba3a 8207849: Allow the addition of more number to the Java version string
tonyp
parents: 48608
diff changeset
   519
  AC_SUBST(VERSION_EXTRA3)
33926
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   520
  AC_SUBST(VERSION_PRE)
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   521
  AC_SUBST(VERSION_BUILD)
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   522
  AC_SUBST(VERSION_OPT)
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   523
  AC_SUBST(VERSION_NUMBER)
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   524
  AC_SUBST(VERSION_NUMBER_FOUR_POSITIONS)
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   525
  AC_SUBST(VERSION_STRING)
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   526
  AC_SUBST(VERSION_SHORT)
33929
b6f2e71b26c5 8087329: Introduce VERSION_IS_GA
erikj
parents: 33928
diff changeset
   527
  AC_SUBST(VERSION_IS_GA)
48327
d2a837cf9ff1 8192833: JEP 322: Time-Based Release Versioning
mr
parents: 47216
diff changeset
   528
  AC_SUBST(VERSION_DATE)
d2a837cf9ff1 8192833: JEP 322: Time-Based Release Versioning
mr
parents: 47216
diff changeset
   529
  AC_SUBST(VENDOR_VERSION_STRING)
48355
4944950606ef 8191913: Bump classfile version number to 55
psandoz
parents: 48327
diff changeset
   530
  AC_SUBST(VERSION_CLASSFILE_MAJOR)
4944950606ef 8191913: Bump classfile version number to 55
psandoz
parents: 48327
diff changeset
   531
  AC_SUBST(VERSION_CLASSFILE_MINOR)
54326
eb7f2c367f73 8205934: Define jdk -source/-target version in version-numbers file
erikj
parents: 52804
diff changeset
   532
  AC_SUBST(JDK_SOURCE_TARGET_VERSION)
33926
3a19edba4808 8085822: JEP 223: New Version-String Scheme (initial integration)
ihse
parents:
diff changeset
   533
])