Skip to content

Commit

Permalink
8292716: Configure should check that jtreg is of the required version
Browse files Browse the repository at this point in the history
8292763: JDK-8292716 breaks configure without jtreg

Reviewed-by: phh, shade
Backport-of: 9288072655a689c06a03f85c976bbd2f0744d3d5
  • Loading branch information
GoeLin committed Mar 12, 2024
1 parent 069fbd7 commit 5cf250f
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions make/autoconf/toolchain.m4
Expand Up @@ -61,6 +61,9 @@ TOOLCHAIN_MINIMUM_VERSION_xlc=""
# Minimum supported linker versions, empty means unspecified
TOOLCHAIN_MINIMUM_LD_VERSION_gcc="2.18"

# Minimum supported version
JTREG_MINIMUM_VERSION=6.1

# Prepare the system so that TOOLCHAIN_CHECK_COMPILER_VERSION can be called.
# Must have CC_VERSION_NUMBER and CXX_VERSION_NUMBER.
# $1 - optional variable prefix for compiler and version variables (BUILD_)
Expand Down Expand Up @@ -1144,6 +1147,24 @@ AC_DEFUN_ONCE([TOOLCHAIN_SETUP_JTREG],
UTIL_FIXUP_EXECUTABLE(JTREGEXE)
UTIL_FIXUP_PATH(JT_HOME)
AC_SUBST(JT_HOME)
# Verify jtreg version
if test "x$JT_HOME" != x; then
AC_MSG_CHECKING([jtreg version number])
# jtreg -version looks like this: "jtreg 6.1+1-19"
# Extract actual version part ("6.1" in this case)
jtreg_version_full=`$JAVA -jar $JT_HOME/lib/jtreg.jar -version | $HEAD -n 1 | $CUT -d ' ' -f 2`
jtreg_version=${jtreg_version_full/%+*}
AC_MSG_RESULT([$jtreg_version])
# This is a simplified version of TOOLCHAIN_CHECK_COMPILER_VERSION
comparable_actual_version=`$AWK -F. '{ printf("%05d%05d%05d%05d\n", [$]1, [$]2, [$]3, [$]4) }' <<< "$jtreg_version"`
comparable_minimum_version=`$AWK -F. '{ printf("%05d%05d%05d%05d\n", [$]1, [$]2, [$]3, [$]4) }' <<< "$JTREG_MINIMUM_VERSION"`
if test $comparable_actual_version -lt $comparable_minimum_version ; then
AC_MSG_ERROR([jtreg version is too old, at least version $JTREG_MINIMUM_VERSION is required])
fi
fi
AC_SUBST(JTREGEXE)
])

Expand Down

1 comment on commit 5cf250f

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.