THRIFT-5646 Check for the presence of Gradle to build the Kotlin library. (#2691)

Client: kotlin
diff --git a/configure.ac b/configure.ac
index a926e3e..9a71fc7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -211,9 +211,10 @@
 AX_THRIFT_LIB(kotlin, [Kotlin], yes)
 if test "$with_kotlin" = "yes";  then
   AX_JAVAC_AND_JAVA
+  AC_PATH_PROG([GRADLE], [gradle])
   AC_SUBST(CLASSPATH)
   AC_SUBST(GRADLE_OPTS)
-  if test "x$JAVA" != "x" && test "x$JAVAC" != "x" ; then
+  if test "x$JAVA" != "x" && test "x$JAVAC" != "x" && "x$GRADLE" != "x" ; then
     have_kotlin="yes"
   fi
 fi