< prev index next >
common/autoconf/jdk-version.m4
Print this page
@@ -26,12 +26,13 @@
###############################################################################
#
# Setup version numbers
#
-# Verify that a given string represent a valid version number, and assing it to
-# a variable.
+# Verify that a given string represents a valid version number, and assign it
+# to a variable.
+
# Argument 1: the variable to assign to
# Argument 2: the value given by the user
AC_DEFUN([JDKVER_CHECK_AND_SET_NUMBER],
[
# Additional [] needed to keep m4 from mangling shell constructs.
@@ -79,11 +80,11 @@
# If --with-version-string is set, process it first. It is possible to
# override parts with more specific flags, since these are processed later.
AC_ARG_WITH(version-string, [AS_HELP_STRING([--with-version-string],
[Set version string @<:@calculated@:>@])])
if test "x$with_version_string" = xyes; then
- AC_MSG_ERROR([--with--version-string must have a value])
+ AC_MSG_ERROR([--with-version-string must have a value])
elif test "x$with_version_string" != x; then
# Additional [] needed to keep m4 from mangling shell constructs.
if [ [[ $with_version_string =~ ^([0-9]+)(\.([0-9]+))?(\.([0-9]+))?(\.([0-9]+))?(-([a-zA-Z]+))?(\.([a-zA-Z]+))?((\+)([0-9]+)?(-([-a-zA-Z0-9.]+))?)?$ ]] ]; then
VERSION_MAJOR=${BASH_REMATCH[[1]]}
VERSION_MINOR=${BASH_REMATCH[[3]]}
@@ -92,46 +93,46 @@
VERSION_PRE_BASE=${BASH_REMATCH[[9]]}
VERSION_PRE_DEBUGLEVEL=${BASH_REMATCH[[11]]}
version_plus_separator=${BASH_REMATCH[[13]]}
VERSION_BUILD=${BASH_REMATCH[[14]]}
VERSION_OPT=${BASH_REMATCH[[16]]}
- # Unspecified numerical fields is interpreted as 0.
+ # Unspecified numerical fields are interpreted as 0.
if test "x$VERSION_MINOR" = x; then
VERSION_MINOR=0
fi
if test "x$VERSION_SECURITY" = x; then
VERSION_SECURITY=0
fi
if test "x$VERSION_PATCH" = x; then
VERSION_PATCH=0
fi
if test "x$version_plus_separator" != x && test "x$VERSION_BUILD$VERSION_OPT" = x; then
- AC_MSG_ERROR([Version string contains + but both 'BUILD' and 'OPT' is missing])
+ AC_MSG_ERROR([Version string contains + but both 'BUILD' and 'OPT' are missing])
fi
# Stop the version part process from setting default values.
# We still allow them to explicitely override though.
NO_DEFAULT_VERSION_PARTS=true
else
- AC_MSG_ERROR([--with--version-string fails to parse as a valid version string: $with_version_string])
+ AC_MSG_ERROR([--with-version-string fails to parse as a valid version string: $with_version_string])
fi
fi
AC_ARG_WITH(version-pre-base, [AS_HELP_STRING([--with-version-pre-base],
[Set the base part of the version 'PRE' field (pre-release identifier) @<:@'internal'@:>@])],
[with_version_pre_base_present=true], [with_version_pre_base_present=false])
if test "x$with_version_pre_base_present" = xtrue; then
if test "x$with_version_pre_base" = xyes; then
- AC_MSG_ERROR([--with--version-pre-base must have a value])
+ AC_MSG_ERROR([--with-version-pre-base must have a value])
elif test "x$with_version_pre_base" = xno; then
# Interpret --without-* as empty string instead of the literal "no"
VERSION_PRE_BASE=
else
# Only [a-zA-Z] is allowed in the VERSION_PRE. Outer [ ] to quote m4.
[ VERSION_PRE_BASE=`$ECHO "$with_version_pre_base" | $TR -c -d '[a-z][A-Z]'` ]
if test "x$VERSION_PRE_BASE" != "x$with_version_pre_base"; then
- AC_MSG_WARN([--with--version-pre-base value has been sanitized from '$with_version_pre_base' to '$VERSION_PRE_BASE'])
+ AC_MSG_WARN([--with-version-pre-base value has been sanitized from '$with_version_pre_base' to '$VERSION_PRE_BASE'])
fi
fi
else
if test "x$NO_DEFAULT_VERSION_PARTS" != xtrue; then
# Default is to use "internal" as pre
@@ -143,19 +144,19 @@
[Set the debug level part of the version 'PRE' field (pre-release identifier) @<:@current debug level@:>@])],
[with_version_pre_debuglevel_present=true], [with_version_pre_debuglevel_present=false])
if test "x$with_version_pre_debuglevel_present" = xtrue; then
if test "x$with_version_pre_debuglevel" = xyes; then
- AC_MSG_ERROR([--with--version-pre-debuglevel must have a value])
+ AC_MSG_ERROR([--with-version-pre-debuglevel must have a value])
elif test "x$with_version_pre_debuglevel" = xno; then
# Interpret --without-* as empty string instead of the literal "no"
VERSION_PRE_DEBUGLEVEL=
else
# Only [a-zA-Z] is allowed in the VERSION_PRE. Outer [ ] to quote m4.
[ VERSION_PRE_DEBUGLEVEL=`$ECHO "$with_version_pre_debuglevel" | $TR -c -d '[a-z][A-Z]'` ]
if test "x$VERSION_PRE_DEBUGLEVEL" != "x$with_version_pre_debuglevel"; then
- AC_MSG_WARN([--with--version-pre-debuglevel value has been sanitized from '$with_version_pre_debuglevel' to '$VERSION_PRE_DEBUGLEVEL'])
+ AC_MSG_WARN([--with-version-pre-debuglevel value has been sanitized from '$with_version_pre_debuglevel' to '$VERSION_PRE_DEBUGLEVEL'])
fi
fi
else
if test "x$NO_DEFAULT_VERSION_PARTS" != xtrue; then
# Default is to use the debug level name, except for release which is empty.
@@ -171,19 +172,19 @@
[Set version 'OPT' field (build metadata) @<:@<timestamp>.<user>.<dirname>@:>@])],
[with_version_opt_present=true], [with_version_opt_present=false])
if test "x$with_version_opt_present" = xtrue; then
if test "x$with_version_opt" = xyes; then
- AC_MSG_ERROR([--with--version-opt must have a value])
+ AC_MSG_ERROR([--with-version-opt must have a value])
elif test "x$with_version_opt" = xno; then
# Interpret --without-* as empty string instead of the literal "no"
VERSION_OPT=
else
# Only [-.a-zA-Z0-9] is allowed in the VERSION_OPT. Outer [ ] to quote m4.
[ VERSION_OPT=`$ECHO "$with_version_opt" | $TR -c -d '[a-z][A-Z][0-9].-'` ]
if test "x$VERSION_OPT" != "x$with_version_opt"; then
- AC_MSG_WARN([--with--version-opt value has been sanitized from '$with_version_opt' to '$VERSION_OPT'])
+ AC_MSG_WARN([--with-version-opt value has been sanitized from '$with_version_opt' to '$VERSION_OPT'])
fi
fi
else
if test "x$NO_DEFAULT_VERSION_PARTS" != xtrue; then
# Default is to calculate a string like this <timestamp>.<username>.<base dir name>
@@ -199,11 +200,11 @@
[Set version 'BUILD' field (build number) @<:@not specified@:>@])],
[with_version_build_present=true], [with_version_build_present=false])
if test "x$with_version_build_present" = xtrue; then
if test "x$with_version_build" = xyes; then
- AC_MSG_ERROR([--with--version-build must have a value])
+ AC_MSG_ERROR([--with-version-build must have a value])
elif test "x$with_version_build" = xno; then
# Interpret --without-* as empty string instead of the literal "no"
VERSION_BUILD=
elif test "x$with_version_build" = x; then
VERSION_BUILD=
@@ -223,11 +224,11 @@
[Set version 'MAJOR' field (first number) @<:@current source value@:>@])],
[with_version_major_present=true], [with_version_major_present=false])
if test "x$with_version_major_present" = xtrue; then
if test "x$with_version_major" = xyes; then
- AC_MSG_ERROR([--with--version-major must have a value])
+ AC_MSG_ERROR([--with-version-major must have a value])
else
JDKVER_CHECK_AND_SET_NUMBER(VERSION_MAJOR, $with_version_major)
fi
else
if test "x$NO_DEFAULT_VERSION_PARTS" != xtrue; then
@@ -240,11 +241,11 @@
[Set version 'MINOR' field (second number) @<:@current source value@:>@])],
[with_version_minor_present=true], [with_version_minor_present=false])
if test "x$with_version_minor_present" = xtrue; then
if test "x$with_version_minor" = xyes; then
- AC_MSG_ERROR([--with--version-minor must have a value])
+ AC_MSG_ERROR([--with-version-minor must have a value])
elif test "x$with_version_minor" = xno; then
# Interpret --without-* as empty string (i.e. 0) instead of the literal "no"
VERSION_MINOR=0
elif test "x$with_version_minor" = x; then
VERSION_MINOR=0
@@ -262,11 +263,11 @@
[Set version 'SECURITY' field (third number) @<:@current source value@:>@])],
[with_version_security_present=true], [with_version_security_present=false])
if test "x$with_version_security_present" = xtrue; then
if test "x$with_version_security" = xyes; then
- AC_MSG_ERROR([--with--version-security must have a value])
+ AC_MSG_ERROR([--with-version-security must have a value])
elif test "x$with_version_security" = xno; then
# Interpret --without-* as empty string (i.e. 0) instead of the literal "no"
VERSION_SECURITY=0
elif test "x$with_version_security" = x; then
VERSION_SECURITY=0
@@ -284,11 +285,11 @@
[Set version 'PATCH' field (fourth number) @<:@not specified@:>@])],
[with_version_patch_present=true], [with_version_patch_present=false])
if test "x$with_version_patch_present" = xtrue; then
if test "x$with_version_patch" = xyes; then
- AC_MSG_ERROR([--with--version-patch must have a value])
+ AC_MSG_ERROR([--with-version-patch must have a value])
elif test "x$with_version_patch" = xno; then
# Interpret --without-* as empty string (i.e. 0) instead of the literal "no"
VERSION_PATCH=0
elif test "x$with_version_patch" = x; then
VERSION_PATCH=0
< prev index next >