+AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
+ AC_TRY_COMPILE(
+ [ #include <sys/time.h> ],
+ [ struct timeval tv; tv.tv_sec = 1;],
+ [ ac_cv_have_struct_timeval="yes" ],
+ [ ac_cv_have_struct_timeval="no" ]
+ )
+])
+if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
+ AC_DEFINE(HAVE_STRUCT_TIMEVAL)
+ have_struct_timeval=1
+fi
+
+# If we don't have int64_t then we can't compile sftp-server. So don't
+# even attempt to do it.
+if test "x$ac_cv_have_int64_t" = "xno" -a \
+ "x$ac_cv_sizeof_long_int" != "x8" -a \
+ "x$ac_cv_sizeof_long_long_int" = "x0" ; then
+ NO_SFTP='#'
+fi
+AC_SUBST(NO_SFTP)
+