Re: [PATCH] udev: make use of udev_enumerate_add_match_tag() only when it is available

2011-10-03 Thread Keith Packard
On Tue, 27 Sep 2011 18:04:06 +0100, Dave Airlie airl...@gmail.com wrote:
 From: Lennart Poettering lenn...@poettering.net
 
 udev_enumerate_add_match_tag() and udev_monitor_filter_add_match_tag()
 are mostly optimizations, hence simply skip these calls if they are not
 available in the installed version of libudev.

Merged.
   77743f8..fad04dd  master - master

-- 
keith.pack...@intel.com


pgpRZzZ8qvCuq.pgp
Description: PGP signature
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

[PATCH] udev: make use of udev_enumerate_add_match_tag() only when it is available

2011-09-27 Thread Dave Airlie
From: Lennart Poettering lenn...@poettering.net

udev_enumerate_add_match_tag() and udev_monitor_filter_add_match_tag()
are mostly optimizations, hence simply skip these calls if they are not
available in the installed version of libudev.

This should fix the build on older versions of udev.

[airlied: fixes tinderbox failures on RHEL6]

Signed-off-by: Lennart Poettering lenn...@poettering.net
Reviewed-by: Dave Airlie airl...@redhat.com
Tested-by: Dave Airlie airl...@redhat.com
---
 config/udev.c   |4 
 configure.ac|9 +
 include/dix-config.h.in |6 ++
 3 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/config/udev.c b/config/udev.c
index 1ba0d50..e2b3726 100644
--- a/config/udev.c
+++ b/config/udev.c
@@ -285,8 +285,10 @@ config_udev_init(void)
 udev_monitor_filter_add_match_subsystem_devtype(udev_monitor, input, 
NULL);
 udev_monitor_filter_add_match_subsystem_devtype(udev_monitor, tty, 
NULL); /* For Wacom serial devices */
 
+#ifdef HAVE_UDEV_MONITOR_FILTER_ADD_MATCH_TAG
 if (SeatId  strcmp(SeatId, seat0))
 udev_monitor_filter_add_match_tag(udev_monitor, SeatId);
+#endif
 
 if (udev_monitor_enable_receiving(udev_monitor)) {
 ErrorF(config/udev: failed to bind the udev monitor\n);
@@ -300,8 +302,10 @@ config_udev_init(void)
 udev_enumerate_add_match_subsystem(enumerate, input);
 udev_enumerate_add_match_subsystem(enumerate, tty);
 
+#ifdef HAVE_UDEV_ENUMERATE_ADD_MATCH_TAG
 if (SeatId  strcmp(SeatId, seat0))
 udev_enumerate_add_match_tag(enumerate, SeatId);
+#endif
 
 udev_enumerate_scan_devices(enumerate);
 devices = udev_enumerate_get_list_entry(enumerate);
diff --git a/configure.ac b/configure.ac
index b0d2643..30716fb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -822,6 +822,15 @@ if test x$CONFIG_UDEV = xyes; then
AC_MSG_ERROR([udev configuration API requested, but libudev is 
not installed])
fi
AC_DEFINE(CONFIG_UDEV, 1, [Use libudev for input hotplug])
+
+   SAVE_LIBS=$LIBS
+   SAVE_CFLAGS=$CFLAGS
+   CFLAGS=$UDEV_CFLAGS
+   LIBS=$UDEV_LIBS
+   AC_CHECK_FUNCS([udev_monitor_filter_add_match_tag])
+   AC_CHECK_FUNCS([udev_enumerate_add_match_tag])
+   LIBS=$SAVE_LIBS
+   CFLAGS=$SAVE_CFLAGS
 fi
 
 dnl HAVE_DBUS is true if we actually have the D-Bus library, whereas
diff --git a/include/dix-config.h.in b/include/dix-config.h.in
index 5facb11..2dcaf6b 100644
--- a/include/dix-config.h.in
+++ b/include/dix-config.h.in
@@ -402,6 +402,12 @@
 /* Use libudev for input hotplug */
 #undef CONFIG_UDEV
 
+/* Use udev_monitor_filter_add_match_tag() */
+#undef HAVE_UDEV_MONITOR_FILTER_ADD_MATCH_TAG
+
+/* Use udev_enumerate_add_match_tag() */
+#undef HAVE_UDEV_ENUMERATE_ADD_MATCH_TAG
+
 /* Use D-Bus for input hotplug */
 #undef CONFIG_NEED_DBUS
 
-- 
1.7.6.4

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


Re: [PATCH] udev: make use of udev_enumerate_add_match_tag() only when it is available

2011-09-27 Thread Peter Hutterer
On Tue, Sep 27, 2011 at 06:04:06PM +0100, Dave Airlie wrote:
 From: Lennart Poettering lenn...@poettering.net
 
 udev_enumerate_add_match_tag() and udev_monitor_filter_add_match_tag()
 are mostly optimizations, hence simply skip these calls if they are not
 available in the installed version of libudev.
 
 This should fix the build on older versions of udev.
 
 [airlied: fixes tinderbox failures on RHEL6]
 
 Signed-off-by: Lennart Poettering lenn...@poettering.net
 Reviewed-by: Dave Airlie airl...@redhat.com
 Tested-by: Dave Airlie airl...@redhat.com

Reviewed-by: Peter Hutterer peter.hutte...@who-t.net

Keith, please merge this one directly, I won't take it in my tree (which is
currently in tatters).

