summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2012-01-24 11:28:25 +0100
committerDaniel Vetter <daniel.vetter@ffwll.ch>2012-01-24 11:28:25 +0100
commitfa461203e6df7318d49d183366769e392e6decf0 (patch)
treeb1aa2bf0f3b0333e3b1e398ef1b896d0914020a5
parent7f7cafe7293570d56607b101cac7db617741713d (diff)
testdisplay: make udev optional
Hopefully this makes Solaris happy. Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r--configure.ac5
-rw-r--r--tests/testdisplay_hotplug.c17
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 <stdio.h>
#include <string.h>
#include <stdlib.h>
-#include <libudev.h>
#include "testdisplay.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+#if HAVE_UDEV
+#include <libudev.h>
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