THRIFT-3264 Fix Erlang 16 namespaced types
Client: Erlang
Patch: Nobuaki Sukegawa <nsukeg@gmail.com>

This closes #566
diff --git a/configure.ac b/configure.ac
index 9af7f65..0a3fd43 100755
--- a/configure.ac
+++ b/configure.ac
@@ -231,9 +231,16 @@
   fi
   if test -n "$ERL" -a -n "$ERLC" ; then
     have_erlang="yes"
+
+    # otp_release is simply a number (like "17") for OTP17+ while "R16..." for OTP16 or less.
+    # OTP version is currently only used for running tests.
+    if $ERL -eval 'erlang:display(erlang:system_info(otp_release)),halt().' -noshell | grep "^\"R" >/dev/null; then
+      erlang_otp16_or_less="yes"
+    fi
   fi
 fi
 AM_CONDITIONAL(WITH_ERLANG, [test "$have_erlang" = "yes"])
+AM_CONDITIONAL(ERLANG_OTP16, [test "$erlang_otp16_or_less" = "yes"])
 
 AX_THRIFT_LIB(nodejs, [Nodejs], yes)
 have_nodejs=no