jdk

Форк
0
/
jdk-version.m4 
583 строки · 22.6 Кб
1
#
2
# Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved.
3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
#
5
# This code is free software; you can redistribute it and/or modify it
6
# under the terms of the GNU General Public License version 2 only, as
7
# published by the Free Software Foundation.  Oracle designates this
8
# particular file as subject to the "Classpath" exception as provided
9
# by Oracle in the LICENSE file that accompanied this code.
10
#
11
# This code is distributed in the hope that it will be useful, but WITHOUT
12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14
# version 2 for more details (a copy is included in the LICENSE file that
15
# accompanied this code).
16
#
17
# You should have received a copy of the GNU General Public License version
18
# 2 along with this work; if not, write to the Free Software Foundation,
19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20
#
21
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22
# or visit www.oracle.com if you need additional information or have any
23
# questions.
24
#
25

26
###############################################################################
27
#
28
# Setup version numbers
29
#
30

31
# Verify that a given string represents a valid version number, and assign it
32
# to a variable.
33

34
# Argument 1: the variable to assign to
35
# Argument 2: the value given by the user
36
AC_DEFUN([JDKVER_CHECK_AND_SET_NUMBER],
37
[
38
  # Additional [] needed to keep m4 from mangling shell constructs.
39
  if [ ! [[ "$2" =~ ^0*([1-9][0-9]*)$|^0*(0)$ ]] ] ; then
40
    AC_MSG_ERROR(["$2" is not a valid numerical value for $1])
41
  fi
42
  # Extract the version number without leading zeros.
43
  cleaned_value=${BASH_REMATCH[[1]]}
44
  if test "x$cleaned_value" = x; then
45
    # Special case for zero
46
    cleaned_value=${BASH_REMATCH[[2]]}
47
  fi
48

49
  if test $cleaned_value -gt 255; then
50
    AC_MSG_ERROR([$1 is given as $2. This is greater than 255 which is not allowed.])
51
  fi
52
  if test "x$cleaned_value" != "x$2"; then
53
    AC_MSG_WARN([Value for $1 has been sanitized from '$2' to '$cleaned_value'])
54
  fi
55
  $1=$cleaned_value
56
])
57

