From aac329fd2a93651e79c2618f45e85dfbd99cd025 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Mon, 10 Jun 2024 18:45:18 +0200 Subject: 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 Part-of: --- configure.ac | 2 +- src/evdev.c | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index f62a33e..0f9cb01 100644 --- a/configure.ac +++ b/configure.ac @@ -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) diff --git a/src/evdev.c b/src/evdev.c index 92fc330..b9555ef 100644 --- a/src/evdev.c +++ b/src/evdev.c @@ -39,7 +39,9 @@ #include #include +#ifdef HAVE_LIBUDEV #include +#endif #include #include #include @@ -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 } -- cgit v1.2.3