do not check certain features on non-64 systems
diff --git a/configure.ac b/configure.ac
index 287f023..bf710e8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -62,6 +62,17 @@
 AC_STRUCT_TM
 AC_CHECK_TYPE(intmax_t, int64_t)
 
+dnl Test if we should check features that depend on 64-bitness.
+AC_MSG_CHECKING(size of long is longer than 32 bit)
+AS_VAR_PUSHDEF([WIDE_LONG], [WIDE_LONG])
+AC_TRY_COMPILE([#include "confdefs.h"
+#include <sys/types.h>
+], [switch (0) case 0: case (sizeof ($1) >= 8):;],
+    WIDE_LONG=yes, WIDE_LONG=no)
+AC_MSG_RESULT($WIDE_LONG)
+AM_CONDITIONAL([TEST_64BIT], [test x$WIDE_LONG = xyes])
+AS_VAR_POPDEF([WIDE_LONG])
+
 dnl For mingw
 AC_SEARCH_LIBS(getopt, iberty)