testdisplay: make udev optional

Hopefully this makes Solaris happy.

Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
Daniel Vetter 2012-01-24 11:28:25 +01:00
parent 7f7cafe729
commit fa461203e6
2 changed files with 20 additions and 2 deletions

View File

@ -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)
# -----------------------------------------------------------------------------

View File

@ -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