+AC_CHECK_FUNCS([inet_ntoa memchr memset socket poll strcasecmp strdup strtol strtoul])
+
+# check for clock_gettime
+AC_CHECK_FUNC([clock_gettime], [
+ AC_DEFINE([HAVE_CLOCK_GETTIME], [1], [Define if you have clock_gettime])
+], [
+ AC_CHECK_LIB([rt], [clock_gettime], [
+ AC_SUBST([RT_LIBS], [-lrt])
+ AC_DEFINE([HAVE_CLOCK_GETTIME], [1], [Define if you have clock_gettime])
+ ], [
+ AC_CHECK_FUNCS([gettimeofday])
+ ])
+])
+
+# check for doxygen
+AS_IF([test x$enable_doc = xyes], [
+ AC_CHECK_PROGS([DOXYGEN], [doxygen])
+ AS_IF([test -z "$DOXYGEN"], [
+ AC_MSG_ERROR([Doxygen not found])
+ ])
+])
+AM_CONDITIONAL([HAVE_DOXYGEN], [test -n "$DOXYGEN"])
+
+# check for libreadline
+AS_IF([test x$with_readline != xno], [
+ AC_CHECK_LIB([readline], [readline], [
+ AC_SUBST([READLINE_LIBS], [-lreadline])
+ AC_DEFINE([HAVE_LIBREADLINE], [1], [Define if you have libreadline])
+ ], [
+ AC_MSG_FAILURE([readline test failed (--without-readline to disable)])
+ ])
+])
+