evdev: fix build with old kernel headers

* configure.ac: Check whether struct input_absinfo.resolution is defined
in <linux/input.h>.
* evdev.c (SYN_MAX): Add fallback definition.
(abs_ioctl): Wrap use of struct input_absinfo.resolution in #ifdef check.
(keycode_V2_ioctl, mtslots_ioctl, repeat_ioctl): Wrap in #ifdef checks.
(evdev_read_ioctl): Wrap in #ifdef checks the code that uses EV_SW,
EVIOCGREP, EVIOCGKEYCODE_V2, EVIOCGMTSLOTS, EVIOCGPROP, and EVIOCGSW.
(evdev_write_ioctl): Wrap in #ifdef checks the code that uses EVIOCSREP,
EVIOCSKEYCODE_V2, EVIOCSCLOCKID, and EVIOCREVOKE.
diff --git a/configure.ac b/configure.ac
index 228ca5f..b21941e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -249,7 +249,6 @@
 	linux/falloc.h
 	linux/filter.h
 	linux/hiddev.h
-	linux/input.h
 	linux/mmtimer.h
 	linux/perf_event.h
 	linux/seccomp.h
@@ -308,6 +307,10 @@
 	AC_CHECK_DECLS([IO_CMD_PWRITE, IO_CMD_PWRITEV],,, [#include <libaio.h>])
 ])
 
+AC_CHECK_HEADERS([linux/input.h], [
+	AC_CHECK_MEMBERS([struct input_absinfo.resolution],,, [#include <linux/input.h>])
+])
+
 AC_CHECK_DECLS([sys_errlist])
 AC_CHECK_DECLS(m4_normalize([
 	PTRACE_PEEKUSER,