< prev index next >

make/autoconf/lib-tests.m4

Print this page

228   AC_SUBST(JT_HOME)
229 
230   # Verify jtreg version
231   if test "x$JT_HOME" != x; then
232     AC_MSG_CHECKING([jtreg version number])
233     # jtreg -version looks like this: "jtreg 6.1+1-19"
234     # Extract actual version part ("6.1" in this case)
235     jtreg_version_full=`$JAVA -jar $JT_HOME/lib/jtreg.jar -version | $HEAD -n 1 | $CUT -d ' ' -f 2`
236     jtreg_version=${jtreg_version_full/%+*}
237     AC_MSG_RESULT([$jtreg_version])
238 
239     # This is a simplified version of TOOLCHAIN_CHECK_COMPILER_VERSION
240     comparable_actual_version=`$AWK -F. '{ printf("%05d%05d%05d%05d\n", [$]1, [$]2, [$]3, [$]4) }' <<< "$jtreg_version"`
241     comparable_minimum_version=`$AWK -F. '{ printf("%05d%05d%05d%05d\n", [$]1, [$]2, [$]3, [$]4) }' <<< "$JTREG_MINIMUM_VERSION"`
242     if test $comparable_actual_version -lt $comparable_minimum_version ; then
243       AC_MSG_ERROR([jtreg version is too old, at least version $JTREG_MINIMUM_VERSION is required])
244     fi
245   fi
246 ])
247 





















































































248 # Setup the JIB dependency resolver
249 AC_DEFUN_ONCE([LIB_TESTS_SETUP_JIB],
250 [
251   AC_ARG_WITH(jib, [AS_HELP_STRING([--with-jib],
252       [Jib dependency management tool @<:@not used@:>@])])
253 
254   if test "x$with_jib" = xno || test "x$with_jib" = x; then
255     # jib disabled
256     AC_MSG_CHECKING([for jib])
257     AC_MSG_RESULT(no)
258   elif test "x$with_jib" = xyes; then
259     AC_MSG_ERROR([Must supply a value to --with-jib])
260   else
261     JIB_HOME="${with_jib}"
262     AC_MSG_CHECKING([for jib])
263     AC_MSG_RESULT(${JIB_HOME})
264     if test ! -d "${JIB_HOME}"; then
265       AC_MSG_ERROR([--with-jib must be a directory])
266     fi
267     JIB_JAR=$(ls ${JIB_HOME}/lib/jib-*.jar)

284   else
285     BUILD_FAILURE_HANDLER_DEFAULT=false
286   fi
287 
288   UTIL_ARG_ENABLE(NAME: jtreg-failure-handler, DEFAULT: $BUILD_FAILURE_HANDLER_DEFAULT,
289       RESULT: BUILD_FAILURE_HANDLER,
290       DESC: [enable building of the jtreg failure handler],
291       DEFAULT_DESC: [enabled if jtreg is present and build env is CI],
292       CHECKING_MSG: [if the jtreg failure handler should be built],
293       CHECK_AVAILABLE: [
294         AC_MSG_CHECKING([if the jtreg failure handler is available])
295         if test "x$JT_HOME" != "x"; then
296           AC_MSG_RESULT([yes])
297         else
298           AVAILABLE=false
299           AC_MSG_RESULT([no (jtreg not present)])
300         fi
301       ])
302   AC_SUBST(BUILD_FAILURE_HANDLER)
303 ])




















