diff options
author | Enrico Weigelt, metux IT consult <info@metux.net> | 2024-06-10 18:45:18 +0200 |
---|---|---|
committer | Enrico Weigelt, metux IT consult <info@metux.net> | 2024-06-10 19:05:54 +0200 |
commit | aac329fd2a93651e79c2618f45e85dfbd99cd025 (patch) | |
tree | 895fe957f4cee7a37b911a7a3e74a818e08b9615 | |
parent | fbfb16edfe886f9ff2e6962c306645442f31d867 (diff) |
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>
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | src/evdev.c | 6 |
2 files changed, 7 insertions, 1 deletions
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 <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 } |