1 # javaexec.m4 serial 2 (gettext-0.13)
2 dnl Copyright (C) 2001-2003 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 __WIN32__ || defined __EMX__ || defined __DJGPP__
18 ], CLASSPATH_SEPARATOR=';', CLASSPATH_SEPARATOR=':')
20 if test -n "$JAVA"; then
23 pushdef([AC_MSG_CHECKING],[:])dnl
24 pushdef([AC_CHECKING],[:])dnl
25 pushdef([AC_MSG_RESULT],[:])dnl
26 AC_CHECK_PROG(HAVE_GIJ_IN_PATH, gij, yes)
27 AC_CHECK_PROG(HAVE_JAVA_IN_PATH, java, yes)
28 AC_CHECK_PROG(HAVE_JRE_IN_PATH, jre, yes)
29 AC_CHECK_PROG(HAVE_JVIEW_IN_PATH, jview, yes)
30 popdef([AC_MSG_RESULT])dnl
31 popdef([AC_CHECKING])dnl
32 popdef([AC_MSG_CHECKING])dnl
34 save_CLASSPATH="$CLASSPATH"
35 CLASSPATH="$2"${CLASSPATH+"$CLASSPATH_SEPARATOR$CLASSPATH"}
38 if test -n "$HAVE_GIJ_IN_PATH" \
39 && gij --version >/dev/null 2>/dev/null \
40 ifelse([$1], , , [&& gij $1 >/dev/null 2>/dev/null]); then
44 if test -n "$HAVE_JAVA_IN_PATH" \
45 && java -version >/dev/null 2>/dev/null \
46 ifelse([$1], , , [&& java $1 >/dev/null 2>/dev/null]); then
50 if test -n "$HAVE_JRE_IN_PATH" \
51 && (jre >/dev/null 2>/dev/null || test $? = 1) \
52 ifelse([$1], , , [&& jre $1 >/dev/null 2>/dev/null]); then
56 if test -n "$HAVE_JVIEW_IN_PATH" \
57 && (jview -? >/dev/null 2>/dev/null || test $? = 1) \
58 ifelse([$1], , , [&& jview $1 >/dev/null 2>/dev/null]); then
69 CLASSPATH="$save_CLASSPATH"
72 AC_MSG_RESULT([$ac_result])
75 AC_SUBST(CLASSPATH_SEPARATOR)