From b501e243449f18fd76bf627d2a08296ac6af40bd Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Tue, 23 Dec 2025 22:10:59 +0100 Subject: [PATCH] fix Dragonfly BSD build On Dragonfly the USB headers are in different locations, view #define's differ in naming. Signed-off-by: Enrico Weigelt, metux IT consult --- configure.ac | 19 ++++++++++--------- src/backend_bsd.c | 13 +++++++++++++ 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/configure.ac b/configure.ac index b4d7a4a..7809769 100644 --- a/configure.ac +++ b/configure.ac @@ -69,15 +69,16 @@ if test "x$linux_backend" = xyes; then AC_DEFINE(LINUX_BACKEND, 1, [Compile Linux joystick backend]) fi -bsd_backend=yes -AC_CHECK_HEADERS([dev/usb/usb.h]) -AC_CHECK_HEADERS([usbhid.h dev/usb/usbhid.h],, [bsd_backend=no], -[[#if HAVE_DEV_USB_USB_H -#include -#endif -]]) -AC_CHECK_HEADERS([dev/hid/hid.h]) -AC_CHECK_LIB([usbhid],[hid_get_item],, [bsd_backend=no]) +bsd_backend=no +case $host_os in +*dragonfly*) + AC_CHECK_HEADERS([bus/u4b/usb.h bus/u4b/usbhid.h], [bsd_backend=yes]) + ;; +*) + AC_CHECK_HEADERS([dev/usb/usbhid.h], [bsd_backend=yes]) + ;; +esac + AM_CONDITIONAL(BSD_BACKEND, [test "x$bsd_backend" = xyes]) if test "x$bsd_backend" = xyes; then AC_CHECK_HEADERS([dev/usb/usb_ioctl.h]) diff --git a/src/backend_bsd.c b/src/backend_bsd.c index 6225368..ef50f0a 100644 --- a/src/backend_bsd.c +++ b/src/backend_bsd.c @@ -40,8 +40,21 @@ #include #include + +#ifdef __DragonFly__ + +#include +#include + +#define USB_GET_REPORT_ID UR_GET_REPORT + +#else /* __DragonFly__ */ + #include #include + +#endif /* __DragonFly__ */ + #ifdef HAVE_DEV_HID_HID_H #include #endif