Cheers,
  Peter

 ---
  config/udev.c   |4 
  configure.ac|9 +
  include/dix-config.h.in |6 ++
  3 files changed, 19 insertions(+), 0 deletions(-)
 
 diff --git a/config/udev.c b/config/udev.c
 index 1ba0d50..e2b3726 100644
 --- a/config/udev.c
 +++ b/config/udev.c
 @@ -285,8 +285,10 @@ config_udev_init(void)
  udev_monitor_filter_add_match_subsystem_devtype(udev_monitor, input, 
 NULL);
  udev_monitor_filter_add_match_subsystem_devtype(udev_monitor, tty, 
 NULL); /* For Wacom serial devices */
  
 +#ifdef HAVE_UDEV_MONITOR_FILTER_ADD_MATCH_TAG
  if (SeatId  strcmp(SeatId, seat0))
  udev_monitor_filter_add_match_tag(udev_monitor, SeatId);
 +#endif
  
  if (udev_monitor_enable_receiving(udev_monitor)) {
  ErrorF(config/udev: failed to bind the udev monitor\n);
 @@ -300,8 +302,10 @@ config_udev_init(void)
  udev_enumerate_add_match_subsystem(enumerate, input);
  udev_enumerate_add_match_subsystem(enumerate, tty);
  
 +#ifdef HAVE_UDEV_ENUMERATE_ADD_MATCH_TAG
  if (SeatId  strcmp(SeatId, seat0))
  udev_enumerate_add_match_tag(enumerate, SeatId);
 +#endif
  
  udev_enumerate_scan_devices(enumerate);
  devices = udev_enumerate_get_list_entry(enumerate);
 diff --git a/configure.ac b/configure.ac
 index b0d2643..30716fb 100644
 --- a/configure.ac
 +++ b/configure.ac
 @@ -822,6 +822,15 @@ if test x$CONFIG_UDEV = xyes; then
   AC_MSG_ERROR([udev configuration API requested, but libudev is 
 not installed])
   fi
   AC_DEFINE(CONFIG_UDEV, 1, [Use libudev for input hotplug])
 +
 + SAVE_LIBS=$LIBS
 + SAVE_CFLAGS=$CFLAGS
 + CFLAGS=$UDEV_CFLAGS
 + LIBS=$UDEV_LIBS
 + AC_CHECK_FUNCS([udev_monitor_filter_add_match_tag])
 + AC_CHECK_FUNCS([udev_enumerate_add_match_tag])
 + LIBS=$SAVE_LIBS
 + CFLAGS=$SAVE_CFLAGS
  fi
  
  dnl HAVE_DBUS is true if we actually have the D-Bus library, whereas
 diff --git a/include/dix-config.h.in b/include/dix-config.h.in
 index 5facb11..2dcaf6b 100644
 --- a/include/dix-config.h.in
 +++ b/include/dix-config.h.in
 @@ -402,6 +402,12 @@
  /* Use libudev for input hotplug */
  #undef CONFIG_UDEV
  
 +/* Use udev_monitor_filter_add_match_tag() */
 +#undef HAVE_UDEV_MONITOR_FILTER_ADD_MATCH_TAG
 +
 +/* Use udev_enumerate_add_match_tag() */
 +#undef HAVE_UDEV_ENUMERATE_ADD_MATCH_TAG
 +
  /* Use D-Bus for input hotplug */
  #undef CONFIG_NEED_DBUS
  
 -- 
 1.7.6.4
 
 ___
 xorg-devel@lists.x.org: X.Org development
 Archives: http://lists.x.org/archives/xorg-devel
 Info: http://lists.x.org/mailman/listinfo/xorg-devel
 
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


Re: [PATCH] udev: make use of udev_enumerate_add_match_tag() only when it is available

2011-09-27 Thread Keith Packard
On Wed, 28 Sep 2011 08:29:18 +1000, Peter Hutterer peter.hutte...@who-t.net 
wrote:

 Keith, please merge this one directly, I won't take it in my tree (which is
 currently in tatters).

Will do. Thanks!
-- 
keith.pack...@intel.com


pgppYWDp47XGQ.pgp
Description: PGP signature
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel