Allow the Java library to be excluded from the build.
Use AX_THRIFT_LIB to make configure support --without-java.
Don't bother testing for the Java requirements if this is set.
This is necessary because the autoconf macros we are using for Java
cause configure to quit with an error if Java is not found.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665545 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/configure.ac b/configure.ac
index 113ae9f..5c4859c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -39,9 +39,12 @@
PKG_CHECK_MODULES(MONO, mono >= 1.2.6, have_mono=yes, have_mono=no)
AM_CONDITIONAL(ENABLE_MONO, [test "$have_mono" = "yes"])
-AC_PATH_PROG([ANT], [ant])
-AX_PROG_JAVAC
-AX_PROG_JAVA
+AX_THRIFT_LIB(java, [Java], yes)
+if test "$with_java" = "yes"; then
+ AC_PATH_PROG([ANT], [ant])
+ AX_PROG_JAVAC
+ AX_PROG_JAVA
+fi
AM_CONDITIONAL([ENABLE_JAVA],
[test -n "$ANT" -a -n "$JAVA" -a -n "$JAVAC"])