< prev index next >

make/autoconf/lib-tests.m4

Print this page

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





















































































238 # Setup the JIB dependency resolver
239 AC_DEFUN_ONCE([LIB_TESTS_SETUP_JIB],
240 [
241   AC_ARG_WITH(jib, [AS_HELP_STRING([--with-jib],
242       [Jib dependency management tool @<:@not used@:>@])])
243 
244   if test "x$with_jib" = xno || test "x$with_jib" = x; then
245     # jib disabled
246     AC_MSG_CHECKING([for jib])
247     AC_MSG_RESULT(no)
248   elif test "x$with_jib" = xyes; then
249     AC_MSG_ERROR([Must supply a value to --with-jib])
250   else
251     JIB_HOME="${with_jib}"
252     AC_MSG_CHECKING([for jib])
253     AC_MSG_RESULT(${JIB_HOME})
254     if test ! -d "${JIB_HOME}"; then
255       AC_MSG_ERROR([--with-jib must be a directory])
256     fi
257     JIB_JAR=$(ls ${JIB_HOME}/lib/jib-*.jar)

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