137 [Set version string @<:@calculated@:>@])]) |
137 [Set version string @<:@calculated@:>@])]) |
138 if test "x$with_version_string" = xyes; then |
138 if test "x$with_version_string" = xyes; then |
139 AC_MSG_ERROR([--with-version-string must have a value]) |
139 AC_MSG_ERROR([--with-version-string must have a value]) |
140 elif test "x$with_version_string" != x; then |
140 elif test "x$with_version_string" != x; then |
141 # Additional [] needed to keep m4 from mangling shell constructs. |
141 # Additional [] needed to keep m4 from mangling shell constructs. |
142 if [ [[ $with_version_string =~ ^([0-9]+)(\.([0-9]+))?(\.([0-9]+))?(\.([0-9]+))?(-([a-zA-Z]+))?((\+)([0-9]+)?(-([-a-zA-Z0-9.]+))?)?$ ]] ]; then |
142 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 |
143 VERSION_FEATURE=${BASH_REMATCH[[1]]} |
143 VERSION_FEATURE=${BASH_REMATCH[[1]]} |
144 VERSION_INTERIM=${BASH_REMATCH[[3]]} |
144 VERSION_INTERIM=${BASH_REMATCH[[3]]} |
145 VERSION_UPDATE=${BASH_REMATCH[[5]]} |
145 VERSION_UPDATE=${BASH_REMATCH[[5]]} |
146 VERSION_PATCH=${BASH_REMATCH[[7]]} |
146 VERSION_PATCH=${BASH_REMATCH[[7]]} |
147 VERSION_PRE=${BASH_REMATCH[[9]]} |
147 VERSION_EXTRA1=${BASH_REMATCH[[9]]} |
148 version_plus_separator=${BASH_REMATCH[[11]]} |
148 VERSION_EXTRA2=${BASH_REMATCH[[11]]} |
149 VERSION_BUILD=${BASH_REMATCH[[12]]} |
149 VERSION_EXTRA3=${BASH_REMATCH[[13]]} |
150 VERSION_OPT=${BASH_REMATCH[[14]]} |
150 VERSION_PRE=${BASH_REMATCH[[15]]} |
|
151 version_plus_separator=${BASH_REMATCH[[17]]} |
|
152 VERSION_BUILD=${BASH_REMATCH[[18]]} |
|
153 VERSION_OPT=${BASH_REMATCH[[20]]} |
151 # Unspecified numerical fields are interpreted as 0. |
154 # Unspecified numerical fields are interpreted as 0. |
152 if test "x$VERSION_INTERIM" = x; then |
155 if test "x$VERSION_INTERIM" = x; then |
153 VERSION_INTERIM=0 |
156 VERSION_INTERIM=0 |
154 fi |
157 fi |
155 if test "x$VERSION_UPDATE" = x; then |
158 if test "x$VERSION_UPDATE" = x; then |
156 VERSION_UPDATE=0 |
159 VERSION_UPDATE=0 |
157 fi |
160 fi |
158 if test "x$VERSION_PATCH" = x; then |
161 if test "x$VERSION_PATCH" = x; then |
159 VERSION_PATCH=0 |
162 VERSION_PATCH=0 |
|
163 fi |
|
164 if test "x$VERSION_EXTRA1" = x; then |
|
165 VERSION_EXTRA1=0 |
|
166 fi |
|
167 if test "x$VERSION_EXTRA2" = x; then |
|
168 VERSION_EXTRA2=0 |
|
169 fi |
|
170 if test "x$VERSION_EXTRA3" = x; then |
|
171 VERSION_EXTRA3=0 |
160 fi |
172 fi |
161 if test "x$version_plus_separator" != x \ |
173 if test "x$version_plus_separator" != x \ |
162 && test "x$VERSION_BUILD$VERSION_OPT" = x; then |
174 && test "x$VERSION_BUILD$VERSION_OPT" = x; then |
163 AC_MSG_ERROR([Version string contains + but both 'BUILD' and 'OPT' are missing]) |
175 AC_MSG_ERROR([Version string contains + but both 'BUILD' and 'OPT' are missing]) |
164 fi |
176 fi |
325 # Default is 0, if unspecified |
337 # Default is 0, if unspecified |
326 VERSION_PATCH=$DEFAULT_VERSION_PATCH |
338 VERSION_PATCH=$DEFAULT_VERSION_PATCH |
327 fi |
339 fi |
328 fi |
340 fi |
329 |
341 |
|
342 # The 1st version extra number, if any |
|
343 AC_ARG_WITH(version-extra1, [AS_HELP_STRING([--with-version-extra1], |
|
344 [Set 1st version extra number @<:@not specified@:>@])], |
|
345 [with_version_extra1_present=true], [with_version_extra1_present=false]) |
|
346 |
|
347 if test "x$with_version_extra1_present" = xtrue; then |
|
348 if test "x$with_version_extra1" = xyes; then |
|
349 AC_MSG_ERROR([--with-version-extra1 must have a value]) |
|
350 elif test "x$with_version_extra1" = xno; then |
|
351 # Interpret --without-* as empty string (i.e. 0) instead of the literal "no" |
|
352 VERSION_EXTRA1=0 |
|
353 elif test "x$with_version_extra1" = x; then |
|
354 VERSION_EXTRA1=0 |
|
355 else |
|
356 JDKVER_CHECK_AND_SET_NUMBER(VERSION_EXTRA1, $with_version_extra1) |
|
357 fi |
|
358 else |
|
359 if test "x$NO_DEFAULT_VERSION_PARTS" != xtrue; then |
|
360 VERSION_EXTRA1=$DEFAULT_VERSION_EXTRA1 |
|
361 fi |
|
362 fi |
|
363 |
|
364 # The 2nd version extra number, if any |
|
365 AC_ARG_WITH(version-extra2, [AS_HELP_STRING([--with-version-extra2], |
|
366 [Set 2nd version extra number @<:@not specified@:>@])], |
|
367 [with_version_extra2_present=true], [with_version_extra2_present=false]) |
|
368 |
|
369 if test "x$with_version_extra2_present" = xtrue; then |
|
370 if test "x$with_version_extra2" = xyes; then |
|
371 AC_MSG_ERROR([--with-version-extra2 must have a value]) |
|
372 elif test "x$with_version_extra2" = xno; then |
|
373 # Interpret --without-* as empty string (i.e. 0) instead of the literal "no" |
|
374 VERSION_EXTRA2=0 |
|
375 elif test "x$with_version_extra2" = x; then |
|
376 VERSION_EXTRA2=0 |
|
377 else |
|
378 JDKVER_CHECK_AND_SET_NUMBER(VERSION_EXTRA2, $with_version_extra2) |
|
379 fi |
|
380 else |
|
381 if test "x$NO_DEFAULT_VERSION_PARTS" != xtrue; then |
|
382 VERSION_EXTRA2=$DEFAULT_VERSION_EXTRA2 |
|
383 fi |
|
384 fi |
|
385 |
|
386 # The 3rd version extra number, if any |
|
387 AC_ARG_WITH(version-extra3, [AS_HELP_STRING([--with-version-extra3], |
|
388 [Set 3rd version extra number @<:@not specified@:>@])], |
|
389 [with_version_extra3_present=true], [with_version_extra3_present=false]) |
|
390 |
|
391 if test "x$with_version_extra3_present" = xtrue; then |
|
392 if test "x$with_version_extra3" = xyes; then |
|
393 AC_MSG_ERROR([--with-version-extra3 must have a value]) |
|
394 elif test "x$with_version_extra3" = xno; then |
|
395 # Interpret --without-* as empty string (i.e. 0) instead of the literal "no" |
|
396 VERSION_EXTRA3=0 |
|
397 elif test "x$with_version_extra3" = x; then |
|
398 VERSION_EXTRA3=0 |
|
399 else |
|
400 JDKVER_CHECK_AND_SET_NUMBER(VERSION_EXTRA3, $with_version_extra3) |
|
401 fi |
|
402 else |
|
403 if test "x$NO_DEFAULT_VERSION_PARTS" != xtrue; then |
|
404 VERSION_EXTRA3=$DEFAULT_VERSION_EXTRA3 |
|
405 fi |
|
406 fi |
|
407 |
330 # Calculate derived version properties |
408 # Calculate derived version properties |
331 |
409 |
332 # Set VERSION_IS_GA based on if VERSION_PRE has a value |
410 # Set VERSION_IS_GA based on if VERSION_PRE has a value |
333 if test "x$VERSION_PRE" = x; then |
411 if test "x$VERSION_PRE" = x; then |
334 VERSION_IS_GA=true |
412 VERSION_IS_GA=true |
337 fi |
415 fi |
338 |
416 |
339 # VERSION_NUMBER but always with exactly 4 positions, with 0 for empty positions. |
417 # VERSION_NUMBER but always with exactly 4 positions, with 0 for empty positions. |
340 VERSION_NUMBER_FOUR_POSITIONS=$VERSION_FEATURE.$VERSION_INTERIM.$VERSION_UPDATE.$VERSION_PATCH |
418 VERSION_NUMBER_FOUR_POSITIONS=$VERSION_FEATURE.$VERSION_INTERIM.$VERSION_UPDATE.$VERSION_PATCH |
341 |
419 |
342 stripped_version_number=$VERSION_NUMBER_FOUR_POSITIONS |
420 # VERSION_NUMBER but always with all positions, with 0 for empty positions. |
|
421 VERSION_NUMBER_ALL_POSITIONS=$VERSION_NUMBER_FOUR_POSITIONS.$VERSION_EXTRA1.$VERSION_EXTRA2.$VERSION_EXTRA3 |
|
422 |
|
423 stripped_version_number=$VERSION_NUMBER_ALL_POSITIONS |
343 # Strip trailing zeroes from stripped_version_number |
424 # Strip trailing zeroes from stripped_version_number |
344 for i in 1 2 3 ; do stripped_version_number=${stripped_version_number%.0} ; done |
425 for i in 1 2 3 4 5 6 ; do stripped_version_number=${stripped_version_number%.0} ; done |
345 VERSION_NUMBER=$stripped_version_number |
426 VERSION_NUMBER=$stripped_version_number |
346 |
427 |
347 # The complete version string, with additional build information |
428 # The complete version string, with additional build information |
348 if test "x$VERSION_BUILD$VERSION_OPT" = x; then |
429 if test "x$VERSION_BUILD$VERSION_OPT" = x; then |
349 VERSION_STRING=$VERSION_NUMBER${VERSION_PRE:+-$VERSION_PRE} |
430 VERSION_STRING=$VERSION_NUMBER${VERSION_PRE:+-$VERSION_PRE} |
390 |
471 |
391 AC_SUBST(VERSION_FEATURE) |
472 AC_SUBST(VERSION_FEATURE) |
392 AC_SUBST(VERSION_INTERIM) |
473 AC_SUBST(VERSION_INTERIM) |
393 AC_SUBST(VERSION_UPDATE) |
474 AC_SUBST(VERSION_UPDATE) |
394 AC_SUBST(VERSION_PATCH) |
475 AC_SUBST(VERSION_PATCH) |
|
476 AC_SUBST(VERSION_EXTRA1) |
|
477 AC_SUBST(VERSION_EXTRA2) |
|
478 AC_SUBST(VERSION_EXTRA3) |
395 AC_SUBST(VERSION_PRE) |
479 AC_SUBST(VERSION_PRE) |
396 AC_SUBST(VERSION_BUILD) |
480 AC_SUBST(VERSION_BUILD) |
397 AC_SUBST(VERSION_OPT) |
481 AC_SUBST(VERSION_OPT) |
398 AC_SUBST(VERSION_NUMBER) |
482 AC_SUBST(VERSION_NUMBER) |
399 AC_SUBST(VERSION_NUMBER_FOUR_POSITIONS) |
483 AC_SUBST(VERSION_NUMBER_FOUR_POSITIONS) |