From fa461203e6df7318d49d183366769e392e6decf0 Mon Sep 17 00:00:00 2001 From: Daniel Vetter Date: Tue, 24 Jan 2012 11:28:25 +0100 Subject: testdisplay: make udev optional Hopefully this makes Solaris happy. Signed-Off-by: Daniel Vetter --- configure.ac | 5 ++++- tests/testdisplay_hotplug.c | 17 ++++++++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 19744e08..edae77fa 100644 --- a/configure.ac +++ b/configure.ac @@ -57,7 +57,10 @@ PKG_CHECK_MODULES(PCIACCESS, [pciaccess >= 0.10]) # for testdisplay PKG_CHECK_MODULES(CAIRO, cairo) -PKG_CHECK_MODULES(LIBUDEV, libudev) +PKG_CHECK_MODULES(LIBUDEV, [libudev], [udev=yes], [udev=no]) +if test x"$udev" = xyes; then + AC_DEFINE(HAVE_UDEV,1,[Enable udev-based monitor hotplug detection]) +fi PKG_CHECK_MODULES(GLIB, glib-2.0) # ----------------------------------------------------------------------------- diff --git a/tests/testdisplay_hotplug.c b/tests/testdisplay_hotplug.c index 504e7b08..3f80dc73 100644 --- a/tests/testdisplay_hotplug.c +++ b/tests/testdisplay_hotplug.c @@ -24,10 +24,14 @@ #include #include #include -#include #include "testdisplay.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#if HAVE_UDEV +#include static struct udev_monitor *uevent_monitor; static struct udev *udev; static GIOChannel *udevchannel; @@ -119,3 +123,14 @@ void testdisplay_cleanup_hotplug(void) if (udev) udev_unref(udev); } +#else +gboolean testdisplay_setup_hotplug(void) +{ + fprintf(stderr, "no hotplug support on this platform\n"); + return TRUE; +} + +void testdisplay_cleanup_hotplug(void) +{ +} +#endif -- cgit v1.2.3