THRIFT-646. erlang: Fix build on machines without Erlang

AC_ERLANG_SUBST_LIB_DIR aborts configure if erlc cannot be found.  Just
skip that and all of the other install stuff if we don't have Erlang.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@988720 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/configure.ac b/configure.ac
index e5c59c1..822fd1a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -106,10 +106,12 @@
 if test "$with_erlang" = "yes";  then
   AC_ERLANG_PATH_ERL
   AC_ERLANG_PATH_ERLC
-  AC_ERLANG_SUBST_LIB_DIR
-  # Install into the detected Erlang directory instead of $libdir/erlang/lib
-  ERLANG_INSTALL_LIB_DIR="$ERLANG_LIB_DIR"
-  AC_ERLANG_SUBST_INSTALL_LIB_SUBDIR(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
+  if test -n "$ERLC" ; then
+    AC_ERLANG_SUBST_LIB_DIR
+    # Install into the detected Erlang directory instead of $libdir/erlang/lib
+    ERLANG_INSTALL_LIB_DIR="$ERLANG_LIB_DIR"
+    AC_ERLANG_SUBST_INSTALL_LIB_SUBDIR(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
+  fi
 fi
 AM_CONDITIONAL(WITH_ERLANG, [test -n "$ERL" -a -n "$ERLC"])