Use AC_CHECK_TYPES to check for struct stat64

* m4/stat.m4: Remove.
* configure.ac (AC_STAT64): Remove.
(AC_CHECK_TYPES): Add struct stat64.
* file.c: Replace HAVE_STAT64 with HAVE_STRUCT_STAT64.
diff --git a/configure.ac b/configure.ac
index 5b0a38f..055b258 100644
--- a/configure.ac
+++ b/configure.ac
@@ -191,7 +191,6 @@
 	struct stat.st_gen,
 	struct stat.st_rdev
 ]))
-AC_STAT64
 AC_STATFS64
 
 AC_TYPE_SIGNAL
@@ -260,6 +259,8 @@
 AC_CHECK_TYPES([struct mmsghdr],,, [#include <sys/socket.h>])
 AC_CHECK_MEMBERS([struct msghdr.msg_control],,, [#include <sys/socket.h>])
 
+AC_CHECK_TYPES([struct stat64],,, [#include <sys/types.h>
+#include <asm/stat.h>])
 AC_CHECK_TYPES([struct __old_kernel_stat],,, [#include <asm/stat.h>])
 
 AC_CHECK_TYPES([struct pt_all_user_regs, struct ia64_fpreg, struct ptrace_peeksiginfo_args],,,
diff --git a/file.c b/file.c
index 92ebcd6..ae74d5a 100644
--- a/file.c
+++ b/file.c
@@ -299,7 +299,7 @@
 	return 0;
 }
 
-#if defined STAT32_PERSONALITY && !defined HAVE_STAT64
+#if defined STAT32_PERSONALITY && !defined HAVE_STRUCT_STAT64
 # if defined AARCH64 || defined X86_64 || defined X32
 /*
  * Linux x86_64 and x32 have unified `struct stat' but their i386 personality
@@ -338,13 +338,13 @@
 #   define STAT64_SIZE	104
 #  endif
 ;
-#  define HAVE_STAT64	1
+#  define HAVE_STRUCT_STAT64	1
 # else /* !(AARCH64 || X86_64 || X32) */
 #  warning FIXME: check whether struct stat64 definition is needed for this architecture!
 # endif
-#endif /* STAT32_PERSONALITY && !HAVE_STAT64 */
+#endif /* STAT32_PERSONALITY && !HAVE_STRUCT_STAT64 */
 
-#ifdef HAVE_STAT64
+#ifdef HAVE_STRUCT_STAT64
 
 # define DO_PRINTSTAT do_printstat64
 # define STRUCT_STAT struct stat64
@@ -424,7 +424,7 @@
 	return sys_fstat(tcp);
 }
 
-#endif /* HAVE_STAT64 */
+#endif /* HAVE_STRUCT_STAT64 */
 
 int
 sys_newfstatat(struct tcb *tcp)
@@ -439,11 +439,11 @@
 			printstat64(tcp, tcp->u_arg[2]);
 		else
 			printstat(tcp, tcp->u_arg[2]);
-#elif defined HAVE_STAT64
+#elif defined HAVE_STRUCT_STAT64
 		printstat64(tcp, tcp->u_arg[2]);
 #else
 		printstat(tcp, tcp->u_arg[2]);
-#endif /* STAT32_PERSONALITY || HAVE_STAT64 */
+#endif /* STAT32_PERSONALITY || HAVE_STRUCT_STAT64 */
 		tprints(", ");
 		printflags(at_flags, tcp->u_arg[3], "AT_???");
 	}
diff --git a/m4/stat.m4 b/m4/stat.m4
deleted file mode 100644
index bf0e480..0000000
--- a/m4/stat.m4
+++ /dev/null
@@ -1,16 +0,0 @@
-dnl ### A macro to determine whether stat64 is defined.
-AC_DEFUN([AC_STAT64],
-[AC_MSG_CHECKING(for stat64 in (asm|sys)/stat.h)
-AC_CACHE_VAL(ac_cv_type_stat64,
-[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-#include <sys/types.h>
-#include <linux/types.h>
-#include <asm/stat.h>
-]], [[struct stat64 st;]])],[ac_cv_type_stat64=yes],[ac_cv_type_stat64=no])])
-AC_MSG_RESULT($ac_cv_type_stat64)
-if test "$ac_cv_type_stat64" = yes
-then
-	AC_DEFINE([HAVE_STAT64], 1,
-[Define if stat64 is available in asm/stat.h.])
-fi
-])