Index: SDL2-2.0.22/configure.ac
===================================================================
--- SDL2-2.0.22.orig/configure.ac
+++ SDL2-2.0.22/configure.ac
@@ -4175,7 +4175,7 @@ dnl BeOS support removed after SDL 2.0.1
             SOURCES="$SOURCES $srcdir/src/joystick/iphoneos/*.m"
             SOURCES="$SOURCES $srcdir/src/joystick/steam/*.c"
             have_joystick=yes
-        else
+        elif test x$enable_sensor == xyes; then
             # Need this code for accelerometer as joystick support
             SOURCES="$SOURCES $srcdir/src/joystick/iphoneos/*.m"
         fi
