2 dnl Copyright (C) 2001-2003, 2006, 2009-2020 Free Software Foundation, Inc.
3 dnl This file is free software; the Free Software Foundation
4 dnl gives unlimited permission to copy and/or distribute it,
5 dnl with or without modifications, as long as this notice is preserved.
7 # Prerequisites of javaexec.sh.
8 # gt_JAVAEXEC or gt_JAVAEXEC(testclass, its-directory)
9 # Sets HAVE_JAVAEXEC to nonempty if javaexec.sh will work.
11 AC_DEFUN([gt_JAVAEXEC],
13 AC_MSG_CHECKING([for Java virtual machine])
15 #if defined _WIN32 || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__
18 ], CLASSPATH_SEPARATOR=';', CLASSPATH_SEPARATOR=':')
26 if test -n "$JAVA"; then
30 pushdef([AC_MSG_CHECKING],[:])dnl
31 pushdef([AC_CHECKING],[:])dnl
32 pushdef([AC_MSG_RESULT],[:])dnl
33 AC_CHECK_PROG([HAVE_GIJ_IN_PATH], [gij], [yes])
34 AC_CHECK_PROG([HAVE_JAVA_IN_PATH], [java], [yes])
35 AC_CHECK_PROG([HAVE_JRE_IN_PATH], [jre], [yes])
36 AC_CHECK_PROG([HAVE_JVIEW_IN_PATH], [jview], [yes])
37 popdef([AC_MSG_RESULT])dnl
38 popdef([AC_CHECKING])dnl
39 popdef([AC_MSG_CHECKING])dnl
41 save_CLASSPATH="$CLASSPATH"
42 CLASSPATH="$2"${CLASSPATH+"$CLASSPATH_SEPARATOR$CLASSPATH"}
45 if test -n "$HAVE_GIJ_IN_PATH" \
46 && gij --version >/dev/null 2>/dev/null \
48 echo "$as_me:__oline__: gij $1" >&AS_MESSAGE_LOG_FD
49 gij $1 >&AS_MESSAGE_LOG_FD 2>&1
54 if test -n "$HAVE_JAVA_IN_PATH" \
55 && java -version >/dev/null 2>/dev/null \
57 echo "$as_me:__oline__: gij $1" >&AS_MESSAGE_LOG_FD
58 java $1 >&AS_MESSAGE_LOG_FD 2>&1
63 if test -n "$HAVE_JRE_IN_PATH" \
64 && (jre >/dev/null 2>/dev/null || test $? = 1) \
66 echo "$as_me:__oline__: gij $1" >&AS_MESSAGE_LOG_FD
67 jre $1 >&AS_MESSAGE_LOG_FD 2>&1
72 if test -n "$HAVE_JVIEW_IN_PATH" \
73 && (jview -? >/dev/null 2>/dev/null || test $? = 1) \
75 echo "$as_me:__oline__: gij $1" >&AS_MESSAGE_LOG_FD
76 jview $1 >&AS_MESSAGE_LOG_FD 2>&1
87 CLASSPATH="$save_CLASSPATH"
90 if test -n "$HAVE_JAVAEXEC"; then
91 ac_result="$CONF_JAVA"
95 AC_MSG_RESULT([$ac_result])
98 AC_SUBST([CLASSPATH_SEPARATOR])
99 AC_SUBST([HAVE_JAVA_ENVVAR])
101 AC_SUBST([HAVE_JAVA])
103 AC_SUBST([HAVE_JVIEW])