From 7555701defb2837843d588f50304f7f0f767356d Mon Sep 17 00:00:00 2001 From: Ozkan Sezer Date: Mon, 6 Nov 2023 23:25:58 +0300 Subject: [PATCH] autotools: fix linux joystick breakage after commit 221d6ea8a8ca Fixes https://github.com/libsdl-org/SDL/issues/8488 --- configure | 11 ++++++++--- configure.ac | 3 ++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/configure b/configure index 4bbeee8c4..304db817a 100755 --- a/configure +++ b/configure @@ -26399,6 +26399,14 @@ printf "%s\n" "#define SDL_VIDEO_VULKAN 1" >>confdefs.h CheckInputEvents() { + ac_fn_c_check_header_compile "$LINENO" "linux/input.h" "ac_cv_header_linux_input_h" "$ac_includes_default" +if test "x$ac_cv_header_linux_input_h" = xyes +then : + printf "%s\n" "#define HAVE_LINUX_INPUT_H 1" >>confdefs.h + +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Linux 2.4 unified input interface" >&5 printf %s "checking for Linux 2.4 unified input interface... " >&6; } use_input_events=no @@ -26428,9 +26436,6 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext printf "%s\n" "$use_input_events" >&6; } if test x$use_input_events = xyes; then -printf "%s\n" "#define HAVE_LINUX_INPUT_H 1" >>confdefs.h - - printf "%s\n" "#define SDL_INPUT_LINUXEV 1" >>confdefs.h SUMMARY_input="${SUMMARY_input} linuxev" diff --git a/configure.ac b/configure.ac index 861d2b528..e9ffc654e 100644 --- a/configure.ac +++ b/configure.ac @@ -2758,6 +2758,8 @@ 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_CHECK_HEADERS(linux/input.h) + AC_MSG_CHECKING(for Linux 2.4 unified input interface) use_input_events=no AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ @@ -2769,7 +2771,6 @@ dnl Check for Linux 2.4 unified input event interface support ]])], [use_input_events=yes],[]) AC_MSG_RESULT($use_input_events) if test x$use_input_events = xyes; then - AC_DEFINE(HAVE_LINUX_INPUT_H, 1, [ ]) AC_DEFINE(SDL_INPUT_LINUXEV, 1, [ ]) SUMMARY_input="${SUMMARY_input} linuxev" fi