Browse Source

autotools: fix linux joystick breakage after commit 221d6ea8a8ca

Fixes https://github.com/libsdl-org/SDL/issues/8488
Ozkan Sezer 1 năm trước cách đây
mục cha
commit
7555701def
2 tập tin đã thay đổi với 10 bổ sung4 xóa
  1. 8 3
      configure
  2. 2 1
      configure.ac

+ 8 - 3
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"

+ 2 - 1
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