228   AC_SUBST(JT_HOME)
229 
230   # Verify jtreg version
231   if test "x$JT_HOME" != x; then
232     AC_MSG_CHECKING([jtreg version number])
233     # jtreg -version looks like this: "jtreg 6.1+1-19"
234     # Extract actual version part ("6.1" in this case)
235     jtreg_version_full=`$JAVA -jar $JT_HOME/lib/jtreg.jar -version | $HEAD -n 1 | $CUT -d ' ' -f 2`
236     jtreg_version=${jtreg_version_full/%+*}
237     AC_MSG_RESULT([$jtreg_version])
238 
239     # This is a simplified version of TOOLCHAIN_CHECK_COMPILER_VERSION
240     comparable_actual_version=`$AWK -F. '{ printf("%05d%05d%05d%05d\n", [$]1, [$]2, [$]3, [$]4) }' <<< "$jtreg_version"`
241     comparable_minimum_version=`$AWK -F. '{ printf("%05d%05d%05d%05d\n", [$]1, [$]2, [$]3, [$]4) }' <<< "$JTREG_MINIMUM_VERSION"`
242     if test $comparable_actual_version -lt $comparable_minimum_version ; then
243       AC_MSG_ERROR([jtreg version is too old, at least version $JTREG_MINIMUM_VERSION is required])
244     fi
245   fi
246 ])
247 
248 # Setup the JTReg Regression Test Harness.
249 AC_DEFUN_ONCE([LIB_TESTS_SETUP_JTREG_MW],
250 [
251   AC_ARG_WITH(jtregMW, [AS_HELP_STRING([--with-jtregMW],
252       [Regression Test Harness @<:@probed@:>@])])
253 
254   if test "x$with_jtregMW" = xno; then
255     # jtreg disabled
256     AC_MSG_CHECKING([for jtreg test harness])
257     AC_MSG_RESULT([no, disabled])
258   elif test "x$with_jtregMW" != xyes && test "x$with_jtregMW" != x; then
259     # An explicit path is specified, use it.
260     JT_HOME_MW="$with_jtregMW"
261     UTIL_FIXUP_PATH([JT_HOME_MW])
262     if test ! -d "$JT_HOME_MW"; then
263       AC_MSG_ERROR([jtreg home directory from --with-jtregMW=$with_jtregMW does not exist])
264     fi
265 
266     if test ! -e "$JT_HOME_MW/lib/jtreg.jar"; then
267       AC_MSG_ERROR([jtreg home directory from --with-jtregMW=$with_jtregMW is not a valid jtreg home])
268     fi
269 
270     JTREGEXE_MW="$JT_HOME_MW/bin/jtreg"
271     if test ! -x "$JTREGEXE_MW"; then
272       AC_MSG_ERROR([jtreg home directory from --with-jtregMW=$with_jtregMW does not contain valid jtreg executable])
273     fi
274 
275     AC_MSG_CHECKING([for jtreg test harness])
276     AC_MSG_RESULT([$JT_HOME_MW])
277   else
278     # Try to locate jtreg
279     if test "x$JT_HOME_MW" != x; then
280       # JT_HOME_MW set in environment, use it
281       if test ! -d "$JT_HOME_MW"; then
282         AC_MSG_WARN([Ignoring JT_HOME_MW pointing to invalid directory: $JT_HOME_MW])
283         JT_HOME_MW=
284       else
285         if test ! -e "$JT_HOME_MW/lib/jtreg.jar"; then
286           AC_MSG_WARN([Ignoring JT_HOME_MW which is not a valid jtreg home: $JT_HOME_MW])
287           JT_HOME_MW=
288         elif test ! -x "$JT_HOME_MW/bin/jtreg"; then
289           AC_MSG_WARN([Ignoring JT_HOME_MW which does not contain valid jtreg executable: $JT_HOME_MW])
290           JT_HOME_MW=
291         else
292           JTREGEXE_MW="$JT_HOME_MW/bin/jtreg"
293           AC_MSG_NOTICE([Located jtreg using JT_HOME_MW from environment])
294         fi
295       fi
296     fi
297 
298     if test "x$JT_HOME_MW" = x; then
299       # JT_HOME_MW is not set in environment, or was deemed invalid.
300       # Try to find jtreg on path
301       UTIL_LOOKUP_PROGS(JTREGEXE_MW, jtreg)
302       if test "x$JTREGEXE_MW" != x; then
303         # That's good, now try to derive JT_HOME_MW
304         JT_HOME_MW=`(cd $($DIRNAME $JTREGEXE_MW)/.. && pwd)`
305         if test ! -e "$JT_HOME_MW/lib/jtreg.jar"; then
306           AC_MSG_WARN([Ignoring jtreg from path since a valid jtreg home cannot be found])
307           JT_HOME_MW=
308           JTREGEXE_MW=
309         else
310           AC_MSG_NOTICE([Located jtreg using jtreg executable in path])
311         fi
312       fi
313     fi
314 
315     AC_MSG_CHECKING([for jtreg test harness])
316     if test "x$JT_HOME_MW" != x; then
317       AC_MSG_RESULT([$JT_HOME_MW])
318     else
319       AC_MSG_RESULT([no, not found])
320 
321       if test "x$with_jtregMW" = xyes; then
322         AC_MSG_ERROR([--with-jtregMW was specified, but no jtreg found.])
323       fi
324     fi
325   fi
326 
327   UTIL_FIXUP_EXECUTABLE(JTREGEXE_MW)
328   UTIL_FIXUP_PATH(JT_HOME_MW)
329   AC_SUBST(JT_HOME_MW)
330   AC_SUBST(JTREGEXE_MW)
331 ])
332 
333 # Setup the JIB dependency resolver
334 AC_DEFUN_ONCE([LIB_TESTS_SETUP_JIB],
335 [
336   AC_ARG_WITH(jib, [AS_HELP_STRING([--with-jib],
337       [Jib dependency management tool @<:@not used@:>@])])
338 
339   if test "x$with_jib" = xno || test "x$with_jib" = x; then
340     # jib disabled
341     AC_MSG_CHECKING([for jib])
342     AC_MSG_RESULT(no)
343   elif test "x$with_jib" = xyes; then
344     AC_MSG_ERROR([Must supply a value to --with-jib])
345   else
346     JIB_HOME="${with_jib}"
347     AC_MSG_CHECKING([for jib])
348     AC_MSG_RESULT(${JIB_HOME})
349     if test ! -d "${JIB_HOME}"; then
350       AC_MSG_ERROR([--with-jib must be a directory])
351     fi
352     JIB_JAR=$(ls ${JIB_HOME}/lib/jib-*.jar)

369   else
370     BUILD_FAILURE_HANDLER_DEFAULT=false
371   fi
372 
373   UTIL_ARG_ENABLE(NAME: jtreg-failure-handler, DEFAULT: $BUILD_FAILURE_HANDLER_DEFAULT,
374       RESULT: BUILD_FAILURE_HANDLER,
375       DESC: [enable building of the jtreg failure handler],
376       DEFAULT_DESC: [enabled if jtreg is present and build env is CI],
377       CHECKING_MSG: [if the jtreg failure handler should be built],
378       CHECK_AVAILABLE: [
379         AC_MSG_CHECKING([if the jtreg failure handler is available])
380         if test "x$JT_HOME" != "x"; then
381           AC_MSG_RESULT([yes])
382         else
383           AVAILABLE=false
384           AC_MSG_RESULT([no (jtreg not present)])
385         fi
386       ])
387   AC_SUBST(BUILD_FAILURE_HANDLER)
388 ])
389 
390 AC_DEFUN_ONCE([LIB_TESTS_ENABLE_DISABLE_JTREG_MAIN_WRAPPER],
391 [
392   UTIL_ARG_ENABLE(NAME: jtreg-main-wrapper, DEFAULT: auto,
393       RESULT: BUILD_JTREG_MAIN_WRAPPER,
394       DESC: [enable building of the jtreg main wrapper],
395       DEFAULT_DESC: [enabled if jtreg is present],
396       CHECKING_MSG: [if the jtreg main wrapper should be built],
397       CHECK_AVAILABLE: [
398         AC_MSG_CHECKING([if the jtreg main wrapper is available])
399         if test "x$JT_HOME_MW" != "x"; then
400           AC_MSG_RESULT([yes])
401         else
402           AVAILABLE=false
403           AC_MSG_RESULT([no (jtreg not present)])
404         fi
405       ])
406   AC_SUBST(BUILD_JTREG_MAIN_WRAPPER)
407 ])
< prev index next >