Fixed building without linux/input.h

https://github.com/libsdl-org/SDL/issues/6169
This commit is contained in:
Sam Lantinga
2022-11-11 10:24:17 -08:00
parent b7e65a81f1
commit 9f8b68a278
12 changed files with 39 additions and 19 deletions
+8 -6
View File
@@ -329,7 +329,7 @@ if test x$enable_libc = xyes; then
dnl Check for C library headers
dnl AC_CHECK_INCLUDES_DEFAULT is an autoconf-2.7x thing where AC_HEADER_STDC is deprecated.
m4_ifdef([AC_CHECK_INCLUDES_DEFAULT], [AC_CHECK_INCLUDES_DEFAULT], [AC_HEADER_STDC])
AC_CHECK_HEADERS(sys/types.h stdio.h stdlib.h stddef.h stdarg.h malloc.h memory.h string.h strings.h wchar.h inttypes.h stdint.h limits.h ctype.h math.h float.h iconv.h signal.h)
AC_CHECK_HEADERS(sys/types.h stdio.h stdlib.h stddef.h stdarg.h malloc.h memory.h string.h strings.h wchar.h inttypes.h stdint.h limits.h ctype.h math.h float.h iconv.h signal.h linux/input.h)
dnl Check for typedefs, structures, etc.
AC_TYPE_SIZE_T
@@ -3900,13 +3900,15 @@ case "$host" in
if test x$enable_joystick = xyes; then
case $ARCH in
linux)
AC_DEFINE(SDL_JOYSTICK_LINUX, 1, [ ])
SOURCES="$SOURCES $srcdir/src/joystick/linux/*.c"
SOURCES="$SOURCES $srcdir/src/joystick/steam/*.c"
have_joystick=yes
if test "x$ac_cv_header_linux_input_h" = xyes; then
AC_DEFINE(SDL_JOYSTICK_LINUX, 1, [ ])
SOURCES="$SOURCES $srcdir/src/joystick/linux/*.c"
SOURCES="$SOURCES $srcdir/src/joystick/steam/*.c"
have_joystick=yes
fi
;;
freebsd)
if test x$use_input_events = xyes; then
if test x$use_input_events = xyes -a x$ac_cv_header_linux_input_h = xyes; then
AC_DEFINE(SDL_JOYSTICK_LINUX, 1, [ ])
SOURCES="$SOURCES $srcdir/src/joystick/linux/*.c"
SOURCES="$SOURCES $srcdir/src/joystick/steam/*.c"