58
AC_DEFUN_ONCE([JDKVER_SETUP_JDK_VERSION_NUMBERS],
59
[
60
  # Source the version numbers file
61
  . $TOPDIR/make/conf/version-numbers.conf
62
  # Source the branding file
63
  . $TOPDIR/make/conf/branding.conf
64

65
  # Some non-version number information is set in that file
66
  AC_SUBST(LAUNCHER_NAME)
67
  AC_SUBST(PRODUCT_NAME)
68
  AC_SUBST(PRODUCT_SUFFIX)
69
  AC_SUBST(JDK_RC_PLATFORM_NAME)
70
  AC_SUBST(HOTSPOT_VM_DISTRO)
71

72
  # Note: UTIL_ARG_WITH treats empty strings as valid values when OPTIONAL is false!
73

74
  # Outer [ ] to quote m4.
75
  [ USERNAME=`$ECHO "$USER" | $TR -d -c '[a-z][A-Z][0-9]'` ]
76

77
  # $USER may be not defined in dockers, so try to check with $WHOAMI
78
  if test "x$USERNAME" = x && test "x$WHOAMI" != x; then
79
    [ USERNAME=`$WHOAMI | $TR -d -c '[a-z][A-Z][0-9]'` ]
80
  fi
81

82
  # Setup username (for use in adhoc version strings etc)
83
  UTIL_ARG_WITH(NAME: build-user, TYPE: string,
84
    RESULT: USERNAME,
85
    DEFAULT: $USERNAME,
86
    DESC: [build username to use in version strings],
87
    DEFAULT_DESC: [current username, sanitized],
88
    CHECK_VALUE: [UTIL_CHECK_STRING_NON_EMPTY])
89
  AC_SUBST(USERNAME)
90

91
  # Set the JDK RC name
92
  # Otherwise calculate from "branding.conf" included above.
93
  UTIL_ARG_WITH(NAME: jdk-rc-name, TYPE: string,
94
    DEFAULT: $PRODUCT_NAME $JDK_RC_PLATFORM_NAME,
95
    DESC: [Set JDK RC name. This is used for FileDescription and ProductName
96
       properties of MS Windows binaries.],
97
    DEFAULT_DESC: [from branding.conf],
98
    CHECK_VALUE: [UTIL_CHECK_STRING_NON_EMPTY_PRINTABLE])
99
  AC_SUBST(JDK_RC_NAME)
100

101
  # The vendor name, if any
102
  # Only set COMPANY_NAME if '--with-vendor-name' was used and is not empty.
103
  # Otherwise we will use the value from "branding.conf" included above.
104
  UTIL_ARG_WITH(NAME: vendor-name, TYPE: string,
105
    RESULT: COMPANY_NAME,
106
    DEFAULT: $COMPANY_NAME,
107
    DESC: [Set vendor name. Among others, used to set the 'java.vendor'
108
       and 'java.vm.vendor' system properties.],
109
    DEFAULT_DESC: [from branding.conf],
110
    CHECK_VALUE: [UTIL_CHECK_STRING_NON_EMPTY_PRINTABLE])
111
  AC_SUBST(COMPANY_NAME)
112

113
  # Set the JDK RC Company name
114
  # Otherwise uses the value set for "vendor-name".
115
  UTIL_ARG_WITH(NAME: jdk-rc-company-name, TYPE: string,
116
    DEFAULT: $COMPANY_NAME,
117
    DESC: [Set JDK RC company name. This is used for CompanyName properties of MS Windows binaries.],
118
    DEFAULT_DESC: [from branding.conf],
119
    CHECK_VALUE: [UTIL_CHECK_STRING_NON_EMPTY_PRINTABLE])
120
  AC_SUBST(JDK_RC_COMPANY_NAME)
121

122
  # The vendor URL, if any
123
  # Only set VENDOR_URL if '--with-vendor-url' was used and is not empty.
124
  # Otherwise we will use the value from "branding.conf" included above.
125
  UTIL_ARG_WITH(NAME: vendor-url, TYPE: string,
126
    DEFAULT: $VENDOR_URL,
127
    DESC: [Set the 'java.vendor.url' system property],
128
    DEFAULT_DESC: [from branding.conf],
129
    CHECK_VALUE: [UTIL_CHECK_STRING_NON_EMPTY_PRINTABLE])
130
  AC_SUBST(VENDOR_URL)
131

132
  # The vendor bug URL, if any
133
  # Only set VENDOR_URL_BUG if '--with-vendor-bug-url' was used and is not empty.
134
  # Otherwise we will use the value from "branding.conf" included above.
135
  UTIL_ARG_WITH(NAME: vendor-bug-url, TYPE: string,
136
    RESULT: VENDOR_URL_BUG,
137
    DEFAULT: $VENDOR_URL_BUG,
138
    DESC: [Set the 'java.vendor.url.bug' system property],
139
    DEFAULT_DESC: [from branding.conf],
140
    CHECK_VALUE: [UTIL_CHECK_STRING_NON_EMPTY_PRINTABLE])
141
  AC_SUBST(VENDOR_URL_BUG)
142

143
  # The vendor VM bug URL, if any
144
  # Only set VENDOR_URL_VM_BUG if '--with-vendor-vm-bug-url' was used and is not empty.
145
  # Otherwise we will use the value from "branding.conf" included above.
146
  UTIL_ARG_WITH(NAME: vendor-vm-bug-url, TYPE: string,
147
    RESULT: VENDOR_URL_VM_BUG,
148
    DEFAULT: $VENDOR_URL_VM_BUG,
149
    DESC: [Sets the bug URL which will be displayed when the VM crashes],
150
    DEFAULT_DESC: [from branding.conf],
151
    CHECK_VALUE: [UTIL_CHECK_STRING_NON_EMPTY_PRINTABLE])
152
  AC_SUBST(VENDOR_URL_VM_BUG)
153

154
  # Override version from arguments
155

156
  # If --with-version-string is set, process it first. It is possible to
157
  # override parts with more specific flags, since these are processed later.
158
  UTIL_ARG_WITH(NAME: version-string, TYPE: string,
159
    DEFAULT: [],
160
    DESC: [Set version string],
161
    DEFAULT_DESC: [calculated],
162
    CHECK_VALUE: [
163
      if test "x$RESULT" != x; then
164
        # Additional [] needed to keep m4 from mangling shell constructs.
165
        if [ [[ $RESULT =~ ^([0-9]+)(\.([0-9]+))?(\.([0-9]+))?(\.([0-9]+))?(\.([0-9]+))?(\.([0-9]+))?(\.([0-9]+))?(-([a-zA-Z0-9]+))?(((\+)([0-9]*))?(-([-a-zA-Z0-9.]+))?)?$ ]] ]; then
166
          VERSION_FEATURE=${BASH_REMATCH[[1]]}
167
          VERSION_INTERIM=${BASH_REMATCH[[3]]}
168
          VERSION_UPDATE=${BASH_REMATCH[[5]]}
169
          VERSION_PATCH=${BASH_REMATCH[[7]]}
170
          VERSION_EXTRA1=${BASH_REMATCH[[9]]}
171
          VERSION_EXTRA2=${BASH_REMATCH[[11]]}
172
          VERSION_EXTRA3=${BASH_REMATCH[[13]]}
173
          VERSION_PRE=${BASH_REMATCH[[15]]}
174
          version_plus_separator=${BASH_REMATCH[[18]]}
175
          VERSION_BUILD=${BASH_REMATCH[[19]]}
176
          VERSION_OPT=${BASH_REMATCH[[21]]}
177
          # Unspecified numerical fields are interpreted as 0.
178
          if test "x$VERSION_INTERIM" = x; then
179
            VERSION_INTERIM=0
180
          fi
181
          if test "x$VERSION_UPDATE" = x; then
182
            VERSION_UPDATE=0
183
          fi
184
          if test "x$VERSION_PATCH" = x; then
185
            VERSION_PATCH=0
186
          fi
187
          if test "x$VERSION_EXTRA1" = x; then
188
            VERSION_EXTRA1=0
189
          fi
190
          if test "x$VERSION_EXTRA2" = x; then
191
            VERSION_EXTRA2=0
192
          fi
193
          if test "x$VERSION_EXTRA3" = x; then
194
            VERSION_EXTRA3=0
195
          fi
196
          if test "x$version_plus_separator" != x \
197
              && test "x$VERSION_BUILD$VERSION_OPT" = x; then
198
            AC_MSG_ERROR([Version string contains + but both 'BUILD' and 'OPT' are missing])
199
          fi
200
          if test "x$VERSION_BUILD" = x0; then
201
            AC_MSG_WARN([Version build 0 is interpreted as no build number])
202
            VERSION_BUILD=
203
          fi
204
          # Stop the version part process from setting default values.
205
          # We still allow them to explicitly override though.
206
          NO_DEFAULT_VERSION_PARTS=true
207
        else
208
          FAILURE="--with-version-string fails to parse as a valid version string: $RESULT"
209
        fi
210
      fi
211
    ])
212

213
  AC_ARG_WITH(version-pre, [AS_HELP_STRING([--with-version-pre],
214
      [Set the base part of the version 'PRE' field (pre-release identifier) @<:@'internal'@:>@])],
215
      [with_version_pre_present=true], [with_version_pre_present=false])
216

217
  if test "x$with_version_pre_present" = xtrue; then
218
    if test "x$with_version_pre" = xyes; then
219
      AC_MSG_ERROR([--with-version-pre must have a value])
220
    elif test "x$with_version_pre" = xno; then
221
      # Interpret --without-* as empty string instead of the literal "no"
222
      VERSION_PRE=
223
    else
224
      # Only [a-zA-Z0-9] is allowed in the VERSION_PRE. Outer [ ] to quote m4.
225
      [ VERSION_PRE=`$ECHO "$with_version_pre" | $TR -c -d '[a-zA-Z0-9]'` ]
226
      if test "x$VERSION_PRE" != "x$with_version_pre"; then
227
        AC_MSG_WARN([--with-version-pre value has been sanitized from '$with_version_pre' to '$VERSION_PRE'])
228
      fi
229
    fi
230
  else
231
    if test "x$NO_DEFAULT_VERSION_PARTS" != xtrue; then
232
      # Default is to use "internal" as pre
233
      VERSION_PRE="internal"
234
    fi
235
  fi
236

237
  AC_ARG_WITH(version-opt, [AS_HELP_STRING([--with-version-opt],
238
      [Set version 'OPT' field (build metadata) @<:@<timestamp>.<user>.<dirname>@:>@])],
239
      [with_version_opt_present=true], [with_version_opt_present=false])
240

241
  if test "x$with_version_opt_present" = xtrue; then
242
    if test "x$with_version_opt" = xyes; then
243
      AC_MSG_ERROR([--with-version-opt must have a value])
244
    elif test "x$with_version_opt" = xno; then
245
      # Interpret --without-* as empty string instead of the literal "no"
246
      VERSION_OPT=
247
    else
248
      # Only [-.a-zA-Z0-9] is allowed in the VERSION_OPT. Outer [ ] to quote m4.
249
      [ VERSION_OPT=`$ECHO "$with_version_opt" | $TR -c -d '[a-z][A-Z][0-9].-'` ]
250
      if test "x$VERSION_OPT" != "x$with_version_opt"; then
251
        AC_MSG_WARN([--with-version-opt value has been sanitized from '$with_version_opt' to '$VERSION_OPT'])
252
      fi
253
    fi
254
  else
255
    if test "x$NO_DEFAULT_VERSION_PARTS" != xtrue; then
256
      # Default is to calculate a string like this:
257
      # 'adhoc.<username>.<base dir name>'
258
      # Outer [ ] to quote m4.
259
      [ basedirname=`$BASENAME "$WORKSPACE_ROOT" | $TR -d -c '[a-z][A-Z][0-9].-'` ]
260
      VERSION_OPT="adhoc.$USERNAME.$basedirname"
261
    fi
262
  fi
263

264
  AC_ARG_WITH(version-build, [AS_HELP_STRING([--with-version-build],
265
      [Set version 'BUILD' field (build number) @<:@not specified@:>@])],
266
      [with_version_build_present=true], [with_version_build_present=false])
267

268
  if test "x$with_version_build_present" = xtrue; then
269
    if test "x$with_version_build" = xyes; then
270
      AC_MSG_ERROR([--with-version-build must have a value])
271
    elif test "x$with_version_build" = xno; then
272
      # Interpret --without-* as empty string instead of the literal "no"
273
      VERSION_BUILD=
274
    elif test "x$with_version_build" = x; then
275
      VERSION_BUILD=
276
    else
277
      JDKVER_CHECK_AND_SET_NUMBER(VERSION_BUILD, $with_version_build)
278
      if test "x$VERSION_BUILD" = "x0"; then
279
        AC_MSG_WARN([--with-version-build=0 is interpreted as --without-version-build])
280
        VERSION_BUILD=
281
      fi
282
    fi
283
  else
284
    if test "x$NO_DEFAULT_VERSION_PARTS" != xtrue; then
285
      # Default is to not have a build number.
286
      VERSION_BUILD=""
287
    fi
288
  fi
289

290
  # Default is to get value from version-numbers.conf
291
  if test "x$NO_DEFAULT_VERSION_PARTS" = xtrue; then
292
    DEFAULT_VERSION_FEATURE="$VERSION_FEATURE"
293
  fi
294

295
  UTIL_ARG_WITH(NAME: version-feature, TYPE: string,
296
    DEFAULT: $DEFAULT_VERSION_FEATURE,
297
    DESC: [Set version 'FEATURE' field (first number)],
298
    DEFAULT_DESC: [current source value],
299
    CHECK_VALUE: [
300
      JDKVER_CHECK_AND_SET_NUMBER(VERSION_FEATURE, $RESULT)
301
    ])
302

303
  AC_ARG_WITH(version-interim, [AS_HELP_STRING([--with-version-interim],
304
      [Set version 'INTERIM' field (second number) @<:@current source value@:>@])],
305
      [with_version_interim_present=true], [with_version_interim_present=false])
306

307
  if test "x$with_version_interim_present" = xtrue; then
308
    if test "x$with_version_interim" = xyes; then
309
      AC_MSG_ERROR([--with-version-interim must have a value])
310
    elif test "x$with_version_interim" = xno; then
311
      # Interpret --without-* as empty string (i.e. 0) instead of the literal "no"
312
      VERSION_INTERIM=0
313
    elif test "x$with_version_interim" = x; then
314
      VERSION_INTERIM=0
315
    else
316
      JDKVER_CHECK_AND_SET_NUMBER(VERSION_INTERIM, $with_version_interim)
317
    fi
318
  else
319
    if test "x$NO_DEFAULT_VERSION_PARTS" != xtrue; then
320
      # Default is 0, if unspecified
321
      VERSION_INTERIM=$DEFAULT_VERSION_INTERIM
322
    fi
323
  fi
324

325
  AC_ARG_WITH(version-update, [AS_HELP_STRING([--with-version-update],
326
      [Set version 'UPDATE' field (third number) @<:@current source value@:>@])],
327
      [with_version_update_present=true], [with_version_update_present=false])
328

329
  if test "x$with_version_update_present" = xtrue; then
330
    if test "x$with_version_update" = xyes; then
331
      AC_MSG_ERROR([--with-version-update must have a value])
332
    elif test "x$with_version_update" = xno; then
333
      # Interpret --without-* as empty string (i.e. 0) instead of the literal "no"
334
      VERSION_UPDATE=0
335
    elif test "x$with_version_update" = x; then
336
      VERSION_UPDATE=0
337
    else
338
      JDKVER_CHECK_AND_SET_NUMBER(VERSION_UPDATE, $with_version_update)
339
    fi
340
  else
341
    if test "x$NO_DEFAULT_VERSION_PARTS" != xtrue; then
342
      # Default is 0, if unspecified
343
      VERSION_UPDATE=$DEFAULT_VERSION_UPDATE
344
    fi
345
  fi
346

347
  AC_ARG_WITH(version-patch, [AS_HELP_STRING([--with-version-patch],
348
      [Set version 'PATCH' field (fourth number) @<:@not specified@:>@])],
349
      [with_version_patch_present=true], [with_version_patch_present=false])
350

351
  if test "x$with_version_patch_present" = xtrue; then
352
    if test "x$with_version_patch" = xyes; then
353
      AC_MSG_ERROR([--with-version-patch must have a value])
354
    elif test "x$with_version_patch" = xno; then
355
      # Interpret --without-* as empty string (i.e. 0) instead of the literal "no"
356
      VERSION_PATCH=0
357
    elif test "x$with_version_patch" = x; then
358
      VERSION_PATCH=0
359
    else
360
      JDKVER_CHECK_AND_SET_NUMBER(VERSION_PATCH, $with_version_patch)
361
    fi
362
  else
363
    if test "x$NO_DEFAULT_VERSION_PARTS" != xtrue; then
364
      # Default is 0, if unspecified
365
      VERSION_PATCH=$DEFAULT_VERSION_PATCH
366
    fi
367
  fi
368

369
  # The 1st version extra number, if any
370
  AC_ARG_WITH(version-extra1, [AS_HELP_STRING([--with-version-extra1],
371
      [Set 1st version extra number @<:@not specified@:>@])],
372
      [with_version_extra1_present=true], [with_version_extra1_present=false])
373

374
  if test "x$with_version_extra1_present" = xtrue; then
375
    if test "x$with_version_extra1" = xyes; then
376
      AC_MSG_ERROR([--with-version-extra1 must have a value])
377
    elif test "x$with_version_extra1" = xno; then
378
      # Interpret --without-* as empty string (i.e. 0) instead of the literal "no"
379
      VERSION_EXTRA1=0
380
    elif test "x$with_version_extra1" = x; then
381
      VERSION_EXTRA1=0
382
    else
383
      JDKVER_CHECK_AND_SET_NUMBER(VERSION_EXTRA1, $with_version_extra1)
384
    fi
385
  else
386
    if test "x$NO_DEFAULT_VERSION_PARTS" != xtrue; then
387
      VERSION_EXTRA1=$DEFAULT_VERSION_EXTRA1
388
    fi
389
  fi
390

391
  # The 2nd version extra number, if any
392
  AC_ARG_WITH(version-extra2, [AS_HELP_STRING([--with-version-extra2],
393
      [Set 2nd version extra number @<:@not specified@:>@])],
394
      [with_version_extra2_present=true], [with_version_extra2_present=false])
395

396
  if test "x$with_version_extra2_present" = xtrue; then
397
    if test "x$with_version_extra2" = xyes; then
398
      AC_MSG_ERROR([--with-version-extra2 must have a value])
399
    elif test "x$with_version_extra2" = xno; then
400
      # Interpret --without-* as empty string (i.e. 0) instead of the literal "no"
401
      VERSION_EXTRA2=0
402
    elif test "x$with_version_extra2" = x; then
403
      VERSION_EXTRA2=0
404
    else
405
      JDKVER_CHECK_AND_SET_NUMBER(VERSION_EXTRA2, $with_version_extra2)
406
    fi
407
  else
408
    if test "x$NO_DEFAULT_VERSION_PARTS" != xtrue; then
409
      VERSION_EXTRA2=$DEFAULT_VERSION_EXTRA2
410
    fi
411
  fi
412

413
  # The 3rd version extra number, if any
414
  AC_ARG_WITH(version-extra3, [AS_HELP_STRING([--with-version-extra3],
415
      [Set 3rd version extra number @<:@not specified@:>@])],
416
      [with_version_extra3_present=true], [with_version_extra3_present=false])
417

418
  if test "x$with_version_extra3_present" = xtrue; then
419
    if test "x$with_version_extra3" = xyes; then
420
      AC_MSG_ERROR([--with-version-extra3 must have a value])
421
    elif test "x$with_version_extra3" = xno; then
422
      # Interpret --without-* as empty string (i.e. 0) instead of the literal "no"
423
      VERSION_EXTRA3=0
424
    elif test "x$with_version_extra3" = x; then
425
      VERSION_EXTRA3=0
426
    else
427
      JDKVER_CHECK_AND_SET_NUMBER(VERSION_EXTRA3, $with_version_extra3)
428
    fi
429
  else
430
    if test "x$NO_DEFAULT_VERSION_PARTS" != xtrue; then
431
      VERSION_EXTRA3=$DEFAULT_VERSION_EXTRA3
432
    fi
433
  fi
434

435
  # Calculate derived version properties
436

437
  # Set VERSION_IS_GA based on if VERSION_PRE has a value
438
  if test "x$VERSION_PRE" = x; then
439
    VERSION_IS_GA=true
440
  else
441
    VERSION_IS_GA=false
442
  fi
443

444
  # VERSION_NUMBER but always with exactly 4 positions, with 0 for empty positions.
445
  VERSION_NUMBER_FOUR_POSITIONS=$VERSION_FEATURE.$VERSION_INTERIM.$VERSION_UPDATE.$VERSION_PATCH
446

447
  # VERSION_NUMBER but always with all positions, with 0 for empty positions.
448
  VERSION_NUMBER_ALL_POSITIONS=$VERSION_NUMBER_FOUR_POSITIONS.$VERSION_EXTRA1.$VERSION_EXTRA2.$VERSION_EXTRA3
449

450
  stripped_version_number=$VERSION_NUMBER_ALL_POSITIONS
451
  # Strip trailing zeroes from stripped_version_number
452
  for i in 1 2 3 4 5 6 ; do stripped_version_number=${stripped_version_number%.0} ; done
453
  VERSION_NUMBER=$stripped_version_number
454

455
  # A build number of "0" is interpreted as "no build number".
456
  if test "x$VERSION_BUILD" = x0; then
457
    VERSION_BUILD=
458
  fi
459

460
  # Compute the complete version string, with additional build information
461
  version_with_pre=$VERSION_NUMBER${VERSION_PRE:+-$VERSION_PRE}
462
  if test "x$VERSION_BUILD" != x || \
463
      ( test "x$VERSION_OPT" != x && test "x$VERSION_PRE" = x ); then
464
    # As per JEP 223, if build is set, or if opt is set but not pre,
465
    # we need a + separator
466
    version_with_build=$version_with_pre+$VERSION_BUILD
467
  else
468
    version_with_build=$version_with_pre
469
  fi
470
  VERSION_STRING=$version_with_build${VERSION_OPT:+-$VERSION_OPT}
471

472
  # The short version string, just VERSION_NUMBER and PRE, if present.
473
  VERSION_SHORT=$VERSION_NUMBER${VERSION_PRE:+-$VERSION_PRE}
474

475
  # The version date
476
  UTIL_ARG_WITH(NAME: version-date, TYPE: string,
477
    DEFAULT: $DEFAULT_VERSION_DATE,
478
    DESC: [Set version date],
479
    DEFAULT_DESC: [current source value],
480
    CHECK_VALUE: [
481
      if test "x$RESULT" = x; then
482
        FAILURE="--with-version-date cannot be empty"
483
      elif [ ! [[ $RESULT =~ ^[0-9]{4}-[0-9]{2}-[0-9]{2}$ ]] ]; then
484
        FAILURE="\"$RESULT\" is not a valid version date"
485
      fi
486
    ])
487

488
  # The vendor version string, if any
489
  # DEFAULT is set to an empty string in the case of --with-vendor-version-string without
490
  # any value, which would set VENDOR_VERSION_STRING_ENABLED to true and ultimately also
491
  # cause VENDOR_VERSION_STRING to fall back to the value in DEFAULT
492
  UTIL_ARG_WITH(NAME: vendor-version-string, TYPE: string,
493
    DEFAULT: [],
494
    OPTIONAL: true,
495
    DESC: [Set vendor version string],
496
    DEFAULT_DESC: [not specified])
497

498
  if test "x$VENDOR_VERSION_STRING_ENABLED" = xtrue; then
499
    if [ ! [[ $VENDOR_VERSION_STRING =~ ^[[:graph:]]*$ ]] ]; then
500
      AC_MSG_ERROR([--with--vendor-version-string contains non-graphical characters: $VENDOR_VERSION_STRING])
501
    fi
502
  fi
503

504
  # Set the MACOSX Bundle Name base
505
  UTIL_ARG_WITH(NAME: macosx-bundle-name-base, TYPE: string,
506
    DEFAULT: $MACOSX_BUNDLE_NAME_BASE,
507
    DESC: [Set the MacOSX Bundle Name base. This is the base name for calculating MacOSX Bundle Names.],
508
    DEFAULT_DESC: [from branding.conf],
509
    CHECK_VALUE: [UTIL_CHECK_STRING_NON_EMPTY_PRINTABLE])
510
  AC_SUBST(MACOSX_BUNDLE_NAME_BASE)
511

512
  # If using the default value, append the VERSION_PRE if there is one
513
  # to make it possible to tell official builds apart from developer builds
514
  if test "x$VERSION_PRE" != x; then
515
    MACOSX_BUNDLE_ID_BASE="$MACOSX_BUNDLE_ID_BASE-$VERSION_PRE"
516
  fi
517

518
  # Set the MACOSX Bundle ID base
519
  UTIL_ARG_WITH(NAME: macosx-bundle-id-base, TYPE: string,
520
    DEFAULT: $MACOSX_BUNDLE_ID_BASE,
521
    DESC: [Set the MacOSX Bundle ID base. This is the base ID for calculating MacOSX Bundle IDs.],
522
    DEFAULT_DESC: [based on branding.conf and VERSION_PRE],
523
    CHECK_VALUE: [UTIL_CHECK_STRING_NON_EMPTY_PRINTABLE])
524
  AC_SUBST(MACOSX_BUNDLE_ID_BASE)
525

526
  if test "x$VERSION_BUILD" != x; then
527
    MACOSX_BUNDLE_BUILD_VERSION="$VERSION_BUILD"
528
  else
529
    MACOSX_BUNDLE_BUILD_VERSION=0
530
  fi
531

532
  # If VERSION_OPT consists of only numbers and periods, add it.
533
  if [ [[ $VERSION_OPT =~ ^[0-9\.]+$ ]] ]; then
534
    MACOSX_BUNDLE_BUILD_VERSION="$MACOSX_BUNDLE_BUILD_VERSION.$VERSION_OPT"
535
  fi
536

537
  # Set the MACOSX CFBundleVersion field
538
  UTIL_ARG_WITH(NAME: macosx-bundle-build-version, TYPE: string,
539
    DEFAULT: $MACOSX_BUNDLE_BUILD_VERSION,
540
    DESC: [Set the MacOSX Bundle CFBundleVersion field. This key is a machine-readable
541
      string composed of one to three period-separated integers and should represent the
542
      build version.],
543
    DEFAULT_DESC: [the build number],
544
    CHECK_VALUE: [
545
      if test "x$RESULT" = x; then
546
        FAILURE="--with-macosx-bundle-build-version must have a value"
547
      elif [ ! [[ $RESULT =~ ^[0-9\.]*$ ]] ]; then
548
        FAILURE="--with-macosx-bundle-build-version contains non numbers and periods: $RESULT"
549
      fi
550
    ])
551
  AC_SUBST(MACOSX_BUNDLE_BUILD_VERSION)
552

553
  # We could define --with flags for these, if really needed
554
  VERSION_CLASSFILE_MAJOR="$DEFAULT_VERSION_CLASSFILE_MAJOR"
555
  VERSION_CLASSFILE_MINOR="$DEFAULT_VERSION_CLASSFILE_MINOR"
556
  VERSION_DOCS_API_SINCE="$DEFAULT_VERSION_DOCS_API_SINCE"
557
  JDK_SOURCE_TARGET_VERSION="$DEFAULT_JDK_SOURCE_TARGET_VERSION"
558

559
  AC_MSG_CHECKING([for version string])
560
  AC_MSG_RESULT([$VERSION_STRING])
561

562
  AC_SUBST(VERSION_FEATURE)
563
  AC_SUBST(VERSION_INTERIM)
564
  AC_SUBST(VERSION_UPDATE)
565
  AC_SUBST(VERSION_PATCH)
566
  AC_SUBST(VERSION_EXTRA1)
567
  AC_SUBST(VERSION_EXTRA2)
568
  AC_SUBST(VERSION_EXTRA3)
569
  AC_SUBST(VERSION_PRE)
570
  AC_SUBST(VERSION_BUILD)
571
  AC_SUBST(VERSION_OPT)
572
  AC_SUBST(VERSION_NUMBER)
573
  AC_SUBST(VERSION_NUMBER_FOUR_POSITIONS)
574
  AC_SUBST(VERSION_STRING)
575
  AC_SUBST(VERSION_SHORT)
576
  AC_SUBST(VERSION_IS_GA)
577
  AC_SUBST(VERSION_DATE)
578
  AC_SUBST(VENDOR_VERSION_STRING)
579
  AC_SUBST(VERSION_CLASSFILE_MAJOR)
580
  AC_SUBST(VERSION_CLASSFILE_MINOR)
581
  AC_SUBST(VERSION_DOCS_API_SINCE)
582
  AC_SUBST(JDK_SOURCE_TARGET_VERSION)
583
])
584

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.