mirror of
https://github.com/X11Libre/xf86-input-evdev.git
synced 2026-03-26 02:38:35 +00:00
fix FTBS on non-udev target platforms (eg. FreeBSD)
On platforms that don't have libudev at all (eg. FreeBSD), the build breaks. The only consumer, EvdevDeviceIsVirtual(), can live well with just bailing out directly if libudev isn't present. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-input-evdev/-/merge_requests/6>
This commit is contained in:
@@ -45,7 +45,7 @@ XORG_DEFAULT_OPTIONS
|
||||
|
||||
# Obtain compiler/linker options from server and required extensions
|
||||
PKG_CHECK_MODULES(XORG, [xorg-server >= 1.18] xproto [inputproto >= 2.1.99.3])
|
||||
PKG_CHECK_MODULES(UDEV, libudev)
|
||||
PKG_CHECK_MODULES(UDEV, libudev, [AC_DEFINE(HAVE_LIBUDEV, 1,[libudev support])])
|
||||
|
||||
PKG_CHECK_MODULES(LIBEVDEV, [libevdev >= 0.4])
|
||||
PKG_CHECK_MODULES(MTDEV, mtdev)
|
||||
|
||||
@@ -39,7 +39,9 @@
|
||||
#include <X11/extensions/XI.h>
|
||||
|
||||
#include <sys/stat.h>
|
||||
#ifdef HAVE_LIBUDEV
|
||||
#include <libudev.h>
|
||||
#endif
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
@@ -225,6 +227,7 @@ EvdevIsDuplicate(InputInfoPtr pInfo)
|
||||
static BOOL
|
||||
EvdevDeviceIsVirtual(const char* devicenode)
|
||||
{
|
||||
#ifdef HAVE_LIBUDEV
|
||||
struct udev *udev = NULL;
|
||||
struct udev_device *device = NULL;
|
||||
struct stat st;
|
||||
@@ -255,6 +258,9 @@ out:
|
||||
udev_device_unref(device);
|
||||
udev_unref(udev);
|
||||
return rc;
|
||||
#else
|
||||
return FALSE;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user