[PATCH] allow the use of an alternative input.h
Rob Taylor
rob.taylor at codethink.co.uk
Wed Nov 7 12:09:49 PST 2007
This add a --with-linux-input-header configure switch to allow the use of a
local copy of the latest input.h without having it available in include search
paths.
---
configure.in | 8 ++++++++
hald/linux/addons/addon-acpi-buttons-toshiba.c | 7 ++++++-
hald/linux/addons/addon-input.c | 6 +++++-
hald/linux/device.c | 7 ++++++-
hald/linux/probing/probe-input.c | 7 ++++++-
hald/massif-hald.sh | 2 +-
tools/hal-setup-keymap.c | 6 +++++-
7 files changed, 37 insertions(+), 6 deletions(-)
diff --git a/configure.in b/configure.in
index fc5a691..90f10f3 100644
--- a/configure.in
+++ b/configure.in
@@ -919,6 +919,14 @@ fi
msg_sonypic=$have_sonypic
AM_CONDITIONAL(HAVE_SONYPIC, [test x$msg_sonypic = xyes], [Compiling Sony PIC])
+dnl use non-system input.h
+AC_ARG_WITH([linux-input-header],
+ AS_HELP_STRING([--with-linux-input-header=<path>],
+ [Use an given Linux input.h rather than that installed on the system (<linux/input.h>)]))
+if test "x$with_linux_input_header" != "x"; then
+ AC_DEFINE_UNQUOTED(HAL_LINUX_INPUT_HEADER_H, "$with_linux_input_header", [If set, the header to use instead of <linux/input.h>])
+fi
+
dnl
dnl SUBSETTING END
dnl
diff --git a/hald/linux/addons/addon-acpi-buttons-toshiba.c b/hald/linux/addons/addon-acpi-buttons-toshiba.c
index f336992..f0dc09d 100644
--- a/hald/linux/addons/addon-acpi-buttons-toshiba.c
+++ b/hald/linux/addons/addon-acpi-buttons-toshiba.c
@@ -29,7 +29,12 @@
# include <config.h>
#endif
-#include <linux/input.h>
+#ifdef HAL_LINUX_INPUT_HEADER_H
+ #include HAL_LINUX_INPUT_HEADER_H
+else
+ #include <linux/input.h>
+#endif
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/hald/linux/addons/addon-input.c b/hald/linux/addons/addon-input.c
index 2ba923b..11d9ebc 100644
--- a/hald/linux/addons/addon-input.c
+++ b/hald/linux/addons/addon-input.c
@@ -36,7 +36,11 @@
#include <sys/stat.h>
#include <fcntl.h>
-#include <linux/input.h>
+#ifdef HAL_LINUX_INPUT_HEADER_H
+ #include HAL_LINUX_INPUT_HEADER_H
+#else
+ #include <linux/input.h>
+#endif
#include <glib/gmain.h>
#include <glib/gprintf.h>
#include <dbus/dbus-glib-lowlevel.h>
diff --git a/hald/linux/device.c b/hald/linux/device.c
index a03be12..7111629 100644
--- a/hald/linux/device.c
+++ b/hald/linux/device.c
@@ -38,7 +38,12 @@
#include <unistd.h>
#include <asm/byteorder.h>
#include <fcntl.h>
-#include <linux/input.h>
+
+#ifdef HAL_LINUX_INPUT_HEADER_H
+ #include HAL_LINUX_INPUT_HEADER_H
+#else
+ #include <linux/input.h>
+#endif
#include <dbus/dbus.h>
#include <dbus/dbus-glib.h>
diff --git a/hald/linux/probing/probe-input.c b/hald/linux/probing/probe-input.c
index 6a107fb..6ace0fa 100644
--- a/hald/linux/probing/probe-input.c
+++ b/hald/linux/probing/probe-input.c
@@ -29,13 +29,18 @@
#include <errno.h>
#include <fcntl.h>
-#include <linux/input.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#ifdef HAL_LINUX_INPUT_HEADER_H
+ #include HAL_LINUX_INPUT_HEADER_H
+#else
+ #include <linux/input.h>
+#endif
+
#include "libhal/libhal.h"
#include "../../logger.h"
diff --git a/hald/massif-hald.sh b/hald/massif-hald.sh
index f53396c..9292a4e 100755
--- a/hald/massif-hald.sh
+++ b/hald/massif-hald.sh
@@ -19,7 +19,7 @@ rm massif.*
valgrind --tool=massif --format=html --depth=10 \
--alloc-fn=g_malloc --alloc-fn=g_realloc \
--alloc-fn=g_try_malloc --alloc-fn=g_malloc0 --alloc-fn=g_mem_chunk_alloc \
- ./hald --daemon=no --verbose=yes --retain-privileges --exit-after-probing
+ ./hald --daemon=no --verbose=yes --retain-privileges #--exit-after-probing
#massif uses the pid file, which is hard to process.
mv massif.*.html massif.html
diff --git a/tools/hal-setup-keymap.c b/tools/hal-setup-keymap.c
index 4ae82f5..24c51f9 100644
--- a/tools/hal-setup-keymap.c
+++ b/tools/hal-setup-keymap.c
@@ -31,7 +31,11 @@
#include <unistd.h>
#include <sys/ioctl.h>
-#include <linux/input.h>
+#ifdef HAL_LINUX_INPUT_HEADER_H
+ #include HAL_LINUX_INPUT_HEADER_H
+#else
+ #include <linux/input.h>
+#endif
#include "libhal/libhal.h"
#include "hal-setup-keymap-hash-name.h"
--
1.5.3.GIT
--------------080406060005010608000001--
More information about the hal
mailing list