+AC_FUNC_PRINTF_UNIX98
+
+#
+# Check whether to use trio printf
+#
+
+AC_ARG_ENABLE(included-printf, [ --enable-included-printf use included printf [default=auto]], enable_trio="$enableval")
+
+if test "$enable_trio" != "no" ; then
+ if test "$ac_cv_func_vsnprintf_c99" != "yes" ; then
+ enable_trio = yes
+ fi
+ if test "$ac_cv_func_printf_unix98" != "yes" ; then
+ enable_trio = yes
+ fi
+fi
+
+AM_CONDITIONAL(HAVE_GOOD_PRINTF, test "$enable_trio" != "yes")
+if test "$enable_trio" != "yes" ; then
+ AC_DEFINE(HAVE_GOOD_PRINTF,1,[define to use system printf])
+ AC_DEFINE(HAVE_VASPRINTF,1)
+ AC_DEFINE(HAVE_C99_VSNPRINTF,1)
+ AC_DEFINE(HAVE_UNIX98_PRINTF,1)
+else
+ AC_DEFINE(HAVE_GOOD_PRINTF,0)
+fi