Thrift-731: configure doesn't check for ant >= 1.7
Client: java, build process
Patch: Harlan Lieberman-Berg, Jake Farrell

Adds a configure check to verify that the current version of ant is >= 1.7 otherwise sets WITH_JAVA to no.




git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1127686 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/aclocal/ax_javac_and_java.m4 b/aclocal/ax_javac_and_java.m4
index 03ab08e..fdb4bf0 100644
--- a/aclocal/ax_javac_and_java.m4
+++ b/aclocal/ax_javac_and_java.m4
@@ -105,3 +105,17 @@
 
           rm -f configtest_ax_javac_and_java.java configtest_ax_javac_and_java.class
           ])
+
+
+AC_DEFUN([AX_CHECK_ANT_VERSION],
+         [
+          AC_MSG_CHECKING(for ant version > $2)
+          ANT_VALID=`expr $($1 -version 2>/dev/null | sed -n 's/.*version \(@<:@0-9\.@:>@*\).*/\1/p') \>= $2`
+          if test "x$ANT_VALID" = "x1" ; then
+            AC_MSG_RESULT(yes)
+          else
+            AC_MSG_RESULT(no)
+            ANT=""
+          fi
+          ])
+
diff --git a/configure.ac b/configure.ac
index faffa55..8668a03 100644
--- a/configure.ac
+++ b/configure.ac
@@ -148,15 +148,7 @@
 if test "$with_java" = "yes";  then
   AX_JAVAC_AND_JAVA
   AC_PATH_PROG([ANT], [ant])
-  AX_CHECK_JAVA_CLASS(org.slf4j.Logger)
-  have_slf4j="$success"
-  AX_CHECK_JAVA_CLASS(org.slf4j.impl.SimpleLogger)
-  have_slf4j_simple="$success"
-  AX_CHECK_JAVA_CLASS(org.apache.commons.lang.builder.HashCodeBuilder)
-  have_hashcode="$success"
-  if test "x$have_slf4j_simple" = "xyes" && test "x$have_slf4j" = "xyes" && test "x$have_hashcode" = "xyes" ; then
-    ANT_FLAGS="$ANT_FLAGS -Dnoivy="
-  fi
+  AX_CHECK_ANT_VERSION($ANT, 1.7)
   AC_SUBST(CLASSPATH)
   AC_SUBST(ANT_FLAGS)
   if test "x$JAVAC" != "x" && test "x$JAVAC" != "x" && test "x$ANT" != "x" ; then