From ab57f7d628b7b6800018f9e20296cf8f809c577c Mon Sep 17 00:00:00 2001 From: Erik Helin Date: Mon, 15 Jun 2020 12:28:27 +0200 Subject: [PATCH] 8193686: Allow --with-jtreg to accept a zip compressed jtreg image Reviewed-by: ihse --- make/autoconf/toolchain.m4 | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/make/autoconf/toolchain.m4 b/make/autoconf/toolchain.m4 index c4ad9531be8..420cb23e815 100644 --- a/make/autoconf/toolchain.m4 +++ b/make/autoconf/toolchain.m4 @@ -999,8 +999,27 @@ AC_DEFUN_ONCE([TOOLCHAIN_SETUP_JTREG], AC_MSG_CHECKING([for jtreg test harness]) AC_MSG_RESULT([no, disabled]) elif test "x$with_jtreg" != xyes && test "x$with_jtreg" != x; then - # An explicit path is specified, use it. - JT_HOME="$with_jtreg" + if test -d "$with_jtreg"; then + # An explicit path is specified, use it. + JT_HOME="$with_jtreg" + else + case "$with_jtreg" in + *.zip ) + JTREG_SUPPORT_DIR=$CONFIGURESUPPORT_OUTPUTDIR/jtreg + $RM -rf $JTREG_SUPPORT_DIR + $MKDIR -p $JTREG_SUPPORT_DIR + $UNZIP -qq -d $JTREG_SUPPORT_DIR $with_jtreg + + # Try to find jtreg to determine JT_HOME path + JTREG_PATH=`$FIND $JTREG_SUPPORT_DIR | $GREP "/bin/jtreg"` + if test "x$JTREG_PATH" != x; then + JT_HOME=$($DIRNAME $($DIRNAME $JTREG_PATH)) + fi + ;; + * ) + ;; + esac + fi UTIL_FIXUP_PATH([JT_HOME]) if test ! -d "$JT_HOME"; then AC_MSG_ERROR([jtreg home directory from --with-jtreg=$with_jtreg does not exist])