[PATCH input-aiptek 2/7] config: replace hard-coded -DLINUX_INPUT with proper AC_CHECK_HEADERS

Gaetan Nadon memsize at videotron.ca
Thu Apr 15 09:51:05 PDT 2010


Not all platforms have Linux kernel input subsystem.
Automake AC_CHECK_HEADERS is designed for that purpose.

Signed-off-by: Gaetan Nadon <memsize at videotron.ca>
---
 configure.ac     |    2 +-
 src/Makefile.am  |    2 +-
 src/xf86Aiptek.c |    6 +-----
 src/xf86Aiptek.h |    5 ++++-
 4 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/configure.ac b/configure.ac
index 6395548..e03b13c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -64,7 +64,7 @@ PKG_CHECK_MODULES(XORG, [xorg-server >= 1.0.99.901] xproto $REQUIRED_MODULES)
 # Checks for libraries.
 
 # Checks for header files.
-AC_HEADER_STDC
+AC_CHECK_HEADERS([linux/input.h])
 
 DRIVER_NAME=aiptek
 AC_SUBST([DRIVER_NAME])
diff --git a/src/Makefile.am b/src/Makefile.am
index abae1f4..0b8f60a 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -25,7 +25,7 @@
 # _ladir passes a dummy rpath to libtool so the thing will actually link
 # TODO: -nostdlib/-Bstatic/-lgcc platform magic, not installing the .a, etc.
 
-AM_CFLAGS = $(XORG_CFLAGS) $(CWARNFLAGS) -DLINUX_INPUT
+AM_CFLAGS = $(XORG_CFLAGS) $(CWARNFLAGS)
 
 @DRIVER_NAME at _drv_la_LTLIBRARIES = @DRIVER_NAME at _drv.la
 @DRIVER_NAME at _drv_la_LDFLAGS = -module -avoid-version
diff --git a/src/xf86Aiptek.c b/src/xf86Aiptek.c
index bd78121..c282bf3 100644
--- a/src/xf86Aiptek.c
+++ b/src/xf86Aiptek.c
@@ -117,10 +117,6 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
 #include "xf86Aiptek.h"
 #include <errno.h>
 #include <string.h>
@@ -2264,7 +2260,7 @@ xf86AiptekInit(InputDriverPtr    drv,
     xf86Msg(X_CONFIG, "%s is in %s mode\n", local->name,
         (device->flags & ABSOLUTE_FLAG) ? "absolute" : "relative");
 
-#ifdef LINUX_INPUT
+#ifdef HAVE_LINUX_INPUT_H
     /* The define-name is accurate; the XFree86 keyword is not. We are
      * reading from a Linux kernel "Input" device. The Input device
      * layer generally supports mice, joysticks, and keyboards. As
diff --git a/src/xf86Aiptek.h b/src/xf86Aiptek.h
index 810185b..8a8b5cc 100644
--- a/src/xf86Aiptek.h
+++ b/src/xf86Aiptek.h
@@ -40,8 +40,11 @@
 #ifndef _AIPTEK_H_
 #define _AIPTEK_H_
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
 
-#ifdef LINUX_INPUT
+#ifdef HAVE_LINUX_INPUT_H
 #   include <asm/types.h>
 #   include <linux/input.h>
 #   ifndef EV_MSC
-- 
1.6.0.4



More information about the xorg-devel mailing list