summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorTilman Sauerbeck <tilman@code-monkey.de>2006-07-08 19:55:53 +0200
committerTilman Sauerbeck <tilman@code-monkey.de>2006-07-08 19:55:53 +0200
commit39b2f7b2182aedb1ab45415efb4c263012ace512 (patch)
tree9e30c2c5bbe69bc6dda6064994fe4c3ebaf20131 /configure.ac
parent63f13e01ee6e7df1753f2113f4cff9538596be0a (diff)
Bug #3042: Use autoconf to get the correct name of a struct member.
This allows us to remove the kernel version ifdefs from the code, which are ugly and broken.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac19
1 files changed, 19 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 6d056fec4..c8bdf38e2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1061,6 +1061,25 @@ dnl has it in libc), or if libdl is needed to get it.
*)
;;
esac
+
+ # check whether struct kbd_repeat has the 'period' field.
+ # on kernels < 2.5.42 it's called 'rate' instead.
+ AC_TRY_COMPILE([
+#include <linux/kd.h>
+#ifdef __sparc__
+#include <asm/param.h>
+#include <asm/kbio.h>
+#endif
+],[
+int main () {
+ struct kbd_repeat k;
+ k.period = 0;
+ return 0;
+}],
+ [period_field="period"],
+ [period_field="rate"])
+ AC_DEFINE_UNQUOTED(LNX_KBD_PERIOD_NAME, [$period_field],
+ [Name of the period field in struct kbd_repeat])
;;
freebsd* | kfreebsd*-gnu)
XORG_OS="freebsd"