joystick: Fix up Linux joystick code to (mostly) compile on FreeBSD.

This commit is contained in:
Ryan C. Gordon
2020-11-23 22:14:22 -05:00
parent 179bd66581
commit 5c9577476f
3 changed files with 62 additions and 26 deletions

View File

@@ -2603,8 +2603,22 @@ dnl See if we can use the new unified event interface in Linux 2.4
CheckInputEvents()
{
dnl Check for Linux 2.4 unified input event interface support
AC_MSG_CHECKING(for Linux 2.4 unified input interface)
use_input_events=no
AC_MSG_CHECKING(for Linux 2.4 unified input interface)
use_input_events=no
dnl FreeBSD puts this in /usr/include/dev/evdev/input.h ...
AC_TRY_COMPILE([
#include <dev/evdev/input.h>
],[
#ifndef EVIOCGNAME
#error EVIOCGNAME() ioctl not available
#endif
],[
use_input_events=yes
])
dnl And Linux of course puts it in linux/input.h ...
if test x$use_input_events = xno; then
AC_TRY_COMPILE([
#include <linux/input.h>
],[
@@ -2614,11 +2628,13 @@ CheckInputEvents()
],[
use_input_events=yes
])
AC_MSG_RESULT($use_input_events)
if test x$use_input_events = xyes; then
AC_DEFINE(SDL_INPUT_LINUXEV, 1, [ ])
SUMMARY_input="${SUMMARY_input} linuxev"
fi
fi
AC_MSG_RESULT($use_input_events)
if test x$use_input_events = xyes; then
AC_DEFINE(SDL_INPUT_LINUXEV, 1, [ ])
SUMMARY_input="${SUMMARY_input} linuxev"
fi
}
dnl See if we can use the kernel kd.h header