Răsfoiți Sursa

Update to SDL2.0.10

Areloch 6 ani în urmă
părinte
comite
c932bda8dd
100 a modificat fișierele cu 7629 adăugiri și 802 ștergeri
  1. 47 4
      Engine/lib/sdl/Android.mk
  2. 158 45
      Engine/lib/sdl/CMakeLists.txt
  3. 1 1
      Engine/lib/sdl/COPYING.txt
  4. 14 5
      Engine/lib/sdl/Makefile.in
  5. 2 0
      Engine/lib/sdl/Makefile.minimal
  6. 137 0
      Engine/lib/sdl/Makefile.os2
  7. 32 9
      Engine/lib/sdl/Makefile.pandora
  8. 2 0
      Engine/lib/sdl/Makefile.psp
  9. 27 8
      Engine/lib/sdl/Makefile.wiz
  10. 3 2
      Engine/lib/sdl/SDL2.spec
  11. 2 1
      Engine/lib/sdl/SDL2.spec.in
  12. 79 0
      Engine/lib/sdl/acinclude/ax_gcc_x86_cpuid.m4
  13. 133 0
      Engine/lib/sdl/acinclude/pkg_config.m4
  14. 1 1
      Engine/lib/sdl/build-scripts/androidbuildlibs.sh
  15. 371 167
      Engine/lib/sdl/build-scripts/install-sh
  16. 124 61
      Engine/lib/sdl/build-scripts/mkinstalldirs
  17. 42 0
      Engine/lib/sdl/build-scripts/os2-buildbot.sh
  18. 1 1
      Engine/lib/sdl/build-scripts/raspberrypi-buildbot.sh
  19. 1 1
      Engine/lib/sdl/build-scripts/winrtbuild.ps1
  20. 50 79
      Engine/lib/sdl/cmake/sdlchecks.cmake
  21. 584 202
      Engine/lib/sdl/configure
  22. 4225 0
      Engine/lib/sdl/configure.ac
  23. 12 0
      Engine/lib/sdl/debian/changelog
  24. 6 6
      Engine/lib/sdl/debian/copyright
  25. 16 3
      Engine/lib/sdl/debian/rules
  26. 4 2
      Engine/lib/sdl/include/SDL.h
  27. 1 1
      Engine/lib/sdl/include/SDL_assert.h
  28. 20 2
      Engine/lib/sdl/include/SDL_atomic.h
  29. 49 15
      Engine/lib/sdl/include/SDL_audio.h
  30. 10 1
      Engine/lib/sdl/include/SDL_bits.h
  31. 7 7
      Engine/lib/sdl/include/SDL_blendmode.h
  32. 1 1
      Engine/lib/sdl/include/SDL_clipboard.h
  33. 4 2
      Engine/lib/sdl/include/SDL_config.h
  34. 15 4
      Engine/lib/sdl/include/SDL_config.h.cmake
  35. 13 4
      Engine/lib/sdl/include/SDL_config.h.in
  36. 8 1
      Engine/lib/sdl/include/SDL_config_android.h
  37. 11 1
      Engine/lib/sdl/include/SDL_config_iphoneos.h
  38. 8 2
      Engine/lib/sdl/include/SDL_config_macosx.h
  39. 4 1
      Engine/lib/sdl/include/SDL_config_minimal.h
  40. 170 0
      Engine/lib/sdl/include/SDL_config_os2.h
  41. 4 1
      Engine/lib/sdl/include/SDL_config_pandora.h
  42. 12 7
      Engine/lib/sdl/include/SDL_config_psp.h
  43. 10 1
      Engine/lib/sdl/include/SDL_config_windows.h
  44. 11 1
      Engine/lib/sdl/include/SDL_config_winrt.h
  45. 5 1
      Engine/lib/sdl/include/SDL_config_wiz.h
  46. 1 1
      Engine/lib/sdl/include/SDL_copying.h
  47. 95 6
      Engine/lib/sdl/include/SDL_cpuinfo.h
  48. 1 1
      Engine/lib/sdl/include/SDL_egl.h
  49. 1 1
      Engine/lib/sdl/include/SDL_endian.h
  50. 1 1
      Engine/lib/sdl/include/SDL_error.h
  51. 38 1
      Engine/lib/sdl/include/SDL_events.h
  52. 1 1
      Engine/lib/sdl/include/SDL_filesystem.h
  53. 29 1
      Engine/lib/sdl/include/SDL_gamecontroller.h
  54. 1 1
      Engine/lib/sdl/include/SDL_gesture.h
  55. 15 4
      Engine/lib/sdl/include/SDL_haptic.h
  56. 252 8
      Engine/lib/sdl/include/SDL_hints.h
  57. 31 5
      Engine/lib/sdl/include/SDL_joystick.h
  58. 1 1
      Engine/lib/sdl/include/SDL_keyboard.h
  59. 1 1
      Engine/lib/sdl/include/SDL_keycode.h
  60. 1 1
      Engine/lib/sdl/include/SDL_loadso.h
  61. 1 1
      Engine/lib/sdl/include/SDL_log.h
  62. 28 16
      Engine/lib/sdl/include/SDL_main.h
  63. 1 1
      Engine/lib/sdl/include/SDL_messagebox.h
  64. 1 1
      Engine/lib/sdl/include/SDL_mouse.h
  65. 1 1
      Engine/lib/sdl/include/SDL_mutex.h
  66. 1 1
      Engine/lib/sdl/include/SDL_name.h
  67. 1 1
      Engine/lib/sdl/include/SDL_opengl.h
  68. 1 1
      Engine/lib/sdl/include/SDL_opengles.h
  69. 1 1
      Engine/lib/sdl/include/SDL_opengles2.h
  70. 3 3
      Engine/lib/sdl/include/SDL_pixels.h
  71. 1 1
      Engine/lib/sdl/include/SDL_platform.h
  72. 1 1
      Engine/lib/sdl/include/SDL_power.h
  73. 1 1
      Engine/lib/sdl/include/SDL_quit.h
  74. 29 3
      Engine/lib/sdl/include/SDL_rect.h
  75. 168 1
      Engine/lib/sdl/include/SDL_render.h
  76. 2 2
      Engine/lib/sdl/include/SDL_revision.h
  77. 50 13
      Engine/lib/sdl/include/SDL_rwops.h
  78. 2 2
      Engine/lib/sdl/include/SDL_scancode.h
  79. 251 0
      Engine/lib/sdl/include/SDL_sensor.h
  80. 1 1
      Engine/lib/sdl/include/SDL_shape.h
  81. 26 24
      Engine/lib/sdl/include/SDL_stdinc.h
  82. 9 1
      Engine/lib/sdl/include/SDL_surface.h
  83. 33 1
      Engine/lib/sdl/include/SDL_system.h
  84. 17 14
      Engine/lib/sdl/include/SDL_syswm.h
  85. 1 1
      Engine/lib/sdl/include/SDL_test.h
  86. 1 1
      Engine/lib/sdl/include/SDL_test_assert.h
  87. 22 5
      Engine/lib/sdl/include/SDL_test_common.h
  88. 1 1
      Engine/lib/sdl/include/SDL_test_compare.h
  89. 1 1
      Engine/lib/sdl/include/SDL_test_crc32.h
  90. 1 1
      Engine/lib/sdl/include/SDL_test_font.h
  91. 1 1
      Engine/lib/sdl/include/SDL_test_fuzzer.h
  92. 1 1
      Engine/lib/sdl/include/SDL_test_harness.h
  93. 1 1
      Engine/lib/sdl/include/SDL_test_images.h
  94. 1 1
      Engine/lib/sdl/include/SDL_test_log.h
  95. 1 1
      Engine/lib/sdl/include/SDL_test_md5.h
  96. 3 3
      Engine/lib/sdl/include/SDL_test_memory.h
  97. 1 1
      Engine/lib/sdl/include/SDL_test_random.h
  98. 39 4
      Engine/lib/sdl/include/SDL_thread.h
  99. 1 1
      Engine/lib/sdl/include/SDL_timer.h
  100. 17 1
      Engine/lib/sdl/include/SDL_touch.h

+ 47 - 4
Engine/lib/sdl/Android.mk

@@ -20,6 +20,7 @@ LOCAL_SRC_FILES := \
 	$(wildcard $(LOCAL_PATH)/src/audio/*.c) \
 	$(wildcard $(LOCAL_PATH)/src/audio/android/*.c) \
 	$(wildcard $(LOCAL_PATH)/src/audio/dummy/*.c) \
+	$(wildcard $(LOCAL_PATH)/src/audio/openslES/*.c) \
 	$(LOCAL_PATH)/src/atomic/SDL_atomic.c.arm \
 	$(LOCAL_PATH)/src/atomic/SDL_spinlock.c.arm \
 	$(wildcard $(LOCAL_PATH)/src/core/android/*.c) \
@@ -31,11 +32,13 @@ LOCAL_SRC_FILES := \
 	$(wildcard $(LOCAL_PATH)/src/haptic/android/*.c) \
 	$(wildcard $(LOCAL_PATH)/src/joystick/*.c) \
 	$(wildcard $(LOCAL_PATH)/src/joystick/android/*.c) \
-	$(LOCAL_PATH)/src/joystick/steam/SDL_steamcontroller.c \
+	$(wildcard $(LOCAL_PATH)/src/joystick/hidapi/*.c) \
 	$(wildcard $(LOCAL_PATH)/src/loadso/dlopen/*.c) \
 	$(wildcard $(LOCAL_PATH)/src/power/*.c) \
 	$(wildcard $(LOCAL_PATH)/src/power/android/*.c) \
 	$(wildcard $(LOCAL_PATH)/src/filesystem/android/*.c) \
+	$(wildcard $(LOCAL_PATH)/src/sensor/*.c) \
+	$(wildcard $(LOCAL_PATH)/src/sensor/android/*.c) \
 	$(wildcard $(LOCAL_PATH)/src/render/*.c) \
 	$(wildcard $(LOCAL_PATH)/src/render/*/*.c) \
 	$(wildcard $(LOCAL_PATH)/src/stdlib/*.c) \
@@ -48,10 +51,32 @@ LOCAL_SRC_FILES := \
 	$(wildcard $(LOCAL_PATH)/src/video/yuv2rgb/*.c) \
 	$(wildcard $(LOCAL_PATH)/src/test/*.c))
 
-LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES
-LOCAL_LDLIBS := -ldl -lGLESv1_CM -lGLESv2 -llog -landroid
+LOCAL_SHARED_LIBRARIES := hidapi
 
-cmd-strip := 
+LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES
+LOCAL_CFLAGS += \
+	-Wall -Wextra \
+	-Wdocumentation \
+	-Wdocumentation-unknown-command \
+	-Wmissing-prototypes \
+	-Wunreachable-code-break \
+	-Wunneeded-internal-declaration \
+	-Wmissing-variable-declarations \
+	-Wfloat-conversion \
+	-Wshorten-64-to-32 \
+	-Wunreachable-code-return
+
+# Warnings we haven't fixed (yet)
+LOCAL_CFLAGS += -Wno-unused-parameter -Wno-sign-compare
+ 
+
+LOCAL_LDLIBS := -ldl -lGLESv1_CM -lGLESv2 -lOpenSLES -llog -landroid
+
+ifeq ($(NDK_DEBUG),1)
+    cmd-strip :=
+endif
+
+LOCAL_STATIC_LIBRARIES := cpufeatures
 
 include $(BUILD_SHARED_LIBRARY)
 
@@ -86,4 +111,22 @@ LOCAL_MODULE_FILENAME := libSDL2main
 
 include $(BUILD_STATIC_LIBRARY)
 
+###########################
+#
+# hidapi library
+#
+###########################
+
+include $(CLEAR_VARS)
+
+LOCAL_CPPFLAGS += -std=c++11
+
+LOCAL_SRC_FILES := src/hidapi/android/hid.cpp
+
+LOCAL_MODULE := libhidapi
+LOCAL_LDLIBS := -llog
+
+include $(BUILD_SHARED_LIBRARY)
+
+$(call import-module,android/cpufeatures)
 

+ 158 - 45
Engine/lib/sdl/CMakeLists.txt

@@ -3,7 +3,7 @@ if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
 endif()
 
 cmake_minimum_required(VERSION 2.8.11)
-project(SDL2 C)
+project(SDL2 C CXX)
 
 # !!! FIXME: this should probably do "MACOSX_RPATH ON" as a target property
 # !!! FIXME:  for the SDL2 shared library (so you get an
@@ -42,10 +42,13 @@ include(${SDL2_SOURCE_DIR}/cmake/sdlchecks.cmake)
 # set SDL_BINARY_AGE and SDL_INTERFACE_AGE to 0.
 set(SDL_MAJOR_VERSION 2)
 set(SDL_MINOR_VERSION 0)
-set(SDL_MICRO_VERSION 8)
+set(SDL_MICRO_VERSION 10)
 set(SDL_INTERFACE_AGE 0)
-set(SDL_BINARY_AGE 8)
+set(SDL_BINARY_AGE 10)
 set(SDL_VERSION "${SDL_MAJOR_VERSION}.${SDL_MINOR_VERSION}.${SDL_MICRO_VERSION}")
+# the following should match the versions in Xcode project file:
+set(DYLIB_CURRENT_VERSION 10.0.0)
+set(DYLIB_COMPATIBILITY_VERSION 1.0.0)
 
 # Set defaults preventing destination file conflicts
 set(SDL_CMAKE_DEBUG_POSTFIX "d"
@@ -61,7 +64,7 @@ set(LT_REVISION "${SDL_INTERFACE_AGE}")
 set(LT_RELEASE "${SDL_MAJOR_VERSION}.${SDL_MINOR_VERSION}")
 set(LT_VERSION "${LT_MAJOR}.${LT_AGE}.${LT_REVISION}")
 
-message(STATUS "${LT_VERSION} :: ${LT_AGE} :: ${LT_REVISION} :: ${LT_CURRENT} :: ${LT_RELEASE}")
+#message(STATUS "${LT_VERSION} :: ${LT_AGE} :: ${LT_REVISION} :: ${LT_CURRENT} :: ${LT_RELEASE}")
 
 # General settings & flags
 set(LIBRARY_OUTPUT_DIRECTORY "build")
@@ -152,6 +155,20 @@ if(UNIX OR MINGW OR MSYS)
   set(OPT_DEF_LIBC ON)
 endif()
 
+# The hidraw support doesn't catch Xbox, PS4 and Nintendo controllers,
+#  so we'll just use libusb when it's available. Except that libusb
+#  requires root permissions to open devices, so that's not generally
+#  useful, and we'll disable this by default on Unix. Windows and macOS
+#  can use it without root access, though, so enable by default there.
+if(WINDOWS OR APPLE OR ANDROID)
+  set(HIDAPI_SKIP_LIBUSB TRUE)
+else()
+  set(HIDAPI_SKIP_LIBUSB FALSE)
+endif()
+if (HIDAPI_SKIP_LIBUSB)
+  set(OPT_DEF_HIDAPI ON)
+endif()
+
 # Compiler info
 if(CMAKE_COMPILER_IS_GNUCC)
   set(USE_GCC TRUE)
@@ -210,8 +227,14 @@ endif()
 set(SDL_LIBS "-lSDL2")
 set(SDL_CFLAGS "")
 
-# Emscripten toolchain has a nonempty default value for this, and the checks 
-# in this file need to change that, so remember the original value, and 
+# When building shared lib for Windows with MinGW,
+# avoid the DLL having a "lib" prefix
+if(WINDOWS)
+  set(CMAKE_SHARED_LIBRARY_PREFIX "")
+endif()
+
+# Emscripten toolchain has a nonempty default value for this, and the checks
+# in this file need to change that, so remember the original value, and
 # restore back to that afterwards. For check_function_exists() to work in
 # Emscripten, this value must be at its default value.
 set(ORIG_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
@@ -244,7 +267,7 @@ endif()
 set(OPT_DEF_ASM TRUE)
 if(EMSCRIPTEN)
   # Set up default values for the currently supported set of subsystems:
-  # Emscripten/Javascript does not have assembly support, a dynamic library 
+  # Emscripten/Javascript does not have assembly support, a dynamic library
   # loading architecture, low-level CPU inspection or multithreading.
   set(OPT_DEF_ASM FALSE)
   set(SDL_SHARED_ENABLED_BY_DEFAULT OFF)
@@ -255,13 +278,28 @@ if(EMSCRIPTEN)
   set(SDL_DLOPEN_ENABLED_BY_DEFAULT OFF)
 endif()
 
+# When defined, respect CMake's BUILD_SHARED_LIBS setting:
+set(SDL_STATIC_ENABLED_BY_DEFAULT ON)
 if (NOT DEFINED SDL_SHARED_ENABLED_BY_DEFAULT)
+  # ...unless decided already (as for EMSCRIPTEN)
+
+  set(SDL_SHARED_ENABLED_BY_DEFAULT OFF)
+
+  if (NOT DEFINED BUILD_SHARED_LIBS)
+    # No preference? Build both, just like the AC/AM configure
+    set(SDL_SHARED_ENABLED_BY_DEFAULT ON)
+
+  elseif (BUILD_SHARED_LIBS)
+    # In this case, we assume the user wants a shared lib and don't build
+    # the static one
     set(SDL_SHARED_ENABLED_BY_DEFAULT ON)
+    set(SDL_STATIC_ENABLED_BY_DEFAULT OFF)
+  endif()
 endif()
 
 set(SDL_SUBSYSTEMS
     Atomic Audio Video Render Events Joystick Haptic Power Threads Timers
-    File Loadso CPUinfo Filesystem Dlopen)
+    File Loadso CPUinfo Filesystem Dlopen Sensor)
 foreach(_SUB ${SDL_SUBSYSTEMS})
   string(TOUPPER ${_SUB} _OPT)
   if (NOT DEFINED SDL_${_OPT}_ENABLED_BY_DEFAULT)
@@ -317,8 +355,6 @@ set_option(VIDEO_X11           "Use X11 video driver" ${UNIX_SYS})
 set_option(VIDEO_WAYLAND       "Use Wayland video driver" ${UNIX_SYS})
 dep_option(WAYLAND_SHARED      "Dynamically load Wayland support" ON "VIDEO_WAYLAND" OFF)
 dep_option(VIDEO_WAYLAND_QT_TOUCH  "QtWayland server support for Wayland video driver" ON "VIDEO_WAYLAND" OFF)
-set_option(VIDEO_MIR           "Use Mir video driver" ${UNIX_SYS})
-dep_option(MIR_SHARED          "Dynamically load Mir support" ON "VIDEO_MIR" OFF)
 set_option(VIDEO_RPI           "Use Raspberry Pi video driver" ${UNIX_SYS})
 dep_option(X11_SHARED          "Dynamically load X11 support" ON "VIDEO_X11" OFF)
 set(SDL_X11_OPTIONS Xcursor Xinerama XInput Xrandr Xscrnsaver XShape Xvm)
@@ -328,16 +364,18 @@ foreach(_SUB ${SDL_X11_OPTIONS})
 endforeach()
 set_option(VIDEO_COCOA         "Use Cocoa video driver" ${APPLE})
 set_option(DIRECTX             "Use DirectX for Windows audio/video" ${WINDOWS})
+set_option(WASAPI              "Use the Windows WASAPI audio driver" ${WINDOWS})
 set_option(RENDER_D3D          "Enable the Direct3D render driver" ${WINDOWS})
 set_option(VIDEO_VIVANTE       "Use Vivante EGL video driver" ${UNIX_SYS})
 dep_option(VIDEO_VULKAN        "Enable Vulkan support" ON "ANDROID OR APPLE OR LINUX OR WINDOWS" OFF)
 set_option(VIDEO_KMSDRM        "Use KMS DRM video driver" ${UNIX_SYS})
 dep_option(KMSDRM_SHARED       "Dynamically load KMS DRM support" ON "VIDEO_KMSDRM" OFF)
+option_string(BACKGROUNDING_SIGNAL "number to use for magic backgrounding signal or 'OFF'" "OFF")
+option_string(FOREGROUNDING_SIGNAL "number to use for magic foregrounding signal or 'OFF'" "OFF")
+set_option(HIDAPI              "Use HIDAPI for low level joystick drivers" ${OPT_DEF_HIDAPI})
 
-# TODO: We should (should we?) respect cmake's ${BUILD_SHARED_LIBS} flag here
-# The options below are for compatibility to configure's default behaviour.
 set(SDL_SHARED ${SDL_SHARED_ENABLED_BY_DEFAULT} CACHE BOOL "Build a shared version of the library")
-set(SDL_STATIC ON CACHE BOOL "Build a static version of the library")
+set(SDL_STATIC ${SDL_STATIC_ENABLED_BY_DEFAULT} CACHE BOOL "Build a static version of the library")
 
 dep_option(SDL_STATIC_PIC      "Static version of the library should be built with Position Independent Code" OFF "SDL_STATIC" OFF)
 set_option(SDL_TEST            "Build the test directory" OFF)
@@ -376,6 +414,14 @@ else()
 endif()
 set(HAVE_ASSERTIONS ${ASSERTIONS})
 
+if(NOT BACKGROUNDING_SIGNAL STREQUAL "OFF")
+  add_definitions("-DSDL_BACKGROUNDING_SIGNAL=${BACKGROUNDING_SIGNAL}")
+endif()
+
+if(NOT FOREGROUNDING_SIGNAL STREQUAL "OFF")
+  add_definitions("-DSDL_FOREGROUNDING_SIGNAL=${FOREGROUNDING_SIGNAL}")
+endif()
+
 # Compiler option evaluation
 if(USE_GCC OR USE_CLANG)
   # Check for -Wall first, so later things can override pieces of it.
@@ -387,6 +433,11 @@ if(USE_GCC OR USE_CLANG)
     endif()
   endif()
 
+  check_c_compiler_flag(-fno-strict-aliasing HAVE_GCC_NO_STRICT_ALIASING)
+  if(HAVE_GCC_NO_STRICT_ALIASING)
+    list(APPEND EXTRA_CFLAGS "-fno-strict-aliasing")
+  endif()
+
   check_c_compiler_flag(-Wdeclaration-after-statement HAVE_GCC_WDECLARATION_AFTER_STATEMENT)
   if(HAVE_GCC_WDECLARATION_AFTER_STATEMENT)
     check_c_compiler_flag(-Werror=declaration-after-statement HAVE_GCC_WERROR_DECLARATION_AFTER_STATEMENT)
@@ -444,6 +495,8 @@ if(USE_GCC OR USE_CLANG)
 
   if(APPLE)
     list(APPEND EXTRA_LDFLAGS "-Wl,-undefined,error")
+    list(APPEND EXTRA_LDFLAGS "-Wl,-compatibility_version,${DYLIB_COMPATIBILITY_VERSION}")
+    list(APPEND EXTRA_LDFLAGS "-Wl,-current_version,${DYLIB_CURRENT_VERSION}")
   else()
     set(CMAKE_REQUIRED_FLAGS "-Wl,--no-undefined")
     check_c_compiler_flag("" HAVE_NO_UNDEFINED)
@@ -643,7 +696,7 @@ if(LIBC)
             _ultoa strtol strtoul strtoll strtod atoi atof strcmp strncmp
             _stricmp _strnicmp sscanf
             acos acosf asin asinf atan atanf atan2 atan2f ceil ceilf
-            copysign copysignf cos cosf fabs fabsf floor floorf fmod fmodf
+            copysign copysignf cos cosf exp expf fabs fabsf floor floorf fmod fmodf
             log logf log10 log10f pow powf scalbn scalbnf sin sinf sqrt sqrtf tan tanf)
       string(TOUPPER ${_FN} _UPPER)
       set(HAVE_${_UPPER} 1)
@@ -679,7 +732,7 @@ if(LIBC)
             _uitoa _ultoa strtol strtoul _i64toa _ui64toa strtoll strtoull
             atoi atof strcmp strncmp _stricmp strcasecmp _strnicmp strncasecmp
             vsscanf vsnprintf fopen64 fseeko fseeko64 sigaction setjmp
-            nanosleep sysconf sysctlbyname getauxval poll
+            nanosleep sysconf sysctlbyname getauxval poll _Exit
             )
       string(TOUPPER ${_FN} _UPPER)
       set(_HAVEVAR "HAVE_${_UPPER}")
@@ -743,11 +796,15 @@ if(SDL_HAPTIC)
   file(GLOB HAPTIC_SOURCES ${SDL2_SOURCE_DIR}/src/haptic/*.c)
   set(SOURCE_FILES ${SOURCE_FILES} ${HAPTIC_SOURCES})
 endif()
+if(SDL_SENSOR)
+  file(GLOB SENSOR_SOURCES ${SDL2_SOURCE_DIR}/src/sensor/*.c)
+  set(SOURCE_FILES ${SOURCE_FILES} ${SENSOR_SOURCES})
+endif()
 if(SDL_POWER)
   file(GLOB POWER_SOURCES ${SDL2_SOURCE_DIR}/src/power/*.c)
   set(SOURCE_FILES ${SOURCE_FILES} ${POWER_SOURCES})
 endif()
-# TODO: in configure.in, the test for LOADSO and SDL_DLOPEN is a bit weird:
+# TODO: in configure.ac, the test for LOADSO and SDL_DLOPEN is a bit weird:
 # if LOADSO is not wanted, SDL_LOADSO_DISABLED is set
 # If however on Unix or APPLE dlopen() is detected via CheckDLOPEN(),
 # SDL_LOADSO_DISABLED will not be set, regardless of the LOADSO settings
@@ -786,6 +843,7 @@ if(SDL_VIDEO)
   endif()
 endif()
 
+# Platform-specific options and settings
 if(ANDROID)
   file(GLOB ANDROID_CORE_SOURCES ${SDL2_SOURCE_DIR}/src/core/android/*.c)
   set(SOURCE_FILES ${SOURCE_FILES} ${ANDROID_CORE_SOURCES})
@@ -821,6 +879,7 @@ if(ANDROID)
     set(HAVE_SDL_HAPTIC TRUE)
   endif()
   if(SDL_JOYSTICK)
+    CheckHIDAPI()
     set(SDL_JOYSTICK_ANDROID 1)
     file(GLOB ANDROID_JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/android/*.c ${SDL2_SOURCE_DIR}/src/joystick/steam/*.c)
     set(SOURCE_FILES ${SOURCE_FILES} ${ANDROID_JOYSTICK_SOURCES})
@@ -844,6 +903,12 @@ if(ANDROID)
     set(SOURCE_FILES ${SOURCE_FILES} ${TIMER_SOURCES})
     set(HAVE_SDL_TIMERS TRUE)
   endif()
+  if(SDL_SENSOR)
+    set(SDL_SENSOR_ANDROID 1)
+    set(HAVE_SDL_SENSORS TRUE)
+    file(GLOB ANDROID_SENSOR_SOURCES ${SDL2_SOURCE_DIR}/src/sensor/android/*.c)
+    set(SOURCE_FILES ${SOURCE_FILES} ${ANDROID_SENSOR_SOURCES})
+  endif()
   if(SDL_VIDEO)
     set(SDL_VIDEO_DRIVER_ANDROID 1)
     file(GLOB ANDROID_VIDEO_SOURCES ${SDL2_SOURCE_DIR}/src/video/android/*.c)
@@ -861,6 +926,8 @@ if(ANDROID)
     if(VIDEO_OPENGLES)
       set(SDL_VIDEO_OPENGL_EGL 1)
       set(HAVE_VIDEO_OPENGLES TRUE)
+      set(SDL_VIDEO_OPENGL_ES 1)
+      set(SDL_VIDEO_RENDER_OGL_ES 1)
       set(SDL_VIDEO_OPENGL_ES2 1)
       set(SDL_VIDEO_RENDER_OGL_ES2 1)
 
@@ -886,10 +953,7 @@ if(ANDROID)
 
   CheckPTHREAD()
 
-endif()
-
-# Platform-specific options and settings
-if(EMSCRIPTEN)
+elseif(EMSCRIPTEN)
   # Hide noisy warnings that intend to aid mostly during initial stages of porting a new
   # project. Uncomment at will for verbose cross-compiling -I/../ path info.
   add_definitions(-Wno-warn-absolute-paths)
@@ -941,6 +1005,7 @@ if(EMSCRIPTEN)
       set(SDL_VIDEO_RENDER_OGL_ES2 1)
     endif()
   endif()
+
 elseif(UNIX AND NOT APPLE AND NOT ANDROID)
   if(SDL_AUDIO)
     if(SYSV5 OR SOLARIS OR HPUX)
@@ -975,7 +1040,6 @@ elseif(UNIX AND NOT APPLE AND NOT ANDROID)
     # Need to check for Raspberry PI first and add platform specific compiler flags, otherwise the test for GLES fails!
     CheckRPI()
     CheckX11()
-    CheckMir()
     CheckDirectFB()
     CheckOpenGLX11()
     CheckOpenGLESX11()
@@ -1001,7 +1065,7 @@ elseif(UNIX AND NOT APPLE AND NOT ANDROID)
         #include <linux/kd.h>
         #include <linux/keyboard.h>
 
-        int main(int argc, char **argv) 
+        int main(int argc, char **argv)
         {
             struct kbentry kbe;
             kbe.kb_table = KG_CTRL;
@@ -1042,6 +1106,12 @@ elseif(UNIX AND NOT APPLE AND NOT ANDROID)
         include_directories(${IBUS_INCLUDE_DIRS})
         list(APPEND EXTRA_LIBS ${IBUS_LIBRARIES})
       endif()
+      if(HAVE_LIBUNWIND_H)
+        # We've already found the header, so REQUIRE the lib to be present
+        pkg_search_module(UNWIND REQUIRED libunwind)
+        pkg_search_module(UNWIND_GENERIC REQUIRED libunwind-generic)
+        list(APPEND EXTRA_LIBS ${UNWIND_LIBRARIES} ${UNWIND_GENERIC_LIBRARIES})
+      endif()
     endif()
 
     check_include_file("fcitx/frontend.h" HAVE_FCITX_FRONTEND_H)
@@ -1059,6 +1129,7 @@ elseif(UNIX AND NOT APPLE AND NOT ANDROID)
 
   if(SDL_JOYSTICK)
     CheckUSBHID()   # seems to be BSD specific - limit the test to BSD only?
+    CheckHIDAPI()
     if(LINUX AND NOT ANDROID)
       set(SDL_JOYSTICK_LINUX 1)
       file(GLOB JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/linux/*.c ${SDL2_SOURCE_DIR}/src/joystick/steam/*.c)
@@ -1183,8 +1254,6 @@ elseif(WINDOWS)
     check_include_file(ddraw.h HAVE_DDRAW_H)
     check_include_file(dsound.h HAVE_DSOUND_H)
     check_include_file(dinput.h HAVE_DINPUT_H)
-    check_include_file(mmdeviceapi.h HAVE_MMDEVICEAPI_H)
-    check_include_file(audioclient.h HAVE_AUDIOCLIENT_H)
     check_include_file(dxgi.h HAVE_DXGI_H)
     if(HAVE_D3D_H OR HAVE_D3D11_H OR HAVE_DDRAW_H OR HAVE_DSOUND_H OR HAVE_DINPUT_H)
       set(HAVE_DIRECTX TRUE)
@@ -1197,6 +1266,11 @@ elseif(WINDOWS)
     set(CMAKE_REQUIRED_FLAGS ${ORIG_CMAKE_REQUIRED_FLAGS})
   endif()
 
+  # headers needed elsewhere ...
+  check_include_file(mmdeviceapi.h HAVE_MMDEVICEAPI_H)
+  check_include_file(audioclient.h HAVE_AUDIOCLIENT_H)
+  check_include_file(endpointvolume.h HAVE_ENDPOINTVOLUME_H)
+
   if(SDL_AUDIO)
     set(SDL_AUDIO_DRIVER_WINMM 1)
     file(GLOB WINMM_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/winmm/*.c)
@@ -1209,7 +1283,7 @@ elseif(WINDOWS)
       set(SOURCE_FILES ${SOURCE_FILES} ${DSOUND_AUDIO_SOURCES})
     endif()
 
-    if(HAVE_AUDIOCLIENT_H AND HAVE_MMDEVICEAPI_H)
+    if(WASAPI AND HAVE_AUDIOCLIENT_H AND HAVE_MMDEVICEAPI_H)
       set(SDL_AUDIO_DRIVER_WASAPI 1)
       file(GLOB WASAPI_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/wasapi/*.c)
       set(SOURCE_FILES ${SOURCE_FILES} ${WASAPI_AUDIO_SOURCES})
@@ -1261,9 +1335,9 @@ elseif(WINDOWS)
   endif()
 
   # Libraries for Win32 native and MinGW
-  list(APPEND EXTRA_LIBS user32 gdi32 winmm imm32 ole32 oleaut32 version uuid)
+  list(APPEND EXTRA_LIBS user32 gdi32 winmm imm32 ole32 oleaut32 version uuid advapi32 setupapi shell32)
 
-  # TODO: in configure.in the check for timers is set on
+  # TODO: in configure.ac the check for timers is set on
   # cygwin | mingw32* - does this include mingw32CE?
   if(SDL_TIMERS)
     set(SDL_TIMER_WINDOWS 1)
@@ -1299,6 +1373,10 @@ elseif(WINDOWS)
   endif()
 
   if(SDL_JOYSTICK)
+    CheckHIDAPI()
+    if(HAVE_HIDAPI)
+      set(SOURCE_FILES ${SOURCE_FILES} ${SDL2_SOURCE_DIR}/src/hidapi/windows/hid.c)
+    endif()
     file(GLOB JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/windows/*.c)
     set(SOURCE_FILES ${SOURCE_FILES} ${JOYSTICK_SOURCES})
     if(HAVE_DINPUT_H)
@@ -1344,6 +1422,7 @@ elseif(WINDOWS)
     set(SDL_CFLAGS "${SDL_CFLAGS} -Dmain=SDL_main")
     list(APPEND SDL_LIBS "-lmingw32" "-lSDL2main" "-mwindows")
   endif()
+
 elseif(APPLE)
   # TODO: rework this all for proper MacOS X, iOS and Darwin support
 
@@ -1381,6 +1460,14 @@ elseif(APPLE)
   endif()
 
   if(SDL_JOYSTICK)
+    CheckHIDAPI()
+    if(HAVE_HIDAPI)
+      if(IOS)
+        set(SOURCE_FILES ${SOURCE_FILES} ${SDL2_SOURCE_DIR}/src/hidapi/ios/hid.m)
+      else()
+        set(SOURCE_FILES ${SOURCE_FILES} ${SDL2_SOURCE_DIR}/src/hidapi/mac/hid.c)
+      endif()
+    endif()
     set(SDL_JOYSTICK_IOKIT 1)
     if (IOS)
       file(GLOB JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/iphoneos/*.m ${SDL2_SOURCE_DIR}/src/joystick/steam/*.c)
@@ -1493,6 +1580,7 @@ elseif(APPLE)
   endif()
 
   CheckPTHREAD()
+
 elseif(HAIKU)
   if(SDL_VIDEO)
     set(SDL_VIDEO_DRIVER_HAIKU 1)
@@ -1527,10 +1615,11 @@ endif()
 
 if(VIDEO_VULKAN)
   set(SDL_VIDEO_VULKAN 1)
+  set(HAVE_VIDEO_VULKAN TRUE)
 endif()
 
 # Dummies
-# configure.in does it differently:
+# configure.ac does it differently:
 # if not have X
 #   if enable_X {  SDL_X_DISABLED = 1 }
 #   [add dummy sources]
@@ -1538,7 +1627,7 @@ endif()
 # This leads to missing internal references on building, since the
 # src/X/*.c does not get included.
 if(NOT HAVE_SDL_JOYSTICK)
-  set(SDL_JOYSTICK_DISABLED 1)
+  set(SDL_JOYSTICK_DUMMY 1)
   if(SDL_JOYSTICK AND NOT APPLE) # results in unresolved symbols on OSX
 
     file(GLOB JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/dummy/*.c)
@@ -1546,10 +1635,15 @@ if(NOT HAVE_SDL_JOYSTICK)
   endif()
 endif()
 if(NOT HAVE_SDL_HAPTIC)
-  set(SDL_HAPTIC_DISABLED 1)
+  set(SDL_HAPTIC_DUMMY 1)
   file(GLOB HAPTIC_SOURCES ${SDL2_SOURCE_DIR}/src/haptic/dummy/*.c)
   set(SOURCE_FILES ${SOURCE_FILES} ${HAPTIC_SOURCES})
 endif()
+if(NOT HAVE_SDL_SENSORS)
+  set(SDL_SENSOR_DUMMY 1)
+  file(GLOB SENSORS_SOURCES ${SDL2_SOURCE_DIR}/src/sensor/dummy/*.c)
+  set(SOURCE_FILES ${SOURCE_FILES} ${SENSORS_SOURCES})
+endif()
 if(NOT HAVE_SDL_LOADSO)
   set(SDL_LOADSO_DISABLED 1)
   file(GLOB LOADSO_SOURCES ${SDL2_SOURCE_DIR}/src/loadso/dummy/*.c)
@@ -1695,7 +1789,7 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
 
 # Always build SDLmain
 add_library(SDL2main STATIC ${SDLMAIN_SOURCES})
-target_include_directories(SDL2main PUBLIC $<INSTALL_INTERFACE:include>)
+target_include_directories(SDL2main PUBLIC "$<BUILD_INTERFACE:${SDL2_SOURCE_DIR}/include>" $<INSTALL_INTERFACE:include/SDL2>)
 set(_INSTALL_LIBS "SDL2main")
 if (NOT ANDROID)
   set_target_properties(SDL2main PROPERTIES DEBUG_POSTFIX ${SDL_CMAKE_DEBUG_POSTFIX})
@@ -1704,7 +1798,9 @@ endif()
 if(SDL_SHARED)
   add_library(SDL2 SHARED ${SOURCE_FILES} ${VERSION_SOURCES})
   if(APPLE)
-    set_target_properties(SDL2 PROPERTIES MACOSX_RPATH 1)
+    set_target_properties(SDL2 PROPERTIES
+      MACOSX_RPATH 1
+      OUTPUT_NAME "SDL2-${LT_RELEASE}")
   elseif(UNIX AND NOT ANDROID)
     set_target_properties(SDL2 PROPERTIES
       VERSION ${LT_VERSION}
@@ -1724,12 +1820,26 @@ if(SDL_SHARED)
   endif()
   set(_INSTALL_LIBS "SDL2" ${_INSTALL_LIBS})
   target_link_libraries(SDL2 ${EXTRA_LIBS} ${EXTRA_LDFLAGS})
-  target_include_directories(SDL2 PUBLIC $<INSTALL_INTERFACE:include>)
+  target_include_directories(SDL2 PUBLIC "$<BUILD_INTERFACE:${SDL2_SOURCE_DIR}/include>" $<INSTALL_INTERFACE:include/SDL2>)
   if (NOT ANDROID)
     set_target_properties(SDL2 PROPERTIES DEBUG_POSTFIX ${SDL_CMAKE_DEBUG_POSTFIX})
   endif()
 endif()
 
+if(ANDROID)
+  if(HAVE_HIDAPI)
+    add_library(hidapi SHARED ${SDL2_SOURCE_DIR}/src/hidapi/android/hid.cpp)
+  endif()
+
+  if(MSVC AND NOT LIBC)
+    # Don't try to link with the default set of libraries.
+    set_target_properties(hidapi PROPERTIES LINK_FLAGS_RELEASE "/NODEFAULTLIB")
+    set_target_properties(hidapi PROPERTIES LINK_FLAGS_DEBUG "/NODEFAULTLIB")
+    set_target_properties(hidapi PROPERTIES STATIC_LIBRARY_FLAGS "/NODEFAULTLIB")
+  endif()
+  target_link_libraries(hidapi log)
+endif()
+
 if(SDL_STATIC)
   set (BUILD_SHARED_LIBS FALSE)
   add_library(SDL2-static STATIC ${SOURCE_FILES})
@@ -1750,7 +1860,7 @@ if(SDL_STATIC)
   # libraries - do we need to consider this?
   set(_INSTALL_LIBS "SDL2-static" ${_INSTALL_LIBS})
   target_link_libraries(SDL2-static ${EXTRA_LIBS} ${EXTRA_LDFLAGS})
-  target_include_directories(SDL2-static PUBLIC $<INSTALL_INTERFACE:include>)
+  target_include_directories(SDL2-static PUBLIC "$<BUILD_INTERFACE:${SDL2_SOURCE_DIR}/include>" $<INSTALL_INTERFACE:include/SDL2>)
   if (NOT ANDROID)
     set_target_properties(SDL2-static PROPERTIES DEBUG_POSTFIX ${SDL_CMAKE_DEBUG_POSTFIX})
   endif()
@@ -1761,7 +1871,7 @@ endif()
 if(SDL_TEST)
   file(GLOB TEST_SOURCES ${SDL2_SOURCE_DIR}/src/test/*.c)
   add_library(SDL2_test STATIC ${TEST_SOURCES})
-  
+
   add_subdirectory(test)
 endif()
 
@@ -1772,9 +1882,7 @@ install(TARGETS ${_INSTALL_LIBS} EXPORT SDL2Targets
   RUNTIME DESTINATION bin)
 
 ##### Export files #####
-if (APPLE)
-  set(PKG_PREFIX "SDL2.framework/Resources")
-elseif (WINDOWS)
+if (WINDOWS)
   set(PKG_PREFIX "cmake")
 else ()
   set(PKG_PREFIX "lib/cmake/SDL2")
@@ -1808,18 +1916,23 @@ endforeach()
 list(APPEND INCLUDE_FILES ${BIN_INCLUDE_FILES})
 install(FILES ${INCLUDE_FILES} DESTINATION include/SDL2)
 
+string(TOUPPER "${CMAKE_BUILD_TYPE}" UPPER_BUILD_TYPE)
+if (UPPER_BUILD_TYPE MATCHES DEBUG)
+  set(SOPOSTFIX "${SDL_CMAKE_DEBUG_POSTFIX}")
+else()
+  set(SOPOSTFIX "")
+endif()
+
 if(NOT (WINDOWS OR CYGWIN))
   if(SDL_SHARED)
-    if (APPLE)
-        set(SOEXT "dylib")
-    else()
-        set(SOEXT "so")
-    endif()
+    set(SOEXT ${CMAKE_SHARED_LIBRARY_SUFFIX}) # ".so", ".dylib", etc.
+    get_target_property(SONAME SDL2 OUTPUT_NAME)
     if(NOT ANDROID)
         install(CODE "
           execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
-          \"libSDL2-2.0.${SOEXT}\" \"libSDL2.${SOEXT}\")")
-        install(FILES ${SDL2_BINARY_DIR}/libSDL2.${SOEXT} DESTINATION "lib${LIB_SUFFIX}")
+            \"lib${SONAME}${SOPOSTFIX}${SOEXT}\" \"libSDL2${SOPOSTFIX}${SOEXT}\"
+            WORKING_DIRECTORY \"${SDL2_BINARY_DIR}\")")
+        install(FILES ${SDL2_BINARY_DIR}/libSDL2${SOPOSTFIX}${SOEXT} DESTINATION "lib${LIB_SUFFIX}")
     endif()
   endif()
   if(FREEBSD)

+ 1 - 1
Engine/lib/sdl/COPYING.txt

@@ -1,6 +1,6 @@
 
 Simple DirectMedia Layer
-Copyright (C) 1997-2018 Sam Lantinga <[email protected]>
+Copyright (C) 1997-2019 Sam Lantinga <[email protected]>
   
 This software is provided 'as-is', without any express or implied
 warranty.  In no event will the authors be held liable for any damages

+ 14 - 5
Engine/lib/sdl/Makefile.in

@@ -44,7 +44,9 @@ SDLTEST_OBJECTS = @SDLTEST_OBJECTS@
 
 WAYLAND_SCANNER = @WAYLAND_SCANNER@
 
-SRC_DIST = *.txt acinclude Android.mk autogen.sh android-project build-scripts cmake cmake_uninstall.cmake.in configure configure.in debian docs include Makefile.* sdl2-config.cmake.in sdl2-config.in sdl2.m4 sdl2.pc.in SDL2.spec.in SDL2Config.cmake src test VisualC.html VisualC VisualC-WinRT Xcode Xcode-iOS
+INSTALL_SDL2_CONFIG = @INSTALL_SDL2_CONFIG@
+
+SRC_DIST = *.txt acinclude Android.mk autogen.sh android-project build-scripts cmake cmake_uninstall.cmake.in configure configure.ac debian docs include Makefile.* sdl2-config.cmake.in sdl2-config.in sdl2.m4 sdl2.pc.in SDL2.spec.in SDL2Config.cmake src test VisualC.html VisualC VisualC-WinRT Xcode Xcode-iOS wayland-protocols
 GEN_DIST = SDL2.spec
 
 ifneq ($V,1)
@@ -101,6 +103,7 @@ HDRS = \
 	SDL_render.h \
 	SDL_rwops.h \
 	SDL_scancode.h \
+	SDL_sensor.h \
 	SDL_shape.h \
 	SDL_stdinc.h \
 	SDL_surface.h \
@@ -124,9 +127,9 @@ LT_RELEASE  = @LT_RELEASE@
 LT_REVISION = @LT_REVISION@
 LT_LDFLAGS  = -no-undefined -rpath $(libdir) -release $(LT_RELEASE) -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
 
-all: $(srcdir)/configure Makefile $(objects) $(objects)/$(TARGET) $(objects)/$(SDLMAIN_TARGET) $(objects)/$(SDLTEST_TARGET)
+all: $(srcdir)/configure Makefile $(objects)/$(TARGET) $(objects)/$(SDLMAIN_TARGET) $(objects)/$(SDLTEST_TARGET)
 
-$(srcdir)/configure: $(srcdir)/configure.in
+$(srcdir)/configure: $(srcdir)/configure.ac
 	@echo "Warning, configure is out of date, please re-run autogen.sh"
 
 Makefile: $(srcdir)/Makefile.in
@@ -134,8 +137,9 @@ Makefile: $(srcdir)/Makefile.in
 
 Makefile.in:;
 
-$(objects):
-	$(SHELL) $(auxdir)/mkinstalldirs $@
+$(objects)/.created:
+	$(SHELL) $(auxdir)/mkinstalldirs $(objects)
+	touch $@
 
 update-revision:
 	$(SHELL) $(auxdir)/updaterev.sh
@@ -153,8 +157,11 @@ $(objects)/$(SDLTEST_TARGET): $(SDLTEST_OBJECTS)
 
 install: all install-bin install-hdrs install-lib install-data
 install-bin:
+ifeq ($(INSTALL_SDL2_CONFIG),TRUE)
 	$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(bindir)
 	$(INSTALL) -m 755 sdl2-config $(DESTDIR)$(bindir)/sdl2-config
+endif
+
 install-hdrs: update-revision
 	$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(includedir)/SDL2
 	for file in $(HDRS) $(SDLTEST_HDRS); do \
@@ -177,8 +184,10 @@ install-data:
 	$(INSTALL) -m 644 $(srcdir)/sdl2.m4 $(DESTDIR)$(datadir)/aclocal/sdl2.m4
 	$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(libdir)/pkgconfig
 	$(INSTALL) -m 644 sdl2.pc $(DESTDIR)$(libdir)/pkgconfig
+ifeq ($(INSTALL_SDL2_CONFIG),TRUE)
 	$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(libdir)/cmake/SDL2
 	$(INSTALL) -m 644 sdl2-config.cmake $(DESTDIR)$(libdir)/cmake/SDL2
+endif
 
 uninstall: uninstall-bin uninstall-hdrs uninstall-lib uninstall-data
 uninstall-bin:

+ 2 - 0
Engine/lib/sdl/Makefile.minimal

@@ -22,6 +22,8 @@ SOURCES = \
 	src/filesystem/dummy/*.c \
 	src/render/*.c \
 	src/render/software/*.c \
+	src/sensor/*.c \
+	src/sensor/dummy/*.c \
 	src/stdlib/*.c \
 	src/thread/*.c \
 	src/thread/generic/*.c \

+ 137 - 0
Engine/lib/sdl/Makefile.os2

@@ -0,0 +1,137 @@
+# Open Watcom makefile to build SDL2.dll for OS/2:
+# wmake -f Makefile.os2
+
+LIBNAME = SDL2
+VERSION = 2.0.10
+DESCRIPTION = Simple DirectMedia Layer 2
+
+LIBHOME = .
+LIBPATH = $(LIBHOME)/lib
+DLLFILE = $(LIBHOME)/$(LIBNAME).dll
+LIBFILE = $(LIBHOME)/$(LIBNAME).lib
+LNKFILE = $(LIBNAME).lnk
+
+INCPATH = -I"$(%WATCOM)/h/os2" -I"$(%WATCOM)/h"
+INCPATH+= -I"$(LIBHOME)/h"
+INCPATH+= -Iinclude
+
+LIBM = libm.lib
+LIBS = mmpm2.lib libuls.lib libconv.lib $(LIBM)
+
+CFLAGS = -bt=os2 -d0 -q -bm -5s -fp5 -fpi87 -sg -oteanbmier -ei
+# max warnings:
+CFLAGS+= -wx
+# building dll:
+CFLAGS+= -bd
+# the include paths :
+CFLAGS+= $(INCPATH)
+# building SDL itself (for DECLSPEC):
+CFLAGS+= -DBUILD_SDL
+
+MSRCS= e_atan2.c e_exp.c e_fmod.c e_log10.c e_log.c e_pow.c e_rem_pio2.c e_sqrt.c &
+       k_cos.c k_rem_pio2.c k_sin.c k_tan.c &
+       s_atan.c s_copysign.c s_cos.c s_fabs.c s_floor.c s_scalbn.c s_sin.c s_tan.c
+
+SRCS = SDL.c SDL_assert.c SDL_error.c SDL_log.c SDL_dataqueue.c SDL_hints.c
+SRCS+= SDL_getenv.c SDL_iconv.c SDL_malloc.c SDL_qsort.c SDL_stdlib.c SDL_string.c
+SRCS+= SDL_cpuinfo.c SDL_atomic.c SDL_spinlock.c SDL_thread.c SDL_timer.c
+SRCS+= SDL_rwops.c SDL_power.c
+SRCS+= SDL_audio.c SDL_audiocvt.c SDL_audiodev.c SDL_audiotypecvt.c SDL_mixer.c SDL_wave.c
+SRCS+= SDL_events.c SDL_quit.c SDL_keyboard.c SDL_mouse.c SDL_windowevents.c &
+       SDL_clipboardevents.c SDL_dropevents.c SDL_displayevents.c SDL_gesture.c &
+       SDL_sensor.c SDL_touch.c
+SRCS+= SDL_haptic.c SDL_gamecontroller.c SDL_joystick.c
+SRCS+= SDL_render.c yuv_rgb.c SDL_yuv.c SDL_yuv_sw.c SDL_blendfillrect.c &
+       SDL_blendline.c SDL_blendpoint.c SDL_drawline.c SDL_drawpoint.c &
+       SDL_render_sw.c SDL_rotate.c
+SRCS+= SDL_blit.c SDL_blit_0.c SDL_blit_1.c SDL_blit_A.c SDL_blit_auto.c &
+       SDL_blit_copy.c SDL_blit_N.c SDL_blit_slow.c SDL_fillrect.c SDL_bmp.c &
+       SDL_pixels.c SDL_rect.c SDL_RLEaccel.c SDL_shape.c SDL_stretch.c &
+       SDL_surface.c SDL_video.c SDL_clipboard.c SDL_vulkan_utils.c SDL_egl.c
+
+SRCS+= SDL_syscond.c SDL_sysmutex.c SDL_syssem.c SDL_systhread.c SDL_systls.c
+SRCS+= SDL_systimer.c
+SRCS+= SDL_sysloadso.c
+SRCS+= SDL_sysfilesystem.c
+SRCS+= SDL_syshaptic.c SDL_sysjoystick.c
+SRCS+= SDL_dummyaudio.c SDL_diskaudio.c
+SRCS+= SDL_nullvideo.c SDL_nullframebuffer.c SDL_nullevents.c
+SRCS+= SDL_dummysensor.c
+
+SRCS+= SDL_dynapi.c
+
+OBJS = $(SRCS:.c=.obj)
+MOBJS= $(MSRCS:.c=.obj)
+
+.extensions:
+.extensions: .lib .dll .obj .c .asm
+
+.c: ./src;./src/dynapi;./src/audio;./src/cpuinfo;./src/events;./src/file;./src/haptic;./src/joystick;./src/power;./src/render;./src/render/software;./src/sensor;./src/stdlib;./src/thread;./src/timer;./src/video;./src/video/yuv2rgb;./src/atomic;./src/audio/disk;
+.c: ./src/haptic/dummy;./src/joystick/dummy;./src/audio/dummy;./src/video/dummy;./src/sensor/dummy;
+.c: ./src/loadso/dummy;./src/filesystem/dummy;./src/timer/dummy;./src/thread/generic;
+
+all: $(DLLFILE) $(LIBFILE) .symbolic
+
+$(DLLFILE): $(OBJS) $(LIBM) $(LNKFILE)
+    @echo * Linking: $@
+    wlink @$(LNKFILE)
+
+$(LIBFILE): $(DLLFILE)
+    @echo * Creating LIB file: $@
+    wlib -q -b -n -c -pa -s -t -zld -ii -io $* $(DLLFILE)
+
+.c.obj:
+    wcc386 $(CFLAGS) -fo=$^@ $<
+
+SDL_cpuinfo.obj: SDL_cpuinfo.c
+    wcc386 $(CFLAGS) -wcd=200 -fo=$^@ $<
+
+SDL_rwops.obj: SDL_rwops.c
+    wcc386 $(CFLAGS) -wcd=136 -fo=$^@ $<
+
+SDL_blendfillrect.obj: SDL_blendfillrect.c
+    wcc386 $(CFLAGS) -wcd=200 -fo=$^@ $<
+
+SDL_blendline.obj: SDL_blendline.c
+    wcc386 $(CFLAGS) -wcd=200 -fo=$^@ $<
+
+SDL_blendpoint.obj: SDL_blendpoint.c
+    wcc386 $(CFLAGS) -wcd=200 -fo=$^@ $<
+
+SDL_RLEaccel.obj: SDL_RLEaccel.c
+    wcc386 $(CFLAGS) -wcd=201 -fo=$^@ $<
+
+.c: ./src/libm;
+$(LIBM): $(MOBJS)
+    wlib -q -b -n -c -pa -s -t -zld -ii -io $@ $(MOBJS)
+
+$(LNKFILE):
+    @echo * Creating linker file: $@
+    @%create $@
+    @%append $@ SYSTEM os2v2_dll INITINSTANCE TERMINSTANCE
+    @%append $@ NAME $(DLLFILE)
+    @for %i in ($(OBJS)) do @%append $@ FILE %i
+    @%append $@ LIBPATH $(%LIB);$(LIBPATH)
+    @for %i in ($(LIBS)) do @%append $@ LIB %i
+    @%append $@ OPTION QUIET
+    @%append $@ OPTION IMPF=$(LIBHOME)/$^&.exp
+    @%append $@ OPTION MAP=$(LIBHOME)/$^&.map
+    @%append $@ OPTION DESCRIPTION '@$#libsdl org:$(VERSION)$#@$(DESCRIPTION)'
+    @%append $@ OPTION QUIET
+    @%append $@ OPTION ELIMINATE
+    @%append $@ OPTION MANYAUTODATA
+    @%append $@ OPTION OSNAME='OS/2 and eComStation'
+    @%append $@ OPTION SHOWDEAD
+
+clean: .SYMBOLIC
+    @ echo * Clean: $(LIBNAME)
+    @if exist *.obj rm *.obj
+    @if exist *.err rm *.err
+    @if exist $(LNKFILE) rm $(LNKFILE)
+    @if exist $(LIBM) rm $(LIBM)
+
+distclean: .SYMBOLIC clean
+    @if exist $(LIBHOME)/*.exp rm $(LIBHOME)/*.exp
+    @if exist $(LIBHOME)/*.map rm $(LIBHOME)/*.map
+    @if exist $(LIBFILE) rm $(LIBFILE)
+    @if exist $(DLLFILE) rm $(DLLFILE)

+ 32 - 9
Engine/lib/sdl/Makefile.pandora

@@ -12,15 +12,38 @@ CFLAGS  = -O3 -march=armv7-a -mcpu=cortex-a8 -mtune=cortex-a8 -mfloat-abi=softfp
 
 TARGET  = libSDL.a
 
-SOURCES = ./src/*.c ./src/audio/*.c ./src/cpuinfo/*.c ./src/events/*.c \
-	./src/file/*.c ./src/stdlib/*.c ./src/thread/*.c ./src/timer/*.c ./src/video/*.c \
-	./src/joystick/*.c ./src/haptic/*.c ./src/power/*.c ./src/video/dummy/*.c ./src/audio/disk/*.c \
-	./src/audio/dummy/*.c ./src/loadso/dlopen/*.c ./src/audio/dsp/*.c \
-	./src/thread/pthread/SDL_systhread.c ./src/thread/pthread/SDL_syssem.c \
-	./src/thread/pthread/SDL_sysmutex.c ./src/thread/pthread/SDL_syscond.c \
-	./src/joystick/linux/*.c ./src/haptic/linux/*.c ./src/timer/unix/*.c \
-	./src/atomic/*.c ./src/filesystem/unix/*.c \
-	./src/video/pandora/SDL_pandora.o ./src/video/pandora/SDL_pandora_events.o ./src/video/x11/*.c 
+SOURCES = 
+	./src/*.c \
+	./src/atomic/*.c \
+	./src/audio/*.c \
+	./src/audio/disk/*.c \
+	./src/audio/dsp/*.c \
+	./src/audio/dummy/*.c \
+	./src/cpuinfo/*.c \
+	./src/events/*.c \
+	./src/file/*.c \
+	./src/filesystem/unix/*.c \
+	./src/haptic/*.c \
+	./src/haptic/linux/*.c \
+	./src/joystick/*.c \
+	./src/joystick/linux/*.c \
+	./src/loadso/dlopen/*.c \
+	./src/power/*.c \
+	./src/sensor/*.c \
+	./src/sensor/dummy/*.c \
+	./src/stdlib/*.c \
+	./src/thread/*.c \
+	./src/thread/pthread/SDL_syscond.c \
+	./src/thread/pthread/SDL_sysmutex.c \
+	./src/thread/pthread/SDL_syssem.c \
+	./src/thread/pthread/SDL_systhread.c \
+	./src/timer/*.c \
+	./src/timer/unix/*.c \
+	./src/video/*.c \
+	./src/video/dummy/*.c \
+	./src/video/pandora/SDL_pandora.o \
+	./src/video/pandora/SDL_pandora_events.o \
+	./src/video/x11/*.c \
 	
 
 OBJECTS = $(shell echo $(SOURCES) | sed -e 's,\.c,\.o,g')

+ 2 - 0
Engine/lib/sdl/Makefile.psp

@@ -42,6 +42,8 @@ OBJS= src/SDL.o \
       src/render/software/SDL_drawpoint.o \
       src/render/software/SDL_render_sw.o \
       src/render/software/SDL_rotate.o \
+      src/sensor/SDL_sensor.o \
+      src/sensor/dummy/SDL_dummysensor.o \
       src/stdlib/SDL_getenv.o \
       src/stdlib/SDL_iconv.o \
       src/stdlib/SDL_malloc.o \

+ 27 - 8
Engine/lib/sdl/Makefile.wiz

@@ -12,14 +12,33 @@ CFLAGS  = -Wall -fPIC -I./include -I$(WIZSDK)/include -DWIZ_GLES_LITE
 TARGET_STATIC  = libSDL2.a
 TARGET_SHARED  = libSDL2.so
 
-SOURCES = ./src/*.c ./src/audio/*.c ./src/cpuinfo/*.c ./src/events/*.c \
-	./src/file/*.c ./src/stdlib/*.c ./src/thread/*.c ./src/timer/*.c ./src/video/*.c \
-	./src/joystick/*.c ./src/haptic/*.c ./src/video/dummy/*.c ./src/audio/disk/*.c \
-	./src/audio/dummy/*.c ./src/loadso/dlopen/*.c ./src/audio/dsp/*.c \
-	./src/thread/pthread/SDL_systhread.c ./src/thread/pthread/SDL_syssem.c \
-	./src/thread/pthread/SDL_sysmutex.c ./src/thread/pthread/SDL_syscond.c \
-	./src/joystick/linux/*.c ./src/haptic/linux/*.c ./src/timer/unix/*.c \
-	./src/video/pandora/SDL_pandora.o ./src/video/pandora/SDL_pandora_events.o
+SOURCES = \
+	./src/*.c \
+	./src/audio/*.c \
+	./src/audio/disk/*.c \
+	./src/audio/dsp/*.c \
+	./src/audio/dummy/*.c \
+	./src/cpuinfo/*.c \
+	./src/events/*.c \
+	./src/file/*.c \
+	./src/haptic/*.c \
+	./src/haptic/linux/*.c \
+	./src/joystick/*.c \
+	./src/joystick/linux/*.c \
+	./src/loadso/dlopen/*.c \
+	./src/sensor/*.c \
+	./src/sensor/dummy/*.c \
+	./src/stdlib/*.c \
+	./src/thread/*.c \
+	./src/thread/pthread/SDL_syscond.c \
+	./src/thread/pthread/SDL_sysmutex.c \
+	./src/thread/pthread/SDL_syssem.c \
+	./src/thread/pthread/SDL_systhread.c \
+	./src/timer/*.c \
+	./src/timer/unix/*.c \
+	./src/video/*.c \
+	./src/video/dummy/*.c \
+	./src/video/pandora/*.c \
 	
 
 OBJECTS = $(shell echo $(SOURCES) | sed -e 's,\.c,\.o,g')

+ 3 - 2
Engine/lib/sdl/SDL2.spec

@@ -1,6 +1,6 @@
 Summary: Simple DirectMedia Layer
 Name: SDL2
-Version: 2.0.8
+Version: 2.0.10
 Release: 2
 Source: http://www.libsdl.org/release/%{name}-%{version}.tar.gz
 URL: http://www.libsdl.org/
@@ -74,7 +74,8 @@ rm -rf $RPM_BUILD_ROOT
 %{_libdir}/lib*.la
 %{_libdir}/lib*.%{__soext}
 %{_includedir}/*/*.h
-%{_libdir}/pkgconfig/*
+%{_libdir}/cmake/*
+%{_libdir}/pkgconfig/SDL2/*
 %{_datadir}/aclocal/*
 
 %changelog

+ 2 - 1
Engine/lib/sdl/SDL2.spec.in

@@ -74,7 +74,8 @@ rm -rf $RPM_BUILD_ROOT
 %{_libdir}/lib*.la
 %{_libdir}/lib*.%{__soext}
 %{_includedir}/*/*.h
-%{_libdir}/pkgconfig/*
+%{_libdir}/cmake/*
+%{_libdir}/pkgconfig/SDL2/*
 %{_datadir}/aclocal/*
 
 %changelog

+ 79 - 0
Engine/lib/sdl/acinclude/ax_gcc_x86_cpuid.m4

@@ -0,0 +1,79 @@
+# ===========================================================================
+#     http://www.gnu.org/software/autoconf-archive/ax_gcc_x86_cpuid.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+#   AX_GCC_X86_CPUID(OP)
+#
+# DESCRIPTION
+#
+#   On Pentium and later x86 processors, with gcc or a compiler that has a
+#   compatible syntax for inline assembly instructions, run a small program
+#   that executes the cpuid instruction with input OP. This can be used to
+#   detect the CPU type.
+#
+#   On output, the values of the eax, ebx, ecx, and edx registers are stored
+#   as hexadecimal strings as "eax:ebx:ecx:edx" in the cache variable
+#   ax_cv_gcc_x86_cpuid_OP.
+#
+#   If the cpuid instruction fails (because you are running a
+#   cross-compiler, or because you are not using gcc, or because you are on
+#   a processor that doesn't have this instruction), ax_cv_gcc_x86_cpuid_OP
+#   is set to the string "unknown".
+#
+#   This macro mainly exists to be used in AX_GCC_ARCHFLAG.
+#
+# LICENSE
+#
+#   Copyright (c) 2008 Steven G. Johnson <[email protected]>
+#   Copyright (c) 2008 Matteo Frigo
+#
+#   This program is free software: you can redistribute it and/or modify it
+#   under the terms of the GNU General Public License as published by the
+#   Free Software Foundation, either version 3 of the License, or (at your
+#   option) any later version.
+#
+#   This program is distributed in the hope that it will be useful, but
+#   WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+#   Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License along
+#   with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+#   As a special exception, the respective Autoconf Macro's copyright owner
+#   gives unlimited permission to copy, distribute and modify the configure
+#   scripts that are the output of Autoconf when processing the Macro. You
+#   need not follow the terms of the GNU General Public License when using
+#   or distributing such scripts, even though portions of the text of the
+#   Macro appear in them. The GNU General Public License (GPL) does govern
+#   all other use of the material that constitutes the Autoconf Macro.
+#
+#   This special exception to the GPL applies to versions of the Autoconf
+#   Macro released by the Autoconf Archive. When you make and distribute a
+#   modified version of the Autoconf Macro, you may extend this special
+#   exception to the GPL to apply to your modified version as well.
+
+#serial 7
+
+AC_DEFUN([AX_GCC_X86_CPUID],
+[AC_REQUIRE([AC_PROG_CC])
+AC_LANG_PUSH([C])
+AC_CACHE_CHECK(for x86 cpuid $1 output, ax_cv_gcc_x86_cpuid_$1,
+ [AC_RUN_IFELSE([AC_LANG_PROGRAM([#include <stdio.h>], [
+     int op = $1, eax, ebx, ecx, edx;
+     FILE *f;
+      __asm__("cpuid"
+        : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx)
+        : "a" (op));
+     f = fopen("conftest_cpuid", "w"); if (!f) return 1;
+     fprintf(f, "%x:%x:%x:%x\n", eax, ebx, ecx, edx);
+     fclose(f);
+     return 0;
+])],
+     [ax_cv_gcc_x86_cpuid_$1=`cat conftest_cpuid`; rm -f conftest_cpuid],
+     [ax_cv_gcc_x86_cpuid_$1=unknown; rm -f conftest_cpuid],
+     [ax_cv_gcc_x86_cpuid_$1=unknown])])
+AC_LANG_POP([C])
+])

+ 133 - 0
Engine/lib/sdl/acinclude/pkg_config.m4

@@ -0,0 +1,133 @@
+# PKG_PROG_PKG_CONFIG([MIN-VERSION])
+# ----------------------------------
+AC_DEFUN([PKG_PROG_PKG_CONFIG],
+[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
+m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
+AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
+AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
+AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
+
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
+fi
+if test -n "$PKG_CONFIG"; then
+	_pkg_min_version=m4_default([$1], [0.9.0])
+	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
+	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+		AC_MSG_RESULT([yes])
+	else
+		AC_MSG_RESULT([no])
+		PKG_CONFIG=""
+	fi
+fi[]dnl
+])# PKG_PROG_PKG_CONFIG
+
+# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+#
+# Check to see whether a particular set of modules exists.  Similar
+# to PKG_CHECK_MODULES(), but does not set variables or print errors.
+#
+# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+# only at the first occurence in configure.ac, so if the first place
+# it's called might be skipped (such as if it is within an "if", you
+# have to call PKG_CHECK_EXISTS manually
+# --------------------------------------------------------------
+AC_DEFUN([PKG_CHECK_EXISTS],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+if test -n "$PKG_CONFIG" && \
+    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
+  m4_default([$2], [:])
+m4_ifvaln([$3], [else
+  $3])dnl
+fi])
+
+# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
+# ---------------------------------------------
+m4_define([_PKG_CONFIG],
+[if test -n "$$1"; then
+    pkg_cv_[]$1="$$1"
+ elif test -n "$PKG_CONFIG"; then
+    PKG_CHECK_EXISTS([$3],
+                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
+		     [pkg_failed=yes])
+ else
+    pkg_failed=untried
+fi[]dnl
+])# _PKG_CONFIG
+
+# _PKG_SHORT_ERRORS_SUPPORTED
+# -----------------------------
+AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
+else
+        _pkg_short_errors_supported=no
+fi[]dnl
+])# _PKG_SHORT_ERRORS_SUPPORTED
+
+
+# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
+# [ACTION-IF-NOT-FOUND])
+#
+#
+# Note that if there is a possibility the first call to
+# PKG_CHECK_MODULES might not happen, you should be sure to include an
+# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
+#
+#
+# --------------------------------------------------------------
+AC_DEFUN([PKG_CHECK_MODULES],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
+AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
+
+pkg_failed=no
+AC_MSG_CHECKING([for $1])
+
+_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
+_PKG_CONFIG([$1][_LIBS], [libs], [$2])
+
+m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
+and $1[]_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.])
+
+if test $pkg_failed = yes; then
+   	AC_MSG_RESULT([no])
+        _PKG_SHORT_ERRORS_SUPPORTED
+        if test $_pkg_short_errors_supported = yes; then
+	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
+        else 
+	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
+        fi
+	# Put the nasty error message in config.log where it belongs
+	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
+
+	m4_default([$4], [AC_MSG_ERROR(
+[Package requirements ($2) were not met:
+
+$$1_PKG_ERRORS
+
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+_PKG_TEXT])dnl
+        ])
+elif test $pkg_failed = untried; then
+     	AC_MSG_RESULT([no])
+	m4_default([$4], [AC_MSG_FAILURE(
+[The pkg-config script could not be found or is too old.  Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
+
+_PKG_TEXT
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.])dnl
+        ])
+else
+	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
+	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
+        AC_MSG_RESULT([yes])
+	$3
+fi[]dnl
+])# PKG_CHECK_MODULES

+ 1 - 1
Engine/lib/sdl/build-scripts/androidbuildlibs.sh

@@ -69,6 +69,6 @@ ndk-build \
   NDK_LIBS_OUT=$lib \
   APP_BUILD_SCRIPT=Android.mk \
   APP_ABI="armeabi-v7a arm64-v8a x86 x86_64" \
-  APP_PLATFORM=android-14 \
+  APP_PLATFORM=android-16 \
   APP_MODULES="SDL2 SDL2_main" \
   $ndk_args

+ 371 - 167
Engine/lib/sdl/build-scripts/install-sh

@@ -1,7 +1,7 @@
 #!/bin/sh
 # install - install a program, script, or datafile
 
-scriptversion=2005-02-02.21
+scriptversion=2011-11-20.07; # UTC
 
 # This originates from X11R5 (mit/util/scripts/install.sh), which was
 # later released in X11R6 (xc/config/util/install.sh) with the
@@ -35,42 +35,72 @@ scriptversion=2005-02-02.21
 # FSF changes to this file are in the public domain.
 #
 # Calling this script install-sh is preferred over install.sh, to prevent
-# `make' implicit rules from creating a file called install from it
+# 'make' implicit rules from creating a file called install from it
 # when there is no Makefile.
 #
 # This script is compatible with the BSD install script, but was written
-# from scratch.  It can only install one file at a time, a restriction
-# shared with many OS's install programs.
+# from scratch.
+
+nl='
+'
+IFS=" ""	$nl"
 
 # set DOITPROG to echo to test this script
 
 # Don't use :- since 4.3BSD and earlier shells don't like it.
-doit="${DOITPROG-}"
+doit=${DOITPROG-}
+if test -z "$doit"; then
+  doit_exec=exec
+else
+  doit_exec=$doit
+fi
 
-# put in absolute paths if you don't have them in your path; or use env. vars.
+# Put in absolute file names if you don't have them in your path;
+# or use environment vars.
+
+chgrpprog=${CHGRPPROG-chgrp}
+chmodprog=${CHMODPROG-chmod}
+chownprog=${CHOWNPROG-chown}
+cmpprog=${CMPPROG-cmp}
+cpprog=${CPPROG-cp}
+mkdirprog=${MKDIRPROG-mkdir}
+mvprog=${MVPROG-mv}
+rmprog=${RMPROG-rm}
+stripprog=${STRIPPROG-strip}
+
+posix_glob='?'
+initialize_posix_glob='
+  test "$posix_glob" != "?" || {
+    if (set -f) 2>/dev/null; then
+      posix_glob=
+    else
+      posix_glob=:
+    fi
+  }
+'
 
-mvprog="${MVPROG-mv}"
-cpprog="${CPPROG-cp}"
-chmodprog="${CHMODPROG-chmod}"
-chownprog="${CHOWNPROG-chown}"
-chgrpprog="${CHGRPPROG-chgrp}"
-stripprog="${STRIPPROG-strip}"
-rmprog="${RMPROG-rm}"
-mkdirprog="${MKDIRPROG-mkdir}"
+posix_mkdir=
+
+# Desired mode of installed file.
+mode=0755
 
-chmodcmd="$chmodprog 0755"
-chowncmd=
 chgrpcmd=
-stripcmd=
+chmodcmd=$chmodprog
+chowncmd=
+mvcmd=$mvprog
 rmcmd="$rmprog -f"
-mvcmd="$mvprog"
+stripcmd=
+
 src=
 dst=
 dir_arg=
-dstarg=
+dst_arg=
+
+copy_on_change=false
 no_target_directory=
 
-usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
+usage="\
+Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
    or: $0 [OPTION]... SRCFILES... DIRECTORY
    or: $0 [OPTION]... -t DIRECTORY SRCFILES...
    or: $0 [OPTION]... -d DIRECTORIES...
@@ -80,108 +110,148 @@ In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
 In the 4th, create DIRECTORIES.
 
 Options:
--c         (ignored)
--d         create directories instead of installing files.
--g GROUP   $chgrpprog installed files to GROUP.
--m MODE    $chmodprog installed files to MODE.
--o USER    $chownprog installed files to USER.
--s         $stripprog installed files.
--t DIRECTORY  install into DIRECTORY.
--T         report an error if DSTFILE is a directory.
---help     display this help and exit.
---version  display version info and exit.
+     --help     display this help and exit.
+     --version  display version info and exit.
+
+  -c            (ignored)
+  -C            install only if different (preserve the last data modification time)
+  -d            create directories instead of installing files.
+  -g GROUP      $chgrpprog installed files to GROUP.
+  -m MODE       $chmodprog installed files to MODE.
+  -o USER       $chownprog installed files to USER.
+  -s            $stripprog installed files.
+  -t DIRECTORY  install into DIRECTORY.
+  -T            report an error if DSTFILE is a directory.
 
 Environment variables override the default commands:
-  CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
+  CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
+  RMPROG STRIPPROG
 "
 
-while test -n "$1"; do
+while test $# -ne 0; do
   case $1 in
-    -c) shift
-        continue;;
+    -c) ;;
+
+    -C) copy_on_change=true;;
 
-    -d) dir_arg=true
-        shift
-        continue;;
+    -d) dir_arg=true;;
 
     -g) chgrpcmd="$chgrpprog $2"
-        shift
-        shift
-        continue;;
+	shift;;
 
     --help) echo "$usage"; exit $?;;
 
-    -m) chmodcmd="$chmodprog $2"
-        shift
-        shift
-        continue;;
+    -m) mode=$2
+	case $mode in
+	  *' '* | *'	'* | *'
+'*	  | *'*'* | *'?'* | *'['*)
+	    echo "$0: invalid mode: $mode" >&2
+	    exit 1;;
+	esac
+	shift;;
 
     -o) chowncmd="$chownprog $2"
-        shift
-        shift
-        continue;;
+	shift;;
 
-    -s) stripcmd=$stripprog
-        shift
-        continue;;
+    -s) stripcmd=$stripprog;;
 
-    -t) dstarg=$2
-	shift
-	shift
-	continue;;
+    -t) dst_arg=$2
+	# Protect names problematic for 'test' and other utilities.
+	case $dst_arg in
+	  -* | [=\(\)!]) dst_arg=./$dst_arg;;
+	esac
+	shift;;
 
-    -T) no_target_directory=true
-	shift
-	continue;;
+    -T) no_target_directory=true;;
 
     --version) echo "$0 $scriptversion"; exit $?;;
 
-    *)  # When -d is used, all remaining arguments are directories to create.
-	# When -t is used, the destination is already specified.
-	test -n "$dir_arg$dstarg" && break
-        # Otherwise, the last argument is the destination.  Remove it from $@.
-	for arg
-	do
-          if test -n "$dstarg"; then
-	    # $@ is not empty: it contains at least $arg.
-	    set fnord "$@" "$dstarg"
-	    shift # fnord
-	  fi
-	  shift # arg
-	  dstarg=$arg
-	done
+    --)	shift
 	break;;
+
+    -*)	echo "$0: invalid option: $1" >&2
+	exit 1;;
+
+    *)  break;;
   esac
+  shift
 done
 
-if test -z "$1"; then
+if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
+  # When -d is used, all remaining arguments are directories to create.
+  # When -t is used, the destination is already specified.
+  # Otherwise, the last argument is the destination.  Remove it from $@.
+  for arg
+  do
+    if test -n "$dst_arg"; then
+      # $@ is not empty: it contains at least $arg.
+      set fnord "$@" "$dst_arg"
+      shift # fnord
+    fi
+    shift # arg
+    dst_arg=$arg
+    # Protect names problematic for 'test' and other utilities.
+    case $dst_arg in
+      -* | [=\(\)!]) dst_arg=./$dst_arg;;
+    esac
+  done
+fi
+
+if test $# -eq 0; then
   if test -z "$dir_arg"; then
     echo "$0: no input file specified." >&2
     exit 1
   fi
-  # It's OK to call `install-sh -d' without argument.
+  # It's OK to call 'install-sh -d' without argument.
   # This can happen when creating conditional directories.
   exit 0
 fi
 
+if test -z "$dir_arg"; then
+  do_exit='(exit $ret); exit $ret'
+  trap "ret=129; $do_exit" 1
+  trap "ret=130; $do_exit" 2
+  trap "ret=141; $do_exit" 13
+  trap "ret=143; $do_exit" 15
+
+  # Set umask so as not to create temps with too-generous modes.
+  # However, 'strip' requires both read and write access to temps.
+  case $mode in
+    # Optimize common cases.
+    *644) cp_umask=133;;
+    *755) cp_umask=22;;
+
+    *[0-7])
+      if test -z "$stripcmd"; then
+	u_plus_rw=
+      else
+	u_plus_rw='% 200'
+      fi
+      cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
+    *)
+      if test -z "$stripcmd"; then
+	u_plus_rw=
+      else
+	u_plus_rw=,u+rw
+      fi
+      cp_umask=$mode$u_plus_rw;;
+  esac
+fi
+
 for src
 do
-  # Protect names starting with `-'.
+  # Protect names problematic for 'test' and other utilities.
   case $src in
-    -*) src=./$src ;;
+    -* | [=\(\)!]) src=./$src;;
   esac
 
   if test -n "$dir_arg"; then
     dst=$src
-    src=
-
-    if test -d "$dst"; then
-      mkdircmd=:
-      chmodcmd=
-    else
-      mkdircmd=$mkdirprog
-    fi
+    dstdir=$dst
+    test -d "$dstdir"
+    dstdir_status=$?
   else
+
     # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
     # might cause directories to be created, which would be especially bad
     # if $src (and thus $dsttmp) contains '*'.
@@ -190,71 +260,194 @@ do
       exit 1
     fi
 
-    if test -z "$dstarg"; then
+    if test -z "$dst_arg"; then
       echo "$0: no destination specified." >&2
       exit 1
     fi
-
-    dst=$dstarg
-    # Protect names starting with `-'.
-    case $dst in
-      -*) dst=./$dst ;;
-    esac
+    dst=$dst_arg
 
     # If destination is a directory, append the input filename; won't work
     # if double slashes aren't ignored.
     if test -d "$dst"; then
       if test -n "$no_target_directory"; then
-	echo "$0: $dstarg: Is a directory" >&2
+	echo "$0: $dst_arg: Is a directory" >&2
 	exit 1
       fi
-      dst=$dst/`basename "$src"`
+      dstdir=$dst
+      dst=$dstdir/`basename "$src"`
+      dstdir_status=0
+    else
+      # Prefer dirname, but fall back on a substitute if dirname fails.
+      dstdir=`
+	(dirname "$dst") 2>/dev/null ||
+	expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	     X"$dst" : 'X\(//\)[^/]' \| \
+	     X"$dst" : 'X\(//\)$' \| \
+	     X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
+	echo X"$dst" |
+	    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+		   s//\1/
+		   q
+		 }
+		 /^X\(\/\/\)[^/].*/{
+		   s//\1/
+		   q
+		 }
+		 /^X\(\/\/\)$/{
+		   s//\1/
+		   q
+		 }
+		 /^X\(\/\).*/{
+		   s//\1/
+		   q
+		 }
+		 s/.*/./; q'
+      `
+
+      test -d "$dstdir"
+      dstdir_status=$?
     fi
   fi
 
-  # This sed command emulates the dirname command.
-  dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'`
+  obsolete_mkdir_used=false
+
+  if test $dstdir_status != 0; then
+    case $posix_mkdir in
+      '')
+	# Create intermediate dirs using mode 755 as modified by the umask.
+	# This is like FreeBSD 'install' as of 1997-10-28.
+	umask=`umask`
+	case $stripcmd.$umask in
+	  # Optimize common cases.
+	  *[2367][2367]) mkdir_umask=$umask;;
+	  .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
+
+	  *[0-7])
+	    mkdir_umask=`expr $umask + 22 \
+	      - $umask % 100 % 40 + $umask % 20 \
+	      - $umask % 10 % 4 + $umask % 2
+	    `;;
+	  *) mkdir_umask=$umask,go-w;;
+	esac
+
+	# With -d, create the new directory with the user-specified mode.
+	# Otherwise, rely on $mkdir_umask.
+	if test -n "$dir_arg"; then
+	  mkdir_mode=-m$mode
+	else
+	  mkdir_mode=
+	fi
+
+	posix_mkdir=false
+	case $umask in
+	  *[123567][0-7][0-7])
+	    # POSIX mkdir -p sets u+wx bits regardless of umask, which
+	    # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
+	    ;;
+	  *)
+	    tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+	    trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
+
+	    if (umask $mkdir_umask &&
+		exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
+	    then
+	      if test -z "$dir_arg" || {
+		   # Check for POSIX incompatibilities with -m.
+		   # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
+		   # other-writable bit of parent directory when it shouldn't.
+		   # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+		   ls_ld_tmpdir=`ls -ld "$tmpdir"`
+		   case $ls_ld_tmpdir in
+		     d????-?r-*) different_mode=700;;
+		     d????-?--*) different_mode=755;;
+		     *) false;;
+		   esac &&
+		   $mkdirprog -m$different_mode -p -- "$tmpdir" && {
+		     ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
+		     test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+		   }
+		 }
+	      then posix_mkdir=:
+	      fi
+	      rmdir "$tmpdir/d" "$tmpdir"
+	    else
+	      # Remove any dirs left behind by ancient mkdir implementations.
+	      rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
+	    fi
+	    trap '' 0;;
+	esac;;
+    esac
 
-  # Make sure that the destination directory exists.
+    if
+      $posix_mkdir && (
+	umask $mkdir_umask &&
+	$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
+      )
+    then :
+    else
 
-  # Skip lots of stat calls in the usual case.
-  if test ! -d "$dstdir"; then
-    defaultIFS='
-	 '
-    IFS="${IFS-$defaultIFS}"
+      # The umask is ridiculous, or mkdir does not conform to POSIX,
+      # or it failed possibly due to a race condition.  Create the
+      # directory the slow way, step by step, checking for races as we go.
 
-    oIFS=$IFS
-    # Some sh's can't handle IFS=/ for some reason.
-    IFS='%'
-    set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
-    shift
-    IFS=$oIFS
+      case $dstdir in
+	/*) prefix='/';;
+	[-=\(\)!]*) prefix='./';;
+	*)  prefix='';;
+      esac
 
-    pathcomp=
+      eval "$initialize_posix_glob"
 
-    while test $# -ne 0 ; do
-      pathcomp=$pathcomp$1
+      oIFS=$IFS
+      IFS=/
+      $posix_glob set -f
+      set fnord $dstdir
       shift
-      if test ! -d "$pathcomp"; then
-        $mkdirprog "$pathcomp"
-	# mkdir can fail with a `File exist' error in case several
-	# install-sh are creating the directory concurrently.  This
-	# is OK.
-	test -d "$pathcomp" || exit
+      $posix_glob set +f
+      IFS=$oIFS
+
+      prefixes=
+
+      for d
+      do
+	test X"$d" = X && continue
+
+	prefix=$prefix$d
+	if test -d "$prefix"; then
+	  prefixes=
+	else
+	  if $posix_mkdir; then
+	    (umask=$mkdir_umask &&
+	     $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
+	    # Don't fail if two instances are running concurrently.
+	    test -d "$prefix" || exit 1
+	  else
+	    case $prefix in
+	      *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
+	      *) qprefix=$prefix;;
+	    esac
+	    prefixes="$prefixes '$qprefix'"
+	  fi
+	fi
+	prefix=$prefix/
+      done
+
+      if test -n "$prefixes"; then
+	# Don't fail if two instances are running concurrently.
+	(umask $mkdir_umask &&
+	 eval "\$doit_exec \$mkdirprog $prefixes") ||
+	  test -d "$dstdir" || exit 1
+	obsolete_mkdir_used=true
       fi
-      pathcomp=$pathcomp/
-    done
+    fi
   fi
 
   if test -n "$dir_arg"; then
-    $doit $mkdircmd "$dst" \
-      && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \
-      && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \
-      && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \
-      && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; }
-
+    { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
+    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
+    { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
+      test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
   else
-    dstfile=`basename "$dst"`
 
     # Make a couple of temp file names in the proper directory.
     dsttmp=$dstdir/_inst.$$_
@@ -262,10 +455,9 @@ do
 
     # Trap to clean up those temp files at exit.
     trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
-    trap '(exit $?); exit' 1 2 13 15
 
     # Copy the file name to the temp name.
-    $doit $cpprog "$src" "$dsttmp" &&
+    (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
 
     # and set any options; do chmod last to preserve setuid bits.
     #
@@ -273,51 +465,63 @@ do
     # ignore errors from any of these, just make sure not to ignore
     # errors from the above "$doit $cpprog $src $dsttmp" command.
     #
-    { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
-      && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
-      && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
-      && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } &&
-
-    # Now rename the file to the real destination.
-    { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \
-      || {
-	   # The rename failed, perhaps because mv can't rename something else
-	   # to itself, or perhaps because mv is so ancient that it does not
-	   # support -f.
-
-	   # Now remove or move aside any old file at destination location.
-	   # We try this two ways since rm can't unlink itself on some
-	   # systems and the destination file might be busy for other
-	   # reasons.  In this case, the final cleanup might fail but the new
-	   # file should still install successfully.
-	   {
-	     if test -f "$dstdir/$dstfile"; then
-	       $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \
-	       || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \
-	       || {
-		 echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
-		 (exit 1); exit 1
-	       }
-	     else
-	       :
-	     fi
-	   } &&
-
-	   # Now rename the file to the real destination.
-	   $doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
-	 }
-    }
-  fi || { (exit 1); exit 1; }
+    { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
+    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
+    { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
+    { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
+
+    # If -C, don't bother to copy if it wouldn't change the file.
+    if $copy_on_change &&
+       old=`LC_ALL=C ls -dlL "$dst"	2>/dev/null` &&
+       new=`LC_ALL=C ls -dlL "$dsttmp"	2>/dev/null` &&
+
+       eval "$initialize_posix_glob" &&
+       $posix_glob set -f &&
+       set X $old && old=:$2:$4:$5:$6 &&
+       set X $new && new=:$2:$4:$5:$6 &&
+       $posix_glob set +f &&
+
+       test "$old" = "$new" &&
+       $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
+    then
+      rm -f "$dsttmp"
+    else
+      # Rename the file to the real destination.
+      $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
+
+      # The rename failed, perhaps because mv can't rename something else
+      # to itself, or perhaps because mv is so ancient that it does not
+      # support -f.
+      {
+	# Now remove or move aside any old file at destination location.
+	# We try this two ways since rm can't unlink itself on some
+	# systems and the destination file might be busy for other
+	# reasons.  In this case, the final cleanup might fail but the new
+	# file should still install successfully.
+	{
+	  test ! -f "$dst" ||
+	  $doit $rmcmd -f "$dst" 2>/dev/null ||
+	  { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
+	    { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
+	  } ||
+	  { echo "$0: cannot unlink or rename $dst" >&2
+	    (exit 1); exit 1
+	  }
+	} &&
+
+	# Now rename the file to the real destination.
+	$doit $mvcmd "$dsttmp" "$dst"
+      }
+    fi || exit 1
+
+    trap '' 0
+  fi
 done
 
-# The final little trick to "correctly" pass the exit status to the exit trap.
-{
-  (exit 0); exit 0
-}
-
 # Local variables:
 # eval: (add-hook 'write-file-hooks 'time-stamp)
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-end: "$"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
 # End:

+ 124 - 61
Engine/lib/sdl/build-scripts/mkinstalldirs

@@ -1,29 +1,59 @@
 #! /bin/sh
 # mkinstalldirs --- make directory hierarchy
-# Author: Noah Friedman <[email protected]>
-# Created: 1993-05-16
-# Public domain
 
+scriptversion=2009-04-28.21; # UTC
+
+# Original author: Noah Friedman <[email protected]>
+# Created: 1993-05-16
+# Public domain.
+#
+# This file is maintained in Automake, please report
+# bugs to <[email protected]> or send patches to
+# <[email protected]>.
+
+nl='
+'
+IFS=" ""	$nl"
 errstatus=0
-dirmode=""
+dirmode=
 
 usage="\
-Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..."
+Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ...
+
+Create each directory DIR (with mode MODE, if specified), including all
+leading file name components.
+
+Report bugs to <[email protected]>."
 
 # process command line arguments
 while test $# -gt 0 ; do
-   case "${1}" in
-     -h | --help | --h* )			# -h for help
-	echo "${usage}" 1>&2; exit 0 ;;
-     -m )					# -m PERM arg
-	shift
-	test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; }
-	dirmode="${1}"
-	shift ;;
-     -- ) shift; break ;;			# stop option processing
-     -* ) echo "${usage}" 1>&2; exit 1 ;;	# unknown option
-     * )  break ;;				# first non-opt arg
-   esac
+  case $1 in
+    -h | --help | --h*)         # -h for help
+      echo "$usage"
+      exit $?
+      ;;
+    -m)                         # -m PERM arg
+      shift
+      test $# -eq 0 && { echo "$usage" 1>&2; exit 1; }
+      dirmode=$1
+      shift
+      ;;
+    --version)
+      echo "$0 $scriptversion"
+      exit $?
+      ;;
+    --)                         # stop option processing
+      shift
+      break
+      ;;
+    -*)                         # unknown option
+      echo "$usage" 1>&2
+      exit 1
+      ;;
+    *)                          # first non-opt arg
+      break
+      ;;
+  esac
 done
 
 for file
@@ -36,64 +66,97 @@ do
 done
 
 case $# in
-0) exit 0 ;;
+  0) exit 0 ;;
 esac
 
+# Solaris 8's mkdir -p isn't thread-safe.  If you mkdir -p a/b and
+# mkdir -p a/c at the same time, both will detect that a is missing,
+# one will create a, then the other will try to create a and die with
+# a "File exists" error.  This is a problem when calling mkinstalldirs
+# from a parallel make.  We use --version in the probe to restrict
+# ourselves to GNU mkdir, which is thread-safe.
 case $dirmode in
-'')
-  if mkdir -p -- . 2>/dev/null; then
-    echo "mkdir -p -- $*"
-    exec mkdir -p -- "$@"
-  fi ;;
-*)
-  if mkdir -m "$dirmode" -p -- . 2>/dev/null; then
-    echo "mkdir -m $dirmode -p -- $*"
-    exec mkdir -m "$dirmode" -p -- "$@"
-  fi ;;
+  '')
+    if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
+      echo "mkdir -p -- $*"
+      exec mkdir -p -- "$@"
+    else
+      # On NextStep and OpenStep, the 'mkdir' command does not
+      # recognize any option.  It will interpret all options as
+      # directories to create, and then abort because '.' already
+      # exists.
+      test -d ./-p && rmdir ./-p
+      test -d ./--version && rmdir ./--version
+    fi
+    ;;
+  *)
+    if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 &&
+       test ! -d ./--version; then
+      echo "mkdir -m $dirmode -p -- $*"
+      exec mkdir -m "$dirmode" -p -- "$@"
+    else
+      # Clean up after NextStep and OpenStep mkdir.
+      for d in ./-m ./-p ./--version "./$dirmode";
+      do
+        test -d $d && rmdir $d
+      done
+    fi
+    ;;
 esac
 
 for file
 do
-   set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
-   shift
-
-   pathcomp=
-   for d
-   do
-     pathcomp="$pathcomp$d"
-     case "$pathcomp" in
-       -* ) pathcomp=./$pathcomp ;;
-     esac
-
-     if test ! -d "$pathcomp"; then
-	echo "mkdir $pathcomp"
-
-	mkdir "$pathcomp" || lasterr=$?
-
-	if test ! -d "$pathcomp"; then
-	  errstatus=$lasterr
-	else
-	  if test ! -z "$dirmode"; then
-	     echo "chmod $dirmode $pathcomp"
-
-	     lasterr=""
-	     chmod "$dirmode" "$pathcomp" || lasterr=$?
-
-	     if test ! -z "$lasterr"; then
-	       errstatus=$lasterr
-	     fi
+  case $file in
+    /*) pathcomp=/ ;;
+    *)  pathcomp= ;;
+  esac
+  oIFS=$IFS
+  IFS=/
+  set fnord $file
+  shift
+  IFS=$oIFS
+
+  for d
+  do
+    test "x$d" = x && continue
+
+    pathcomp=$pathcomp$d
+    case $pathcomp in
+      -*) pathcomp=./$pathcomp ;;
+    esac
+
+    if test ! -d "$pathcomp"; then
+      echo "mkdir $pathcomp"
+
+      mkdir "$pathcomp" || lasterr=$?
+
+      if test ! -d "$pathcomp"; then
+	errstatus=$lasterr
+      else
+	if test ! -z "$dirmode"; then
+	  echo "chmod $dirmode $pathcomp"
+	  lasterr=
+	  chmod "$dirmode" "$pathcomp" || lasterr=$?
+
+	  if test ! -z "$lasterr"; then
+	    errstatus=$lasterr
 	  fi
 	fi
-     fi
+      fi
+    fi
 
-     pathcomp="$pathcomp/"
-   done
+    pathcomp=$pathcomp/
+  done
 done
 
 exit $errstatus
 
 # Local Variables:
 # mode: shell-script
-# sh-indentation: 3
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
 # End:
-# mkinstalldirs ends here

+ 42 - 0
Engine/lib/sdl/build-scripts/os2-buildbot.sh

@@ -0,0 +1,42 @@
+#!/bin/bash
+
+# This is the script buildbot.libsdl.org uses to cross-compile SDL2 from
+#  x86 Linux to OS/2, using OpenWatcom.
+
+# The final zipfile can be unpacked on any machine that supports OpenWatcom
+#  (Windows, Linux, OS/2, etc). Point the compiler at the include directory
+#  and link against the SDL2.lib file. Ship the SDL2.dll with your app.
+
+if [ -z "$WATCOM" ]; then
+    echo "This script expects \$WATCOM to be set to the OpenWatcom install dir." 1>&2
+    echo "This is often something like '/usr/local/share/watcom'" 1>&2
+    exit 1
+fi
+
+export PATH="$WATCOM/binl:$PATH"
+
+ZIPFILE="$1"
+if [ -z $1 ]; then
+    ZIPFILE=sdl-os2.zip
+fi
+ZIPDIR=SDL2-os2
+
+set -e
+set -x
+
+cd `dirname "$0"`
+cd ..
+
+rm -f $ZIPFILE
+wmake -f Makefile.os2
+rm -rf $ZIPDIR
+mkdir $ZIPDIR
+chmod a+r SDL2.lib SDL2.dll
+mv SDL2.lib SDL2.dll $ZIPDIR/
+cp -R include $ZIPDIR/
+zip -9r "$ZIPFILE" $ZIPDIR
+
+wmake -f Makefile.os2 distclean
+
+set +x
+echo "All done. Final installable is in $ZIPFILE ...";

+ 1 - 1
Engine/lib/sdl/build-scripts/raspberrypi-buildbot.sh

@@ -42,7 +42,7 @@ SYSROOT="/opt/rpi-sysroot"
 export CC="ccache /opt/rpi-tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gcc --sysroot=$SYSROOT -I$SYSROOT/opt/vc/include -I$SYSROOT/usr/include -I$SYSROOT/opt/vc/include/interface/vcos/pthreads -I$SYSROOT/opt/vc/include/interface/vmcs_host/linux -L$SYSROOT/opt/vc/lib"
 # -L$SYSROOT/usr/lib/arm-linux-gnueabihf"
 # !!! FIXME: shouldn't have to --disable-* things here.
-../configure --with-sysroot=$SYSROOT --host=arm-raspberry-linux-gnueabihf --prefix=$PWD/rpi-sdl2-installed --disable-pulseaudio --disable-esd --disable-video-mir --disable-video-wayland
+../configure --with-sysroot=$SYSROOT --host=arm-raspberry-linux-gnueabihf --prefix=$PWD/rpi-sdl2-installed --disable-pulseaudio --disable-esd --disable-video-wayland
 $MAKE
 $MAKE install
 # Fix up a few things to a real install path on a real Raspberry Pi...

+ 1 - 1
Engine/lib/sdl/build-scripts/winrtbuild.ps1

@@ -39,7 +39,7 @@
 #
 
 # Base version of SDL, used for packaging purposes
-$SDLVersion = "2.0.7"
+$SDLVersion = "2.0.10"
 
 # Gets the .bat file that sets up an MSBuild environment, given one of
 # Visual Studio's, "PlatformToolset"s.

+ 50 - 79
Engine/lib/sdl/cmake/sdlchecks.cmake

@@ -381,9 +381,21 @@ macro(CheckX11)
         FindLibraryAndSONAME("${_LIB}")
     endforeach()
 
-    find_path(X_INCLUDEDIR X11/Xlib.h)
+    find_path(X_INCLUDEDIR X11/Xlib.h
+        /usr/pkg/xorg/include
+        /usr/X11R6/include
+        /usr/X11R7/include
+        /usr/local/include/X11
+        /usr/include/X11
+        /usr/openwin/include
+        /usr/openwin/share/include
+        /opt/graphics/OpenGL/include
+        /opt/X11/include
+    )
+
     if(X_INCLUDEDIR)
-      set(X_CFLAGS "-I${X_INCLUDEDIR}")
+      list(APPEND EXTRA_CFLAGS "-I${X_INCLUDEDIR}")
+      list(APPEND CMAKE_REQUIRED_INCLUDES "${X_INCLUDEDIR}")
     endif()
 
     check_include_file(X11/Xcursor/Xcursor.h HAVE_XCURSOR_H)
@@ -420,7 +432,7 @@ macro(CheckX11)
         endif()
         if(NOT HAVE_SHMAT)
           add_definitions(-DNO_SHARED_MEMORY)
-          set(X_CFLAGS "${X_CFLAGS} -DNO_SHARED_MEMORY")
+          list(APPEND EXTRA_CFLAGS "-DNO_SHARED_MEMORY")
         endif()
       endif()
 
@@ -439,8 +451,6 @@ macro(CheckX11)
         endif()
       endif()
 
-      set(SDL_CFLAGS "${SDL_CFLAGS} ${X_CFLAGS}")
-
       set(CMAKE_REQUIRED_LIBRARIES ${X11_LIB} ${X11_LIB})
       check_c_source_compiles("
           #include <X11/Xlib.h>
@@ -554,46 +564,6 @@ macro(CheckX11)
   endif()
 endmacro()
 
-# Requires:
-# - EGL
-# - PkgCheckModules
-# Optional:
-# - MIR_SHARED opt
-# - HAVE_DLOPEN opt
-macro(CheckMir)
-    if(VIDEO_MIR)
-        find_library(MIR_LIB mirclient mircommon egl)
-        pkg_check_modules(MIR_TOOLKIT mirclient>=0.26 mircommon)
-        pkg_check_modules(EGL egl)
-        pkg_check_modules(XKB xkbcommon)
-
-        if (MIR_LIB AND MIR_TOOLKIT_FOUND AND EGL_FOUND AND XKB_FOUND)
-            set(HAVE_VIDEO_MIR TRUE)
-            set(HAVE_SDL_VIDEO TRUE)
-
-            file(GLOB MIR_SOURCES ${SDL2_SOURCE_DIR}/src/video/mir/*.c)
-            set(SOURCE_FILES ${SOURCE_FILES} ${MIR_SOURCES})
-            set(SDL_VIDEO_DRIVER_MIR 1)
-
-            list(APPEND EXTRA_CFLAGS ${MIR_TOOLKIT_CFLAGS} ${EGL_CFLAGS} ${XKB_CFLAGS})
-
-            if(MIR_SHARED)
-                if(NOT HAVE_DLOPEN)
-                    message_warn("You must have SDL_LoadObject() support for dynamic Mir loading")
-                else()
-                    FindLibraryAndSONAME(mirclient)
-                    FindLibraryAndSONAME(xkbcommon)
-                    set(SDL_VIDEO_DRIVER_MIR_DYNAMIC "\"${MIRCLIENT_LIB_SONAME}\"")
-                    set(SDL_VIDEO_DRIVER_MIR_DYNAMIC_XKBCOMMON "\"${XKBCOMMON_LIB_SONAME}\"")
-                    set(HAVE_MIR_SHARED TRUE)
-                endif()
-            else()
-                set(EXTRA_LIBS ${MIR_TOOLKIT_LIBRARIES} ${EXTRA_LIBS})
-            endif()
-        endif()
-    endif()
-endmacro()
-
 macro(WaylandProtocolGen _SCANNER _XML _PROTL)
     set(_WAYLAND_PROT_C_CODE "${CMAKE_CURRENT_BINARY_DIR}/wayland-generated-protocols/${_PROTL}-protocol.c")
     set(_WAYLAND_PROT_H_CODE "${CMAKE_CURRENT_BINARY_DIR}/wayland-generated-protocols/${_PROTL}-client-protocol.h")
@@ -625,35 +595,6 @@ macro(CheckWayland)
   if(VIDEO_WAYLAND)
     pkg_check_modules(WAYLAND wayland-client wayland-scanner wayland-protocols wayland-egl wayland-cursor egl xkbcommon)
 
-    # We have to generate some protocol interface code for some various Wayland features.
-    if(WAYLAND_FOUND)
-      execute_process(
-        COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=pkgdatadir wayland-client
-        WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
-        RESULT_VARIABLE WAYLAND_CORE_PROTOCOL_DIR_RC
-        OUTPUT_VARIABLE WAYLAND_CORE_PROTOCOL_DIR
-        ERROR_QUIET
-        OUTPUT_STRIP_TRAILING_WHITESPACE
-      )
-      if(NOT WAYLAND_CORE_PROTOCOL_DIR_RC EQUAL 0)
-        set(WAYLAND_FOUND FALSE)
-      endif()
-    endif()
-
-    if(WAYLAND_FOUND)
-      execute_process(
-        COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=pkgdatadir wayland-protocols
-        WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
-        RESULT_VARIABLE WAYLAND_PROTOCOLS_DIR_RC
-        OUTPUT_VARIABLE WAYLAND_PROTOCOLS_DIR
-        ERROR_QUIET
-        OUTPUT_STRIP_TRAILING_WHITESPACE
-      )
-      if(NOT WAYLAND_PROTOCOLS_DIR_RC EQUAL 0)
-        set(WAYLAND_FOUND FALSE)
-      endif()
-    endif()
-
     if(WAYLAND_FOUND)
       execute_process(
         COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=wayland_scanner wayland-scanner
@@ -685,11 +626,10 @@ macro(CheckWayland)
       file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/wayland-generated-protocols")
       include_directories("${CMAKE_CURRENT_BINARY_DIR}/wayland-generated-protocols")
 
-      WaylandProtocolGen("${WAYLAND_SCANNER}" "${WAYLAND_CORE_PROTOCOL_DIR}/wayland.xml" "wayland")
-
-      foreach(_PROTL relative-pointer-unstable-v1 pointer-constraints-unstable-v1 xdg-shell-unstable-v6)
-        string(REGEX REPLACE "\\-unstable\\-.*$" "" PROTSUBDIR ${_PROTL})
-        WaylandProtocolGen("${WAYLAND_SCANNER}" "${WAYLAND_PROTOCOLS_DIR}/unstable/${PROTSUBDIR}/${_PROTL}.xml" "${_PROTL}")
+      file(GLOB WAYLAND_PROTOCOLS_XML RELATIVE "${SDL2_SOURCE_DIR}/wayland-protocols/" "${SDL2_SOURCE_DIR}/wayland-protocols/*.xml")
+      foreach(_XML ${WAYLAND_PROTOCOLS_XML})
+        string(REGEX REPLACE "\\.xml$" "" _PROTL "${_XML}")
+        WaylandProtocolGen("${WAYLAND_SCANNER}" "${SDL2_SOURCE_DIR}/wayland-protocols/${_XML}" "${_PROTL}")
       endforeach()
 
       if(VIDEO_WAYLAND_QT_TOUCH)
@@ -1125,6 +1065,37 @@ macro(CheckUSBHID)
   endif()
 endmacro()
 
+# Check for HIDAPI joystick drivers. This is currently a Unix thing, not Windows or macOS!
+macro(CheckHIDAPI)
+  if(HIDAPI)
+    if(HIDAPI_SKIP_LIBUSB)
+      set(HAVE_HIDAPI TRUE)
+    else()
+      set(HAVE_HIDAPI FALSE)
+      pkg_check_modules(LIBUSB libusb)
+      if (LIBUSB_FOUND)
+        check_include_file(libusb.h HAVE_LIBUSB_H)
+        if (HAVE_LIBUSB_H)
+          set(HAVE_HIDAPI TRUE)
+        endif()
+      endif()
+    endif()
+
+    if(HAVE_HIDAPI)
+      set(SDL_JOYSTICK_HIDAPI 1)
+      set(HAVE_SDL_JOYSTICK TRUE)
+      file(GLOB HIDAPI_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/hidapi/*.c)
+      set(SOURCE_FILES ${SOURCE_FILES} ${HIDAPI_SOURCES})
+      set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${LIBUSB_CFLAGS} -I${SDL2_SOURCE_DIR}/src/hidapi/hidapi")
+      if(NOT HIDAPI_SKIP_LIBUSB)
+        set(SOURCE_FILES ${SOURCE_FILES} ${SDL2_SOURCE_DIR}/src/hidapi/libusb/hid.c)
+        list(APPEND EXTRA_LIBS ${LIBUSB_LIBS})
+      endif()
+    endif()
+  endif()
+endmacro()
+
+
 # Requires:
 # - n/a
 macro(CheckRPI)

Fișier diff suprimat deoarece este prea mare
+ 584 - 202
Engine/lib/sdl/configure


+ 4225 - 0
Engine/lib/sdl/configure.ac

@@ -0,0 +1,4225 @@
+dnl Process this file with autoconf to produce a configure script.
+AC_INIT(README.txt)
+AC_CONFIG_HEADER(include/SDL_config.h)
+AC_CONFIG_AUX_DIR(build-scripts)
+AC_CONFIG_MACRO_DIR([acinclude])
+
+dnl Save the CFLAGS to see whether they were passed in or generated
+orig_CFLAGS="$CFLAGS"
+
+dnl Set various version strings - taken gratefully from the GTk sources
+#
+# Making releases:
+# Edit include/SDL_version.h and change the version, then:
+#   SDL_MICRO_VERSION += 1;
+#   SDL_INTERFACE_AGE += 1;
+#   SDL_BINARY_AGE += 1;
+# if any functions have been added, set SDL_INTERFACE_AGE to 0.
+# if backwards compatibility has been broken,
+# set SDL_BINARY_AGE and SDL_INTERFACE_AGE to 0.
+#
+SDL_MAJOR_VERSION=2
+SDL_MINOR_VERSION=0
+SDL_MICRO_VERSION=10
+SDL_INTERFACE_AGE=0
+SDL_BINARY_AGE=10
+SDL_VERSION=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION.$SDL_MICRO_VERSION
+
+AC_SUBST(SDL_MAJOR_VERSION)
+AC_SUBST(SDL_MINOR_VERSION)
+AC_SUBST(SDL_MICRO_VERSION)
+AC_SUBST(SDL_INTERFACE_AGE)
+AC_SUBST(SDL_BINARY_AGE)
+AC_SUBST(SDL_VERSION)
+
+# libtool versioning
+LT_INIT([win32-dll])
+
+LT_RELEASE=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION
+LT_CURRENT=`expr $SDL_MICRO_VERSION - $SDL_INTERFACE_AGE`
+LT_REVISION=$SDL_INTERFACE_AGE
+LT_AGE=`expr $SDL_BINARY_AGE - $SDL_INTERFACE_AGE`
+m4_pattern_allow([^LT_])
+
+AC_SUBST(LT_RELEASE)
+AC_SUBST(LT_CURRENT)
+AC_SUBST(LT_REVISION)
+AC_SUBST(LT_AGE)
+
+dnl Detect the canonical build and host environments
+dnl AC_CANONICAL_HOST
+
+dnl Check for tools
+AC_PROG_LIBTOOL
+AC_PROG_CC
+AC_PROG_CXX
+AC_PROG_INSTALL
+AC_PROG_MAKE_SET
+AC_CHECK_TOOL(WINDRES, [windres], [:])
+PKG_PROG_PKG_CONFIG
+
+dnl Make sure that srcdir is a full pathname
+case "$host" in
+    *-*-mingw32*)
+        # Except on msys, where make can't handle full pathnames (bug 1972)
+        ;;
+    *)
+        srcdir=`cd $srcdir && pwd`
+        ;;
+esac
+
+dnl Set up the compiler and linker flags
+INCLUDE="-I$srcdir/include -idirafter $srcdir/src/video/khronos"
+if test x$srcdir != x.; then
+    INCLUDE="-Iinclude $INCLUDE"
+elif test -d .hg; then
+    AC_MSG_ERROR([
+*** When building from Mercurial you should configure and build in a
+    separate directory so you don't clobber SDL_config.h, SDL_revision.h
+])
+fi
+BASE_CFLAGS=""
+BASE_LDFLAGS=""
+case "$host" in
+    *-*-cygwin*)
+        # We build SDL on cygwin without the UNIX emulation layer
+        save_CFLAGS="$CFLAGS"
+        have_no_cygwin=no
+        AC_MSG_CHECKING(for GCC -mno-cygwin option)
+        CFLAGS="$save_CFLAGS -mno-cygwin"
+
+        AC_TRY_COMPILE([
+        ],[
+        ],[
+        have_no_cygwin=yes
+        ])
+        AC_MSG_RESULT($have_no_cygwin)
+        CFLAGS="$save_CFLAGS"
+
+        if test x$have_no_cygwin = xyes; then
+            BASE_CFLAGS="-mno-cygwin"
+            BASE_LDFLAGS="-mno-cygwin"
+        fi
+        BASE_CFLAGS="$BASE_CFLAGS -I/usr/include/mingw"
+        ;;
+esac
+# Uncomment the following line if you want to force SDL and applications
+# built with it to be compiled for a particular architecture.
+#AX_GCC_ARCHFLAG([no], [BASE_CFLAGS="$BASE_CFLAGS $ax_cv_gcc_archflag]")
+BUILD_CFLAGS="$CFLAGS $CPPFLAGS -DUSING_GENERATED_CONFIG_H"
+# The default optimization for SDL is -O3 (Bug #31)
+if test "x$orig_CFLAGS" = x; then
+    BUILD_CFLAGS=`echo $BUILD_CFLAGS | sed 's/-O2/-O3/'`
+fi
+EXTRA_CFLAGS="$INCLUDE $BASE_CFLAGS"
+BUILD_LDFLAGS="$LDFLAGS"
+EXTRA_LDFLAGS="$BASE_LDFLAGS"
+## These are common directories to find software packages
+#for path in /usr/freeware /usr/pkg /usr/X11R6 /usr/local; do
+#    if test -d $path/include; then
+#        EXTRA_CFLAGS="$EXTRA_CFLAGS -I$path/include"
+#    fi
+#    if test -d $path/lib; then
+#        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -L$path/lib"
+#    fi
+#done
+SDL_CFLAGS="$BASE_CFLAGS"
+SDL_LIBS="-lSDL2"
+if test "x$BASE_LDFLAGS" != x; then
+    SDL_LIBS="$SDL_LIBS $BASE_LDFLAGS"
+fi
+if test "x$EXTRA_CFLAGS" != x; then
+    CPPFLAGS="$CPPFLAGS $EXTRA_CFLAGS"
+    CFLAGS="$CFLAGS $EXTRA_CFLAGS"
+fi
+if test "x$EXTRA_LDFLAGS" != x; then
+    LDFLAGS="$LDFLAGS $EXTRA_LDFLAGS"
+fi
+
+dnl set this to use on systems that use lib64 instead of lib
+base_libdir=`echo \${libdir} | sed 's/.*\/\(.*\)/\1/; q'`
+
+dnl Function to find a library in the compiler search path
+find_lib()
+{
+    gcc_bin_path=[`$CC -print-search-dirs 2>/dev/null | fgrep programs: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'`]
+    gcc_lib_path=[`$CC -print-search-dirs 2>/dev/null | fgrep libraries: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'`]
+    env_lib_path=[`echo $LIBS $LDFLAGS $* | sed 's/-L[ ]*//g'`]
+    if test "$cross_compiling" = yes; then
+        host_lib_path=""
+    else
+        host_lib_path="/usr/$base_libdir /usr/local/$base_libdir"
+    fi
+    for path in $env_lib_path $gcc_bin_path $gcc_lib_path $host_lib_path; do
+        lib=[`ls -- $path/$1 2>/dev/null | sed -e '/\.so\..*\./d' -e 's,.*/,,' | sort | tail -1`]
+        if test x$lib != x; then
+            echo $lib
+            return
+        fi
+    done
+    # Try again, this time allowing more than one version digit after the .so
+    for path in $env_lib_path $gcc_bin_path $gcc_lib_path $host_lib_path; do
+        lib=[`ls -- $path/$1 2>/dev/null | sed -e 's,.*/,,' | sort | tail -1`]
+        if test x$lib != x; then
+            echo $lib
+            return
+        fi
+    done
+}
+
+dnl Check for compiler characteristics
+AC_C_CONST
+AC_C_INLINE
+AC_C_VOLATILE
+
+dnl See whether we want assertions for debugging/sanity checking SDL itself.
+AC_ARG_ENABLE(assertions,
+AS_HELP_STRING([--enable-assertions],
+               [Enable internal sanity checks (auto/disabled/release/enabled/paranoid) [[default=auto]]]),
+              , enable_assertions=auto)
+case "$enable_assertions" in
+    auto) # Use optimization settings to determine assertion level
+        ;;
+    disabled)
+        AC_DEFINE(SDL_DEFAULT_ASSERT_LEVEL, 0, [ ])
+        ;;
+    release)
+        AC_DEFINE(SDL_DEFAULT_ASSERT_LEVEL, 1, [ ])
+        ;;
+    enabled)
+        AC_DEFINE(SDL_DEFAULT_ASSERT_LEVEL, 2, [ ])
+        ;;
+    paranoid)
+        AC_DEFINE(SDL_DEFAULT_ASSERT_LEVEL, 3, [ ])
+        ;;
+    *)
+        AC_MSG_ERROR([*** unknown assertion level. stop.])
+        ;;
+esac
+
+dnl See whether we can use gcc style dependency tracking
+AC_ARG_ENABLE(dependency-tracking,
+AS_HELP_STRING([--enable-dependency-tracking],
+               [Use gcc -MMD -MT dependency tracking [[default=yes]]]),
+              , enable_dependency_tracking=yes)
+if test x$enable_dependency_tracking = xyes; then
+    have_gcc_mmd_mt=no
+    AC_MSG_CHECKING(for GCC -MMD -MT option)
+    AC_TRY_COMPILE([
+    #if !defined(__GNUC__) || __GNUC__ < 3
+    #error Dependency tracking requires GCC 3.0 or newer
+    #endif
+    ],[
+    ],[
+    have_gcc_mmd_mt=yes
+    ])
+    AC_MSG_RESULT($have_gcc_mmd_mt)
+
+    if test x$have_gcc_mmd_mt = xyes; then
+        DEPENDENCY_TRACKING_OPTIONS="-MMD -MT \$@"
+    fi
+fi
+
+AC_MSG_CHECKING(for linker option --no-undefined)
+have_no_undefined=no
+case "$host" in
+    dnl Skip this on platforms where it is just simply busted.
+    *-*-openbsd*)
+        ;;
+
+    *)
+        save_LDFLAGS="$LDFLAGS"
+        LDFLAGS="$LDFLAGS -Wl,--no-undefined"
+        AC_TRY_LINK([
+        ],[
+        ],[
+        have_no_undefined=yes
+        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,--no-undefined"
+        ])
+        LDFLAGS="$save_LDFLAGS"
+        ;;
+esac
+AC_MSG_RESULT($have_no_undefined)
+
+AC_MSG_CHECKING(for linker option --dynamicbase)
+have_dynamicbase=no
+case "$host" in
+    *)
+        save_LDFLAGS="$LDFLAGS"
+        LDFLAGS="$LDFLAGS -Wl,--dynamicbase"
+        AC_TRY_LINK([
+        ],[
+        ],[
+        have_dynamicbase=yes
+        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,--dynamicbase"
+        ])
+        LDFLAGS="$save_LDFLAGS"
+        ;;
+esac
+AC_MSG_RESULT($have_dynamicbase)
+
+AC_MSG_CHECKING(for linker option --nxcompat)
+have_nxcompat=no
+case "$host" in
+    *)
+        save_LDFLAGS="$LDFLAGS"
+        LDFLAGS="$LDFLAGS -Wl,--nxcompat"
+        AC_TRY_LINK([
+        ],[
+        ],[
+        have_nxcompat=yes
+        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,--nxcompat"
+        ])
+        LDFLAGS="$save_LDFLAGS"
+        ;;
+esac
+AC_MSG_RESULT($have_nxcompat)
+
+AC_MSG_CHECKING(for linker option --high-entropy-va)
+have_high_entropy_va=no
+case "$host" in
+    *)
+        save_LDFLAGS="$LDFLAGS"
+        LDFLAGS="$LDFLAGS -Wl,--high-entropy-va"
+        AC_TRY_LINK([
+        ],[
+        ],[
+        have_high_entropy_va=yes
+        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,--high-entropy-va"
+        ])
+        LDFLAGS="$save_LDFLAGS"
+        ;;
+esac
+AC_MSG_RESULT($have_high_entropy_va)
+
+dnl See whether we are allowed to use the system C library
+AC_ARG_ENABLE(libc,
+AS_HELP_STRING([--enable-libc], [Use the system C library [[default=yes]]]),
+              , enable_libc=yes)
+if test x$enable_libc = xyes; then
+    AC_DEFINE(HAVE_LIBC, 1, [ ])
+
+    dnl Check for C library headers
+    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)
+
+    dnl Check for typedefs, structures, etc.
+    AC_TYPE_SIZE_T
+
+    dnl Check for defines
+    AC_CHECK_DEFINE(M_PI, math.h)
+
+    dnl Checks for library functions.
+    case "$host" in
+    *-*-cygwin* | *-*-mingw32*)
+        ;;
+    *)
+        AC_FUNC_ALLOCA
+        ;;
+    esac
+
+    AC_FUNC_MEMCMP
+    if test x$ac_cv_func_memcmp_working = xyes; then
+        AC_DEFINE(HAVE_MEMCMP, 1, [ ])
+    fi
+    AC_FUNC_STRTOD
+    if test x$ac_cv_func_strtod = xyes; then
+        AC_DEFINE(HAVE_STRTOD, 1, [ ])
+    fi
+    AC_CHECK_FUNC(mprotect,
+        AC_TRY_COMPILE([
+          #include <sys/types.h>
+          #include <sys/mman.h>
+        ],[
+        ],[
+        AC_DEFINE(HAVE_MPROTECT, 1, [ ])
+        ]),
+    )
+    AC_CHECK_FUNCS(malloc calloc realloc free getenv setenv putenv unsetenv qsort abs bcopy memset memcpy memmove wcslen wcscmp strlen strlcpy strlcat _strrev _strupr _strlwr strchr strrchr strstr itoa _ltoa _uitoa _ultoa strtol strtoul _i64toa _ui64toa strtoll strtoull atoi atof strcmp strncmp _stricmp strcasecmp _strnicmp strncasecmp vsscanf vsnprintf fopen64 fseeko fseeko64 sigaction setjmp nanosleep sysconf sysctlbyname getauxval poll _Exit)
+
+    AC_CHECK_LIB(m, pow, [LIBS="$LIBS -lm"; EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lm"])
+    AC_CHECK_FUNCS(acos acosf asin asinf atan atanf atan2 atan2f ceil ceilf copysign copysignf cos cosf exp expf fabs fabsf floor floorf fmod fmodf log logf log10 log10f pow powf scalbn scalbnf sin sinf sqrt sqrtf tan tanf)
+
+    AC_CHECK_LIB(iconv, iconv_open, [LIBS="$LIBS -liconv"; EXTRA_LDFLAGS="$EXTRA_LDFLAGS -liconv"])
+    AC_CHECK_FUNCS(iconv)
+
+    AC_CHECK_MEMBER(struct sigaction.sa_sigaction,[AC_DEFINE([HAVE_SA_SIGACTION], 1, [ ])], ,[#include <signal.h>])
+
+    dnl Check for additional non-standard headers
+    AC_CHECK_HEADERS(libunwind.h)
+fi
+
+dnl AC_CHECK_SIZEOF(void*)
+
+dnl See whether we can use gcc atomic operations on this architecture
+AC_ARG_ENABLE(gcc-atomics,
+AS_HELP_STRING([--enable-gcc-atomics],
+               [Use gcc builtin atomics [[default=yes]]]),
+              , enable_gcc_atomics=yes)
+if test x$enable_gcc_atomics = xyes; then
+    have_gcc_atomics=no
+    AC_MSG_CHECKING(for GCC builtin atomic operations)
+    AC_TRY_LINK([
+    ],[
+    int a;
+    void *x, *y, *z;
+    __sync_lock_test_and_set(&a, 4);
+    __sync_lock_test_and_set(&x, y);
+    __sync_fetch_and_add(&a, 1);
+    __sync_bool_compare_and_swap(&a, 5, 10);
+    __sync_bool_compare_and_swap(&x, y, z);
+    ],[
+    have_gcc_atomics=yes
+    ])
+    AC_MSG_RESULT($have_gcc_atomics)
+
+    if test x$have_gcc_atomics = xyes; then
+        AC_DEFINE(HAVE_GCC_ATOMICS, 1, [ ])
+    else
+        # See if we have the minimum operation needed for GCC atomics
+        AC_TRY_LINK([
+        ],[
+        int a;
+        __sync_lock_test_and_set(&a, 1);
+        __sync_lock_release(&a);
+        ],[
+        have_gcc_sync_lock_test_and_set=yes
+        ])
+        if test x$have_gcc_sync_lock_test_and_set = xyes; then
+            AC_DEFINE(HAVE_GCC_SYNC_LOCK_TEST_AND_SET, 1, [ ])
+        fi
+    fi
+fi
+
+# Standard C sources
+SOURCES="$SOURCES $srcdir/src/*.c"
+SOURCES="$SOURCES $srcdir/src/atomic/*.c"
+SOURCES="$SOURCES $srcdir/src/audio/*.c"
+SOURCES="$SOURCES $srcdir/src/cpuinfo/*.c"
+SOURCES="$SOURCES $srcdir/src/dynapi/*.c"
+SOURCES="$SOURCES $srcdir/src/events/*.c"
+SOURCES="$SOURCES $srcdir/src/file/*.c"
+SOURCES="$SOURCES $srcdir/src/haptic/*.c"
+SOURCES="$SOURCES $srcdir/src/joystick/*.c"
+SOURCES="$SOURCES $srcdir/src/libm/*.c"
+SOURCES="$SOURCES $srcdir/src/power/*.c"
+#SOURCES="$SOURCES $srcdir/src/filesystem/*.c"
+SOURCES="$SOURCES $srcdir/src/render/*.c"
+SOURCES="$SOURCES $srcdir/src/render/*/*.c"
+SOURCES="$SOURCES $srcdir/src/sensor/*.c"
+SOURCES="$SOURCES $srcdir/src/stdlib/*.c"
+SOURCES="$SOURCES $srcdir/src/thread/*.c"
+SOURCES="$SOURCES $srcdir/src/timer/*.c"
+SOURCES="$SOURCES $srcdir/src/video/*.c"
+SOURCES="$SOURCES $srcdir/src/video/yuv2rgb/*.c"
+
+dnl Enable/disable various subsystems of the SDL library
+
+AC_ARG_ENABLE(atomic,
+AS_HELP_STRING([--enable-atomic], [Enable the atomic operations subsystem [[default=yes]]]),
+              , enable_atomic=yes)
+if test x$enable_atomic != xyes; then
+    AC_DEFINE(SDL_ATOMIC_DISABLED, 1, [ ])
+else
+    SUMMARY_modules="${SUMMARY_modules} atomic"
+fi
+AC_ARG_ENABLE(audio,
+AS_HELP_STRING([--enable-audio], [Enable the audio subsystem [[default=yes]]]),
+              , enable_audio=yes)
+if test x$enable_audio != xyes; then
+    AC_DEFINE(SDL_AUDIO_DISABLED, 1, [ ])
+else
+    SUMMARY_modules="${SUMMARY_modules} audio"
+fi
+AC_ARG_ENABLE(video,
+AS_HELP_STRING([--enable-video], [Enable the video subsystem [[default=yes]]]),
+              , enable_video=yes)
+if test x$enable_video != xyes; then
+    AC_DEFINE(SDL_VIDEO_DISABLED, 1, [ ])
+else
+    SUMMARY_modules="${SUMMARY_modules} video"
+fi
+AC_ARG_ENABLE(render,
+AS_HELP_STRING([--enable-render], [Enable the render subsystem [[default=yes]]]),
+              , enable_render=yes)
+if test x$enable_render != xyes; then
+    AC_DEFINE(SDL_RENDER_DISABLED, 1, [ ])
+else
+    SUMMARY_modules="${SUMMARY_modules} render"
+fi
+AC_ARG_ENABLE(events,
+AS_HELP_STRING([--enable-events], [Enable the events subsystem [[default=yes]]]),
+              , enable_events=yes)
+if test x$enable_events != xyes; then
+    AC_DEFINE(SDL_EVENTS_DISABLED, 1, [ ])
+else
+    SUMMARY_modules="${SUMMARY_modules} events"
+fi
+AC_ARG_ENABLE(joystick,
+AS_HELP_STRING([--enable-joystick], [Enable the joystick subsystem [[default=yes]]]),
+              , enable_joystick=yes)
+if test x$enable_joystick != xyes; then
+    AC_DEFINE(SDL_JOYSTICK_DISABLED, 1, [ ])
+else
+    SUMMARY_modules="${SUMMARY_modules} joystick"
+fi
+AC_ARG_ENABLE(haptic,
+AS_HELP_STRING([--enable-haptic], [Enable the haptic (force feedback) subsystem [[default=yes]]]),
+              , enable_haptic=yes)
+if test x$enable_haptic != xyes; then
+    AC_DEFINE(SDL_HAPTIC_DISABLED, 1, [ ])
+else
+    SUMMARY_modules="${SUMMARY_modules} haptic"
+fi
+AC_ARG_ENABLE(sensor,
+AS_HELP_STRING([--enable-sensor], [Enable the sensor subsystem [[default=yes]]]),
+              , enable_sensor=yes)
+if test x$enable_sensor != xyes; then
+    AC_DEFINE(SDL_SENSOR_DISABLED, 1, [ ])
+else
+    SUMMARY_modules="${SUMMARY_modules} sensor"
+fi
+AC_ARG_ENABLE(power,
+AS_HELP_STRING([--enable-power], [Enable the power subsystem [[default=yes]]]),
+              , enable_power=yes)
+if test x$enable_power != xyes; then
+    AC_DEFINE(SDL_POWER_DISABLED, 1, [ ])
+else
+    SUMMARY_modules="${SUMMARY_modules} power"
+fi
+AC_ARG_ENABLE(filesystem,
+AS_HELP_STRING([--enable-filesystem], [Enable the filesystem subsystem [[default=yes]]]),
+              , enable_filesystem=yes)
+if test x$enable_filesystem != xyes; then
+    AC_DEFINE(SDL_FILESYSTEM_DISABLED, 1, [ ])
+else
+    SUMMARY_modules="${SUMMARY_modules} filesystem"
+fi
+AC_ARG_ENABLE(threads,
+AS_HELP_STRING([--enable-threads], [Enable the threading subsystem [[default=yes]]]),
+              , enable_threads=yes)
+if test x$enable_threads != xyes; then
+    AC_DEFINE(SDL_THREADS_DISABLED, 1, [ ])
+else
+    SUMMARY_modules="${SUMMARY_modules} threads"
+fi
+AC_ARG_ENABLE(timers,
+AS_HELP_STRING([--enable-timers], [Enable the timer subsystem [[default=yes]]]),
+              , enable_timers=yes)
+if test x$enable_timers != xyes; then
+    AC_DEFINE(SDL_TIMERS_DISABLED, 1, [ ])
+else
+    SUMMARY_modules="${SUMMARY_modules} timers"
+fi
+AC_ARG_ENABLE(file,
+AS_HELP_STRING([--enable-file], [Enable the file subsystem [[default=yes]]]),
+              , enable_file=yes)
+if test x$enable_file != xyes; then
+    AC_DEFINE(SDL_FILE_DISABLED, 1, [ ])
+else
+    SUMMARY_modules="${SUMMARY_modules} file"
+fi
+AC_ARG_ENABLE(loadso,
+AS_HELP_STRING([--enable-loadso], [Enable the shared object loading subsystem [[default=yes]]]),
+              , enable_loadso=yes)
+if test x$enable_loadso != xyes; then
+    AC_DEFINE(SDL_LOADSO_DISABLED, 1, [ ])
+else
+    SUMMARY_modules="${SUMMARY_modules} loadso"
+fi
+AC_ARG_ENABLE(cpuinfo,
+AS_HELP_STRING([--enable-cpuinfo], [Enable the cpuinfo subsystem [[default=yes]]]),
+              , enable_cpuinfo=yes)
+if test x$enable_cpuinfo != xyes; then
+    AC_DEFINE(SDL_CPUINFO_DISABLED, 1, [ ])
+else
+    SUMMARY_modules="${SUMMARY_modules} cpuinfo"
+fi
+AC_ARG_ENABLE(assembly,
+AS_HELP_STRING([--enable-assembly], [Enable assembly routines [[default=yes]]]),
+              , enable_assembly=yes)
+if test x$enable_assembly = xyes; then
+    SUMMARY_modules="${SUMMARY_modules} assembly"
+
+    AC_DEFINE(SDL_ASSEMBLY_ROUTINES, 1, [ ])
+
+    # Make sure that we don't generate floating point code that would
+    # cause illegal instruction exceptions on older processors
+    case "$host" in
+        *-*-darwin*)
+            # Don't need to worry about Apple hardware, it's all SSE capable
+            default_ssemath=yes
+            ;;
+        *64-*-*)
+            # x86 64-bit architectures all have SSE instructions
+            default_ssemath=yes
+            ;;
+        *)
+            default_ssemath=no
+            ;;
+    esac
+    AC_ARG_ENABLE(ssemath,
+AS_HELP_STRING([--enable-ssemath], [Allow GCC to use SSE floating point math [[default=maybe]]]),
+                  , enable_ssemath=$default_ssemath)
+    if test x$enable_ssemath = xno; then
+        if test x$have_gcc_sse = xyes -o x$have_gcc_sse2 = xyes -o x$have_gcc_sse3 = xyes; then
+            EXTRA_CFLAGS="$EXTRA_CFLAGS -mfpmath=387"
+        fi
+    fi
+
+    dnl Check for various instruction support
+    AC_ARG_ENABLE(mmx,
+AS_HELP_STRING([--enable-mmx], [use MMX assembly routines [[default=yes]]]),
+                  , enable_mmx=yes)
+    if test x$enable_mmx = xyes; then
+        save_CFLAGS="$CFLAGS"
+        have_gcc_mmx=no
+        AC_MSG_CHECKING(for GCC -mmmx option)
+        mmx_CFLAGS="-mmmx"
+        CFLAGS="$save_CFLAGS $mmx_CFLAGS"
+
+        AC_TRY_COMPILE([
+        #ifdef __MINGW32__
+        #include <_mingw.h>
+        #ifdef __MINGW64_VERSION_MAJOR
+        #include <intrin.h>
+        #else
+        #include <mmintrin.h>
+        #endif
+        #else
+        #include <mmintrin.h>
+        #endif
+        #ifndef __MMX__
+        #error Assembler CPP flag not enabled
+        #endif
+        ],[
+        ],[
+        have_gcc_mmx=yes
+        ])
+        AC_MSG_RESULT($have_gcc_mmx)
+        CFLAGS="$save_CFLAGS"
+
+        if test x$have_gcc_mmx = xyes; then
+            EXTRA_CFLAGS="$EXTRA_CFLAGS $mmx_CFLAGS"
+            SUMMARY_math="${SUMMARY_math} mmx"
+        fi
+    fi
+
+    AC_ARG_ENABLE(3dnow,
+AS_HELP_STRING([--enable-3dnow], [use 3DNow! assembly routines [[default=yes]]]),
+                  , enable_3dnow=yes)
+    if test x$enable_3dnow = xyes; then
+        save_CFLAGS="$CFLAGS"
+        have_gcc_3dnow=no
+        AC_MSG_CHECKING(for GCC -m3dnow option)
+        amd3dnow_CFLAGS="-m3dnow"
+        CFLAGS="$save_CFLAGS $amd3dnow_CFLAGS"
+
+        AC_TRY_LINK([
+        #include <mm3dnow.h>
+        #ifndef __3dNOW__
+        #error Assembler CPP flag not enabled
+        #endif
+        ],[
+        void *p = 0;
+        _m_prefetch(p);
+        ],[
+        have_gcc_3dnow=yes
+        ])
+        AC_MSG_RESULT($have_gcc_3dnow)
+        CFLAGS="$save_CFLAGS"
+
+        if test x$have_gcc_3dnow = xyes; then
+            EXTRA_CFLAGS="$EXTRA_CFLAGS $amd3dnow_CFLAGS"
+            SUMMARY_math="${SUMMARY_math} 3dnow"
+        fi
+    fi
+
+    AC_ARG_ENABLE(sse,
+AS_HELP_STRING([--enable-sse], [use SSE assembly routines [[default=yes]]]),
+                  , enable_sse=yes)
+    if test x$enable_sse = xyes; then
+        save_CFLAGS="$CFLAGS"
+        have_gcc_sse=no
+        AC_MSG_CHECKING(for GCC -msse option)
+        sse_CFLAGS="-msse"
+        CFLAGS="$save_CFLAGS $sse_CFLAGS"
+
+        AC_TRY_COMPILE([
+        #ifdef __MINGW32__
+        #include <_mingw.h>
+        #ifdef __MINGW64_VERSION_MAJOR
+        #include <intrin.h>
+        #else
+        #include <xmmintrin.h>
+        #endif
+        #else
+        #include <xmmintrin.h>
+        #endif
+        #ifndef __SSE__
+        #error Assembler CPP flag not enabled
+        #endif
+        ],[
+        ],[
+        have_gcc_sse=yes
+        ])
+        AC_MSG_RESULT($have_gcc_sse)
+        CFLAGS="$save_CFLAGS"
+
+        if test x$have_gcc_sse = xyes; then
+            EXTRA_CFLAGS="$EXTRA_CFLAGS $sse_CFLAGS"
+            SUMMARY_math="${SUMMARY_math} sse"
+        fi
+    fi
+
+    AC_ARG_ENABLE(sse2,
+AS_HELP_STRING([--enable-sse2], [use SSE2 assembly routines [[default=maybe]]]),
+                  , enable_sse2=$default_ssemath)
+    if test x$enable_sse2 = xyes; then
+        save_CFLAGS="$CFLAGS"
+        have_gcc_sse2=no
+        AC_MSG_CHECKING(for GCC -msse2 option)
+        sse2_CFLAGS="-msse2"
+        CFLAGS="$save_CFLAGS $sse2_CFLAGS"
+
+        AC_TRY_COMPILE([
+        #ifdef __MINGW32__
+        #include <_mingw.h>
+        #ifdef __MINGW64_VERSION_MAJOR
+        #include <intrin.h>
+        #else
+        #include <emmintrin.h>
+        #endif
+        #else
+        #include <emmintrin.h>
+        #endif
+        #ifndef __SSE2__
+        #error Assembler CPP flag not enabled
+        #endif
+        ],[
+        ],[
+        have_gcc_sse2=yes
+        ])
+        AC_MSG_RESULT($have_gcc_sse2)
+        CFLAGS="$save_CFLAGS"
+
+        if test x$have_gcc_sse2 = xyes; then
+            EXTRA_CFLAGS="$EXTRA_CFLAGS $sse2_CFLAGS"
+            SUMMARY_math="${SUMMARY_math} sse2"
+        fi
+    fi
+
+    AC_ARG_ENABLE(sse3,
+AS_HELP_STRING([--enable-sse3], [use SSE3 assembly routines [[default=maybe]]]),
+                  , enable_sse3=$default_ssemath)
+    if test x$enable_sse3 = xyes; then
+        save_CFLAGS="$CFLAGS"
+        have_gcc_sse3=no
+        AC_MSG_CHECKING(for GCC -msse3 option)
+        sse3_CFLAGS="-msse3"
+        CFLAGS="$save_CFLAGS $sse3_CFLAGS"
+
+        AC_TRY_COMPILE([
+        #ifdef __MINGW32__
+        #include <_mingw.h>
+        #ifdef __MINGW64_VERSION_MAJOR
+        #include <intrin.h>
+        #else
+        #include <pmmintrin.h>
+        #endif
+        #else
+        #include <pmmintrin.h>
+        #endif
+        #ifndef __SSE2__
+        #error Assembler CPP flag not enabled
+        #endif
+        ],[
+        ],[
+        have_gcc_sse3=yes
+        ])
+        AC_MSG_RESULT($have_gcc_sse3)
+        CFLAGS="$save_CFLAGS"
+
+        if test x$have_gcc_sse3 = xyes; then
+            EXTRA_CFLAGS="$EXTRA_CFLAGS $sse3_CFLAGS"
+            SUMMARY_math="${SUMMARY_math} sse3"
+        fi
+    fi
+
+    AC_CHECK_HEADER(immintrin.h,
+                    have_immintrin_h_hdr=yes,
+                    have_immintrin_h_hdr=no)
+    if test x$have_immintrin_h_hdr = xyes; then
+        AC_DEFINE(HAVE_IMMINTRIN_H, 1, [ ])
+    fi
+
+    AC_ARG_ENABLE(altivec,
+AS_HELP_STRING([--enable-altivec], [use Altivec assembly routines [[default=yes]]]),
+                  , enable_altivec=yes)
+    if test x$enable_altivec = xyes; then
+        save_CFLAGS="$CFLAGS"
+        have_gcc_altivec=no
+        have_altivec_h_hdr=no
+        altivec_CFLAGS="-maltivec"
+        CFLAGS="$save_CFLAGS $altivec_CFLAGS"
+
+        AC_MSG_CHECKING(for Altivec with GCC altivec.h and -maltivec option)
+        AC_TRY_COMPILE([
+        #include <altivec.h>
+        vector unsigned int vzero() {
+            return vec_splat_u32(0);
+        }
+        ],[
+        ],[
+        have_gcc_altivec=yes
+        have_altivec_h_hdr=yes
+        ])
+        AC_MSG_RESULT($have_gcc_altivec)
+
+        if test x$have_gcc_altivec = xno; then
+            AC_MSG_CHECKING(for Altivec with GCC -maltivec option)
+            AC_TRY_COMPILE([
+            vector unsigned int vzero() {
+                return vec_splat_u32(0);
+            }
+            ],[
+            ],[
+            have_gcc_altivec=yes
+            ])
+            AC_MSG_RESULT($have_gcc_altivec)
+        fi
+
+        if test x$have_gcc_altivec = xno; then
+            AC_MSG_CHECKING(for Altivec with GCC altivec.h and -faltivec option)
+            altivec_CFLAGS="-faltivec"
+            CFLAGS="$save_CFLAGS $altivec_CFLAGS"
+            AC_TRY_COMPILE([
+            #include <altivec.h>
+            vector unsigned int vzero() {
+                return vec_splat_u32(0);
+            }
+            ],[
+            ],[
+            have_gcc_altivec=yes
+            have_altivec_h_hdr=yes
+            ])
+            AC_MSG_RESULT($have_gcc_altivec)
+        fi
+
+        if test x$have_gcc_altivec = xno; then
+            AC_MSG_CHECKING(for Altivec with GCC -faltivec option)
+            AC_TRY_COMPILE([
+            vector unsigned int vzero() {
+                return vec_splat_u32(0);
+            }
+            ],[
+            ],[
+            have_gcc_altivec=yes
+            ])
+            AC_MSG_RESULT($have_gcc_altivec)
+        fi
+        CFLAGS="$save_CFLAGS"
+
+        if test x$have_gcc_altivec = xyes; then
+            AC_DEFINE(SDL_ALTIVEC_BLITTERS, 1, [ ])
+            if test x$have_altivec_h_hdr = xyes; then
+              AC_DEFINE(HAVE_ALTIVEC_H, 1, [ ])
+            fi
+            EXTRA_CFLAGS="$EXTRA_CFLAGS $altivec_CFLAGS"
+            SUMMARY_math="${SUMMARY_math} altivec"
+        fi
+    fi
+fi
+
+dnl See if the OSS audio interface is supported
+CheckOSS()
+{
+    AC_ARG_ENABLE(oss,
+AS_HELP_STRING([--enable-oss], [support the OSS audio API [[default=maybe]]]),
+                  , enable_oss=maybe)
+
+    # OpenBSD "has" OSS, but it's not really for app use. They want you to
+    #  use sndio instead. So on there, we default to disabled. You can force
+    #  it on if you really want, though.
+    if test x$enable_oss = xmaybe; then
+        enable_oss=yes
+        case "$host" in
+            *-*-openbsd*)
+                enable_oss=no;;
+        esac
+    fi
+
+    if test x$enable_audio = xyes -a x$enable_oss = xyes; then
+        AC_MSG_CHECKING(for OSS audio support)
+        have_oss=no
+        if test x$have_oss != xyes; then
+            AC_TRY_COMPILE([
+              #include <sys/soundcard.h>
+            ],[
+              int arg = SNDCTL_DSP_SETFRAGMENT;
+            ],[
+            have_oss=yes
+            ])
+        fi
+        if test x$have_oss != xyes; then
+            AC_TRY_COMPILE([
+              #include <soundcard.h>
+            ],[
+              int arg = SNDCTL_DSP_SETFRAGMENT;
+            ],[
+            have_oss=yes
+            AC_DEFINE(SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H, 1, [ ])
+            ])
+        fi
+        AC_MSG_RESULT($have_oss)
+        if test x$have_oss = xyes; then
+            SUMMARY_audio="${SUMMARY_audio} oss"
+            AC_DEFINE(SDL_AUDIO_DRIVER_OSS, 1, [ ])
+            SOURCES="$SOURCES $srcdir/src/audio/dsp/*.c"
+            have_audio=yes
+
+            # We may need to link with ossaudio emulation library
+            case "$host" in
+                *-*-openbsd*|*-*-netbsd*)
+                    EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lossaudio";;
+            esac
+        fi
+    fi
+}
+
+dnl See if the ALSA audio interface is supported
+CheckALSA()
+{
+    AC_ARG_ENABLE(alsa,
+AS_HELP_STRING([--enable-alsa], [support the ALSA audio API [[default=yes]]]),
+                  , enable_alsa=yes)
+    if test x$enable_audio = xyes -a x$enable_alsa = xyes; then
+        AM_PATH_ALSA(1.0.11, have_alsa=yes, have_alsa=no)
+        # Restore all flags from before the ALSA detection runs
+        CFLAGS="$alsa_save_CFLAGS"
+        LDFLAGS="$alsa_save_LDFLAGS"
+        LIBS="$alsa_save_LIBS"
+        if test x$have_alsa = xyes; then
+            AC_ARG_ENABLE(alsa-shared,
+AS_HELP_STRING([--enable-alsa-shared], [dynamically load ALSA audio support [[default=yes]]]),
+                          , enable_alsa_shared=yes)
+            alsa_lib=[`find_lib "libasound.so.*" "$ALSA_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
+
+            AC_DEFINE(SDL_AUDIO_DRIVER_ALSA, 1, [ ])
+            SOURCES="$SOURCES $srcdir/src/audio/alsa/*.c"
+            EXTRA_CFLAGS="$EXTRA_CFLAGS $ALSA_CFLAGS"
+            if test x$have_loadso != xyes && \
+               test x$enable_alsa_shared = xyes; then
+                AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic ALSA loading])
+            fi
+            if test x$have_loadso = xyes && \
+               test x$enable_alsa_shared = xyes && test x$alsa_lib != x; then
+                echo "-- dynamic libasound -> $alsa_lib"
+                AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ALSA_DYNAMIC, "$alsa_lib", [ ])
+                SUMMARY_audio="${SUMMARY_audio} alsa(dynamic)"
+            else
+                EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ALSA_LIBS"
+                SUMMARY_audio="${SUMMARY_audio} alsa"
+            fi
+            have_audio=yes
+        fi
+    fi
+}
+
+dnl Find JACK Audio
+CheckJACK()
+{
+    AC_ARG_ENABLE(jack,
+AS_HELP_STRING([--enable-jack], [use JACK audio [[default=yes]]]),
+                  , enable_jack=yes)
+    if test x$enable_audio = xyes -a x$enable_jack = xyes; then
+        PKG_CHECK_MODULES([JACK], [jack >= 0.125], audio_jack=yes, audio_jack=no)
+
+        if test x$audio_jack = xyes; then
+            AC_ARG_ENABLE(jack-shared,
+AS_HELP_STRING([--enable-jack-shared], [dynamically load JACK audio support [[default=yes]]]),
+                          , enable_jack_shared=yes)
+            jack_lib=[`find_lib "libjack.so.*" "$JACK_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
+
+            AC_DEFINE(SDL_AUDIO_DRIVER_JACK, 1, [ ])
+            SOURCES="$SOURCES $srcdir/src/audio/jack/*.c"
+            EXTRA_CFLAGS="$EXTRA_CFLAGS $JACK_CFLAGS"
+            if test x$have_loadso != xyes && \
+               test x$enable_jack_shared = xyes; then
+                AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic JACK audio loading])
+            fi
+            if test x$have_loadso = xyes && \
+               test x$enable_jack_shared = xyes && test x$jack_lib != x; then
+                echo "-- dynamic libjack -> $jack_lib"
+                AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_JACK_DYNAMIC, "$jack_lib", [ ])
+                SUMMARY_audio="${SUMMARY_audio} jack(dynamic)"
+
+                case "$host" in
+                    # On Solaris, jack must be linked deferred explicitly
+                    # to prevent undefined symbol failures.
+                    *-*-solaris*)
+                        JACK_LIBS=`echo $JACK_LIBS | sed 's/\-l/-Wl,-l/g'`
+                        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-zdeferred $JACK_LIBS -Wl,-znodeferred"
+                esac
+            else
+                EXTRA_LDFLAGS="$EXTRA_LDFLAGS $JACK_LIBS"
+                SUMMARY_audio="${SUMMARY_audio} jack"
+            fi
+            have_audio=yes
+        fi
+    fi
+}
+
+dnl Find the ESD includes and libraries
+CheckESD()
+{
+    AC_ARG_ENABLE(esd,
+AS_HELP_STRING([--enable-esd], [support the Enlightened Sound Daemon [[default=yes]]]),
+                  , enable_esd=yes)
+    if test x$enable_audio = xyes -a x$enable_esd = xyes; then
+        AM_PATH_ESD(0.2.8, have_esd=yes, have_esd=no)
+        if test x$have_esd = xyes; then
+            AC_ARG_ENABLE(esd-shared,
+AS_HELP_STRING([--enable-esd-shared], [dynamically load ESD audio support [[default=yes]]]),
+                          , enable_esd_shared=yes)
+            esd_lib=[`find_lib "libesd.so.*" "$ESD_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
+
+            AC_DEFINE(SDL_AUDIO_DRIVER_ESD, 1, [ ])
+            SOURCES="$SOURCES $srcdir/src/audio/esd/*.c"
+            EXTRA_CFLAGS="$EXTRA_CFLAGS $ESD_CFLAGS"
+            if test x$have_loadso != xyes && \
+               test x$enable_esd_shared = xyes; then
+                AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic ESD loading])
+            fi
+            if test x$have_loadso = xyes && \
+               test x$enable_esd_shared = xyes && test x$esd_lib != x; then
+                echo "-- dynamic libesd -> $esd_lib"
+                AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ESD_DYNAMIC, "$esd_lib", [ ])
+                SUMMARY_audio="${SUMMARY_audio} esd(dynamic)"
+            else
+                EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ESD_LIBS"
+                SUMMARY_audio="${SUMMARY_audio} esd"
+            fi
+            have_audio=yes
+        fi
+    fi
+}
+
+dnl Find PulseAudio
+CheckPulseAudio()
+{
+    AC_ARG_ENABLE(pulseaudio,
+AS_HELP_STRING([--enable-pulseaudio], [use PulseAudio [[default=yes]]]),
+                  , enable_pulseaudio=yes)
+    if test x$enable_audio = xyes -a x$enable_pulseaudio = xyes; then
+        PKG_CHECK_MODULES([PULSEAUDIO], [libpulse-simple >= 0.9], audio_pulseaudio=yes, audio_pulseaudio=no)
+
+        if test x$audio_pulseaudio = xyes; then
+            AC_ARG_ENABLE(pulseaudio-shared,
+AS_HELP_STRING([--enable-pulseaudio-shared], [dynamically load PulseAudio support [[default=yes]]]),
+                          , enable_pulseaudio_shared=yes)
+            pulseaudio_lib=[`find_lib "libpulse-simple.so.*" "$PULSEAUDIO_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
+
+            AC_DEFINE(SDL_AUDIO_DRIVER_PULSEAUDIO, 1, [ ])
+            SOURCES="$SOURCES $srcdir/src/audio/pulseaudio/*.c"
+            EXTRA_CFLAGS="$EXTRA_CFLAGS $PULSEAUDIO_CFLAGS"
+            if test x$have_loadso != xyes && \
+               test x$enable_pulseaudio_shared = xyes; then
+                AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic PulseAudio loading])
+            fi
+            if test x$have_loadso = xyes && \
+               test x$enable_pulseaudio_shared = xyes && test x$pulseaudio_lib != x; then
+                echo "-- dynamic libpulse-simple -> $pulseaudio_lib"
+                AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC, "$pulseaudio_lib", [ ])
+                SUMMARY_audio="${SUMMARY_audio} pulse(dynamic)"
+
+                case "$host" in
+                    # On Solaris, pulseaudio must be linked deferred explicitly
+                    # to prevent undefined symbol failures.
+                    *-*-solaris*)
+                        PULSEAUDIO_LIBS=`echo $PULSEAUDIO_LIBS | sed 's/\-l/-Wl,-l/g'`
+                        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-zdeferred $PULSEAUDIO_LIBS -Wl,-znodeferred"
+                esac
+            else
+                EXTRA_LDFLAGS="$EXTRA_LDFLAGS $PULSEAUDIO_LIBS"
+                SUMMARY_audio="${SUMMARY_audio} pulse"
+            fi
+            have_audio=yes
+        fi
+    fi
+}
+
+CheckARTSC()
+{
+    AC_ARG_ENABLE(arts,
+AS_HELP_STRING([--enable-arts], [support the Analog Real Time Synthesizer [[default=yes]]]),
+                  , enable_arts=yes)
+    if test x$enable_audio = xyes -a x$enable_arts = xyes; then
+        AC_PATH_PROG(ARTSCONFIG, artsc-config)
+        if test x$ARTSCONFIG = x -o x$ARTSCONFIG = x'"$ARTSCONFIG"'; then
+            : # arts isn't installed
+        else
+            ARTS_CFLAGS=`$ARTSCONFIG --cflags`
+            ARTS_LIBS=`$ARTSCONFIG --libs`
+            AC_MSG_CHECKING(for aRts development environment)
+            audio_arts=no
+            save_CFLAGS="$CFLAGS"
+            CFLAGS="$CFLAGS $ARTS_CFLAGS"
+            AC_TRY_COMPILE([
+             #include <artsc.h>
+            ],[
+             arts_stream_t stream;
+            ],[
+            audio_arts=yes
+            ])
+            CFLAGS="$save_CFLAGS"
+            AC_MSG_RESULT($audio_arts)
+            if test x$audio_arts = xyes; then
+                AC_ARG_ENABLE(arts-shared,
+AS_HELP_STRING([--enable-arts-shared], [dynamically load aRts audio support [[default=yes]]]),
+                              , enable_arts_shared=yes)
+                arts_lib=[`find_lib "libartsc.so.*" "$ARTS_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
+
+                AC_DEFINE(SDL_AUDIO_DRIVER_ARTS, 1, [ ])
+                SOURCES="$SOURCES $srcdir/src/audio/arts/*.c"
+                EXTRA_CFLAGS="$EXTRA_CFLAGS $ARTS_CFLAGS"
+                if test x$have_loadso != xyes && \
+                   test x$enable_arts_shared = xyes; then
+                    AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic ARTS loading])
+                fi
+                if test x$have_loadso = xyes && \
+                   test x$enable_arts_shared = xyes && test x$arts_lib != x; then
+                    echo "-- dynamic libartsc -> $arts_lib"
+                    AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ARTS_DYNAMIC, "$arts_lib", [ ])
+                    SUMMARY_audio="${SUMMARY_audio} arts(dynamic)"
+                else
+                    EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ARTS_LIBS"
+                    SUMMARY_audio="${SUMMARY_audio} arts"
+                fi
+                have_audio=yes
+            fi
+        fi
+    fi
+}
+
+dnl See if the NAS audio interface is supported
+CheckNAS()
+{
+    AC_ARG_ENABLE(nas,
+AS_HELP_STRING([--enable-nas], [support the NAS audio API [[default=yes]]]),
+                  , enable_nas=yes)
+    if test x$enable_audio = xyes -a x$enable_nas = xyes; then
+        AC_CHECK_HEADER(audio/audiolib.h, have_nas_hdr=yes)
+        AC_CHECK_LIB(audio, AuOpenServer, have_nas_lib=yes)
+
+        AC_MSG_CHECKING(for NAS audio support)
+        have_nas=no
+
+        if test x$have_nas_hdr = xyes -a x$have_nas_lib = xyes; then
+            have_nas=yes
+            NAS_LIBS="-laudio"
+
+        elif test -r /usr/X11R6/include/audio/audiolib.h; then
+            have_nas=yes
+            NAS_CFLAGS="-I/usr/X11R6/include/"
+            NAS_LIBS="-L/usr/X11R6/lib -laudio -lXt"
+
+        fi
+
+        AC_MSG_RESULT($have_nas)
+
+        if test x$have_nas = xyes; then
+            AC_ARG_ENABLE(nas-shared,
+AS_HELP_STRING([--enable-nas-shared], [dynamically load NAS audio support [[default=yes]]]),
+                          , enable_nas_shared=yes)
+            nas_lib=[`find_lib "libaudio.so.*" "$NAS_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
+
+            if test x$have_loadso != xyes && \
+               test x$enable_nas_shared = xyes; then
+                AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic NAS loading])
+            fi
+            if test x$have_loadso = xyes && \
+               test x$enable_nas_shared = xyes && test x$nas_lib != x; then
+                echo "-- dynamic libaudio -> $nas_lib"
+                AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_NAS_DYNAMIC, "$nas_lib", [ ])
+                SUMMARY_audio="${SUMMARY_audio} nas(dynamic)"
+            else
+                EXTRA_LDFLAGS="$EXTRA_LDFLAGS $NAS_LIBS"
+                SUMMARY_audio="${SUMMARY_audio} nas"
+            fi
+
+            AC_DEFINE(SDL_AUDIO_DRIVER_NAS, 1, [ ])
+            SOURCES="$SOURCES $srcdir/src/audio/nas/*.c"
+            EXTRA_CFLAGS="$EXTRA_CFLAGS $NAS_CFLAGS"
+            have_audio=yes
+        fi
+    fi
+}
+
+dnl See if the sndio audio interface is supported
+CheckSNDIO()
+{
+    AC_ARG_ENABLE(sndio,
+AS_HELP_STRING([--enable-sndio], [support the sndio audio API [[default=yes]]]),
+                  , enable_sndio=yes)
+    if test x$enable_audio = xyes -a x$enable_sndio = xyes; then
+        AC_CHECK_HEADER(sndio.h, have_sndio_hdr=yes)
+        AC_CHECK_LIB(sndio, sio_open, have_sndio_lib=yes)
+
+        AC_MSG_CHECKING(for sndio audio support)
+        have_sndio=no
+
+        if test x$have_sndio_hdr = xyes -a x$have_sndio_lib = xyes; then
+            have_sndio=yes
+            SNDIO_LIBS="-lsndio"
+        fi
+
+        AC_MSG_RESULT($have_sndio)
+
+        if test x$have_sndio = xyes; then
+            AC_ARG_ENABLE(sndio-shared,
+AS_HELP_STRING([--enable-sndio-shared], [dynamically load sndio audio support [[default=yes]]]),
+                          , enable_sndio_shared=yes)
+            sndio_lib=[`find_lib "libsndio.so.*" "$SNDIO_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
+
+            if test x$have_loadso != xyes && \
+               test x$enable_sndio_shared = xyes; then
+                AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic sndio loading])
+            fi
+            if test x$have_loadso = xyes && \
+               test x$enable_sndio_shared = xyes && test x$sndio_lib != x; then
+                echo "-- dynamic libsndio -> $sndio_lib"
+                AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_SNDIO_DYNAMIC, "$sndio_lib", [ ])
+                SUMMARY_audio="${SUMMARY_audio} sndio(dynamic)"
+            else
+                EXTRA_LDFLAGS="$EXTRA_LDFLAGS $SNDIO_LIBS"
+                SUMMARY_audio="${SUMMARY_audio} sndio"
+            fi
+
+            AC_DEFINE(SDL_AUDIO_DRIVER_SNDIO, 1, [ ])
+            SOURCES="$SOURCES $srcdir/src/audio/sndio/*.c"
+            EXTRA_CFLAGS="$EXTRA_CFLAGS $SNDIO_CFLAGS"
+            have_audio=yes
+        fi
+    fi
+}
+
+dnl Find FusionSound
+CheckFusionSound()
+{
+    AC_ARG_ENABLE(fusionsound,
+AS_HELP_STRING([--enable-fusionsound], [use FusionSound audio driver [[default=no]]]),
+                  , enable_fusionsound=no)
+    if test x$enable_audio = xyes -a x$enable_fusionsound = xyes; then
+        PKG_CHECK_MODULES([FUSIONSOUND], [fusionsound >= 1.1.1], fusionsound=yes, fusionsound=no)
+
+        if test x$fusionsound = xyes; then
+            AC_DEFINE(SDL_AUDIO_DRIVER_FUSIONSOUND, 1, [ ])
+            SOURCES="$SOURCES $srcdir/src/audio/fusionsound/*.c"
+            EXTRA_CFLAGS="$EXTRA_CFLAGS $FUSIONSOUND_CFLAGS"
+            
+            AC_ARG_ENABLE(fusionsound-shared,
+AS_HELP_STRING([--enable-fusionsound-shared], [dynamically load fusionsound audio support [[default=yes]]]),
+                          , enable_fusionsound_shared=yes)
+            fusionsound_shared=no
+            AC_MSG_CHECKING(for FusionSound dynamic loading support)
+            if test x$have_loadso != xyes && \
+               test x$enable_fusionsound_shared = xyes; then
+                AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic fusionsound loading])
+            fi
+            if test x$have_loadso = xyes && \
+               test x$enable_fusionsound_shared = xyes; then
+                AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC, "libfusionsound.so", [ ])
+                fusionsound_shared=yes
+                SUMMARY_audio="${SUMMARY_audio} fusionsound(dynamic)"
+            else
+                EXTRA_LDFLAGS="$EXTRA_LDFLAGS $FUSIONSOUND_LIBS"
+                SUMMARY_audio="${SUMMARY_audio} fusionsound"
+            fi
+            AC_MSG_RESULT($fusionsound_shared)
+            
+            have_audio=yes
+        fi
+    fi
+}
+
+dnl rcg07142001 See if the user wants the disk writer audio driver...
+CheckDiskAudio()
+{
+    AC_ARG_ENABLE(diskaudio,
+AS_HELP_STRING([--enable-diskaudio], [support the disk writer audio driver [[default=yes]]]),
+                  , enable_diskaudio=yes)
+    if test x$enable_audio = xyes -a x$enable_diskaudio = xyes; then
+        AC_DEFINE(SDL_AUDIO_DRIVER_DISK, 1, [ ])
+        SOURCES="$SOURCES $srcdir/src/audio/disk/*.c"
+        SUMMARY_audio="${SUMMARY_audio} disk"
+    fi
+}
+
+dnl rcg03142006 See if the user wants the dummy audio driver...
+CheckDummyAudio()
+{
+    AC_ARG_ENABLE(dummyaudio,
+AS_HELP_STRING([--enable-dummyaudio], [support the dummy audio driver [[default=yes]]]),
+                  , enable_dummyaudio=yes)
+    if test x$enable_audio = xyes -a x$enable_dummyaudio = xyes; then
+        AC_DEFINE(SDL_AUDIO_DRIVER_DUMMY, 1, [ ])
+        SOURCES="$SOURCES $srcdir/src/audio/dummy/*.c"
+        SUMMARY_audio="${SUMMARY_audio} dummy"
+    fi
+}
+
+dnl See if libsamplerate is available
+CheckLibSampleRate()
+{
+    AC_ARG_ENABLE(libsamplerate,
+AS_HELP_STRING([--enable-libsamplerate], [use libsamplerate for audio rate conversion [[default=yes]]]),
+                  , enable_libsamplerate=yes)
+    if test x$enable_libsamplerate = xyes; then
+        AC_CHECK_HEADER(samplerate.h,
+                        have_samplerate_h_hdr=yes,
+                        have_samplerate_h_hdr=no)
+        if test x$have_samplerate_h_hdr = xyes; then
+            AC_DEFINE(HAVE_LIBSAMPLERATE_H, 1, [ ])
+
+            AC_ARG_ENABLE(libsamplerate-shared,
+AS_HELP_STRING([--enable-libsamplerate-shared], [dynamically load libsamplerate [[default=yes]]]),
+                          , enable_libsamplerate_shared=yes)
+
+            samplerate_lib=[`find_lib "libsamplerate.so.*" "" | sed 's/.*\/\(.*\)/\1/; q'`]
+
+            if test x$have_loadso != xyes && \
+               test x$enable_libsamplerate_shared = xyes; then
+                AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic libsamplerate loading])
+            fi
+            if test x$have_loadso = xyes && \
+               test x$enable_libsamplerate_shared = xyes && test x$samplerate_lib != x; then
+                echo "-- dynamic libsamplerate -> $samplerate_lib"
+                AC_DEFINE_UNQUOTED(SDL_LIBSAMPLERATE_DYNAMIC, "$samplerate_lib", [ ])
+            else
+                EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lsamplerate"
+            fi
+        fi
+    fi
+}
+
+dnl See if GCC's -fvisibility=hidden is supported (gcc4 and later, usually).
+dnl  Details of this flag are here: http://gcc.gnu.org/wiki/Visibility
+CheckVisibilityHidden()
+{
+    AC_MSG_CHECKING(for GCC -fvisibility=hidden option)
+    have_gcc_fvisibility=no
+
+    visibility_CFLAGS="-fvisibility=hidden"
+    save_CFLAGS="$CFLAGS"
+    CFLAGS="$save_CFLAGS $visibility_CFLAGS -Werror"
+    AC_TRY_COMPILE([
+    #if !defined(__GNUC__) || __GNUC__ < 4
+    #error SDL only uses visibility attributes in GCC 4 or newer
+    #endif
+    ],[
+    ],[
+    have_gcc_fvisibility=yes
+    ])
+    AC_MSG_RESULT($have_gcc_fvisibility)
+    CFLAGS="$save_CFLAGS"
+
+    if test x$have_gcc_fvisibility = xyes; then
+        EXTRA_CFLAGS="$EXTRA_CFLAGS $visibility_CFLAGS"
+    fi
+}
+
+dnl See if GCC's -fno-strict-aliasingis supported.
+dnl  Reference: https://bugzilla.libsdl.org/show_bug.cgi?id=4254
+CheckNoStrictAliasing()
+{
+    AC_MSG_CHECKING(for GCC -fno-strict-aliasing option)
+    have_gcc_no_strict_aliasing=no
+
+    save_CFLAGS="$CFLAGS"
+    CFLAGS="$save_CFLAGS -fno-strict-aliasing"
+    AC_TRY_COMPILE([
+    int x = 0;
+    ],[
+    ],[
+    have_gcc_no_strict_aliasing=yes
+    ])
+    AC_MSG_RESULT($have_gcc_no_strict_aliasing)
+    CFLAGS="$save_CFLAGS"
+
+    if test x$have_gcc_no_strict_aliasing = xyes; then
+        EXTRA_CFLAGS="$EXTRA_CFLAGS -fno-strict-aliasing"
+    fi
+}
+
+dnl See if GCC's -mpreferred-stack-boundary is supported.
+dnl  Reference: http://bugzilla.libsdl.org/show_bug.cgi?id=1296
+CheckStackBoundary()
+{
+    AC_MSG_CHECKING(for GCC -mpreferred-stack-boundary option)
+    have_gcc_preferred_stack_boundary=no
+
+    save_CFLAGS="$CFLAGS"
+    CFLAGS="$save_CFLAGS -mpreferred-stack-boundary=2"
+    AC_TRY_COMPILE([
+    int x = 0;
+    ],[
+    ],[
+    have_gcc_preferred_stack_boundary=yes
+    ])
+    AC_MSG_RESULT($have_gcc_preferred_stack_boundary)
+    CFLAGS="$save_CFLAGS"
+
+    if test x$have_gcc_preferred_stack_boundary = xyes; then
+        EXTRA_CFLAGS="$EXTRA_CFLAGS -mpreferred-stack-boundary=2"
+    fi
+}
+
+dnl See if GCC's -Wdeclaration-after-statement is supported.
+dnl  This lets us catch things that would fail on a C89 compiler when using
+dnl  a modern GCC.
+CheckDeclarationAfterStatement()
+{
+    AC_MSG_CHECKING(for GCC -Wdeclaration-after-statement option)
+    have_gcc_declaration_after_statement=no
+
+    save_CFLAGS="$CFLAGS"
+    CFLAGS="$save_CFLAGS -Wdeclaration-after-statement -Werror=declaration-after-statement"
+    AC_TRY_COMPILE([
+    int x = 0;
+    ],[
+    ],[
+    have_gcc_declaration_after_statement=yes
+    ])
+    AC_MSG_RESULT($have_gcc_declaration_after_statement)
+    CFLAGS="$save_CFLAGS"
+
+    if test x$have_gcc_declaration_after_statement = xyes; then
+        EXTRA_CFLAGS="$EXTRA_CFLAGS -Wdeclaration-after-statement -Werror=declaration-after-statement"
+    fi
+}
+
+dnl See if GCC's -Wall is supported.
+CheckWarnAll()
+{
+    AC_MSG_CHECKING(for GCC -Wall option)
+    have_gcc_Wall=no
+
+    save_CFLAGS="$CFLAGS"
+    CFLAGS="$save_CFLAGS -Wall"
+    AC_TRY_COMPILE([
+    int x = 0;
+    ],[
+    ],[
+    have_gcc_Wall=yes
+    ])
+    AC_MSG_RESULT($have_gcc_Wall)
+    CFLAGS="$save_CFLAGS"
+
+    if test x$have_gcc_Wall = xyes; then
+        EXTRA_CFLAGS="$EXTRA_CFLAGS -Wall"
+
+        dnl Haiku headers use multicharacter constants all over the place. Ignore these warnings when using -Wall.
+        AC_MSG_CHECKING(for necessary GCC -Wno-multichar option)
+        need_gcc_Wno_multichar=no
+        case "$host" in
+            *-*-haiku*)
+                need_gcc_Wno_multichar=yes
+                ;;
+        esac
+        AC_MSG_RESULT($need_gcc_Wno_multichar)
+        if test x$need_gcc_Wno_multichar = xyes; then
+            EXTRA_CFLAGS="$EXTRA_CFLAGS -Wno-multichar"
+        fi
+    fi
+}
+
+dnl Check for Wayland
+CheckWayland()
+{
+    AC_ARG_ENABLE(video-wayland,
+AS_HELP_STRING([--enable-video-wayland], [use Wayland video driver [[default=yes]]]),
+                  ,enable_video_wayland=yes)
+
+    AC_ARG_ENABLE(video-wayland-qt-touch,
+AS_HELP_STRING([--enable-video-wayland-qt-touch], [QtWayland server support for Wayland video driver [[default=yes]]]),
+                  ,enable_video_wayland_qt_touch=yes)
+
+    if test x$enable_video = xyes -a x$enable_video_wayland = xyes; then
+        AC_MSG_CHECKING(for Wayland support)
+        video_wayland=no
+        if  test x$video_opengl_egl = xyes && \
+            test x$video_opengles_v2 = xyes; then
+            if $PKG_CONFIG --exists wayland-client wayland-scanner wayland-protocols wayland-egl wayland-cursor egl xkbcommon ; then
+                WAYLAND_CFLAGS=`$PKG_CONFIG --cflags wayland-client wayland-egl wayland-cursor xkbcommon`
+                WAYLAND_LIBS=`$PKG_CONFIG --libs wayland-client wayland-egl wayland-cursor xkbcommon`
+                WAYLAND_SCANNER=`$PKG_CONFIG --variable=wayland_scanner wayland-scanner`
+                video_wayland=yes
+            fi
+        fi
+        AC_MSG_RESULT($video_wayland)
+
+        if test x$video_wayland = xyes; then
+            AC_DEFINE(SDL_VIDEO_DRIVER_WAYLAND, 1, [ ])
+            if test x$enable_video_wayland_qt_touch = xyes; then
+                AC_DEFINE(SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH, 1, [ ])
+            fi
+
+            WAYLAND_SOURCES="$srcdir/src/video/wayland/*.c"
+            SOURCES="$SOURCES $WAYLAND_SOURCES"
+            EXTRA_CFLAGS="$EXTRA_CFLAGS $WAYLAND_CFLAGS -I\$(gen)"
+            AC_ARG_ENABLE(wayland-shared,
+AS_HELP_STRING([--enable-wayland-shared], [dynamically load Wayland support [[default=maybe]]]),
+                          , enable_wayland_shared=maybe)
+
+            dnl FIXME: Do BSD and OS X need special cases?
+            case "$host" in
+                *)
+                    wayland_client_lib=[`find_lib "libwayland-client.so.*" "$WAYLAND_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
+                    wayland_egl_lib=[`find_lib "libwayland-egl.so.*" "$WAYLAND_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
+                    if test x$wayland_egl_lib = x; then
+                        dnl This works in Ubuntu 13.10, maybe others
+                        wayland_egl_lib=[`find_lib "mesa-egl/libwayland-egl.so.*" "$WAYLAND_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
+                    fi
+                    wayland_cursor_lib=[`find_lib "libwayland-cursor.so.*" "$WAYLAND_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
+                    xkbcommon_lib=[`find_lib "libxkbcommon.so.*" "$WAYLAND_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
+                    ;;
+            esac
+
+            if test x$enable_wayland_shared = xmaybe; then
+                enable_wayland_shared=yes
+            fi
+            if test x$have_loadso != xyes && \
+               test x$enable_wayland_shared = xyes; then
+                AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic Wayland loading])
+                enable_wayland_shared=no
+            fi
+            if test x$have_loadso = xyes && \
+               test x$enable_wayland_shared = xyes && \
+               test x$wayland_client_lib != x && \
+               test x$wayland_egl_lib != x && \
+               test x$wayland_cursor_lib != x && \
+               test x$xkbcommon_lib != x; then
+                echo "-- dynamic libwayland-client -> $wayland_client_lib"
+                echo "-- dynamic libwayland-egl -> $wayland_egl_lib"
+                echo "-- dynamic libwayland-cursor -> $wayland_cursor_lib"
+                echo "-- dynamic libxkbcommon -> $xkbcommon_lib"
+                AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC, "$wayland_client_lib", [ ])
+                AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_EGL, "$wayland_egl_lib", [ ])
+                AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR, "$wayland_cursor_lib", [ ])
+                AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON, "$xkbcommon_lib", [ ])
+                SUMMARY_video="${SUMMARY_video} wayland(dynamic)"
+            else
+                enable_wayland_shared=no
+                EXTRA_LDFLAGS="$EXTRA_LDFLAGS $WAYLAND_LIBS"
+                SUMMARY_video="${SUMMARY_video} wayland"
+            fi
+            have_video=yes
+        fi
+    fi
+}
+
+
+dnl Check for Native Client stuff
+CheckNativeClient()
+{
+        AC_TRY_COMPILE([
+          #if !defined(__native_client__)
+          #error "NO NACL"
+          #endif
+        ],[
+        ],[
+        AC_DEFINE(SDL_VIDEO_DRIVER_NACL, 1, [ ])
+        AC_DEFINE(SDL_AUDIO_DRIVER_NACL, 1, [ ])
+        AC_DEFINE(HAVE_POW, 1, [ ])
+        AC_DEFINE(HAVE_OPENGLES2, 1, [ ])
+        AC_DEFINE(SDL_VIDEO_OPENGL_ES2, 1, [ ])
+        AC_DEFINE(SDL_VIDEO_RENDER_OGL_ES2, 1, [ ])
+
+        SDL_LIBS="-lppapi_simple -lppapi_gles2 $SDL_LIBS"
+
+        SDLMAIN_SOURCES="$srcdir/src/main/nacl/*.c"
+        SOURCES="$SOURCES $srcdir/src/audio/nacl/*.c"
+        SUMMARY_audio="${SUMMARY_audio} nacl"
+        SOURCES="$SOURCES $srcdir/src/video/nacl/*.c"
+        SUMMARY_video="${SUMMARY_video} nacl opengles2"
+        ])
+}
+
+
+CheckRPI()
+{
+    AC_ARG_ENABLE(video-rpi,
+AS_HELP_STRING([--enable-video-rpi], [use Raspberry Pi video driver [[default=yes]]]),
+                  , enable_video_rpi=yes)
+    if test x$enable_video = xyes -a x$enable_video_rpi = xyes; then
+        PKG_CHECK_MODULES([RPI], [bcm_host brcmegl], video_rpi=yes, video_rpi=no)
+
+        if test x$video_rpi = xno; then
+            if test x$ARCH = xnetbsd; then
+                RPI_CFLAGS="-I/usr/pkg/include -I/usr/pkg/include/interface/vcos/pthreads -I/usr/pkg/include/interface/vmcs_host/linux"
+                RPI_LIBS="-Wl,-R/usr/pkg/lib -L/usr/pkg/lib -lbcm_host"
+            else
+                RPI_CFLAGS="-I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux"
+                RPI_LIBS="-Wl,-rpath,/opt/vc/lib -L/opt/vc/lib -lbcm_host"
+            fi
+        fi
+
+        # Save the original compiler flags and libraries
+        ac_save_cflags="$CFLAGS"; ac_save_libs="$LIBS"
+
+        # Add the Raspberry Pi compiler flags and libraries
+        CFLAGS="$CFLAGS $RPI_CFLAGS"; LIBS="$LIBS $RPI_LIBS"
+
+        AC_MSG_CHECKING(for Raspberry Pi)
+        have_video_rpi=no
+        AC_TRY_LINK([
+          #include <bcm_host.h>
+        ],[
+          bcm_host_init();
+        ],[
+        have_video_rpi=yes
+        ],[
+        ])
+        AC_MSG_RESULT($have_video_rpi)
+
+        # Restore the compiler flags and libraries
+        CFLAGS="$ac_save_cflags"; LIBS="$ac_save_libs"
+        
+        if test x$have_video_rpi = xyes; then
+            CFLAGS="$CFLAGS $RPI_CFLAGS"
+            SDL_CFLAGS="$SDL_CFLAGS $RPI_CFLAGS"
+            EXTRA_CFLAGS="$EXTRA_CFLAGS $RPI_CFLAGS"
+            EXTRA_LDFLAGS="$EXTRA_LDFLAGS $RPI_LIBS"
+            SOURCES="$SOURCES $srcdir/src/video/raspberry/*.c"
+            AC_DEFINE(SDL_VIDEO_DRIVER_RPI, 1, [ ])
+            SUMMARY_video="${SUMMARY_video} rpi"
+        fi
+    fi
+}
+
+dnl Find the X11 include and library directories
+CheckX11()
+{
+    AC_ARG_ENABLE(video-x11,
+AS_HELP_STRING([--enable-video-x11], [use X11 video driver [[default=yes]]]),
+                  , enable_video_x11=yes)
+    if test x$enable_video = xyes -a x$enable_video_x11 = xyes; then
+        case "$host" in
+            *-*-darwin*)
+                # This isn't necessary for X11, but fixes GLX detection
+                if test "x$x_includes" = xNONE && \
+                   test "x$x_libraries" = xNONE && \
+                   test -d /usr/X11R6/include && \
+                   test -d /usr/X11R6/lib; then
+                    x_includes="/usr/X11R6/include"
+                    x_libraries="/usr/X11R6/lib"
+                fi
+                ;;
+        esac
+        AC_PATH_X
+        AC_PATH_XTRA
+        if test x$have_x = xyes; then
+            AC_ARG_ENABLE(x11-shared,
+AS_HELP_STRING([--enable-x11-shared], [dynamically load X11 support [[default=maybe]]]),
+                          , enable_x11_shared=maybe)
+
+            case "$host" in
+                *-*-darwin*)
+                    x11_lib='/usr/X11R6/lib/libX11.6.dylib'
+                    x11ext_lib='/usr/X11R6/lib/libXext.6.dylib'
+                    xcursor_lib='/usr/X11R6/lib/libXcursor.1.dylib'
+                    xinerama_lib='/usr/X11R6/lib/libXinerama.1.dylib'
+                    xinput_lib='/usr/X11R6/lib/libXi.6.dylib'
+                    xrandr_lib='/usr/X11R6/lib/libXrandr.2.dylib'
+                    xrender_lib='/usr/X11R6/lib/libXrender.1.dylib'
+                    xss_lib='/usr/X11R6/lib/libXss.1.dylib'
+                    xvidmode_lib='/usr/X11R6/lib/libXxf86vm.1.dylib'
+                    ;;
+                *-*-openbsd*)
+                    x11_lib='libX11.so'
+                    x11ext_lib='libXext.so'
+                    xcursor_lib='libXcursor.so'
+                    xinerama_lib='libXinerama.so'
+                    xinput_lib='libXi.so'
+                    xrandr_lib='libXrandr.so'
+                    xrender_lib='libXrender.so'
+                    xss_lib='libXss.so'
+                    xvidmode_lib='libXxf86vm.so'
+                    ;;
+                *)
+                    x11_lib=[`find_lib "libX11.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
+                    x11ext_lib=[`find_lib "libXext.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
+                    xcursor_lib=[`find_lib "libXcursor.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
+                    xinerama_lib=[`find_lib "libXinerama.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
+                    xinput_lib=[`find_lib "libXi.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
+                    xrandr_lib=[`find_lib "libXrandr.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
+                    xrender_lib=[`find_lib "libXrender.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
+                    xss_lib=[`find_lib "libXss.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
+                    xvidmode_lib=[`find_lib "libXxf86vm.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
+                    ;;
+            esac
+
+            if test x$ac_cv_func_shmat != xyes; then
+                X_CFLAGS="$X_CFLAGS -DNO_SHARED_MEMORY"
+            fi
+            CFLAGS="$CFLAGS $X_CFLAGS"
+            LDFLAGS="$LDFLAGS $X_LIBS"
+
+            AC_CHECK_HEADER(X11/extensions/Xext.h,
+                            have_xext_h_hdr=yes,
+                            have_xext_h_hdr=no,
+                            [#include <X11/Xlib.h>
+                             #include <X11/Xproto.h>
+                            ])
+            if test x$have_xext_h_hdr != xyes; then
+               AC_MSG_ERROR([
+*** Missing Xext.h, maybe you need to install the libxext-dev package?
+               ])
+            fi
+
+            AC_DEFINE(SDL_VIDEO_DRIVER_X11, 1, [ ])
+            SOURCES="$SOURCES $srcdir/src/video/x11/*.c"
+            EXTRA_CFLAGS="$EXTRA_CFLAGS $X_CFLAGS"
+
+            # Needed so SDL applications can include SDL_syswm.h
+            SDL_CFLAGS="$SDL_CFLAGS $X_CFLAGS"
+
+            if test x$enable_x11_shared = xmaybe; then
+                enable_x11_shared=yes
+            fi
+            if test x$have_loadso != xyes && \
+               test x$enable_x11_shared = xyes; then
+                AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic X11 loading])
+                enable_x11_shared=no
+            fi
+            if test x$have_loadso = xyes && \
+               test x$enable_x11_shared = xyes && test x$x11_lib != x && test x$x11ext_lib != x; then
+                echo "-- dynamic libX11 -> $x11_lib"
+                echo "-- dynamic libX11ext -> $x11ext_lib"
+                AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC, "$x11_lib", [ ])
+                AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT, "$x11ext_lib", [ ])
+                SUMMARY_video="${SUMMARY_video} x11(dynamic)"
+            else
+                enable_x11_shared=no
+                EXTRA_LDFLAGS="$EXTRA_LDFLAGS $X_LIBS -lX11 -lXext"
+                SUMMARY_video="${SUMMARY_video} x11"
+            fi
+            have_video=yes
+
+            AC_MSG_CHECKING(for const parameter to XextAddDisplay)
+            have_const_param_XextAddDisplay=no
+            AC_TRY_COMPILE([
+              #include <X11/Xlib.h>
+              #include <X11/Xproto.h>
+              #include <X11/extensions/Xext.h>
+              #include <X11/extensions/extutil.h>
+              extern XExtDisplayInfo* XextAddDisplay(XExtensionInfo* a,Display* b,_Xconst char* c,XExtensionHooks* d,int e,XPointer f);
+            ],[
+            ],[
+            have_const_param_XextAddDisplay=yes
+            AC_DEFINE([SDL_VIDEO_DRIVER_X11_CONST_PARAM_XEXTADDDISPLAY], 1, [ ])
+            ])
+            AC_MSG_RESULT($have_const_param_XextAddDisplay)
+
+            dnl AC_CHECK_LIB(X11, XGetEventData, AC_DEFINE(SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS, 1, [Have XGenericEvent]))
+            AC_MSG_CHECKING([for XGenericEvent])
+            have_XGenericEvent=no
+            AC_TRY_COMPILE([
+                #include <X11/Xlib.h>
+            ],[
+Display *display;
+XEvent event;
+XGenericEventCookie *cookie = &event.xcookie;
+XNextEvent(display, &event);
+XGetEventData(display, cookie);
+XFreeEventData(display, cookie);
+            ],[
+                have_XGenericEvent=yes
+                AC_DEFINE([SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS], 1, [ ])
+            ])
+            AC_MSG_RESULT($have_XGenericEvent)
+
+            AC_CHECK_LIB(X11, XkbKeycodeToKeysym, AC_DEFINE(SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM, 1, [Have XkbKeycodeToKeysym]))
+
+            AC_ARG_ENABLE(video-x11-xcursor,
+AS_HELP_STRING([--enable-video-x11-xcursor], [enable X11 Xcursor support [[default=yes]]]),
+                            , enable_video_x11_xcursor=yes)
+            if test x$enable_video_x11_xcursor = xyes; then
+                definitely_enable_video_x11_xcursor=no
+                AC_CHECK_HEADER(X11/Xcursor/Xcursor.h,
+                                have_xcursor_h_hdr=yes,
+                                have_xcursor_h_hdr=no,
+                                [#include <X11/Xlib.h>
+                                ])
+                if test x$have_xcursor_h_hdr = xyes; then
+                    if test x$enable_x11_shared = xyes && test x$xcursor_lib != x ; then
+                        echo "-- dynamic libXcursor -> $xcursor_lib"
+                        AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XCURSOR, "$xcursor_lib", [ ])
+                        definitely_enable_video_x11_xcursor=yes
+                    else
+                        AC_CHECK_LIB(Xcursor, XcursorImageCreate, have_xcursor_lib=yes)
+                        if test x$have_xcursor_lib = xyes ; then
+                            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXcursor"
+                            definitely_enable_video_x11_xcursor=yes
+                        fi
+                    fi
+                fi
+            fi
+            if test x$definitely_enable_video_x11_xcursor = xyes; then
+                AC_DEFINE(SDL_VIDEO_DRIVER_X11_XCURSOR, 1, [ ])
+                SUMMARY_video_x11="${SUMMARY_video_x11} xcursor"
+            fi
+            AC_ARG_ENABLE(video-x11-xdbe,
+AS_HELP_STRING([--enable-video-x11-xdbe], [enable X11 Xdbe support [[default=yes]]]),
+                            , enable_video_x11_xdbe=yes)
+            if test x$enable_video_x11_xdbe = xyes; then
+                AC_CHECK_HEADER(X11/extensions/Xdbe.h,
+                                have_dbe_h_hdr=yes,
+                                have_dbe_h_hdr=no,
+                                [#include <X11/Xlib.h>
+                                ])
+                if test x$have_dbe_h_hdr = xyes; then
+                    AC_DEFINE(SDL_VIDEO_DRIVER_X11_XDBE, 1, [ ])
+                    SUMMARY_video_x11="${SUMMARY_video_x11} xdbe"
+                fi
+            fi
+            AC_ARG_ENABLE(video-x11-xinerama,
+AS_HELP_STRING([--enable-video-x11-xinerama], [enable X11 Xinerama support [[default=yes]]]),
+                            , enable_video_x11_xinerama=yes)
+            if test x$enable_video_x11_xinerama = xyes; then
+                definitely_enable_video_x11_xinerama=no
+                AC_CHECK_HEADER(X11/extensions/Xinerama.h,
+                                have_xinerama_h_hdr=yes,
+                                have_xinerama_h_hdr=no,
+                                [#include <X11/Xlib.h>
+                                ])
+                if test x$have_xinerama_h_hdr = xyes; then
+                    if test x$enable_x11_shared = xyes && test x$xinerama_lib != x ; then
+                        echo "-- dynamic libXinerama -> $xinerama_lib"
+                        AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA, "$xinerama_lib", [ ])
+                        definitely_enable_video_x11_xinerama=yes
+                    else
+                        AC_CHECK_LIB(Xinerama, XineramaQueryExtension, have_xinerama_lib=yes)
+                        if test x$have_xinerama_lib = xyes ; then
+                            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXinerama"
+                            definitely_enable_video_x11_xinerama=yes
+                        fi
+                    fi
+                fi
+            fi
+            if test x$definitely_enable_video_x11_xinerama = xyes; then
+                AC_DEFINE(SDL_VIDEO_DRIVER_X11_XINERAMA, 1, [ ])
+                SUMMARY_video_x11="${SUMMARY_video_x11} xinerama"
+            fi
+            AC_ARG_ENABLE(video-x11-xinput,
+AS_HELP_STRING([--enable-video-x11-xinput], [enable X11 XInput extension for manymouse, tablets, etc [[default=yes]]]),
+                            , enable_video_x11_xinput=yes)
+            if test x$enable_video_x11_xinput = xyes; then
+                definitely_enable_video_x11_xinput=no
+                AC_CHECK_HEADER(X11/extensions/XInput2.h,
+                                have_xinput_h_hdr=yes,
+                                have_xinput_h_hdr=no,
+                                [#include <X11/Xlib.h>
+                                ])
+                if test x$have_xinput_h_hdr = xyes; then
+                    if test x$enable_x11_shared = xyes && test x$xinput_lib != x ; then
+                        echo "-- dynamic libXi -> $xinput_lib"
+                        AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2, "$xinput_lib", [ ])
+                        definitely_enable_video_x11_xinput=yes
+                    else
+                        AC_CHECK_LIB(Xi, XOpenDevice, have_xinput_lib=yes)
+                        if test x$have_xinput_lib = xyes ; then
+                            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXi"
+                            definitely_enable_video_x11_xinput=yes
+                        fi
+                    fi
+                fi
+            fi
+            if test x$definitely_enable_video_x11_xinput = xyes; then
+                SUMMARY_video_x11="${SUMMARY_video_x11} xinput2"
+                AC_DEFINE(SDL_VIDEO_DRIVER_X11_XINPUT2, 1, [ ])
+                AC_MSG_CHECKING(for xinput2 multitouch)
+                have_xinput2_multitouch=no
+                AC_TRY_COMPILE([
+                    #include <X11/Xlib.h>
+                    #include <X11/Xproto.h>
+                    #include <X11/extensions/XInput2.h>
+                    ],[
+int event_type = XI_TouchBegin;
+XITouchClassInfo *t;
+                    ],[
+                    have_xinput2_multitouch=yes
+                    AC_DEFINE([SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH], 1, [])
+                    SUMMARY_video_x11="${SUMMARY_video_x11} xinput2_multitouch"
+                    ])
+                AC_MSG_RESULT($have_xinput2_multitouch)
+            fi
+            AC_ARG_ENABLE(video-x11-xrandr,
+AS_HELP_STRING([--enable-video-x11-xrandr], [enable X11 Xrandr extension for fullscreen [[default=yes]]]),
+                            , enable_video_x11_xrandr=yes)
+            if test x$enable_video_x11_xrandr = xyes; then
+                dnl XRRScreenResources is only present in Xrandr >= 1.2, we use that as a test.
+                definitely_enable_video_x11_xrandr=no
+                have_xrandr_h_hdr=no
+                AC_TRY_COMPILE([
+                #include <X11/Xlib.h>
+                #include <X11/extensions/Xrandr.h>
+                ],[
+                XRRScreenResources *res = NULL;
+                ],[
+                have_xrandr_h_hdr=yes
+                ])
+                if test x$have_xrandr_h_hdr = xyes; then
+                    if test x$enable_x11_shared = xyes && test x$xrandr_lib != x ; then
+                        echo "-- dynamic libXrandr -> $xrandr_lib"
+                        AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR, "$xrandr_lib", [ ])
+                        definitely_enable_video_x11_xrandr=yes
+                    else
+                        AC_CHECK_LIB(Xrandr, XRRQueryExtension, have_xrandr_lib=yes)
+                        if test x$have_xrandr_lib = xyes ; then
+                            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXrandr"
+                            definitely_enable_video_x11_xrandr=yes
+                        fi
+                    fi
+                fi
+            fi
+            if test x$definitely_enable_video_x11_xrandr = xyes; then
+                AC_DEFINE(SDL_VIDEO_DRIVER_X11_XRANDR, 1, [ ])
+                SUMMARY_video_x11="${SUMMARY_video_x11} xrandr"
+            fi
+            AC_ARG_ENABLE(video-x11-scrnsaver,
+AS_HELP_STRING([--enable-video-x11-scrnsaver], [enable X11 screensaver extension [[default=yes]]]),
+                            , enable_video_x11_scrnsaver=yes)
+            if test x$enable_video_x11_scrnsaver = xyes; then
+                AC_CHECK_HEADER(X11/extensions/scrnsaver.h,
+                                have_scrnsaver_h_hdr=yes,
+                                have_scrnsaver_h_hdr=no,
+                                [#include <X11/Xlib.h>
+                                ])
+                if test x$have_scrnsaver_h_hdr = xyes; then
+                    if test x$enable_x11_shared = xyes && test x$xss_lib != x ; then
+                        echo "-- dynamic libXss -> $xss_lib"
+                        AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS, "$xss_lib", [ ])
+                        definitely_enable_video_x11_scrnsaver=yes
+                    else
+                        AC_CHECK_LIB(Xss, XScreenSaverSuspend, have_xss_lib=yes)
+                        if test x$have_xss_lib = xyes ; then
+                            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXss"
+                            definitely_enable_video_x11_scrnsaver=yes
+                        fi
+                    fi
+                fi
+            fi
+            if test x$definitely_enable_video_x11_scrnsaver = xyes; then
+                AC_DEFINE(SDL_VIDEO_DRIVER_X11_XSCRNSAVER, 1, [ ])
+                SUMMARY_video_x11="${SUMMARY_video_x11} xscrnsaver"
+            fi
+            AC_ARG_ENABLE(video-x11-xshape,
+AS_HELP_STRING([--enable-video-x11-xshape], [enable X11 XShape support [[default=yes]]]),
+                            , enable_video_x11_xshape=yes)
+            if test x$enable_video_x11_xshape = xyes; then
+                AC_CHECK_HEADER(X11/extensions/shape.h,
+                                have_shape_h_hdr=yes,
+                                have_shape_h_hdr=no,
+                                [#include <X11/Xlib.h>
+                                ])
+                if test x$have_shape_h_hdr = xyes; then
+                    AC_DEFINE(SDL_VIDEO_DRIVER_X11_XSHAPE, 1, [ ])
+                    SUMMARY_video_x11="${SUMMARY_video_x11} xshape"
+                fi
+            fi
+            AC_ARG_ENABLE(video-x11-vm,
+AS_HELP_STRING([--enable-video-x11-vm], [use X11 VM extension for fullscreen [[default=yes]]]),
+                            , enable_video_x11_vm=yes)
+            if test x$enable_video_x11_vm = xyes; then
+                definitely_enable_video_x11_vm=no
+                AC_CHECK_HEADER(X11/extensions/xf86vmode.h,
+                                have_vm_h_hdr=yes,
+                                have_vm_h_hdr=no,
+                                [#include <X11/Xlib.h>
+                                ])
+                if test x$have_vm_h_hdr = xyes; then
+                    if test x$enable_x11_shared = xyes && test x$xvidmode_lib != x ; then
+                        echo "-- dynamic libXxf86vm -> $xvidmode_lib"
+                        AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE, "$xvidmode_lib", [ ])
+                        definitely_enable_video_x11_vm=yes
+                    else
+                        AC_CHECK_LIB(Xxf86vm, XF86VidModeQueryVersion, have_vm_lib=yes)
+                        if test x$have_vm_lib = xyes ; then
+                            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXxf86vm"
+                            definitely_enable_video_x11_vm=yes
+                        fi
+                    fi
+                fi
+            fi
+            if test x$definitely_enable_video_x11_vm = xyes; then
+                AC_DEFINE(SDL_VIDEO_DRIVER_X11_XVIDMODE, 1, [ ])
+                SUMMARY_video_x11="${SUMMARY_video_x11} xvidmode"
+            fi
+        fi
+    fi
+}
+
+dnl Set up the Vivante video driver if enabled
+CheckVivanteVideo()
+{
+    AC_ARG_ENABLE(video-vivante,
+AS_HELP_STRING([--enable-video-vivante], [use Vivante EGL video driver [[default=yes]]]),
+                  , enable_video_vivante=yes)
+    if test x$enable_video = xyes -a x$enable_video_vivante = xyes; then
+        AC_MSG_CHECKING(for Vivante VDK API)
+        have_vivante_vdk=no
+        AC_TRY_COMPILE([
+          #define LINUX
+          #define EGL_API_FB
+          #include <gc_vdk.h>
+        ],[
+        ],[
+        have_vivante_vdk=yes
+        ])
+        AC_MSG_RESULT($have_vivante_vdk)
+
+        AC_MSG_CHECKING(for Vivante FB API)
+        have_vivante_egl=no
+        AC_TRY_COMPILE([
+          #define LINUX
+          #define EGL_API_FB
+          #include <EGL/eglvivante.h>
+        ],[
+        ],[
+        have_vivante_egl=yes
+        ])
+        AC_MSG_RESULT($have_vivante_egl)
+
+        if test x$have_vivante_vdk = xyes -o x$have_vivante_egl = xyes; then
+            AC_DEFINE(SDL_VIDEO_DRIVER_VIVANTE, 1, [ ])
+            EXTRA_CFLAGS="$EXTRA_CFLAGS -DLINUX -DEGL_API_FB"
+            if test x$have_vivante_vdk = xyes; then
+                AC_DEFINE(SDL_VIDEO_DRIVER_VIVANTE_VDK, 1, [ ])
+                EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lVDK"
+            fi
+            SOURCES="$SOURCES $srcdir/src/video/vivante/*.c"
+            SUMMARY_video="${SUMMARY_video} vivante"
+            have_video=yes
+        fi
+    fi
+}
+
+dnl Set up the Haiku video driver if enabled
+CheckHaikuVideo()
+{
+    if test x$enable_video = xyes; then
+        AC_DEFINE(SDL_VIDEO_DRIVER_HAIKU, 1, [ ])
+        SOURCES="$SOURCES $srcdir/src/video/haiku/*.cc"
+        have_video=yes
+        SUMMARY_video="${SUMMARY_video} haiku"
+    fi
+}
+
+dnl Set up the Cocoa video driver for Mac OS X (but not Darwin)
+CheckCOCOA()
+{
+    AC_ARG_ENABLE(video-cocoa,
+AS_HELP_STRING([--enable-video-cocoa], [use Cocoa video driver [[default=yes]]]),
+                  , enable_video_cocoa=yes)
+    if test x$enable_video = xyes -a x$enable_video_cocoa = xyes; then
+        save_CFLAGS="$CFLAGS"
+        dnl Work around that we don't have Objective-C support in autoconf
+        CFLAGS="$CFLAGS -x objective-c"
+        AC_MSG_CHECKING(for Cocoa framework)
+        have_cocoa=no
+        AC_TRY_COMPILE([
+          #import <Cocoa/Cocoa.h>
+        ],[
+        ],[
+        have_cocoa=yes
+        ])
+        AC_MSG_RESULT($have_cocoa)
+        CFLAGS="$save_CFLAGS"
+        if test x$have_cocoa = xyes; then
+            AC_DEFINE(SDL_VIDEO_DRIVER_COCOA, 1, [ ])
+            SOURCES="$SOURCES $srcdir/src/video/cocoa/*.m"
+            SUMMARY_video="${SUMMARY_video} cocoa"
+            have_video=yes
+        fi
+    fi
+}
+
+CheckMETAL()
+{
+    AC_ARG_ENABLE(render-metal,
+AS_HELP_STRING([--enable-render-metal], [enable the Metal render driver [[default=yes]]]),
+                                , enable_render_metal=yes)
+    if test x$enable_render = xyes -a x$enable_render_metal = xyes; then
+        save_CFLAGS="$CFLAGS"
+        dnl Work around that we don't have Objective-C support in autoconf
+        CFLAGS="$CFLAGS -x objective-c"
+        AC_MSG_CHECKING(for Metal framework)
+        have_metal=no
+        AC_TRY_COMPILE([
+          #import <Cocoa/Cocoa.h>
+          #import <Metal/Metal.h>
+          #import <QuartzCore/CAMetalLayer.h>
+
+          #if !TARGET_CPU_X86_64
+          #error Metal doesn't work on this configuration
+          #endif
+        ],[
+        ],[
+        have_metal=yes
+        ])
+        CFLAGS="$save_CFLAGS"
+        AC_MSG_RESULT($have_metal)
+        if test x$have_metal = xyes; then
+            AC_DEFINE(SDL_VIDEO_RENDER_METAL, 1, [ ])
+            SOURCES="$SOURCES $srcdir/src/render/metal/*.m"
+            SUMMARY_video="${SUMMARY_video} metal"
+        else
+            enable_render_metal=no
+        fi
+    fi
+}
+
+
+dnl Find DirectFB
+CheckDirectFB()
+{
+    AC_ARG_ENABLE(video-directfb,
+AS_HELP_STRING([--enable-video-directfb], [use DirectFB video driver [[default=no]]]),
+                  , enable_video_directfb=no)
+    if test x$enable_video = xyes -a x$enable_video_directfb = xyes; then
+        PKG_CHECK_MODULES([DIRECTFB], [directfb >= 1.0.0], video_directfb=yes, video_directfb=no)
+
+        if test x$video_directfb = xyes; then
+            # SuSE 11.1 installs directfb-config without directfb-devel
+            save_CPPFLAGS="$CPPFLAGS"
+            CPPFLAGS="$CPPFLAGS $DIRECTFB_CFLAGS"
+            AC_CHECK_HEADER(directfb.h, have_directfb_hdr=yes, have_directfb_hdr=no)
+            CPPFLAGS="$save_CPPFLAGS"
+            video_directfb=$have_directfb_hdr
+        fi
+
+        if test x$video_directfb = xyes; then
+            AC_ARG_ENABLE(directfb-shared,
+AS_HELP_STRING([--enable-directfb-shared], [dynamically load directfb support [[default=yes]]]),
+                              , enable_directfb_shared=yes)
+
+            AC_DEFINE(SDL_VIDEO_DRIVER_DIRECTFB, 1, [ ])
+            AC_DEFINE(SDL_VIDEO_RENDER_DIRECTFB, 1, [ ])
+            SOURCES="$SOURCES $srcdir/src/video/directfb/*.c"
+            EXTRA_CFLAGS="$EXTRA_CFLAGS $DIRECTFB_CFLAGS"
+
+            AC_MSG_CHECKING(for directfb dynamic loading support)
+            directfb_shared=no
+            directfb_lib=[`find_lib "libdirectfb*.so.*" "$DIRECTFB_LIBS"`]
+            # | sed 's/.*\/\(.*\)/\1/; q'`]
+AC_MSG_WARN("directfb $directfb_lib")
+            if test x$have_loadso != xyes && \
+               test x$enable_directfb_shared = xyes; then
+                AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic directfb loading])
+            fi
+            if test x$have_loadso = xyes && \
+               test x$enable_directfb_shared = xyes && test x$directfb_lib != x; then
+                directfb_shared=yes
+                echo "-- $directfb_lib_spec -> $directfb_lib"
+                AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC, "$directfb_lib", [ ])
+                SUMMARY_video="${SUMMARY_video} directfb(dynamic)"
+            else
+                EXTRA_LDFLAGS="$EXTRA_LDFLAGS $DIRECTFB_LIBS"
+                SUMMARY_video="${SUMMARY_video} directfb"
+            fi
+            AC_MSG_RESULT($directfb_shared)
+            SDL_CFLAGS="$SDL_CFLAGS $DIRECTFB_CFLAGS"
+            have_video=yes
+        fi
+    fi
+}
+
+dnl Find KMSDRM
+CheckKMSDRM()
+{
+    AC_ARG_ENABLE(video-kmsdrm,
+AS_HELP_STRING([--enable-video-kmsdrm], [use KMSDRM video driver [[default=no]]]),
+                  , enable_video_kmsdrm=no)
+
+    if test x$enable_video = xyes -a x$enable_video_kmsdrm = xyes; then
+        video_kmsdrm=no
+
+        PKG_CHECK_MODULES([LIBDRM], [libdrm >= 2.4.46], libdrm_avail=yes, libdrm_avail=no)
+        PKG_CHECK_MODULES([LIBGBM], [gbm >= 9.0.0], libgbm_avail=yes, libgbm_avail=no)
+
+        if test x$libdrm_avail = xyes -a x$libgbm_avail = xyes; then
+            video_kmsdrm=yes
+        fi
+
+        if test x$video_kmsdrm = xyes; then
+            AC_ARG_ENABLE(kmsdrm-shared,
+AS_HELP_STRING([--enable-kmsdrm-shared], [dynamically load kmsdrm support [[default=yes]]]),
+                , enable_kmsdrm_shared=yes)
+
+            AC_DEFINE(SDL_VIDEO_DRIVER_KMSDRM, 1, [ ])
+            SOURCES="$SOURCES $srcdir/src/video/kmsdrm/*.c"
+            EXTRA_CFLAGS="$EXTRA_CFLAGS $LIBDRM_CFLAGS $LIBGBM_CFLAGS"
+
+            AC_MSG_CHECKING(for kmsdrm dynamic loading support)
+            kmsdrm_shared=no
+            drm_lib=[`find_lib "libdrm.so.*" "$DRM_LIBS"`]
+            gbm_lib=[`find_lib "libgbm.so.*" "$DRM_LIBS"`]
+            if test x$have_loadso != xyes && \
+               test x$enable_kmsdrm_shared = xyes; then
+                AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic kmsdrm loading])
+            fi
+            if test x$have_loadso = xyes && \
+               test x$enable_kmsdrm_shared = xyes && test x$drm_lib != x && test x$gbm_lib != x; then
+                kmsdrm_shared=yes
+                AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC, "$drm_lib", [ ])
+                AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC_GBM, "$gbm_lib", [ ])
+                AC_DEFINE_UNQUOTED(HAVE_KMSDRM_SHARED, "TRUE", [ ])
+                SUMMARY_video="${SUMMARY_video} kmsdrm(dynamic)"
+            else
+                EXTRA_LDFLAGS="$EXTRA_LDFLAGS $LIBDRM_LIBS $LIBGBM_LIBS"
+                SUMMARY_video="${SUMMARY_video} kmsdrm"
+            fi
+            AC_MSG_RESULT($kmsdrm_shared)
+            have_video=yes
+        fi
+    fi
+}
+
+dnl rcg04172001 Set up the Null video driver.
+CheckDummyVideo()
+{
+    AC_ARG_ENABLE(video-dummy,
+AS_HELP_STRING([--enable-video-dummy], [use dummy video driver [[default=yes]]]),
+                  , enable_video_dummy=yes)
+    if test x$enable_video_dummy = xyes; then
+        AC_DEFINE(SDL_VIDEO_DRIVER_DUMMY, 1, [ ])
+        SOURCES="$SOURCES $srcdir/src/video/dummy/*.c"
+        have_video=yes
+        SUMMARY_video="${SUMMARY_video} dummy"
+    fi
+}
+
+dnl Set up the QNX video driver if enabled
+CheckQNXVideo()
+{
+    if test x$enable_video = xyes; then
+        AC_DEFINE(SDL_VIDEO_DRIVER_QNX, 1, [ ])
+        SOURCES="$SOURCES $srcdir/src/video/qnx/*.c"
+        have_video=yes
+        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lscreen -lEGL -lGLESv2"
+        SUMMARY_video="${SUMMARY_video} qnx"
+    fi
+}
+
+dnl Set up the QNX audio driver if enabled
+CheckQNXAudio()
+{
+    if test x$enable_audio = xyes; then
+        AC_DEFINE(SDL_AUDIO_DRIVER_QSA, 1, [ ])
+        SOURCES="$SOURCES $srcdir/src/audio/qsa/*.c"
+        have_audio=yes
+        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lasound"
+        SUMMARY_audio="${SUMMARY_audio} qsa"
+    fi
+}
+
+dnl Check to see if OpenGL support is desired
+AC_ARG_ENABLE(video-opengl,
+AS_HELP_STRING([--enable-video-opengl], [include OpenGL support [[default=yes]]]),
+              , enable_video_opengl=yes)
+
+dnl Find OpenGL
+CheckOpenGLX11()
+{
+    if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
+        AC_MSG_CHECKING(for OpenGL (GLX) support)
+        video_opengl=no
+        AC_TRY_COMPILE([
+         #include <GL/gl.h>
+         #include <GL/glx.h>
+        ],[
+        ],[
+        video_opengl=yes
+        ])
+        AC_MSG_RESULT($video_opengl)
+        if test x$video_opengl = xyes; then
+            AC_DEFINE(SDL_VIDEO_OPENGL, 1, [ ])
+            AC_DEFINE(SDL_VIDEO_OPENGL_GLX, 1, [ ])
+            AC_DEFINE(SDL_VIDEO_RENDER_OGL, 1, [ ])
+            SUMMARY_video="${SUMMARY_video} opengl"
+        fi
+    fi
+}
+
+dnl Check to see if OpenGL ES support is desired
+AC_ARG_ENABLE(video-opengles,
+AS_HELP_STRING([--enable-video-opengles], [include OpenGL ES support [[default=yes]]]),
+              , enable_video_opengles=yes)
+AC_ARG_ENABLE(video-opengles1,
+AS_HELP_STRING([--enable-video-opengles1], [include OpenGL ES 1.1 support [[default=yes]]]),
+              , enable_video_opengles1=yes)
+AC_ARG_ENABLE(video-opengles2,
+AS_HELP_STRING([--enable-video-opengles2], [include OpenGL ES 2.0 support [[default=yes]]]),
+              , enable_video_opengles2=yes)
+
+dnl Find OpenGL ES
+CheckOpenGLESX11()
+{
+    if test x$enable_video = xyes -a x$enable_video_opengles = xyes; then
+        AC_MSG_CHECKING(for EGL support)
+        video_opengl_egl=no
+        AC_TRY_COMPILE([
+          #define LINUX
+          #define EGL_API_FB
+          #define MESA_EGL_NO_X11_HEADERS
+          #include <EGL/egl.h>
+          #include <EGL/eglext.h>
+        ],[
+        ],[
+        video_opengl_egl=yes
+        ])
+        AC_MSG_RESULT($video_opengl_egl)
+        if test x$video_opengl_egl = xyes; then
+            AC_DEFINE(SDL_VIDEO_OPENGL_EGL, 1, [ ])
+        fi
+            
+        if test x$enable_video_opengles1 = xyes; then
+            AC_MSG_CHECKING(for OpenGL ES v1 headers)
+            video_opengles_v1=no
+            AC_TRY_COMPILE([
+             #include <GLES/gl.h>
+             #include <GLES/glext.h>
+            ],[
+            ],[
+            video_opengles_v1=yes
+            ])
+            AC_MSG_RESULT($video_opengles_v1)
+            if test x$video_opengles_v1 = xyes; then
+                AC_DEFINE(SDL_VIDEO_OPENGL_ES, 1, [ ])
+                AC_DEFINE(SDL_VIDEO_RENDER_OGL_ES, 1, [ ])
+                SUMMARY_video="${SUMMARY_video} opengl_es1"
+            fi
+        fi
+        
+        if test x$enable_video_opengles2 = xyes; then
+            AC_MSG_CHECKING(for OpenGL ES v2 headers)
+            video_opengles_v2=no
+            AC_TRY_COMPILE([
+             #include <GLES2/gl2.h>
+             #include <GLES2/gl2ext.h>
+            ],[
+            ],[
+            video_opengles_v2=yes
+            ])
+            AC_MSG_RESULT($video_opengles_v2)
+            if test x$video_opengles_v2 = xyes; then
+                AC_DEFINE(SDL_VIDEO_OPENGL_ES2, 1, [ ])
+                AC_DEFINE(SDL_VIDEO_RENDER_OGL_ES2, 1, [ ])
+                SUMMARY_video="${SUMMARY_video} opengl_es2"
+            fi
+        fi
+    fi
+}
+
+dnl Check for Windows OpenGL
+CheckWINDOWSGL()
+{
+    if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
+        AC_DEFINE(SDL_VIDEO_OPENGL, 1, [ ])
+        AC_DEFINE(SDL_VIDEO_OPENGL_WGL, 1, [ ])
+        AC_DEFINE(SDL_VIDEO_RENDER_OGL, 1, [ ])
+        SUMMARY_video="${SUMMARY_video} opengl"
+    fi
+}
+
+dnl Check for Windows OpenGL
+CheckWINDOWSGLES()
+{
+    if test x$enable_video = xyes -a x$enable_video_opengles = xyes; then
+
+        AC_MSG_CHECKING(for EGL support)
+        video_opengl_egl=no
+        AC_TRY_COMPILE([
+         #include <EGL/egl.h>
+        ],[
+        ],[
+        video_opengl_egl=yes
+        ])
+        AC_MSG_RESULT($video_opengl_egl)
+        if test x$video_opengl_egl = xyes; then
+            AC_DEFINE(SDL_VIDEO_OPENGL, 1, [ ])
+            AC_DEFINE(SDL_VIDEO_OPENGL_EGL, 1, [ ])
+            SUMMARY_video="${SUMMARY_video} opengl_es1"
+        fi
+       
+        AC_MSG_CHECKING(for OpenGL ES v2 headers)
+        video_opengles_v2=no
+        AC_TRY_COMPILE([
+         #include <GLES2/gl2.h>
+         #include <GLES2/gl2ext.h>
+        ],[
+        ],[
+        video_opengles_v2=yes
+        ])
+        AC_MSG_RESULT($video_opengles_v2)
+        if test x$video_opengles_v2 = xyes; then
+            AC_DEFINE(SDL_VIDEO_OPENGL, 1, [ ])
+            AC_DEFINE(SDL_VIDEO_OPENGL_ES2, 1, [ ])
+            AC_DEFINE(SDL_VIDEO_RENDER_OGL_ES2, 1, [ ])
+            SUMMARY_video="${SUMMARY_video} opengl_es2"
+        fi
+    fi
+}
+
+dnl Check for Haiku OpenGL
+CheckHaikuGL()
+{
+    if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
+        AC_DEFINE(SDL_VIDEO_OPENGL, 1, [ ])
+        AC_DEFINE(SDL_VIDEO_OPENGL_HAIKU, 1, [ ])
+        AC_DEFINE(SDL_VIDEO_RENDER_OGL, 1, [ ])
+        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lGL"
+        SUMMARY_video="${SUMMARY_video} opengl"
+    fi
+}
+
+dnl Check for MacOS OpenGL
+CheckMacGL()
+{
+    if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
+        AC_DEFINE(SDL_VIDEO_OPENGL, 1, [ ])
+        AC_DEFINE(SDL_VIDEO_OPENGL_CGL, 1, [ ])
+        AC_DEFINE(SDL_VIDEO_RENDER_OGL, 1, [ ])
+        SUMMARY_video="${SUMMARY_video} opengl"
+    fi
+}
+
+dnl Check for MacOS OpenGLES
+CheckMacGLES()
+{
+    if test x$enable_video = xyes -a x$enable_video_opengles = xyes; then
+        video_opengl_egl=yes
+        AC_DEFINE(SDL_VIDEO_OPENGL_EGL, 1, [ ])
+        video_opengles_v2=yes
+        AC_DEFINE(SDL_VIDEO_OPENGL_ES2, 1, [ ])
+        AC_DEFINE(SDL_VIDEO_RENDER_OGL_ES2, 1, [ ])
+        SUMMARY_video="${SUMMARY_video} opengl_es2"
+    fi
+}
+
+CheckEmscriptenGLES()
+{
+    if test x$enable_video = xyes -a x$enable_video_opengles = xyes; then
+        AC_MSG_CHECKING(for EGL support)
+        video_opengl_egl=no
+        AC_TRY_COMPILE([
+         #include <EGL/egl.h>
+        ],[
+        ],[
+        video_opengl_egl=yes
+        ])
+        AC_MSG_RESULT($video_opengl_egl)
+        if test x$video_opengl_egl = xyes; then
+            AC_DEFINE(SDL_VIDEO_OPENGL_EGL, 1, [ ])
+        fi
+
+        AC_MSG_CHECKING(for OpenGL ES v2 headers)
+        video_opengles_v2=no
+        AC_TRY_COMPILE([
+         #include <GLES2/gl2.h>
+         #include <GLES2/gl2ext.h>
+        ],[
+        ],[
+        video_opengles_v2=yes
+        ])
+        AC_MSG_RESULT($video_opengles_v2)
+        if test x$video_opengles_v2 = xyes; then
+            AC_DEFINE(SDL_VIDEO_OPENGL_ES2, 1, [ ])
+            AC_DEFINE(SDL_VIDEO_RENDER_OGL_ES2, 1, [ ])
+            SUMMARY_video="${SUMMARY_video} opengl_es2"
+        fi
+    fi
+}
+
+dnl Check to see if Vulkan support is desired
+AC_ARG_ENABLE(video-vulkan,
+AS_HELP_STRING([--enable-video-vulkan], [include Vulkan support [[default=yes]]]),
+              , enable_video_vulkan=yes)
+
+dnl Find Vulkan Header
+CheckVulkan()
+{
+    if test x$enable_video = xyes -a x$enable_video_vulkan = xyes; then
+        case "$host" in
+            *-*-android*)
+                AC_TRY_COMPILE([
+                  #if defined(__ARM_ARCH) && __ARM_ARCH < 7
+                  #error Vulkan doesn't work on this configuration
+                  #endif
+                ],[
+                ],[
+                ],[
+                    enable_video_vulkan=no
+                ])
+                ;;
+            *-*-darwin*)
+                save_CFLAGS="$CFLAGS"
+                dnl Work around that we don't have Objective-C support in autoconf
+                CFLAGS="$CFLAGS -x objective-c"
+                AC_TRY_COMPILE([
+                  #include <Cocoa/Cocoa.h>
+                  #include <Metal/Metal.h>
+                  #include <QuartzCore/CAMetalLayer.h>
+
+                  #if !TARGET_CPU_X86_64
+                  #error Vulkan doesn't work on this configuration
+                  #endif
+                ],[
+                ],[
+                ],[
+                    enable_video_vulkan=no
+                ])
+                CFLAGS="$save_CFLAGS"
+                ;;
+            *)
+                ;;
+        esac
+        if test x$enable_video_vulkan = xno; then
+            # For reasons I am totally unable to see, I get an undefined macro error if
+            # I put this in the AC_TRY_COMPILE.
+            AC_MSG_WARN([Vulkan does not work on this configuration.])
+        fi
+    fi
+    if test x$enable_video_vulkan = xyes; then
+        AC_DEFINE(SDL_VIDEO_VULKAN, 1, [ ])
+        SUMMARY_video="${SUMMARY_video} vulkan"
+    fi
+}
+
+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_TRY_COMPILE([
+          #include <linux/input.h>
+        ],[
+          #ifndef EVIOCGNAME
+          #error EVIOCGNAME() ioctl not available
+          #endif
+        ],[
+        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
+}
+
+dnl See if we can use the kernel kd.h header
+CheckInputKD()
+{
+
+    AC_MSG_CHECKING(for Linux kd.h)
+    use_input_kd=no
+    AC_TRY_COMPILE([
+      #include <linux/kd.h>
+      #include <linux/keyboard.h>
+    ],[
+        struct kbentry kbe;
+        kbe.kb_table = KG_CTRL;
+        ioctl(0, KDGKBENT, &kbe);
+    ],[
+    use_input_kd=yes
+    ])
+    AC_MSG_RESULT($use_input_kd)
+    if test x$use_input_kd = xyes; then
+        AC_DEFINE(SDL_INPUT_LINUXKD, 1, [ ])
+        SUMMARY_input="${SUMMARY_input} linuxkd"
+    fi
+}
+
+dnl See if the platform offers libudev for device enumeration and hotplugging.
+CheckLibUDev()
+{
+    AC_ARG_ENABLE(libudev,
+AS_HELP_STRING([--enable-libudev], [enable libudev support [[default=yes]]]),
+                        , enable_libudev=yes)
+    if test x$enable_libudev = xyes; then
+        AC_CHECK_HEADER(libudev.h,
+                        have_libudev_h_hdr=yes,
+                        have_libudev_h_hdr=no)
+        if test x$have_libudev_h_hdr = xyes; then
+            AC_DEFINE(HAVE_LIBUDEV_H, 1, [ ])
+
+            udev_lib=[`find_lib "libudev.so.*" "" | sed 's/.*\/\(.*\)/\1/; q'`]
+            if test x$udev_lib != x; then
+                echo "-- dynamic udev -> $udev_lib"
+                AC_DEFINE_UNQUOTED(SDL_UDEV_DYNAMIC, "$udev_lib", [ ])
+            fi
+        fi
+    fi
+}
+
+dnl See if the platform offers libdbus for various IPC techniques.
+CheckDBus()
+{
+    AC_ARG_ENABLE(dbus,
+AS_HELP_STRING([--enable-dbus], [enable D-Bus support [[default=yes]]]),
+                        , enable_dbus=yes)
+    if test x$enable_dbus = xyes; then
+        PKG_CHECK_MODULES([DBUS], [dbus-1], have_dbus=yes, have_dbus=no)
+        save_CFLAGS="$CFLAGS"
+        CFLAGS="$save_CFLAGS $DBUS_CFLAGS"
+        AC_CHECK_HEADER(dbus/dbus.h,
+                        have_dbus_dbus_h_hdr=yes,
+                        have_dbus_dbus_h_hdr=no)
+        CFLAGS="$save_CFLAGS"
+        if test x$have_dbus_dbus_h_hdr = xyes; then
+            AC_DEFINE(HAVE_DBUS_DBUS_H, 1, [ ])
+            EXTRA_CFLAGS="$EXTRA_CFLAGS $DBUS_CFLAGS"
+            SOURCES="$SOURCES $srcdir/src/core/linux/SDL_dbus.c"
+        fi
+    fi
+}
+
+dnl See if the platform wanna IME support.
+CheckIME()
+{
+    AC_ARG_ENABLE(ime,
+AS_HELP_STRING([--enable-ime], [enable IME support [[default=yes]]]),
+                  , enable_ime=yes)
+    if test x$enable_ime = xyes; then
+        AC_DEFINE(SDL_USE_IME, 1, [ ])
+            SOURCES="$SOURCES $srcdir/src/core/linux/SDL_ime.c"
+    fi
+}
+
+dnl See if the platform has libibus IME support.
+CheckIBus()
+{
+    AC_ARG_ENABLE(ibus,
+AS_HELP_STRING([--enable-ibus], [enable IBus support [[default=yes]]]),
+                  , enable_ibus=yes)
+    if test x$enable_ibus = xyes; then
+        PKG_CHECK_MODULES([IBUS], [ibus-1.0], have_ibus=yes, have_ibus=no)
+        save_CFLAGS="$CFLAGS"
+        CFLAGS="$save_CFLAGS $IBUS_CFLAGS"
+        AC_CHECK_HEADER(ibus-1.0/ibus.h,
+                        have_ibus_ibus_h_hdr=yes,
+                        have_ibus_ibus_h_hdr=no)
+        AC_CHECK_HEADER(sys/inotify.h,
+                        have_inotify_inotify_h_hdr=yes,
+                        have_inotify_inotify_h_hdr=no)
+        CFLAGS="$save_CFLAGS"
+        if test x$have_ibus_ibus_h_hdr = xyes; then
+            if test x$enable_ime != xyes; then
+                AC_MSG_WARN([IME support is required for IBus.])
+                have_ibus_ibus_h_hdr=no
+            elif test x$enable_dbus != xyes; then
+                AC_MSG_WARN([DBus support is required for IBus.])
+                have_ibus_ibus_h_hdr=no
+            elif test x$have_inotify_inotify_h_hdr != xyes; then
+                AC_MSG_WARN([INotify support is required for IBus.])
+                have_ibus_ibus_h_hdr=no
+            else
+                AC_DEFINE(HAVE_IBUS_IBUS_H, 1, [ ])
+                EXTRA_CFLAGS="$EXTRA_CFLAGS $IBUS_CFLAGS"
+                SOURCES="$SOURCES $srcdir/src/core/linux/SDL_ibus.c"
+            fi
+        fi
+    fi
+}
+
+dnl See if the platform has fcitx IME support.
+CheckFcitx()
+{
+    AC_ARG_ENABLE(fcitx,
+AS_HELP_STRING([--enable-fcitx], [enable fcitx support [[default=yes]]]),
+                  , enable_fcitx=yes)
+    if test x$enable_fcitx = xyes; then
+        PKG_CHECK_MODULES([FCITX], [fcitx], have_fcitx=yes, have_fcitx=no)
+        CFLAGS="$CFLAGS $FCITX_CFLAGS"
+        AC_CHECK_HEADER(fcitx/frontend.h,
+                        have_fcitx_frontend_h_hdr=yes,
+                        have_fcitx_frontend_h_hdr=no)
+        CFLAGS="$save_CFLAGS"
+        if test x$have_fcitx_frontend_h_hdr = xyes; then
+            if test x$enable_ime != xyes; then
+                AC_MSG_WARN([IME support is required for fcitx.])
+                have_fcitx_frontend_h_hdr=no
+            elif test x$enable_dbus != xyes; then
+                AC_MSG_WARN([DBus support is required for fcitx.])
+                have_fcitx_frontend_h_hdr=no
+            else
+                AC_DEFINE(HAVE_FCITX_FRONTEND_H, 1, [ ])
+                EXTRA_CFLAGS="$EXTRA_CFLAGS $FCITX_CFLAGS"
+                SOURCES="$SOURCES $srcdir/src/core/linux/SDL_fcitx.c"
+            fi
+        fi
+    fi
+}
+
+dnl See if we can use the Touchscreen input library
+CheckTslib()
+{
+    AC_ARG_ENABLE(input-tslib,
+AS_HELP_STRING([--enable-input-tslib], [use the Touchscreen library for input [[default=yes]]]),
+                  , enable_input_tslib=yes)
+    if test x$enable_input_tslib = xyes; then
+        AC_MSG_CHECKING(for Touchscreen library support)
+        enable_input_tslib=no
+        AC_TRY_COMPILE([
+          #include "tslib.h"
+        ],[
+        ],[
+        enable_input_tslib=yes
+        ])
+        AC_MSG_RESULT($enable_input_tslib)
+        if test x$enable_input_tslib = xyes; then
+            AC_DEFINE(SDL_INPUT_TSLIB, 1, [ ])
+            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lts"
+            SUMMARY_input="${SUMMARY_input} ts"
+        fi
+    fi
+}
+
+dnl See what type of thread model to use on Linux and Solaris
+CheckPTHREAD()
+{
+    dnl Check for pthread support
+    AC_ARG_ENABLE(pthreads,
+AS_HELP_STRING([--enable-pthreads], [use POSIX threads for multi-threading [[default=yes]]]),
+                  , enable_pthreads=yes)
+    dnl This is used on Linux for glibc binary compatibility (Doh!)
+    AC_ARG_ENABLE(pthread-sem,
+AS_HELP_STRING([--enable-pthread-sem], [use pthread semaphores [[default=yes]]]),
+                  , enable_pthread_sem=yes)
+    case "$host" in
+         *-*-android*)
+            pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
+            pthread_lib=""
+            ;;
+        *-*-linux*|*-*-uclinux*)
+            pthread_cflags="-D_REENTRANT"
+            pthread_lib="-lpthread"
+            ;;
+        *-*-bsdi*)
+            pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
+            pthread_lib=""
+            ;;
+        *-*-darwin*)
+            pthread_cflags="-D_THREAD_SAFE"
+# causes Carbon.p complaints?
+#            pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
+            ;;
+        *-*-freebsd*|*-*-dragonfly*)
+            pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
+            pthread_lib="-pthread"
+            ;;
+        *-*-netbsd*)
+            pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
+            pthread_lib="-lpthread"
+            ;;
+        *-*-openbsd*)
+            pthread_cflags="-D_REENTRANT"
+            pthread_lib="-pthread"
+            ;;
+        *-*-solaris2.9)
+            # From Solaris 9+, posix4's preferred name is rt.
+            pthread_cflags="-D_REENTRANT"
+            pthread_lib="-lpthread -lrt"
+            ;;
+        *-*-solaris2.10)
+            # Solaris 10+ merged pthread into libc.
+            pthread_cflags="-D_REENTRANT"
+            pthread_lib="-lrt"
+            ;;
+        *-*-solaris*)
+            # Solaris 11+ merged rt into libc.
+            pthread_cflags="-D_REENTRANT"
+            pthread_lib=""
+            ;;
+        *-*-sysv5*)
+            pthread_cflags="-D_REENTRANT -Kthread"
+            pthread_lib=""
+            ;;
+        *-*-aix*)
+            pthread_cflags="-D_REENTRANT -mthreads"
+            pthread_lib="-lpthread"
+            ;;
+        *-*-hpux11*)
+            pthread_cflags="-D_REENTRANT"
+            pthread_lib="-L/usr/lib -lpthread"
+            ;;
+        *-*-haiku*)
+            pthread_cflags="-D_REENTRANT"
+            pthread_lib=""
+            ;;
+        *-*-nto*)
+            pthread_cflags="-D_REENTRANT"
+            pthread_lib=""
+            ;;
+        *)
+            pthread_cflags="-D_REENTRANT"
+            pthread_lib="-lpthread"
+            ;;
+    esac
+    if test x$enable_threads = xyes -a x$enable_pthreads = xyes; then
+        # Save the original compiler flags and libraries
+        ac_save_cflags="$CFLAGS"; ac_save_libs="$LIBS"
+        # Add the pthread compiler flags and libraries
+        CFLAGS="$CFLAGS $pthread_cflags"; LIBS="$LIBS $pthread_lib"
+        # Check to see if we have pthread support on this system
+        AC_MSG_CHECKING(for pthreads)
+        use_pthreads=no
+        AC_TRY_LINK([
+         #include <pthread.h>
+        ],[
+         pthread_attr_t type;
+         pthread_attr_init(&type);
+        ],[
+        use_pthreads=yes
+        ])
+        AC_MSG_RESULT($use_pthreads)
+        # Restore the compiler flags and libraries
+        CFLAGS="$ac_save_cflags"; LIBS="$ac_save_libs"
+
+        # Do futher testing if we have pthread support...
+        if test x$use_pthreads = xyes; then
+            AC_DEFINE(SDL_THREAD_PTHREAD, 1, [ ])
+            EXTRA_CFLAGS="$EXTRA_CFLAGS $pthread_cflags"
+            EXTRA_LDFLAGS="$EXTRA_LDFLAGS $pthread_lib"
+            SDL_CFLAGS="$SDL_CFLAGS $pthread_cflags"
+
+            # Save the original compiler flags and libraries
+            ac_save_cflags="$CFLAGS"; ac_save_libs="$LIBS"
+            # Add the pthread compiler flags and libraries
+            CFLAGS="$CFLAGS $pthread_cflags"; LIBS="$LIBS $pthread_lib"
+
+            # Check to see if recursive mutexes are available
+            AC_MSG_CHECKING(for recursive mutexes)
+            has_recursive_mutexes=no
+            if test x$has_recursive_mutexes = xno; then
+                AC_TRY_LINK([
+                  #define _GNU_SOURCE 1
+                  #include <pthread.h>
+                ],[
+                  pthread_mutexattr_t attr;
+                  pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
+                ],[
+                has_recursive_mutexes=yes
+                AC_DEFINE(SDL_THREAD_PTHREAD_RECURSIVE_MUTEX, 1, [ ])
+                ])
+            fi
+            if test x$has_recursive_mutexes = xno; then
+                AC_TRY_LINK([
+                  #define _GNU_SOURCE 1
+                  #include <pthread.h>
+                ],[
+                  pthread_mutexattr_t attr;
+                  pthread_mutexattr_setkind_np(&attr, PTHREAD_MUTEX_RECURSIVE_NP);
+                ],[
+                has_recursive_mutexes=yes
+                AC_DEFINE(SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP, 1, [ ])
+                ])
+            fi
+            AC_MSG_RESULT($has_recursive_mutexes)
+
+            # Check to see if pthread semaphore support is missing
+            if test x$enable_pthread_sem = xyes; then
+                AC_MSG_CHECKING(for pthread semaphores)
+                have_pthread_sem=no
+                AC_TRY_COMPILE([
+                  #include <pthread.h>
+                  #include <semaphore.h>
+                ],[
+                ],[
+                have_pthread_sem=yes
+                ])
+                AC_MSG_RESULT($have_pthread_sem)
+            fi
+            if test x$have_pthread_sem = xyes; then
+                AC_MSG_CHECKING(for sem_timedwait)
+                have_sem_timedwait=no
+                AC_TRY_LINK([
+                  #include <pthread.h>
+                  #include <semaphore.h>
+                ],[
+                  sem_timedwait(NULL, NULL);
+                ],[
+                have_sem_timedwait=yes
+                AC_DEFINE([HAVE_SEM_TIMEDWAIT], 1, [ ])
+                ])
+                AC_MSG_RESULT($have_sem_timedwait)
+            fi
+
+            AC_CHECK_HEADER(pthread_np.h, have_pthread_np_h=yes, have_pthread_np_h=no, [ #include <pthread.h> ])
+            if test x$have_pthread_np_h = xyes; then
+                AC_DEFINE(HAVE_PTHREAD_NP_H, 1, [ ])
+            fi
+
+            # Check to see if pthread naming is available
+            AC_MSG_CHECKING(for pthread_setname_np)
+            AC_TRY_LINK_FUNC(pthread_setname_np, [
+              has_pthread_setname_np=yes
+              AC_DEFINE(HAVE_PTHREAD_SETNAME_NP, 1, [ ])
+            ],[
+              has_pthread_setname_np=no
+            ])
+            AC_MSG_RESULT($has_pthread_setname_np)
+
+            AC_MSG_CHECKING(for pthread_set_name_np)
+            AC_TRY_LINK_FUNC(pthread_set_name_np, [
+              has_pthread_set_name_np=yes
+              AC_DEFINE(HAVE_PTHREAD_SET_NAME_NP, 1, [ ])
+            ],[
+              has_pthread_set_name_np=no
+            ])
+            AC_MSG_RESULT($has_pthread_set_name_np)
+
+            # Restore the compiler flags and libraries
+            CFLAGS="$ac_save_cflags"; LIBS="$ac_save_libs"
+
+            # Basic thread creation functions
+            SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_systhread.c"
+
+            # Semaphores
+            # We can fake these with mutexes and condition variables if necessary
+            if test x$have_pthread_sem = xyes; then
+                SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_syssem.c"
+            else
+                SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syssem.c"
+            fi
+
+            # Mutexes
+            # We can fake these with semaphores if necessary
+            SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_sysmutex.c"
+
+            # Condition variables
+            # We can fake these with semaphores and mutexes if necessary
+            SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_syscond.c"
+
+            # Thread local storage
+            SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_systls.c"
+
+            have_threads=yes
+        fi
+    fi
+}
+
+dnl Determine whether the compiler can produce Windows executables
+CheckWINDOWS()
+{
+    AC_MSG_CHECKING(Windows compiler)
+    have_win32_gcc=no
+    AC_TRY_COMPILE([
+     #include <windows.h>
+    ],[
+    ],[
+    have_win32_gcc=yes
+    ])
+    AC_MSG_RESULT($have_win32_gcc)
+    if test x$have_win32_gcc != xyes; then
+       AC_MSG_ERROR([
+*** Your compiler ($CC) does not produce Windows executables!
+       ])
+    fi
+
+    AC_MSG_CHECKING(Windows CE)
+    have_wince=no
+    AC_TRY_COMPILE([
+#if !defined(_WIN32_WCE) && !defined(__MINGW32CE__)
+#error This is not Windows CE
+#endif
+    ],[
+    ],[
+    have_wince=yes
+       AC_MSG_ERROR([
+*** Sorry, Windows CE is no longer supported.
+       ])
+    ])
+    AC_MSG_RESULT($have_wince)
+
+    # This fixes Windows stack alignment with newer GCC
+    CheckStackBoundary
+}
+
+dnl Find the DirectX includes and libraries
+CheckDIRECTX()
+{
+    AC_ARG_ENABLE(directx,
+AS_HELP_STRING([--enable-directx], [use DirectX for Windows audio/video [[default=yes]]]),
+                  , enable_directx=yes)
+    if test x$enable_directx = xyes; then
+        AC_CHECK_HEADER(d3d9.h, have_d3d=yes)
+        AC_CHECK_HEADER(d3d11_1.h, have_d3d11=yes)
+        AC_CHECK_HEADER(ddraw.h, have_ddraw=yes)
+        AC_CHECK_HEADER(dsound.h, have_dsound=yes)
+        AC_CHECK_HEADER(dinput.h, have_dinput=yes)
+        AC_CHECK_HEADER(dxgi.h, have_dxgi=yes)
+        AC_CHECK_HEADER(xinput.h, have_xinput=yes)
+        AC_TRY_COMPILE([
+#include <windows.h>
+#include <xinput.h>
+XINPUT_GAMEPAD_EX x1;
+        ],[],[have_xinput_gamepadex=yes])
+        AC_TRY_COMPILE([
+#include <windows.h>
+#include <xinput.h>
+XINPUT_STATE_EX s1;
+        ],[],[have_xinput_stateex=yes])
+
+        if test x$have_ddraw = xyes; then
+            AC_DEFINE(HAVE_DDRAW_H, 1, [ ])
+        fi
+        if test x$have_dinput = xyes; then
+            AC_DEFINE(HAVE_DINPUT_H, 1, [ ])
+        fi
+        if test x$have_dsound = xyes; then
+            AC_DEFINE(HAVE_DSOUND_H, 1, [ ])
+        fi
+        if test x$have_dxgi = xyes; then
+            AC_DEFINE(HAVE_DXGI_H, 1, [ ])
+        fi
+        if test x$have_xinput = xyes; then
+            AC_DEFINE(HAVE_XINPUT_H, 1, [ ])
+        fi
+        if test x$have_xinput_gamepadex = xyes; then
+            AC_DEFINE(HAVE_XINPUT_GAMEPAD_EX, 1, [ ])
+        fi
+        if test x$have_xinput_stateex = xyes; then
+            AC_DEFINE(HAVE_XINPUT_STATE_EX, 1, [ ])
+        fi
+
+        # FIXME: latest Cygwin finds dinput headers, but we die on other win32 headers.
+        # FIXME:  ...so force it off for now.
+        case "$host" in
+            *-*-cygwin*)
+            have_dinput=false
+            ;;
+        esac
+    fi
+
+    AC_CHECK_HEADER(mmdeviceapi.h, have_wasapi=yes)
+    if test x$have_wasapi = xyes; then
+        AC_DEFINE(HAVE_MMDEVICEAPI_H,1,[])
+    fi
+    AC_CHECK_HEADER(audioclient.h,,have_wasapi=no)
+    if test x$have_wasapi = xyes; then
+        AC_DEFINE(HAVE_AUDIOCLIENT_H,1,[])
+    fi
+
+    AC_CHECK_HEADER(endpointvolume.h,AC_DEFINE(HAVE_ENDPOINTVOLUME_H,1,[]))
+
+    AC_ARG_ENABLE(wasapi,
+AS_HELP_STRING([--enable-wasapi], [use the Windows WASAPI audio driver [[default=yes]]]),
+                                , enable_wasapi=yes)
+}
+
+dnl Check for the dlfcn.h interface for dynamically loading objects
+CheckDLOPEN()
+{
+    AC_ARG_ENABLE(sdl-dlopen,
+AS_HELP_STRING([--enable-sdl-dlopen], [use dlopen for shared object loading [[default=yes]]]),
+                  , enable_sdl_dlopen=yes)
+    if test x$enable_sdl_dlopen = xyes; then
+        AC_MSG_CHECKING(for dlopen)
+        have_dlopen=no
+        AC_TRY_COMPILE([
+         #include <dlfcn.h>
+        ],[
+         void *handle = dlopen("", RTLD_NOW);
+         const char *loaderror = (char *) dlerror();
+        ],[
+        have_dlopen=yes
+        ])
+        AC_MSG_RESULT($have_dlopen)
+
+        if test x$have_dlopen = xyes; then
+            AC_CHECK_LIB(c, dlopen, EXTRA_LDFLAGS="$EXTRA_LDFLAGS",
+               AC_CHECK_LIB(dl, dlopen, EXTRA_LDFLAGS="$EXTRA_LDFLAGS -ldl",
+                  AC_CHECK_LIB(ltdl, dlopen, EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lltdl")))
+            AC_DEFINE(SDL_LOADSO_DLOPEN, 1, [ ])
+            SOURCES="$SOURCES $srcdir/src/loadso/dlopen/*.c"
+            have_loadso=yes
+        fi
+    fi
+}
+
+dnl Check for the usbhid(3) library on *BSD
+CheckUSBHID()
+{
+    case "$host" in
+        *-*-*bsd*)
+            if test x$enable_joystick = xyes; then
+                AC_CHECK_LIB(usbhid, hid_init, have_libusbhid=yes)
+                if test x$have_libusbhid = xyes; then
+                    AC_CHECK_HEADER(usbhid.h, [USB_CFLAGS="-DHAVE_USBHID_H"])
+                    AC_CHECK_HEADER(libusbhid.h, [USB_CFLAGS="-DHAVE_LIBUSBHID_H"])
+                    USB_LIBS="$USB_LIBS -lusbhid"
+                else
+                    AC_CHECK_HEADER(usb.h, [USB_CFLAGS="-DHAVE_USB_H"])
+                    AC_CHECK_HEADER(libusb.h, [USB_CFLAGS="-DHAVE_LIBUSB_H"])
+                    AC_CHECK_LIB(usb, hid_init, [USB_LIBS="$USB_LIBS -lusb"])
+                fi
+                    
+                save_CFLAGS="$CFLAGS"
+                CFLAGS="$CFLAGS $USB_CFLAGS"
+
+                AC_MSG_CHECKING(for usbhid)
+                have_usbhid=no
+                AC_TRY_COMPILE([
+                  #include <sys/types.h>
+                  #if defined(HAVE_USB_H)
+                  #include <usb.h>
+                  #endif
+                  #ifdef __DragonFly__
+                  # include <bus/usb/usb.h>
+                  # include <bus/usb/usbhid.h>
+                  #else
+                  # include <dev/usb/usb.h>
+                  # include <dev/usb/usbhid.h>
+                  #endif
+                  #if defined(HAVE_USBHID_H)
+                  #include <usbhid.h>
+                  #elif defined(HAVE_LIBUSB_H)
+                  #include <libusb.h>
+                  #elif defined(HAVE_LIBUSBHID_H)
+                  #include <libusbhid.h>
+                  #endif
+                ],[
+                  struct report_desc *repdesc;
+                  struct usb_ctl_report *repbuf;
+                  hid_kind_t hidkind;
+                ],[
+                have_usbhid=yes
+                ])
+                AC_MSG_RESULT($have_usbhid)
+
+                if test x$have_usbhid = xyes; then
+                    AC_MSG_CHECKING(for ucr_data member of usb_ctl_report)
+                    have_usbhid_ucr_data=no
+                    AC_TRY_COMPILE([
+                      #include <sys/types.h>
+                      #if defined(HAVE_USB_H)
+                      #include <usb.h>
+                      #endif
+                      #ifdef __DragonFly__
+                      # include <bus/usb/usb.h>
+                      # include <bus/usb/usbhid.h>
+                      #else
+                      # include <dev/usb/usb.h>
+                      # include <dev/usb/usbhid.h>
+                      #endif
+                      #if defined(HAVE_USBHID_H)
+                      #include <usbhid.h>
+                      #elif defined(HAVE_LIBUSB_H)
+                      #include <libusb.h>
+                      #elif defined(HAVE_LIBUSBHID_H)
+                      #include <libusbhid.h>
+                      #endif
+                    ],[
+                      struct usb_ctl_report buf;
+                      if (buf.ucr_data) { }
+                    ],[
+                    have_usbhid_ucr_data=yes
+                    ])
+                    if test x$have_usbhid_ucr_data = xyes; then
+                        USB_CFLAGS="$USB_CFLAGS -DUSBHID_UCR_DATA"
+                    fi
+                    AC_MSG_RESULT($have_usbhid_ucr_data)
+                    
+                    AC_MSG_CHECKING(for new usbhid API)
+                    have_usbhid_new=no
+                    AC_TRY_COMPILE([
+                      #include <sys/types.h>
+                      #if defined(HAVE_USB_H)
+                      #include <usb.h>
+                      #endif
+                      #ifdef __DragonFly__
+                      #include <bus/usb/usb.h>
+                      #include <bus/usb/usbhid.h>
+                      #else
+                      #include <dev/usb/usb.h>
+                      #include <dev/usb/usbhid.h>
+                      #endif
+                      #if defined(HAVE_USBHID_H)
+                      #include <usbhid.h>
+                      #elif defined(HAVE_LIBUSB_H)
+                      #include <libusb.h>
+                      #elif defined(HAVE_LIBUSBHID_H)
+                      #include <libusbhid.h>
+                      #endif
+                    ],[
+                      report_desc_t d;
+                      hid_start_parse(d, 1, 1);
+                    ],[
+                    have_usbhid_new=yes
+                    ])
+                    if test x$have_usbhid_new = xyes; then
+                        USB_CFLAGS="$USB_CFLAGS -DUSBHID_NEW"
+                    fi
+                    AC_MSG_RESULT($have_usbhid_new)
+
+                    AC_MSG_CHECKING(for struct joystick in machine/joystick.h)
+                    have_machine_joystick=no
+                    AC_TRY_COMPILE([
+                      #include <machine/joystick.h>
+                    ],[
+                      struct joystick t;
+                    ],[
+                    have_machine_joystick=yes
+                    ])
+                    if test x$have_machine_joystick = xyes; then
+                        AC_DEFINE(SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H, 1, [ ])
+                    fi
+                    AC_MSG_RESULT($have_machine_joystick)
+
+                    AC_DEFINE(SDL_JOYSTICK_USBHID, 1, [ ])
+                    SOURCES="$SOURCES $srcdir/src/joystick/bsd/*.c"
+                    EXTRA_CFLAGS="$EXTRA_CFLAGS $USB_CFLAGS"
+                    EXTRA_LDFLAGS="$EXTRA_LDFLAGS $USB_LIBS"
+                    have_joystick=yes
+                fi
+                CFLAGS="$save_CFLAGS"
+            fi
+        ;;
+    esac
+}
+
+dnl Check for HIDAPI joystick drivers
+CheckHIDAPI()
+{
+    # The hidraw support doesn't catch Xbox, PS4 and Nintendo controllers,
+    # so we'll just use libusb when it's available.
+    #
+    # Except that libusb requires root permissions to open devices, so that's not generally useful, and we'll disable this by default.
+    #
+    #  On macOS and Windows, where you don't need libusb or root, we default to yes.
+    skiplibusb=no
+    case "$host" in
+        *-*-cygwin* | *-*-mingw32* | *-*-darwin* )
+            skiplibusb=yes
+            ;;
+    esac
+
+    AC_ARG_ENABLE(hidapi,
+AS_HELP_STRING([--enable-hidapi], [use HIDAPI for low level joystick drivers [[default=maybe]]]),
+                  , enable_hidapi=maybe)
+    hidapi_support=no
+
+    if test x$enable_hidapi = xmaybe; then
+      enable_hidapi=$skiplibusb
+    fi
+
+    if test x$enable_joystick = xyes -a x$enable_hidapi = xyes; then
+        if test x$skiplibusb = xyes; then
+            hidapi_support=yes
+        else
+            PKG_CHECK_MODULES([LIBUSB], [libusb-1.0], have_libusb=yes, have_libusb=no)
+            save_CFLAGS="$CFLAGS"
+            CFLAGS="$save_CFLAGS $LIBUSB_CFLAGS"
+            AC_CHECK_HEADER(libusb.h, have_libusb_h=yes)
+            CFLAGS="$save_CFLAGS"
+            if test x$have_libusb_h = xyes; then
+                hidapi_support=yes
+            fi
+        fi
+
+        if test x$hidapi_support = xyes; then
+            AC_DEFINE(SDL_JOYSTICK_HIDAPI, 1, [ ])
+            EXTRA_CFLAGS="$EXTRA_CFLAGS -I$srcdir/src/hidapi/hidapi"
+            SOURCES="$SOURCES $srcdir/src/joystick/hidapi/*.c"
+
+            if test x$skiplibusb = xno; then
+                SOURCES="$SOURCES $srcdir/src/hidapi/libusb/hid.c"
+                EXTRA_CFLAGS="$EXTRA_CFLAGS $LIBUSB_CFLAGS"
+                EXTRA_LDFLAGS="$EXTRA_LDFLAGS $LIBUSB_LIBS"
+            fi
+        fi
+
+        AC_MSG_CHECKING(for hidapi support)
+        AC_MSG_RESULT($hidapi_support)
+    fi
+}
+
+dnl Check for clock_gettime()
+CheckClockGettime()
+{
+    AC_ARG_ENABLE(clock_gettime,
+AS_HELP_STRING([--enable-clock_gettime], [use clock_gettime() instead of gettimeofday() on UNIX [[default=yes]]]),
+                  , enable_clock_gettime=yes)
+    if test x$enable_clock_gettime = xyes; then
+        AC_CHECK_LIB(rt, clock_gettime, have_clock_gettime=yes)
+        if test x$have_clock_gettime = xyes; then
+            AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [ ])
+            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lrt"
+        else
+            AC_CHECK_LIB(c, clock_gettime, have_clock_gettime=yes)
+            if test x$have_clock_gettime = xyes; then
+               AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [ ])
+               EXTRA_LDFLAGS="$EXTRA_LDFLAGS"
+            fi
+        fi
+    fi
+}
+
+dnl Check for a valid linux/version.h
+CheckLinuxVersion()
+{
+    AC_CHECK_HEADER(linux/version.h, have_linux_version_h=yes)
+    if test x$have_linux_version_h = xyes; then
+        EXTRA_CFLAGS="$EXTRA_CFLAGS -DHAVE_LINUX_VERSION_H"
+    fi
+}
+
+dnl Check if we want to use RPATH
+CheckRPATH()
+{
+    AC_ARG_ENABLE(rpath,
+AS_HELP_STRING([--enable-rpath], [use an rpath when linking SDL [[default=yes]]]),
+                  , enable_rpath=yes)
+}
+
+dnl Check if we want to use custom signals to fake iOS/Android's backgrounding
+dnl  events. These could be useful if you're building a custom embedded
+dnl  environment, etc, but most people don't need this.
+CheckEventSignals()
+{
+    AC_ARG_ENABLE(backgrounding-signal,
+AS_HELP_STRING([--enable-backgrounding-signal], [number to use for magic backgrounding signal or 'no' [[default=no]]]),
+                  , enable_backgrounding_signal=no)
+    if test x$enable_backgrounding_signal != xno; then
+        EXTRA_CFLAGS="$EXTRA_CFLAGS -DSDL_BACKGROUNDING_SIGNAL=$enable_backgrounding_signal"
+    fi
+
+    AC_ARG_ENABLE(foregrounding-signal,
+AS_HELP_STRING([--enable-foregrounding-signal], [number to use for magic foregrounding signal or 'no' [[default=no]]]),
+                  , enable_foregrounding_signal=no)
+    if test x$enable_foregrounding_signal != xno; then
+        EXTRA_CFLAGS="$EXTRA_CFLAGS -DSDL_FOREGROUNDING_SIGNAL=$enable_foregrounding_signal"
+    fi
+}
+
+
+
+dnl Do this on all platforms, before everything else (other things might want to override it).
+CheckWarnAll
+CheckNoStrictAliasing
+
+dnl Do this for every platform, but for some it doesn't mean anything, but better to catch it here anyhow.
+CheckEventSignals
+
+dnl Set up the configuration based on the host platform!
+case "$host" in
+    *-*-linux*|*-*-uclinux*|*-*-gnu*|*-*-k*bsd*-gnu|*-*-bsdi*|*-*-freebsd*|*-*-dragonfly*|*-*-netbsd*|*-*-openbsd*|*-*-sysv5*|*-*-solaris*|*-*-hpux*|*-*-aix*|*-*-minix*|*-*-nto*)
+        case "$host" in
+            *-*-android*)
+                # Android
+                ARCH=android
+                ANDROID_CFLAGS="-DGL_GLEXT_PROTOTYPES"
+                CFLAGS="$CFLAGS $ANDROID_CFLAGS"
+                SDL_CFLAGS="$SDL_CFLAGS $ANDROID_CFLAGS"
+                EXTRA_CFLAGS="$EXTRA_CFLAGS $ANDROID_CFLAGS"
+                EXTRA_LDFLAGS="$EXTRA_LDFLAGS -ldl -lGLESv1_CM -lGLESv2 -llog -landroid"
+                SDLMAIN_SOURCES="$srcdir/src/main/android/*.c"
+
+                if test x$enable_video = xyes; then
+                    SOURCES="$SOURCES $srcdir/src/core/android/*.c $srcdir/src/video/android/*.c"
+                    # FIXME: confdefs? Not AC_DEFINE?
+                    $as_echo "#define SDL_VIDEO_DRIVER_ANDROID 1" >>confdefs.h
+                    SUMMARY_video="${SUMMARY_video} android"
+                fi
+                ;;
+            *-*-linux*)         ARCH=linux ;;
+            *-*-uclinux*)       ARCH=linux ;;
+            *-*-kfreebsd*-gnu)  ARCH=kfreebsd-gnu ;;
+            *-*-knetbsd*-gnu)   ARCH=knetbsd-gnu ;;
+            *-*-kopenbsd*-gnu)  ARCH=kopenbsd-gnu ;;
+            *-*-gnu*)           ARCH=gnu ;; # must be last of the gnu variants
+            *-*-bsdi*)          ARCH=bsdi ;;
+            *-*-freebsd*)       ARCH=freebsd ;;
+            *-*-dragonfly*)     ARCH=freebsd ;;
+            *-*-netbsd*)        ARCH=netbsd ;;
+            *-*-openbsd*)       ARCH=openbsd ;;
+            *-*-sysv5*)         ARCH=sysv5 ;;
+            *-*-solaris*)       ARCH=solaris ;;
+            *-*-hpux*)          ARCH=hpux ;;
+            *-*-aix*)           ARCH=aix ;;
+            *-*-minix*)         ARCH=minix ;;
+            *-*-nto*)           ARCH=nto
+                CheckQNXVideo
+                ;;
+        esac
+        CheckVisibilityHidden
+        CheckDeclarationAfterStatement
+        CheckDummyVideo
+        CheckDiskAudio
+        CheckDummyAudio
+        CheckDLOPEN
+        CheckOSS
+        CheckALSA
+        CheckPulseAudio
+        CheckJACK
+        CheckARTSC
+        CheckESD
+        CheckNAS
+        CheckSNDIO
+        CheckFusionSound
+        CheckLibSampleRate
+        # Need to check for Raspberry PI first and add platform specific compiler flags, otherwise the test for GLES fails!
+        CheckRPI
+        CheckX11
+        CheckDirectFB
+        CheckKMSDRM
+        CheckOpenGLX11
+        CheckOpenGLESX11
+        CheckVulkan
+        CheckWayland
+        CheckInputEvents
+        CheckLibUDev
+        CheckDBus
+        CheckIME
+        CheckIBus
+        CheckFcitx
+        case $ARCH in
+          linux)
+              CheckInputKD
+          ;;
+        esac
+        CheckTslib
+        CheckUSBHID
+        CheckHIDAPI
+        CheckPTHREAD
+        CheckClockGettime
+        CheckLinuxVersion
+        CheckRPATH
+        CheckVivanteVideo
+
+        # Set up files for the audio library
+        if test x$enable_audio = xyes; then
+          case $ARCH in
+            sysv5|solaris|hpux)
+                AC_DEFINE(SDL_AUDIO_DRIVER_SUNAUDIO, 1, [ ])
+                SOURCES="$SOURCES $srcdir/src/audio/sun/*.c"
+                SUMMARY_audio="${SUMMARY_audio} sun"
+                have_audio=yes
+            ;;
+            netbsd)  # Don't use this on OpenBSD, it's busted.
+                AC_DEFINE(SDL_AUDIO_DRIVER_NETBSD, 1, [ ])
+                SOURCES="$SOURCES $srcdir/src/audio/netbsd/*.c"
+                SUMMARY_audio="${SUMMARY_audio} netbsd"
+                have_audio=yes
+            ;;
+            aix)
+                AC_DEFINE(SDL_AUDIO_DRIVER_PAUDIO, 1, [ ])
+                SOURCES="$SOURCES $srcdir/src/audio/paudio/*.c"
+                SUMMARY_audio="${SUMMARY_audio} paudio"
+                have_audio=yes
+            ;;
+            android)
+                AC_DEFINE(SDL_AUDIO_DRIVER_ANDROID, 1, [ ])
+                SOURCES="$SOURCES $srcdir/src/audio/android/*.c"
+                SUMMARY_audio="${SUMMARY_audio} android"
+                have_audio=yes
+            ;;
+            nto)
+                CheckQNXAudio
+            ;;
+          esac
+        fi
+        # Set up files for the joystick library
+        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
+            ;;
+            android)
+                AC_DEFINE(SDL_JOYSTICK_ANDROID, 1, [ ])
+                SOURCES="$SOURCES $srcdir/src/joystick/android/*.c"
+                SOURCES="$SOURCES $srcdir/src/joystick/steam/*.c"
+                have_joystick=yes
+            ;;
+          esac
+        fi
+        # Set up files for the haptic library
+        if test x$enable_haptic = xyes; then
+          case $ARCH in
+            linux)
+                if test x$use_input_events = xyes; then
+                    AC_DEFINE(SDL_HAPTIC_LINUX, 1, [ ])
+                    SOURCES="$SOURCES $srcdir/src/haptic/linux/*.c"
+                    have_haptic=yes
+                fi
+            ;;
+            android)
+                AC_DEFINE(SDL_HAPTIC_ANDROID, 1, [ ])
+                SOURCES="$SOURCES $srcdir/src/haptic/android/*.c"
+                have_haptic=yes
+            ;;
+          esac
+        fi
+        # Set up files for the sensor library
+        if test x$enable_sensor = xyes; then
+          case $ARCH in
+            android)
+                AC_DEFINE(SDL_SENSOR_ANDROID, 1, [ ])
+                SOURCES="$SOURCES $srcdir/src/sensor/android/*.c"
+                have_sensor=yes
+            ;;
+          esac
+        fi
+        # Set up files for the power library
+        if test x$enable_power = xyes; then
+             case $ARCH in
+               linux)
+                   AC_DEFINE(SDL_POWER_LINUX, 1, [ ])
+                   SOURCES="$SOURCES $srcdir/src/power/linux/*.c"
+                   have_power=yes
+               ;;
+               android)
+                   AC_DEFINE(SDL_POWER_ANDROID, 1, [ ])
+                   SOURCES="$SOURCES $srcdir/src/power/android/*.c"
+                   have_power=yes
+               ;;
+             esac
+        fi
+        # Set up files for the filesystem library
+        if test x$enable_filesystem = xyes; then
+             case $ARCH in
+               android)
+                   AC_DEFINE(SDL_FILESYSTEM_ANDROID, 1, [ ])
+                   SOURCES="$SOURCES $srcdir/src/filesystem/android/*.c"
+                   have_filesystem=yes
+               ;;
+               *)
+                   AC_DEFINE(SDL_FILESYSTEM_UNIX, 1, [ ])
+                   SOURCES="$SOURCES $srcdir/src/filesystem/unix/*.c"
+                   have_filesystem=yes
+               ;;
+             esac
+        fi
+        # Set up files for the timer library
+        if test x$enable_timers = xyes; then
+            AC_DEFINE(SDL_TIMER_UNIX, 1, [ ])
+            SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
+            have_timers=yes
+        fi
+        # Set up files for udev hotplugging support
+        if test x$enable_libudev = xyes && test x$have_libudev_h_hdr = xyes; then
+            SOURCES="$SOURCES $srcdir/src/core/linux/SDL_udev.c"               
+        fi
+        # Set up files for evdev input
+        if test x$use_input_events = xyes; then
+            SOURCES="$SOURCES $srcdir/src/core/linux/SDL_evdev*.c"
+        fi       
+        # Set up other core UNIX files
+        SOURCES="$SOURCES $srcdir/src/core/linux/SDL_threadprio.c"
+        SOURCES="$SOURCES $srcdir/src/core/unix/*.c"
+        ;;
+    *-*-cygwin* | *-*-mingw32*)
+        ARCH=win32
+        if test "$build" != "$host"; then # cross-compiling
+            # Default cross-compile location
+            ac_default_prefix=/usr/local/cross-tools/$host
+        else
+            # Look for the location of the tools and install there
+            if test "$BUILD_PREFIX" != ""; then
+                ac_default_prefix=$BUILD_PREFIX
+            fi
+        fi
+        CheckDeclarationAfterStatement
+        CheckDummyVideo
+        CheckDiskAudio
+        CheckDummyAudio
+        CheckWINDOWS
+        CheckWINDOWSGL
+        CheckWINDOWSGLES
+        CheckVulkan
+        CheckDIRECTX
+        CheckHIDAPI
+
+        # Set up the core platform files
+        SOURCES="$SOURCES $srcdir/src/core/windows/*.c"
+
+        # Set up files for the video library
+        if test x$enable_video = xyes; then
+            AC_DEFINE(SDL_VIDEO_DRIVER_WINDOWS, 1, [ ])
+            SOURCES="$SOURCES $srcdir/src/video/windows/*.c"
+            have_video=yes
+            AC_ARG_ENABLE(render-d3d,
+AS_HELP_STRING([--enable-render-d3d], [enable the Direct3D render driver [[default=yes]]]),
+                                , enable_render_d3d=yes)
+            if test x$enable_render_d3d = xyes -a x$have_d3d = xyes; then
+                AC_DEFINE(SDL_VIDEO_RENDER_D3D, 1, [ ])
+                SUMMARY_video="${SUMMARY_video} d3d9"
+            fi
+            if test x$enable_render_d3d = xyes -a x$have_d3d11 = xyes; then
+                AC_DEFINE(SDL_VIDEO_RENDER_D3D11, 1, [ ])
+                SUMMARY_video="${SUMMARY_video} d3d11"
+            fi
+        fi
+        # Set up files for the audio library
+        if test x$enable_audio = xyes; then
+            AC_DEFINE(SDL_AUDIO_DRIVER_WINMM, 1, [ ])
+            SUMMARY_audio="${SUMMARY_audio} winmm"
+            SOURCES="$SOURCES $srcdir/src/audio/winmm/*.c"
+            if test x$have_dsound = xyes; then
+                AC_DEFINE(SDL_AUDIO_DRIVER_DSOUND, 1, [ ])
+                SUMMARY_audio="${SUMMARY_audio} directsound"
+                SOURCES="$SOURCES $srcdir/src/audio/directsound/*.c"
+            fi
+            if test x$have_wasapi = xyes -a x$enable_wasapi = xyes; then
+                AC_DEFINE(SDL_AUDIO_DRIVER_WASAPI, 1, [ ])
+                SUMMARY_audio="${SUMMARY_audio} wasapi"
+                SOURCES="$SOURCES $srcdir/src/audio/wasapi/*.c"
+            fi
+            have_audio=yes
+        fi
+        # Set up files for the joystick library
+        if test x$enable_joystick = xyes; then
+            if test x$have_dinput = xyes -o x$have_xinput = xyes; then
+                if test x$have_xinput = xyes; then
+                    AC_DEFINE(SDL_JOYSTICK_XINPUT, 1, [ ])
+                fi
+                if test x$have_dinput = xyes; then
+                    AC_DEFINE(SDL_JOYSTICK_DINPUT, 1, [ ])
+                    EXTRA_LDFLAGS="$EXTRA_LDFLAGS -ldinput8 -ldxguid -ldxerr8"
+                fi
+            else
+                AC_DEFINE(SDL_JOYSTICK_WINMM, 1, [ ])
+            fi
+            SOURCES="$SOURCES $srcdir/src/joystick/windows/*.c"
+            have_joystick=yes
+            if test x$hidapi_support = xyes; then
+                SOURCES="$SOURCES $srcdir/src/hidapi/windows/hid.c"
+            fi
+        fi
+        if test x$enable_haptic = xyes; then
+            if test x$have_dinput = xyes -o x$have_xinput = xyes; then
+                if test x$have_xinput = xyes; then
+                    AC_DEFINE(SDL_HAPTIC_XINPUT, 1, [ ])
+                fi
+                if test x$have_dinput = xyes; then
+                    AC_DEFINE(SDL_HAPTIC_DINPUT, 1, [ ])
+                fi
+                SOURCES="$SOURCES $srcdir/src/haptic/windows/*.c"
+                have_haptic=yes
+            fi
+        fi
+        if test x$enable_power = xyes; then
+            AC_DEFINE(SDL_POWER_WINDOWS, 1, [ ])
+            SOURCES="$SOURCES $srcdir/src/power/windows/SDL_syspower.c"
+            have_power=yes
+        fi
+        if test x$enable_filesystem = xyes; then
+            AC_DEFINE(SDL_FILESYSTEM_WINDOWS, 1, [ ])
+            SOURCES="$SOURCES $srcdir/src/filesystem/windows/SDL_sysfilesystem.c"
+            have_filesystem=yes
+        fi
+        # Set up files for the thread library
+        if test x$enable_threads = xyes; then
+            AC_DEFINE(SDL_THREAD_WINDOWS, 1, [ ])
+            SOURCES="$SOURCES $srcdir/src/thread/windows/*.c"
+            SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syscond.c"
+            have_threads=yes
+        fi
+        # Set up files for the timer library
+        if test x$enable_timers = xyes; then
+            AC_DEFINE(SDL_TIMER_WINDOWS, 1, [ ])
+            SOURCES="$SOURCES $srcdir/src/timer/windows/*.c"
+            have_timers=yes
+        fi
+        # Set up files for the shared object loading library
+        if test x$enable_loadso = xyes; then
+            AC_DEFINE(SDL_LOADSO_WINDOWS, 1, [ ])
+            SOURCES="$SOURCES $srcdir/src/loadso/windows/*.c"
+            have_loadso=yes
+        fi
+        # Set up the system libraries we need
+        if test -f /lib/w32api/libuuid.a; then
+            LIBUUID=/lib/w32api/libuuid.a
+        else
+            LIBUUID=-luuid
+        fi
+        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -luser32 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lshell32 -lsetupapi -lversion $LIBUUID -static-libgcc"
+        # The Windows platform requires special setup
+        VERSION_SOURCES="$srcdir/src/main/windows/*.rc"
+        SDLMAIN_SOURCES="$srcdir/src/main/windows/*.c"
+        SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main"
+        SDL_LIBS="-lSDL2main $SDL_LIBS -mwindows"
+
+        # Check to see if this is a mingw or cygwin build
+        have_mingw32=
+        AC_CHECK_LIB(mingw32, main, [have_mingw32=yes])
+        if test x$have_mingw32 = xyes; then
+            SDL_LIBS="-lmingw32 $SDL_LIBS"
+        else
+            SDL_LIBS="-lcygwin $SDL_LIBS"
+        fi
+        ;;
+
+    dnl BeOS support removed after SDL 2.0.1. Haiku still works.  --ryan.
+    *-*-beos*)
+        AC_MSG_ERROR([
+*** BeOS support has been removed as of SDL 2.0.2.
+        ])
+        ;;
+
+    *-*-haiku*)
+        ARCH=haiku
+        ac_default_prefix=/boot/system
+        CheckDummyVideo
+        CheckDiskAudio
+        CheckDummyAudio
+        CheckDLOPEN
+        CheckHaikuVideo
+        CheckHaikuGL
+        CheckPTHREAD
+
+        # Set up files for the audio library
+        if test x$enable_audio = xyes; then
+            AC_DEFINE(SDL_AUDIO_DRIVER_HAIKU, 1, [ ])
+            SOURCES="$SOURCES $srcdir/src/audio/haiku/*.cc"
+            SUMMARY_audio="${SUMMARY_audio} haiku"
+            have_audio=yes
+        fi
+        # Set up files for the joystick library
+        if test x$enable_joystick = xyes; then
+            AC_DEFINE(SDL_JOYSTICK_HAIKU, 1, [ ])
+            SOURCES="$SOURCES $srcdir/src/joystick/haiku/*.cc"
+            have_joystick=yes
+        fi
+        # Set up files for the timer library
+        if test x$enable_timers = xyes; then
+            AC_DEFINE(SDL_TIMER_HAIKU, 1, [ ])
+            SOURCES="$SOURCES $srcdir/src/timer/haiku/*.c"
+            have_timers=yes
+        fi
+        # Set up files for the system power library
+        if test x$enable_power = xyes; then
+            AC_DEFINE(SDL_POWER_HAIKU, 1, [ ])
+            SOURCES="$SOURCES $srcdir/src/power/haiku/*.c"
+            have_power=yes
+        fi
+        # Set up files for the system filesystem library
+        if test x$enable_filesystem = xyes; then
+            AC_DEFINE(SDL_FILESYSTEM_HAIKU, 1, [ ])
+            SOURCES="$SOURCES $srcdir/src/filesystem/haiku/*.cc"
+            have_filesystem=yes
+        fi
+        # The Haiku platform requires special setup.
+        SOURCES="$srcdir/src/main/haiku/*.cc $SOURCES"
+        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lroot -lbe -lmedia -lgame -ldevice -ltextencoding"
+        # Haiku's x86 spins use libstdc++.r4.so (for binary compat?), but
+        #  other spins, like x86-64, use a more standard "libstdc++.so.*"
+        AC_CHECK_FILE("/boot/system/lib/libstdc++.r4.so", EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lstdc++.r4", EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lstdc++")
+        ;;
+    arm*-apple-darwin*|*-ios-*)
+        ARCH=ios
+
+        CheckVisibilityHidden
+        CheckDeclarationAfterStatement
+        CheckDummyVideo
+        CheckDiskAudio
+        CheckDummyAudio
+        CheckDLOPEN
+        CheckMETAL
+        CheckVulkan
+        CheckPTHREAD
+
+        # Set up files for the audio library
+        if test x$enable_audio = xyes; then
+            AC_DEFINE(SDL_AUDIO_DRIVER_COREAUDIO, 1, [ ])
+            SOURCES="$SOURCES $srcdir/src/audio/coreaudio/*.m"
+            SUMMARY_audio="${SUMMARY_audio} coreaudio"
+            have_audio=yes
+        fi
+        # Set up files for the joystick library
+        if test x$enable_joystick = xyes; then
+            AC_DEFINE(SDL_JOYSTICK_MFI, 1, [ ])
+            SOURCES="$SOURCES $srcdir/src/joystick/iphoneos/*.m"
+            SOURCES="$SOURCES $srcdir/src/joystick/steam/*.c"
+            have_joystick=yes
+        fi
+        # Set up files for the haptic library
+        #if test x$enable_haptic = xyes; then
+        #    SOURCES="$SOURCES $srcdir/src/haptic/darwin/*.c"
+        #    have_haptic=yes
+        #    EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,ForceFeedback"
+        #fi
+        # Set up files for the power library
+        if test x$enable_power = xyes; then
+            AC_DEFINE(SDL_POWER_UIKIT, 1, [ ])
+            SOURCES="$SOURCES $srcdir/src/power/uikit/*.m"
+            have_power=yes
+        fi
+        # Set up files for the filesystem library
+        if test x$enable_filesystem = xyes; then
+            SOURCES="$SOURCES $srcdir/src/filesystem/cocoa/*.m"
+            have_filesystem=yes
+        fi
+        # Set up additional files for the file library
+        if test x$enable_file = xyes; then
+            AC_DEFINE(SDL_FILESYSTEM_COCOA, 1, [ ])
+            SOURCES="$SOURCES $srcdir/src/file/cocoa/*.m"
+        fi
+        # Set up files for the timer library
+        if test x$enable_timers = xyes; then
+            AC_DEFINE(SDL_TIMER_UNIX, 1, [ ])
+            SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
+            have_timers=yes
+        fi
+        # Set up other core UNIX files
+        SOURCES="$SOURCES $srcdir/src/core/unix/*.c"
+        # The iOS platform requires special setup.
+        AC_DEFINE(SDL_VIDEO_DRIVER_UIKIT, 1, [ ])
+        AC_DEFINE(SDL_VIDEO_OPENGL_ES2, 1, [ ])
+        AC_DEFINE(SDL_VIDEO_OPENGL_ES, 1, [ ])
+        AC_DEFINE(SDL_VIDEO_RENDER_OGL_ES, 1, [ ])
+        AC_DEFINE(SDL_VIDEO_RENDER_OGL_ES2, 1, [ ])
+        SOURCES="$SOURCES $srcdir/src/video/uikit/*.m"
+        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lm -liconv -lobjc"
+        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,AVFoundation"
+        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,AudioToolbox"
+        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,CoreAudio"
+        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,CoreGraphics"
+        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,CoreMotion"
+        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Foundation"
+        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,GameController"
+        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,OpenGLES"
+        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,QuartzCore"
+        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,UIKit"
+
+        if test x$enable_render = xyes -a x$enable_render_metal = xyes; then
+            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Metal"
+        fi
+        ;;
+    *-*-darwin* )
+        # This could be either full "Mac OS X", or plain "Darwin" which is
+        # just the OS X kernel sans upper layers like Carbon and Cocoa.
+        # Next line is broken, and a few files below require Mac OS X (full)
+        ARCH=macosx
+
+        # Mac OS X builds with both the Carbon and OSX APIs at the moment
+        EXTRA_CFLAGS="$EXTRA_CFLAGS -DTARGET_API_MAC_CARBON"
+        EXTRA_CFLAGS="$EXTRA_CFLAGS -DTARGET_API_MAC_OSX"
+
+        CheckVisibilityHidden
+        CheckDeclarationAfterStatement
+        CheckDummyVideo
+        CheckDiskAudio
+        CheckDummyAudio
+        CheckDLOPEN
+        CheckCOCOA
+        CheckMETAL
+        CheckX11
+        CheckMacGL
+        CheckMacGLES
+        CheckOpenGLX11
+        CheckVulkan
+        CheckPTHREAD
+        CheckHIDAPI
+
+        # Set up files for the audio library
+        if test x$enable_audio = xyes; then
+            AC_DEFINE(SDL_AUDIO_DRIVER_COREAUDIO, 1, [ ])
+            SOURCES="$SOURCES $srcdir/src/audio/coreaudio/*.m"
+            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,CoreAudio -Wl,-framework,AudioToolbox"
+            SUMMARY_audio="${SUMMARY_audio} coreaudio"
+            have_audio=yes
+        fi
+        # Set up files for the joystick library
+        if test x$enable_joystick = xyes; then
+            AC_DEFINE(SDL_JOYSTICK_IOKIT, 1, [ ])
+            SOURCES="$SOURCES $srcdir/src/joystick/darwin/*.c"
+            have_joystick=yes
+            if test x$hidapi_support = xyes; then
+                SOURCES="$SOURCES $srcdir/src/hidapi/mac/hid.c"
+            fi
+        fi
+        # Set up files for the haptic library
+        if test x$enable_haptic = xyes; then
+            AC_DEFINE(SDL_HAPTIC_IOKIT, 1, [ ])
+            SOURCES="$SOURCES $srcdir/src/haptic/darwin/*.c"
+            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,ForceFeedback"
+            have_haptic=yes
+        fi
+        # Set up files for the power library
+        if test x$enable_power = xyes; then
+            AC_DEFINE(SDL_POWER_MACOSX, 1, [ ])
+            SOURCES="$SOURCES $srcdir/src/power/macosx/*.c"
+            have_power=yes
+        fi
+        # Set up files for the filesystem library
+        if test x$enable_filesystem = xyes; then
+            AC_DEFINE(SDL_FILESYSTEM_COCOA, 1, [ ])
+            SOURCES="$SOURCES $srcdir/src/filesystem/cocoa/*.m"
+            have_filesystem=yes
+        fi
+        # Set up files for the timer library
+        if test x$enable_timers = xyes; then
+            AC_DEFINE(SDL_TIMER_UNIX, 1, [ ])
+            SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
+            have_timers=yes
+        fi
+        # Set up additional files for the file library
+        if test x$enable_file = xyes; then
+            SOURCES="$SOURCES $srcdir/src/file/cocoa/*.m"
+        fi
+        # Set up other core UNIX files
+        SOURCES="$SOURCES $srcdir/src/core/unix/*.c"
+        # The Mac OS X platform requires special setup.
+        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lobjc"
+        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,CoreVideo"
+        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Cocoa"
+        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Carbon"
+        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,IOKit"
+
+        if test x$enable_render = xyes -a x$enable_render_metal = xyes; then
+            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-weak_framework,QuartzCore -Wl,-weak_framework,Metal"
+        fi
+        ;;
+    *-nacl|*-pnacl)
+        ARCH=nacl
+        CheckNativeClient
+        CheckDummyAudio
+        CheckDummyVideo
+        CheckInputEvents
+        CheckPTHREAD
+
+        # Set up files for the timer library
+        if test x$enable_timers = xyes; then
+            AC_DEFINE(SDL_TIMER_UNIX, 1, [ ])
+            SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
+            have_timers=yes
+        fi
+        
+        if test x$enable_filesystem = xyes; then
+            AC_DEFINE(SDL_FILESYSTEM_NACL, 1, [ ])
+            SOURCES="$SOURCES $srcdir/src/filesystem/nacl/*.c"
+            have_filesystem=yes
+        fi
+        ;;
+    *-*-emscripten* )
+        if test x$enable_video = xyes; then
+            AC_DEFINE(SDL_VIDEO_DRIVER_EMSCRIPTEN, 1, [ ])
+            SOURCES="$SOURCES $srcdir/src/video/emscripten/*.c"
+            have_video=yes
+            SUMMARY_video="${SUMMARY_video} emscripten"
+        fi
+
+        if test x$enable_audio = xyes; then
+            AC_DEFINE(SDL_AUDIO_DRIVER_EMSCRIPTEN, 1, [ ])
+            SOURCES="$SOURCES $srcdir/src/audio/emscripten/*.c"
+            have_audio=yes
+            SUMMARY_audio="${SUMMARY_audio} emscripten"
+        fi
+
+        CheckVisibilityHidden
+        CheckDeclarationAfterStatement
+        CheckDummyVideo
+        CheckDiskAudio
+        CheckDummyAudio
+        CheckDLOPEN
+        CheckClockGettime
+        CheckEmscriptenGLES
+
+         # Set up files for the power library
+        if test x$enable_power = xyes; then
+            AC_DEFINE(SDL_POWER_EMSCRIPTEN, 1, [ ])
+            SOURCES="$SOURCES $srcdir/src/power/emscripten/*.c"
+            have_power=yes
+        fi
+        
+        # Set up files for the power library
+        if test x$enable_joystick = xyes; then
+            AC_DEFINE(SDL_JOYSTICK_EMSCRIPTEN, 1, [ ])
+            SOURCES="$SOURCES $srcdir/src/joystick/emscripten/*.c"
+            have_joystick=yes
+        fi
+
+        # Set up files for the filesystem library
+        if test x$enable_filesystem = xyes; then
+            AC_DEFINE(SDL_FILESYSTEM_EMSCRIPTEN, 1, [ ])
+            SOURCES="$SOURCES $srcdir/src/filesystem/emscripten/*.c"
+            have_filesystem=yes
+        fi
+        # Set up files for the timer library
+        if test x$enable_timers = xyes; then
+            AC_DEFINE(SDL_TIMER_UNIX, 1, [ ])
+            SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
+            have_timers=yes
+        fi
+        ;;
+    *)
+        AC_MSG_ERROR([
+*** Unsupported host:  Please add to configure.ac
+        ])
+        ;;
+esac
+
+# Check whether to install sdl2-config
+AC_MSG_CHECKING(whether to install sdl2-config)
+AC_ARG_ENABLE([sdl2-config],
+    AS_HELP_STRING([--enable-sdl2-config], [Install sdl2-config [default=yes]]),
+    [case "${enableval}" in
+        yes) enable_sdl2_config="TRUE" ;;
+        no) enable_sdl2_config="FALSE" ;;
+        *) AC_MSG_ERROR([bad value '${enableval}' for --enable-sdl2-config]) ;;
+    esac], [enable_sdl2_config="TRUE"])
+if test "$enable_sdl2_config" = "TRUE"; then
+    AC_MSG_RESULT(yes)
+else
+    AC_MSG_RESULT(no)
+fi
+AC_SUBST([INSTALL_SDL2_CONFIG], [$enable_sdl2_config])
+
+# Verify that we have all the platform specific files we need
+
+if test x$have_joystick != xyes; then
+    if test x$enable_joystick = xyes; then
+        AC_DEFINE(SDL_JOYSTICK_DUMMY, 1, [ ])
+    fi
+    SOURCES="$SOURCES $srcdir/src/joystick/dummy/*.c"
+fi
+if test x$have_haptic != xyes; then
+    if test x$enable_haptic = xyes; then
+        AC_DEFINE(SDL_HAPTIC_DUMMY, 1, [ ])
+    fi
+    SOURCES="$SOURCES $srcdir/src/haptic/dummy/*.c"
+fi
+if test x$have_sensor != xyes; then
+    if test x$enable_sensor = xyes; then
+        AC_DEFINE(SDL_SENSOR_DUMMY, 1, [ ])
+    fi
+    SOURCES="$SOURCES $srcdir/src/sensor/dummy/*.c"
+fi
+if test x$have_threads != xyes; then
+    if test x$enable_threads = xyes; then
+        AC_DEFINE(SDL_THREADS_DISABLED, 1, [ ])
+    fi
+    SOURCES="$SOURCES $srcdir/src/thread/generic/*.c"
+fi
+if test x$have_timers != xyes; then
+    if test x$enable_timers = xyes; then
+        AC_DEFINE(SDL_TIMERS_DISABLED, 1, [ ])
+    fi
+    SOURCES="$SOURCES $srcdir/src/timer/dummy/*.c"
+fi
+if test x$have_filesystem != xyes; then
+    if test x$enable_filesystem = xyes; then
+        AC_DEFINE(SDL_FILESYSTEM_DISABLED, 1, [ ])
+    fi
+    SOURCES="$SOURCES $srcdir/src/filesystem/dummy/*.c"
+fi
+if test x$have_loadso != xyes; then
+    if test x$enable_loadso = xyes; then
+        AC_DEFINE(SDL_LOADSO_DISABLED, 1, [ ])
+    fi
+    SOURCES="$SOURCES $srcdir/src/loadso/dummy/*.c"
+fi
+if test x$SDLMAIN_SOURCES = x; then
+    SDLMAIN_SOURCES="$srcdir/src/main/dummy/*.c"
+fi
+SDLTEST_SOURCES="$srcdir/src/test/*.c"
+
+if test x$video_wayland = xyes; then
+    WAYLAND_PROTOCOLS=`cd $srcdir/wayland-protocols ; for p in *.xml ; do echo -n "\$p" |sed 's,\\.xml\$, ,g' ; done`
+    WAYLAND_PROTOCOLS_SOURCES=`for p in $WAYLAND_PROTOCOLS ; do echo -n "\\$(gen)/\$p-protocol.c " ; done`
+    WAYLAND_PROTOCOLS_HEADERS=`for p in $WAYLAND_PROTOCOLS ; do echo -n "\\$(gen)/\$p-client-protocol.h " ; done`
+    GEN_SOURCES="$GEN_SOURCES $WAYLAND_PROTOCOLS_SOURCES"
+    GEN_HEADERS="$GEN_HEADERS $WAYLAND_PROTOCOLS_HEADERS"
+
+    WAYLAND_PROTOCOLS_DEPENDS=`for p in $WAYLAND_PROTOCOLS ; do\
+        echo ;\
+        echo "\\$(gen)/\$p-client-protocol.h: \\$(srcdir)/wayland-protocols/\$p.xml" ;\
+        echo "	@\\$(SHELL) \\$(auxdir)/mkinstalldirs \\$(gen)" ;\
+        echo "	\\$(RUN_CMD_GEN)\\$(WAYLAND_SCANNER) client-header \\$< \\$@" ;\
+        echo ;\
+        echo "\\$(gen)/\$p-protocol.c: \\$(srcdir)/wayland-protocols/\$p.xml" ;\
+        echo "	@\\$(SHELL) \\$(auxdir)/mkinstalldirs \\$(gen)" ;\
+        echo "	\\$(RUN_CMD_GEN)\\$(WAYLAND_SCANNER) code \\$< \\$@" ;\
+        echo ;\
+        echo "\\$(objects)/\$p-protocol.lo: \\$(gen)/\$p-protocol.c \\$(gen)/\$p-client-protocol.h" ;\
+        echo "	\\$(RUN_CMD_CC)\\$(LIBTOOL) --tag=CC --mode=compile \\$(CC) \\$(CFLAGS) \\$(EXTRA_CFLAGS) $DEPENDENCY_TRACKING_OPTIONS -c \\$< -o \\$@" ;\
+        done ;\
+        echo ;\
+        for s in $WAYLAND_SOURCES ; do echo -n "\$s:" ; for p in $WAYLAND_PROTOCOLS ; do echo -n " \\$(gen)/\$p-client-protocol.h" ; done ; echo ; done ; echo`
+fi
+
+OBJECTS=`echo $SOURCES`
+DEPENDS=`echo $SOURCES | tr ' ' '\n'`
+for EXT in asm cc m c S; do
+    OBJECTS=`echo "$OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.'$EXT',$(objects)/\1.lo,g'`
+    DEPENDS=`echo "$DEPENDS" | sed "s,^\\([[^ ]]*\\)/\\([[^ ]]*\\)\\.$EXT\\$,\\\\
+\\$(objects)/\\2.lo: \\1/\\2.$EXT \\$(objects)/.created\\\\
+	\\$(RUN_CMD_CC)\\$(LIBTOOL) --tag=CC --mode=compile \\$(CC) \\$(CFLAGS) \\$(EXTRA_CFLAGS) $DEPENDENCY_TRACKING_OPTIONS -c \\$< -o \\$@,g"`
+done
+
+GEN_OBJECTS=`echo "$GEN_SOURCES" | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.lo,g'`
+
+VERSION_OBJECTS=`echo $VERSION_SOURCES`
+VERSION_DEPENDS=`echo $VERSION_SOURCES`
+VERSION_OBJECTS=`echo "$VERSION_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.rc,$(objects)/\1.o,g'`
+VERSION_DEPENDS=`echo "$VERSION_DEPENDS" | sed "s,\\([[^ ]]*\\)/\\([[^ ]]*\\)\\.rc,\\\\
+\\$(objects)/\\2.o: \\1/\\2.rc\\\\
+	\\$(WINDRES) \\$< \\$@,g"`
+
+SDLMAIN_OBJECTS=`echo $SDLMAIN_SOURCES`
+SDLMAIN_DEPENDS=`echo $SDLMAIN_SOURCES`
+SDLMAIN_OBJECTS=`echo "$SDLMAIN_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.lo,g'`
+SDLMAIN_DEPENDS=`echo "$SDLMAIN_DEPENDS" | sed "s,\\([[^ ]]*\\)/\\([[^ ]]*\\)\\.c,\\\\
+\\$(objects)/\\2.lo: \\1/\\2.c \\$(objects)/.created\\\\
+	\\$(RUN_CMD_CC)\\$(LIBTOOL) --tag=CC --mode=compile \\$(CC) \\$(CFLAGS) \\$(EXTRA_CFLAGS) $DEPENDENCY_TRACKING_OPTIONS -c \\$< -o \\$@,g"`
+
+SDLTEST_OBJECTS=`echo $SDLTEST_SOURCES`
+SDLTEST_DEPENDS=`echo $SDLTEST_SOURCES`
+SDLTEST_OBJECTS=`echo "$SDLTEST_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.lo,g'`
+SDLTEST_DEPENDS=`echo "$SDLTEST_DEPENDS" | sed "s,\\([[^ ]]*\\)/\\([[^ ]]*\\)\\.c,\\\\
+\\$(objects)/\\2.lo: \\1/\\2.c \\$(objects)/.created\\\\
+	\\$(RUN_CMD_CC)\\$(LIBTOOL) --tag=CC --mode=compile \\$(CC) \\$(CFLAGS) \\$(EXTRA_CFLAGS) $DEPENDENCY_TRACKING_OPTIONS -c \\$< -o \\$@,g"`
+
+# Set runtime shared library paths as needed
+
+if test "x$enable_rpath" = "xyes"; then
+  if test $ARCH = bsdi -o $ARCH = freebsd -o $ARCH = linux -o $ARCH = netbsd; then
+    SDL_RLD_FLAGS="-Wl,-rpath,\${libdir}"
+
+    AC_MSG_CHECKING(for linker option --enable-new-dtags)
+    have_enable_new_dtags=no
+    save_LDFLAGS="$LDFLAGS"
+    LDFLAGS="$LDFLAGS -Wl,--enable-new-dtags"
+    AC_TRY_LINK([
+    ],[
+    ],[
+    have_enable_new_dtags=yes
+    SDL_RLD_FLAGS="$SDL_RLD_FLAGS -Wl,--enable-new-dtags"
+    ])
+    LDFLAGS="$save_LDFLAGS"
+    AC_MSG_RESULT($have_enable_new_dtags)
+  fi
+  if test $ARCH = solaris; then
+    SDL_RLD_FLAGS="-R\${libdir}"
+  fi
+else
+  SDL_RLD_FLAGS=""
+fi
+
+SDL_STATIC_LIBS="$SDL_LIBS $EXTRA_LDFLAGS"
+
+dnl Expand the cflags and libraries needed by apps using SDL
+AC_SUBST(SDL_CFLAGS)
+AC_SUBST(SDL_LIBS)
+AC_SUBST(SDL_STATIC_LIBS)
+AC_SUBST(SDL_RLD_FLAGS)
+if test x$enable_shared = xyes; then
+    ENABLE_SHARED_TRUE=
+    ENABLE_SHARED_FALSE="#"
+else
+    ENABLE_SHARED_TRUE="#"
+    ENABLE_SHARED_FALSE=
+fi
+if test x$enable_static = xyes; then
+    ENABLE_STATIC_TRUE=
+    ENABLE_STATIC_FALSE="#"
+else
+    ENABLE_STATIC_TRUE="#"
+    ENABLE_STATIC_FALSE=
+fi
+AC_SUBST(ENABLE_SHARED_TRUE)
+AC_SUBST(ENABLE_SHARED_FALSE)
+AC_SUBST(ENABLE_STATIC_TRUE)
+AC_SUBST(ENABLE_STATIC_FALSE)
+
+dnl Expand the sources and objects needed to build the library
+AC_SUBST(ac_aux_dir)
+AC_SUBST(INCLUDE)
+AC_SUBST(OBJECTS)
+AC_SUBST(GEN_HEADERS)
+AC_SUBST(GEN_OBJECTS)
+AC_SUBST(VERSION_OBJECTS)
+AC_SUBST(SDLMAIN_OBJECTS)
+AC_SUBST(SDLTEST_OBJECTS)
+AC_SUBST(BUILD_CFLAGS)
+AC_SUBST(EXTRA_CFLAGS)
+AC_SUBST(BUILD_LDFLAGS)
+AC_SUBST(EXTRA_LDFLAGS)
+AC_SUBST(WINDRES)
+AC_SUBST(WAYLAND_SCANNER)
+
+cat >Makefile.rules <<__EOF__
+
+# Build rules for objects
+-include \$(OBJECTS:.lo=.d)
+
+# Special dependency for SDL.c, since it depends on SDL_revision.h
+$srcdir/src/SDL.c: update-revision
+$DEPENDS
+$VERSION_DEPENDS
+$SDLMAIN_DEPENDS
+$SDLTEST_DEPENDS
+$WAYLAND_PROTOCOLS_DEPENDS
+__EOF__
+
+AC_CONFIG_FILES([
+    Makefile:Makefile.in:Makefile.rules sdl2-config sdl2-config.cmake SDL2.spec sdl2.pc
+])
+AC_CONFIG_COMMANDS([sdl2_config],[chmod a+x sdl2-config])
+
+SUMMARY="SDL2 Configure Summary:\n"
+if test x$enable_shared = xyes; then
+    SUMMARY="${SUMMARY}Building Shared Libraries\n"
+fi
+if test x$enable_static = xyes; then
+    SUMMARY="${SUMMARY}Building Static Libraries\n"
+fi
+SUMMARY="${SUMMARY}Enabled modules :${SUMMARY_modules}\n"
+SUMMARY="${SUMMARY}Assembly Math   :${SUMMARY_math}\n" 
+SUMMARY="${SUMMARY}Audio drivers   :${SUMMARY_audio}\n"
+SUMMARY="${SUMMARY}Video drivers   :${SUMMARY_video}\n"
+if test x$have_x = xyes; then
+    SUMMARY="${SUMMARY}X11 libraries   :${SUMMARY_video_x11}\n"
+fi
+SUMMARY="${SUMMARY}Input drivers   :${SUMMARY_input}\n"
+if test x$have_samplerate_h_hdr = xyes; then
+    SUMMARY="${SUMMARY}Using libsamplerate : YES\n"
+else
+    SUMMARY="${SUMMARY}Using libsamplerate : NO\n"
+fi
+if test x$have_libudev_h_hdr = xyes; then
+    SUMMARY="${SUMMARY}Using libudev       : YES\n"
+else
+    SUMMARY="${SUMMARY}Using libudev       : NO\n"
+fi
+if test x$have_dbus_dbus_h_hdr = xyes; then
+    SUMMARY="${SUMMARY}Using dbus          : YES\n"
+else
+    SUMMARY="${SUMMARY}Using dbus          : NO\n"
+fi
+if test x$enable_ime = xyes; then
+    SUMMARY="${SUMMARY}Using ime           : YES\n"
+else
+    SUMMARY="${SUMMARY}Using ime           : NO\n"
+fi
+if test x$have_ibus_ibus_h_hdr = xyes; then
+    SUMMARY="${SUMMARY}Using ibus          : YES\n"
+else
+    SUMMARY="${SUMMARY}Using ibus          : NO\n"
+fi
+if test x$have_fcitx_frontend_h_hdr = xyes; then
+    SUMMARY="${SUMMARY}Using fcitx         : YES\n"
+else
+    SUMMARY="${SUMMARY}Using fcitx         : NO\n"
+fi
+AC_CONFIG_COMMANDS([summary], [echo -en "$SUMMARY"], [SUMMARY="$SUMMARY"])
+
+AC_OUTPUT

+ 12 - 0
Engine/lib/sdl/debian/changelog

@@ -1,3 +1,15 @@
+libsdl2 (2.0.10) UNRELEASED; urgency=low
+
+  * Updated SDL to version 2.0.10
+
+ -- Sam Lantinga <[email protected]>  Mon, 17 Jun 2018 08:48:47 -0800
+
+libsdl2 (2.0.9) UNRELEASED; urgency=low
+
+  * Updated SDL to version 2.0.9
+
+ -- Sam Lantinga <[email protected]>  Wed, 26 Sep 2018 10:02:21 -0800
+
 libsdl2 (2.0.8) UNRELEASED; urgency=low
 
   * Updated SDL to version 2.0.8

+ 6 - 6
Engine/lib/sdl/debian/copyright

@@ -4,7 +4,7 @@ Upstream-Contact: Sam Lantinga <[email protected]>
 Source: http://www.libsdl.org/
 
 Files: *
-Copyright: 1997-2018 Sam Lantinga <[email protected]>
+Copyright: 1997-2019 Sam Lantinga <[email protected]>
 License: zlib/libpng
 
 Files: src/libm/*
@@ -12,7 +12,7 @@ Copyright: 1993 by Sun Microsystems, Inc. All rights reserved.
 License: SunPro
 
 Files: src/main/windows/SDL_windows_main.c
-Copyright: 2018 Sam Lantinga
+Copyright: 2019 Sam Lantinga
 License: PublicDomain_Sam_Lantinga
 Comment: SDL_main.c, placed in the public domain by Sam Lantinga  4/13/98
 
@@ -32,7 +32,7 @@ Copyright: 1995 Erik Corry
 License: BrownUn_UnCalifornia_ErikCorry
 
 Files: src/test/SDL_test_md5.c
-Copyright: 1997-2018 Sam Lantinga <[email protected]>
+Copyright: 1997-2019 Sam Lantinga <[email protected]>
            1990 RSA Data Security, Inc.
 License: zlib/libpng and RSA_Data_Security
 
@@ -46,12 +46,12 @@ Copyright: 1994-2003 The XFree86 Project, Inc.
 License: MIT/X11
 
 Files: test/testhaptic.c
-Copyright: 1997-2018 Sam Lantinga <[email protected]>
+Copyright: 1997-2019 Sam Lantinga <[email protected]>
            2008 Edgar Simo Serra
 License: BSD_3_clause
 
 Files: test/testrumble.c
-Copyright: 1997-2018 Sam Lantinga <[email protected]>
+Copyright: 1997-2019 Sam Lantinga <[email protected]>
            2011 Edgar Simo Serra
 License: BSD_3_clause
 
@@ -169,7 +169,7 @@ License: BSD_3_clause
  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 Comment:
-  Copyright (C) 1997-2018 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2019 Sam Lantinga <[email protected]>
   .
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages

+ 16 - 3
Engine/lib/sdl/debian/rules

@@ -4,9 +4,22 @@ DEB_HOST_ARCH_CPU ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU)
 DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
 
 confflags = --disable-rpath --disable-video-directfb \
-            --disable-nas --disable-esd --disable-arts \
-            --disable-alsa-shared --disable-pulseaudio-shared \
-            --disable-x11-shared
+            --disable-nas --disable-esd --disable-arts
+
+# These flags can be used to create a package directly linking with external libraries and having the appropriate package dependencies
+#confflags += --disable-alsa-shared
+#confflags += --disable-arts-shared
+#confflags += --disable-directfb-shared
+#confflags += --disable-esd-shared
+#confflags += --disable-fusionsound-shared
+#confflags += --disable-jack-shared
+#confflags += --disable-kmsdrm-shared
+#confflags += --disable-libsamplerate-shared
+#confflags += --disable-nas-shared
+#confflags += --disable-pulseaudio-shared
+#confflags += --disable-sndio-shared
+#confflags += --disable-wayland-shared
+#confflags += --disable-x11-shared
 
 %:
 	dh $@ --parallel

+ 4 - 2
Engine/lib/sdl/include/SDL.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2018 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2019 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -51,6 +51,7 @@
 #include "SDL_power.h"
 #include "SDL_render.h"
 #include "SDL_rwops.h"
+#include "SDL_sensor.h"
 #include "SDL_shape.h"
 #include "SDL_system.h"
 #include "SDL_thread.h"
@@ -80,10 +81,11 @@ extern "C" {
 #define SDL_INIT_HAPTIC         0x00001000u
 #define SDL_INIT_GAMECONTROLLER 0x00002000u  /**< SDL_INIT_GAMECONTROLLER implies SDL_INIT_JOYSTICK */
 #define SDL_INIT_EVENTS         0x00004000u
+#define SDL_INIT_SENSOR         0x00008000u
 #define SDL_INIT_NOPARACHUTE    0x00100000u  /**< compatibility; this flag is ignored. */
 #define SDL_INIT_EVERYTHING ( \
                 SDL_INIT_TIMER | SDL_INIT_AUDIO | SDL_INIT_VIDEO | SDL_INIT_EVENTS | \
-                SDL_INIT_JOYSTICK | SDL_INIT_HAPTIC | SDL_INIT_GAMECONTROLLER \
+                SDL_INIT_JOYSTICK | SDL_INIT_HAPTIC | SDL_INIT_GAMECONTROLLER | SDL_INIT_SENSOR \
             )
 /* @} */
 

+ 1 - 1
Engine/lib/sdl/include/SDL_assert.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2018 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2019 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages

+ 20 - 2
Engine/lib/sdl/include/SDL_atomic.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2018 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2019 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -162,12 +162,29 @@ extern DECLSPEC void SDLCALL SDL_MemoryBarrierAcquireFunction(void);
 #define SDL_MemoryBarrierRelease()   __asm__ __volatile__ ("dmb ish" : : : "memory")
 #define SDL_MemoryBarrierAcquire()   __asm__ __volatile__ ("dmb ish" : : : "memory")
 #elif defined(__GNUC__) && defined(__arm__)
-#if defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7EM__) || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7S__)
+#if 0 /* defined(__LINUX__) || defined(__ANDROID__) */
+/* Information from:
+   https://chromium.googlesource.com/chromium/chromium/+/trunk/base/atomicops_internals_arm_gcc.h#19
+
+   The Linux kernel provides a helper function which provides the right code for a memory barrier,
+   hard-coded at address 0xffff0fa0
+*/
+typedef void (*SDL_KernelMemoryBarrierFunc)();
+#define SDL_MemoryBarrierRelease()	((SDL_KernelMemoryBarrierFunc)0xffff0fa0)()
+#define SDL_MemoryBarrierAcquire()	((SDL_KernelMemoryBarrierFunc)0xffff0fa0)()
+#elif 0 /* defined(__QNXNTO__) */
+#include <sys/cpuinline.h>
+
+#define SDL_MemoryBarrierRelease()   __cpu_membarrier()
+#define SDL_MemoryBarrierAcquire()   __cpu_membarrier()
+#else
+#if defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7EM__) || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7S__) || defined(__ARM_ARCH_8A__)
 #define SDL_MemoryBarrierRelease()   __asm__ __volatile__ ("dmb ish" : : : "memory")
 #define SDL_MemoryBarrierAcquire()   __asm__ __volatile__ ("dmb ish" : : : "memory")
 #elif defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6T2__) || defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__) || defined(__ARM_ARCH_5TE__)
 #ifdef __thumb__
 /* The mcr instruction isn't available in thumb mode, use real functions */
+#define SDL_MEMORY_BARRIER_USES_FUNCTION
 #define SDL_MemoryBarrierRelease()   SDL_MemoryBarrierReleaseFunction()
 #define SDL_MemoryBarrierAcquire()   SDL_MemoryBarrierAcquireFunction()
 #else
@@ -177,6 +194,7 @@ extern DECLSPEC void SDLCALL SDL_MemoryBarrierAcquireFunction(void);
 #else
 #define SDL_MemoryBarrierRelease()   __asm__ __volatile__ ("" : : : "memory")
 #define SDL_MemoryBarrierAcquire()   __asm__ __volatile__ ("" : : : "memory")
+#endif /* __LINUX__ || __ANDROID__ */
 #endif /* __GNUC__ && __arm__ */
 #else
 #if (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x5120))

+ 49 - 15
Engine/lib/sdl/include/SDL_audio.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2018 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2019 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -140,7 +140,8 @@ typedef Uint16 SDL_AudioFormat;
 #define SDL_AUDIO_ALLOW_FREQUENCY_CHANGE    0x00000001
 #define SDL_AUDIO_ALLOW_FORMAT_CHANGE       0x00000002
 #define SDL_AUDIO_ALLOW_CHANNELS_CHANGE     0x00000004
-#define SDL_AUDIO_ALLOW_ANY_CHANGE          (SDL_AUDIO_ALLOW_FREQUENCY_CHANGE|SDL_AUDIO_ALLOW_FORMAT_CHANGE|SDL_AUDIO_ALLOW_CHANNELS_CHANGE)
+#define SDL_AUDIO_ALLOW_SAMPLES_CHANGE      0x00000008
+#define SDL_AUDIO_ALLOW_ANY_CHANGE          (SDL_AUDIO_ALLOW_FREQUENCY_CHANGE|SDL_AUDIO_ALLOW_FORMAT_CHANGE|SDL_AUDIO_ALLOW_CHANNELS_CHANGE|SDL_AUDIO_ALLOW_SAMPLES_CHANGE)
 /* @} */
 
 /* @} *//* Audio flags */
@@ -419,23 +420,56 @@ extern DECLSPEC void SDLCALL SDL_PauseAudioDevice(SDL_AudioDeviceID dev,
 /* @} *//* Pause audio functions */
 
 /**
- *  This function loads a WAVE from the data source, automatically freeing
- *  that source if \c freesrc is non-zero.  For example, to load a WAVE file,
- *  you could do:
+ *  \brief Load the audio data of a WAVE file into memory
+ *
+ *  Loading a WAVE file requires \c src, \c spec, \c audio_buf and \c audio_len
+ *  to be valid pointers. The entire data portion of the file is then loaded
+ *  into memory and decoded if necessary.
+ *
+ *  If \c freesrc is non-zero, the data source gets automatically closed and
+ *  freed before the function returns.
+ *
+ *  Supported are RIFF WAVE files with the formats PCM (8, 16, 24, and 32 bits),
+ *  IEEE Float (32 bits), Microsoft ADPCM and IMA ADPCM (4 bits), and A-law and
+ *  µ-law (8 bits). Other formats are currently unsupported and cause an error.
+ *
+ *  If this function succeeds, the pointer returned by it is equal to \c spec
+ *  and the pointer to the audio data allocated by the function is written to
+ *  \c audio_buf and its length in bytes to \c audio_len. The \ref SDL_AudioSpec
+ *  members \c freq, \c channels, and \c format are set to the values of the
+ *  audio data in the buffer. The \c samples member is set to a sane default and
+ *  all others are set to zero.
+ *
+ *  It's necessary to use SDL_FreeWAV() to free the audio data returned in
+ *  \c audio_buf when it is no longer used.
+ *
+ *  Because of the underspecification of the Waveform format, there are many
+ *  problematic files in the wild that cause issues with strict decoders. To
+ *  provide compatibility with these files, this decoder is lenient in regards
+ *  to the truncation of the file, the fact chunk, and the size of the RIFF
+ *  chunk. The hints SDL_HINT_WAVE_RIFF_CHUNK_SIZE, SDL_HINT_WAVE_TRUNCATION,
+ *  and SDL_HINT_WAVE_FACT_CHUNK can be used to tune the behavior of the
+ *  loading process.
+ *
+ *  Any file that is invalid (due to truncation, corruption, or wrong values in
+ *  the headers), too big, or unsupported causes an error. Additionally, any
+ *  critical I/O error from the data source will terminate the loading process
+ *  with an error. The function returns NULL on error and in all cases (with the
+ *  exception of \c src being NULL), an appropriate error message will be set.
+ *
+ *  It is required that the data source supports seeking.
+ *
+ *  Example:
  *  \code
  *      SDL_LoadWAV_RW(SDL_RWFromFile("sample.wav", "rb"), 1, ...);
  *  \endcode
  *
- *  If this function succeeds, it returns the given SDL_AudioSpec,
- *  filled with the audio data format of the wave data, and sets
- *  \c *audio_buf to a malloc()'d buffer containing the audio data,
- *  and sets \c *audio_len to the length of that audio buffer, in bytes.
- *  You need to free the audio buffer with SDL_FreeWAV() when you are
- *  done with it.
- *
- *  This function returns NULL and sets the SDL error message if the
- *  wave file cannot be opened, uses an unknown data format, or is
- *  corrupt.  Currently raw and MS-ADPCM WAVE files are supported.
+ *  \param src The data source with the WAVE data
+ *  \param freesrc A integer value that makes the function close the data source if non-zero
+ *  \param spec A pointer filled with the audio format of the audio data
+ *  \param audio_buf A pointer filled with the audio data allocated by the function
+ *  \param audio_len A pointer filled with the length of the audio data buffer in bytes
+ *  \return NULL on error, or non-NULL on success.
  */
 extern DECLSPEC SDL_AudioSpec *SDLCALL SDL_LoadWAV_RW(SDL_RWops * src,
                                                       int freesrc,

+ 10 - 1
Engine/lib/sdl/include/SDL_bits.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2018 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2019 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -101,6 +101,15 @@ SDL_MostSignificantBitIndex32(Uint32 x)
 #endif
 }
 
+SDL_FORCE_INLINE SDL_bool
+SDL_HasExactlyOneBitSet32(Uint32 x)
+{
+    if (x && !(x & (x - 1))) {
+        return SDL_TRUE;
+    }
+    return SDL_FALSE;
+}
+
 /* Ends C function definitions when using C++ */
 #ifdef __cplusplus
 }

+ 7 - 7
Engine/lib/sdl/include/SDL_blendmode.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2018 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2019 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -90,12 +90,12 @@ typedef enum
 /**
  *  \brief Create a custom blend mode, which may or may not be supported by a given renderer
  *
- *  \param srcColorFactor
- *  \param dstColorFactor
- *  \param colorOperation
- *  \param srcAlphaFactor
- *  \param dstAlphaFactor
- *  \param alphaOperation
+ *  \param srcColorFactor source color factor
+ *  \param dstColorFactor destination color factor
+ *  \param colorOperation color operation
+ *  \param srcAlphaFactor source alpha factor
+ *  \param dstAlphaFactor destination alpha factor
+ *  \param alphaOperation alpha operation
  *
  *  The result of the blend mode operation will be:
  *      dstRGB = dstRGB * dstColorFactor colorOperation srcRGB * srcColorFactor

+ 1 - 1
Engine/lib/sdl/include/SDL_clipboard.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2018 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2019 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages

+ 4 - 2
Engine/lib/sdl/include/SDL_config.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2018 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2019 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -41,8 +41,10 @@
 #include "SDL_config_android.h"
 #elif defined(__PSP__)
 #include "SDL_config_psp.h"
+#elif defined(__OS2__)
+#include "SDL_config_os2.h"
 #else
-/* This is a minimal configuration just to get SDL running on new platforms */
+/* This is a minimal configuration just to get SDL running on new platforms. */
 #include "SDL_config_minimal.h"
 #endif /* platform config */
 

+ 15 - 4
Engine/lib/sdl/include/SDL_config.h.cmake

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2018 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2019 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -144,6 +144,8 @@
 #cmakedefine HAVE_COPYSIGNF 1
 #cmakedefine HAVE_COS 1
 #cmakedefine HAVE_COSF 1
+#cmakedefine HAVE_EXP 1
+#cmakedefine HAVE_EXPF 1
 #cmakedefine HAVE_FABS 1
 #cmakedefine HAVE_FABSF 1
 #cmakedefine HAVE_FLOOR 1
@@ -182,6 +184,7 @@
 #cmakedefine HAVE_SEM_TIMEDWAIT 1
 #cmakedefine HAVE_GETAUXVAL 1
 #cmakedefine HAVE_POLL 1
+#cmakedefine HAVE__EXIT 1
 
 #elif __WIN32__
 #cmakedefine HAVE_STDARG_H 1
@@ -207,6 +210,11 @@
 #cmakedefine HAVE_DINPUT_H @HAVE_DINPUT_H@
 #cmakedefine HAVE_XINPUT_H @HAVE_XINPUT_H@
 #cmakedefine HAVE_DXGI_H @HAVE_DXGI_H@
+
+#cmakedefine HAVE_ENDPOINTVOLUME_H @HAVE_ENDPOINTVOLUME_H@
+#cmakedefine HAVE_MMDEVICEAPI_H @HAVE_MMDEVICEAPI_H@
+#cmakedefine HAVE_AUDIOCLIENT_H @HAVE_AUDIOCLIENT_H@
+
 #cmakedefine HAVE_XINPUT_GAMEPAD_EX @HAVE_XINPUT_GAMEPAD_EX@
 #cmakedefine HAVE_XINPUT_STATE_EX @HAVE_XINPUT_STATE_EX@
 
@@ -221,6 +229,7 @@
 #cmakedefine SDL_FILE_DISABLED @SDL_FILE_DISABLED@
 #cmakedefine SDL_JOYSTICK_DISABLED @SDL_JOYSTICK_DISABLED@
 #cmakedefine SDL_HAPTIC_DISABLED @SDL_HAPTIC_DISABLED@
+#cmakedefine SDL_SENSOR_DISABLED @SDL_SENSOR_DISABLED@
 #cmakedefine SDL_LOADSO_DISABLED @SDL_LOADSO_DISABLED@
 #cmakedefine SDL_RENDER_DISABLED @SDL_RENDER_DISABLED@
 #cmakedefine SDL_THREADS_DISABLED @SDL_THREADS_DISABLED@
@@ -277,6 +286,7 @@
 #cmakedefine SDL_JOYSTICK_WINMM @SDL_JOYSTICK_WINMM@
 #cmakedefine SDL_JOYSTICK_USBHID @SDL_JOYSTICK_USBHID@
 #cmakedefine SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H @SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H@
+#cmakedefine SDL_JOYSTICK_HIDAPI @SDL_JOYSTICK_HIDAPI@
 #cmakedefine SDL_JOYSTICK_EMSCRIPTEN @SDL_JOYSTICK_EMSCRIPTEN@
 #cmakedefine SDL_HAPTIC_DUMMY @SDL_HAPTIC_DUMMY@
 #cmakedefine SDL_HAPTIC_LINUX @SDL_HAPTIC_LINUX@
@@ -285,6 +295,10 @@
 #cmakedefine SDL_HAPTIC_XINPUT @SDL_HAPTIC_XINPUT@
 #cmakedefine SDL_HAPTIC_ANDROID @SDL_HAPTIC_ANDROID@
 
+/* Enable various sensor drivers */
+#cmakedefine SDL_SENSOR_ANDROID @SDL_SENSOR_ANDROID@
+#cmakedefine SDL_SENSOR_DUMMY @SDL_SENSOR_DUMMY@
+
 /* Enable various shared object loading systems */
 #cmakedefine SDL_LOADSO_DLOPEN @SDL_LOADSO_DLOPEN@
 #cmakedefine SDL_LOADSO_DUMMY @SDL_LOADSO_DUMMY@
@@ -327,9 +341,6 @@
 #cmakedefine SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR @SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR@
 #cmakedefine SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON @SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON@
 
-#cmakedefine SDL_VIDEO_DRIVER_MIR @SDL_VIDEO_DRIVER_MIR@
-#cmakedefine SDL_VIDEO_DRIVER_MIR_DYNAMIC @SDL_VIDEO_DRIVER_MIR_DYNAMIC@
-#cmakedefine SDL_VIDEO_DRIVER_MIR_DYNAMIC_XKBCOMMON @SDL_VIDEO_DRIVER_MIR_DYNAMIC_XKBCOMMON@
 #cmakedefine SDL_VIDEO_DRIVER_EMSCRIPTEN @SDL_VIDEO_DRIVER_EMSCRIPTEN@
 #cmakedefine SDL_VIDEO_DRIVER_X11 @SDL_VIDEO_DRIVER_X11@
 #cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC @SDL_VIDEO_DRIVER_X11_DYNAMIC@

+ 13 - 4
Engine/lib/sdl/include/SDL_config.h.in

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2018 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2019 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -149,6 +149,8 @@
 #undef HAVE_COPYSIGNF
 #undef HAVE_COS
 #undef HAVE_COSF
+#undef HAVE_EXP
+#undef HAVE_EXPF
 #undef HAVE_FABS
 #undef HAVE_FABSF
 #undef HAVE_FLOOR
@@ -187,6 +189,7 @@
 #undef HAVE_SEM_TIMEDWAIT
 #undef HAVE_GETAUXVAL
 #undef HAVE_POLL
+#undef HAVE__EXIT
 
 #else
 #define HAVE_STDARG_H   1
@@ -207,6 +210,9 @@
 #undef HAVE_DSOUND_H
 #undef HAVE_DXGI_H
 #undef HAVE_XINPUT_H
+#undef HAVE_ENDPOINTVOLUME_H
+#undef HAVE_MMDEVICEAPI_H
+#undef HAVE_AUDIOCLIENT_H
 #undef HAVE_XINPUT_GAMEPAD_EX
 #undef HAVE_XINPUT_STATE_EX
 
@@ -221,6 +227,7 @@
 #undef SDL_FILE_DISABLED
 #undef SDL_JOYSTICK_DISABLED
 #undef SDL_HAPTIC_DISABLED
+#undef SDL_SENSOR_DISABLED
 #undef SDL_LOADSO_DISABLED
 #undef SDL_RENDER_DISABLED
 #undef SDL_THREADS_DISABLED
@@ -277,6 +284,7 @@
 #undef SDL_JOYSTICK_WINMM
 #undef SDL_JOYSTICK_USBHID
 #undef SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H
+#undef SDL_JOYSTICK_HIDAPI
 #undef SDL_JOYSTICK_EMSCRIPTEN
 #undef SDL_HAPTIC_DUMMY
 #undef SDL_HAPTIC_ANDROID
@@ -285,6 +293,10 @@
 #undef SDL_HAPTIC_DINPUT
 #undef SDL_HAPTIC_XINPUT
 
+/* Enable various sensor drivers */
+#undef SDL_SENSOR_ANDROID
+#undef SDL_SENSOR_DUMMY
+
 /* Enable various shared object loading systems */
 #undef SDL_LOADSO_DLOPEN
 #undef SDL_LOADSO_DUMMY
@@ -316,9 +328,6 @@
 #undef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_EGL
 #undef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR
 #undef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON
-#undef SDL_VIDEO_DRIVER_MIR
-#undef SDL_VIDEO_DRIVER_MIR_DYNAMIC
-#undef SDL_VIDEO_DRIVER_MIR_DYNAMIC_XKBCOMMON
 #undef SDL_VIDEO_DRIVER_X11
 #undef SDL_VIDEO_DRIVER_RPI
 #undef SDL_VIDEO_DRIVER_KMSDRM

+ 8 - 1
Engine/lib/sdl/include/SDL_config_android.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2018 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2019 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -98,6 +98,8 @@
 #define HAVE_COPYSIGNF  1
 #define HAVE_COS    1
 #define HAVE_COSF   1
+#define HAVE_EXP    1
+#define HAVE_EXPF   1
 #define HAVE_FABS   1
 #define HAVE_FABSF  1
 #define HAVE_FLOOR  1
@@ -128,12 +130,17 @@
 
 /* Enable various audio drivers */
 #define SDL_AUDIO_DRIVER_ANDROID    1
+#define SDL_AUDIO_DRIVER_OPENSLES   1
 #define SDL_AUDIO_DRIVER_DUMMY  1
 
 /* Enable various input drivers */
 #define SDL_JOYSTICK_ANDROID    1
+#define SDL_JOYSTICK_HIDAPI    1
 #define SDL_HAPTIC_ANDROID    1
 
+/* Enable sensor driver */
+#define SDL_SENSOR_ANDROID  1
+
 /* Enable various shared object loading systems */
 #define SDL_LOADSO_DLOPEN   1
 

+ 11 - 1
Engine/lib/sdl/include/SDL_config_iphoneos.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2018 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2019 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -99,6 +99,8 @@
 #define HAVE_COPYSIGNF  1
 #define HAVE_COS    1
 #define HAVE_COSF   1
+#define HAVE_EXP    1
+#define HAVE_EXPF   1
 #define HAVE_FABS   1
 #define HAVE_FABSF  1
 #define HAVE_FLOOR  1
@@ -135,6 +137,14 @@
 
 /* Enable MFi joystick support */
 #define SDL_JOYSTICK_MFI 1
+/*#define SDL_JOYSTICK_HIDAPI 1*/
+
+#ifdef __TVOS__
+#define SDL_SENSOR_DUMMY    1
+#else
+/* Enable the CoreMotion sensor driver */
+#define SDL_SENSOR_COREMOTION   1
+#endif
 
 /* Enable Unix style SO loading */
 #define SDL_LOADSO_DLOPEN 1

+ 8 - 2
Engine/lib/sdl/include/SDL_config_macosx.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2018 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2019 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -102,6 +102,8 @@
 #define HAVE_COPYSIGNF  1
 #define HAVE_COS    1
 #define HAVE_COSF   1
+#define HAVE_EXP    1
+#define HAVE_EXPF   1
 #define HAVE_FABS   1
 #define HAVE_FABSF  1
 #define HAVE_FLOOR  1
@@ -135,8 +137,12 @@
 
 /* Enable various input drivers */
 #define SDL_JOYSTICK_IOKIT  1
+#define SDL_JOYSTICK_HIDAPI  1
 #define SDL_HAPTIC_IOKIT    1
 
+/* Enable the dummy sensor driver */
+#define SDL_SENSOR_DUMMY  1
+
 /* Enable various shared object loading systems */
 #define SDL_LOADSO_DLOPEN   1
 
@@ -212,7 +218,7 @@
 #endif
 
 /* Enable Vulkan support */
-/* Metal/MoltenVK/Vulkan only supported on 64-bit architectures with 10.11+ */
+/* Metal/Vulkan Portability only supported on 64-bit architectures with 10.11+ */
 #if TARGET_CPU_X86_64 && (MAC_OS_X_VERSION_MAX_ALLOWED >= 101100)
 #define SDL_VIDEO_VULKAN 1
 #else

+ 4 - 1
Engine/lib/sdl/include/SDL_config_minimal.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2018 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2019 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -64,6 +64,9 @@ typedef unsigned long uintptr_t;
 /* Enable the stub haptic driver (src/haptic/dummy/\*.c) */
 #define SDL_HAPTIC_DISABLED 1
 
+/* Enable the stub sensor driver (src/sensor/dummy/\*.c) */
+#define SDL_SENSOR_DISABLED 1
+
 /* Enable the stub shared object loader (src/loadso/dummy/\*.c) */
 #define SDL_LOADSO_DISABLED 1
 

+ 170 - 0
Engine/lib/sdl/include/SDL_config_os2.h

@@ -0,0 +1,170 @@
+/*
+  Simple DirectMedia Layer
+  Copyright (C) 1997-2019 Sam Lantinga <[email protected]>
+
+  This software is provided 'as-is', without any express or implied
+  warranty.  In no event will the authors be held liable for any damages
+  arising from the use of this software.
+
+  Permission is granted to anyone to use this software for any purpose,
+  including commercial applications, and to alter it and redistribute it
+  freely, subject to the following restrictions:
+
+  1. The origin of this software must not be misrepresented; you must not
+     claim that you wrote the original software. If you use this software
+     in a product, an acknowledgment in the product documentation would be
+     appreciated but is not required.
+  2. Altered source versions must be plainly marked as such, and must not be
+     misrepresented as being the original software.
+  3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef SDL_config_os2_h_
+#define SDL_config_os2_h_
+#define SDL_config_h_
+
+#include "SDL_platform.h"
+
+#define SDL_AUDIO_DRIVER_DUMMY 1
+#define SDL_AUDIO_DRIVER_DISK 1
+
+#define SDL_POWER_DISABLED  1
+#define SDL_JOYSTICK_DISABLED 1
+#define SDL_HAPTIC_DISABLED 1
+/*#undef SDL_JOYSTICK_HIDAPI */
+
+#define SDL_SENSOR_DUMMY 1
+#define SDL_VIDEO_DRIVER_DUMMY 1
+
+/* Enable OpenGL support */
+/* #undef SDL_VIDEO_OPENGL */
+
+/* Enable Vulkan support */
+/* #undef SDL_VIDEO_VULKAN */
+
+#define SDL_LOADSO_DISABLED 1
+#define SDL_THREADS_DISABLED 1
+#define SDL_TIMERS_DISABLED 1
+#define SDL_FILESYSTEM_DUMMY 1
+
+/* Enable assembly routines */
+#define SDL_ASSEMBLY_ROUTINES 1
+
+/* #undef HAVE_LIBSAMPLERATE_H */
+
+/* Enable dynamic libsamplerate support */
+/* #undef SDL_LIBSAMPLERATE_DYNAMIC */
+
+#define HAVE_LIBC 1
+
+#define HAVE_SYS_TYPES_H 1
+#define HAVE_STDIO_H 1
+#define STDC_HEADERS 1
+#define HAVE_STDLIB_H 1
+#define HAVE_STDARG_H 1
+#define HAVE_STDDEF_H 1
+#define HAVE_MALLOC_H 1
+#define HAVE_MEMORY_H 1
+#define HAVE_STRING_H 1
+#define HAVE_STRINGS_H 1
+#define HAVE_WCHAR_H 1
+#define HAVE_INTTYPES_H 1
+#define HAVE_STDINT_H 1
+#define HAVE_LIMITS_H 1
+#define HAVE_CTYPE_H 1
+#define HAVE_MATH_H 1
+#define HAVE_FLOAT_H 1
+#define HAVE_SIGNAL_H 1
+
+#define HAVE_MALLOC 1
+#define HAVE_CALLOC 1
+#define HAVE_REALLOC 1
+#define HAVE_FREE 1
+#if defined(__WATCOMC__)
+#define HAVE__FSEEKI64 1
+#define HAVE__FTELLI64 1
+#endif
+#define HAVE_ALLOCA 1
+#define HAVE_GETENV 1
+#define HAVE_SETENV 1
+#define HAVE_PUTENV 1
+#define HAVE_QSORT 1
+#define HAVE_ABS 1
+#define HAVE_BCOPY 1
+#define HAVE_MEMSET 1
+#define HAVE_MEMCPY 1
+#define HAVE_MEMMOVE 1
+#define HAVE_MEMCMP 1
+#define HAVE_WCSLEN 1
+#define HAVE_WCSLCPY 1
+#define HAVE_WCSLCAT 1
+#define HAVE_WCSCMP 1
+#define HAVE_STRLEN 1
+#define HAVE_STRLCPY 1
+#define HAVE_STRLCAT 1
+#define HAVE__STRREV 1
+#define HAVE__STRUPR 1
+#define HAVE__STRLWR 1
+#define HAVE_INDEX 1
+#define HAVE_RINDEX 1
+#define HAVE_STRCHR 1
+#define HAVE_STRRCHR 1
+#define HAVE_STRSTR 1
+#define HAVE_ITOA 1
+#define HAVE__LTOA 1
+#define HAVE__ULTOA 1
+#define HAVE_STRTOL 1
+#define HAVE_STRTOUL 1
+#define HAVE__I64TOA 1
+#define HAVE__UI64TOA 1
+#define HAVE_STRTOLL 1
+#define HAVE_STRTOULL 1
+#define HAVE_STRTOD 1
+#define HAVE_ATOI 1
+#define HAVE_ATOF 1
+#define HAVE_STRCMP 1
+#define HAVE_STRNCMP 1
+#define HAVE_STRICMP 1
+#define HAVE_STRCASECMP 1
+#define HAVE_STRNCASECMP 1
+#define HAVE_SSCANF 1
+#define HAVE_SNPRINTF 1
+#define HAVE_VSNPRINTF 1
+#define HAVE_SETJMP 1
+#define HAVE_ACOS 1
+/* #undef HAVE_ACOSF */
+#define HAVE_ASIN 1
+/* #undef HAVE_ASINF */
+#define HAVE_ATAN 1
+#define HAVE_ATAN2 1
+/* #undef HAVE_ATAN2F */
+#define HAVE_CEIL 1
+/* #undef HAVE_CEILF */
+/* #undef HAVE_COPYSIGN */
+/* #undef HAVE_COPYSIGNF */
+#define HAVE_COS 1
+/* #undef HAVE_COSF */
+#define HAVE_EXP 1
+/* #undef HAVE_EXPF */
+#define HAVE_FABS 1
+/* #undef HAVE_FABSF */
+#define HAVE_FLOOR 1
+/* #undef HAVE_FLOORF */
+#define HAVE_FMOD 1
+/* #undef HAVE_FMODF */
+#define HAVE_LOG 1
+/* #undef HAVE_LOGF */
+#define HAVE_LOG10 1
+/* #undef HAVE_LOG10F */
+#define HAVE_POW 1
+/* #undef HAVE_POWF */
+#define HAVE_SIN 1
+/* #undef HAVE_SINF */
+/* #undef HAVE_SCALBN */
+/* #undef HAVE_SCALBNF */
+#define HAVE_SQRT 1
+/* #undef HAVE_SQRTF */
+#define HAVE_TAN 1
+/* #undef HAVE_TANF */
+
+#endif /* SDL_config_os2_h_ */

+ 4 - 1
Engine/lib/sdl/include/SDL_config_pandora.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2018 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2019 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -90,6 +90,7 @@
 #define HAVE_COPYSIGN 1
 #define HAVE_COS 1
 #define HAVE_COSF 1
+#define HAVE_EXP 1
 #define HAVE_FABS 1
 #define HAVE_FLOOR 1
 #define HAVE_LOG 1
@@ -113,6 +114,8 @@
 #define SDL_JOYSTICK_LINUX 1
 #define SDL_HAPTIC_LINUX 1
 
+#define SDL_SENSOR_DUMMY 1
+
 #define SDL_LOADSO_DLOPEN 1
 
 #define SDL_THREAD_PTHREAD 1

+ 12 - 7
Engine/lib/sdl/include/SDL_config_psp.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2018 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2019 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -97,6 +97,8 @@
 #define HAVE_COPYSIGNF  1
 #define HAVE_COS    1
 #define HAVE_COSF   1
+#define HAVE_EXP    1
+#define HAVE_EXPF   1
 #define HAVE_FABS   1
 #define HAVE_FABSF  1
 #define HAVE_FLOOR  1
@@ -126,22 +128,25 @@
 /* PSP isn't that sophisticated */
 #define LACKS_SYS_MMAN_H 1
 
-/* Enable the stub thread support (src/thread/psp/\*.c) */
+/* Enable the PSP thread support (src/thread/psp/\*.c) */
 #define SDL_THREAD_PSP  1
 
-/* Enable the stub timer support (src/timer/psp/\*.c) */
+/* Enable the PSP timer support (src/timer/psp/\*.c) */
 #define SDL_TIMERS_PSP  1
 
-/* Enable the stub joystick driver (src/joystick/psp/\*.c) */
+/* Enable the PSP joystick driver (src/joystick/psp/\*.c) */
 #define SDL_JOYSTICK_PSP        1
 
-/* Enable the stub audio driver (src/audio/psp/\*.c) */
+/* Enable the dummy sensor driver */
+#define SDL_SENSOR_DUMMY  1
+
+/* Enable the PSP audio driver (src/audio/psp/\*.c) */
 #define SDL_AUDIO_DRIVER_PSP    1
 
-/* PSP video dirver */
+/* PSP video driver */
 #define SDL_VIDEO_DRIVER_PSP   1
 
-/* PSP render dirver */
+/* PSP render driver */
 #define SDL_VIDEO_RENDER_PSP   1
 
 #define SDL_POWER_PSP          1

+ 10 - 1
Engine/lib/sdl/include/SDL_config_windows.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2018 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2019 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -82,6 +82,9 @@ typedef unsigned int uintptr_t;
 #define HAVE_DSOUND_H 1
 #define HAVE_DXGI_H 1
 #define HAVE_XINPUT_H 1
+#define HAVE_MMDEVICEAPI_H 1
+#define HAVE_AUDIOCLIENT_H 1
+#define HAVE_ENDPOINTVOLUME_H 1
 
 /* This is disabled by default to avoid C runtime dependencies and manifest requirements */
 #ifdef HAVE_LIBC
@@ -139,6 +142,8 @@ typedef unsigned int uintptr_t;
 #define HAVE__COPYSIGN  1
 #define HAVE_COS    1
 #define HAVE_COSF   1
+#define HAVE_EXP    1
+#define HAVE_EXPF   1
 #define HAVE_FABS   1
 #define HAVE_FABSF  1
 #define HAVE_FLOOR  1
@@ -188,9 +193,13 @@ typedef unsigned int uintptr_t;
 /* Enable various input drivers */
 #define SDL_JOYSTICK_DINPUT 1
 #define SDL_JOYSTICK_XINPUT 1
+#define SDL_JOYSTICK_HIDAPI 1
 #define SDL_HAPTIC_DINPUT   1
 #define SDL_HAPTIC_XINPUT   1
 
+/* Enable the dummy sensor driver */
+#define SDL_SENSOR_DUMMY  1
+
 /* Enable various shared object loading systems */
 #define SDL_LOADSO_WINDOWS  1
 

+ 11 - 1
Engine/lib/sdl/include/SDL_config_winrt.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2018 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2019 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -97,6 +97,11 @@ typedef unsigned int uintptr_t;
 #if WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP
 #define HAVE_XINPUT_H 1
 #endif
+
+#define HAVE_MMDEVICEAPI_H 1
+#define HAVE_AUDIOCLIENT_H 1
+#define HAVE_ENDPOINTVOLUME_H 1
+
 #define HAVE_LIBC 1
 #define STDC_HEADERS 1
 #define HAVE_CTYPE_H 1
@@ -155,6 +160,8 @@ typedef unsigned int uintptr_t;
 #define HAVE__COPYSIGN 1
 #define HAVE_COS    1
 #define HAVE_COSF   1
+#define HAVE_EXP    1
+#define HAVE_EXPF   1
 #define HAVE_FABS   1
 #define HAVE_FABSF  1
 #define HAVE_FLOOR  1
@@ -190,6 +197,9 @@ typedef unsigned int uintptr_t;
 #define SDL_HAPTIC_XINPUT   1
 #endif
 
+/* Enable the dummy sensor driver */
+#define SDL_SENSOR_DUMMY  1
+
 /* Enable various shared object loading systems */
 #define SDL_LOADSO_WINDOWS  1
 

+ 5 - 1
Engine/lib/sdl/include/SDL_config_wiz.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2018 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2019 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -94,6 +94,8 @@
 #define HAVE_COPYSIGNF  1
 #define HAVE_COS    1
 #define HAVE_COSF   1
+#define HAVE_EXP    1
+#define HAVE_EXPF   1
 #define HAVE_FABS   1
 #define HAVE_FABSF  1
 #define HAVE_FLOOR  1
@@ -127,6 +129,8 @@
 #define SDL_JOYSTICK_LINUX 1
 #define SDL_HAPTIC_LINUX 1
 
+#define SDL_SENSOR_DUMMY  1
+
 #define SDL_LOADSO_DLOPEN 1
 
 #define SDL_THREAD_PTHREAD 1

+ 1 - 1
Engine/lib/sdl/include/SDL_copying.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2018 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2019 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages

+ 95 - 6
Engine/lib/sdl/include/SDL_cpuinfo.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2018 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2019 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -41,26 +41,48 @@
 #else
 #include <intrin.h>
 #ifndef _WIN64
+#ifndef __MMX__
 #define __MMX__
+#endif
+#ifndef __3dNOW__
 #define __3dNOW__
 #endif
+#endif
+#ifndef __SSE__
 #define __SSE__
+#endif
+#ifndef __SSE2__
 #define __SSE2__
+#endif
 #endif /* __clang__ */
 #elif defined(__MINGW64_VERSION_MAJOR)
 #include <intrin.h>
 #else
-#ifdef __ALTIVEC__
-#if HAVE_ALTIVEC_H && !defined(__APPLE_ALTIVEC__) && !defined(SDL_DISABLE_ALTIVEC_H)
+/* altivec.h redefining bool causes a number of problems, see bugs 3993 and 4392, so you need to explicitly define SDL_ENABLE_ALTIVEC_H to have it included. */
+#if defined(HAVE_ALTIVEC_H) && defined(__ALTIVEC__) && !defined(__APPLE_ALTIVEC__) && defined(SDL_ENABLE_ALTIVEC_H)
 #include <altivec.h>
-#undef pixel
-#undef bool
 #endif
+#if !defined(SDL_DISABLE_ARM_NEON_H)
+#  if defined(__ARM_NEON)
+#    include <arm_neon.h>
+#  elif defined(__WINDOWS__) || defined(__WINRT__)
+/* Visual Studio doesn't define __ARM_ARCH, but _M_ARM (if set, always 7), and _M_ARM64 (if set, always 1). */
+#    if defined(_M_ARM)
+#      include <armintr.h>
+#      include <arm_neon.h>
+#      define __ARM_NEON 1 /* Set __ARM_NEON so that it can be used elsewhere, at compile time */
+#    endif
+#    if defined (_M_ARM64)
+#      include <armintr.h>
+#      include <arm_neon.h>
+#      define __ARM_NEON 1 /* Set __ARM_NEON so that it can be used elsewhere, at compile time */
+#    endif
+#  endif
 #endif
 #if defined(__3dNOW__) && !defined(SDL_DISABLE_MM3DNOW_H)
 #include <mm3dnow.h>
 #endif
-#if HAVE_IMMINTRIN_H && !defined(SDL_DISABLE_IMMINTRIN_H)
+#if defined(HAVE_IMMINTRIN_H) && !defined(SDL_DISABLE_IMMINTRIN_H)
 #include <immintrin.h>
 #else
 #if defined(__MMX__) && !defined(SDL_DISABLE_MMINTRIN_H)
@@ -159,6 +181,11 @@ extern DECLSPEC SDL_bool SDLCALL SDL_HasAVX(void);
  */
 extern DECLSPEC SDL_bool SDLCALL SDL_HasAVX2(void);
 
+/**
+ *  This function returns true if the CPU has AVX-512F (foundation) features.
+ */
+extern DECLSPEC SDL_bool SDLCALL SDL_HasAVX512F(void);
+
 /**
  *  This function returns true if the CPU has NEON (ARM SIMD) features.
  */
@@ -169,7 +196,69 @@ extern DECLSPEC SDL_bool SDLCALL SDL_HasNEON(void);
  */
 extern DECLSPEC int SDLCALL SDL_GetSystemRAM(void);
 
+/**
+ * \brief Report the alignment this system needs for SIMD allocations.
+ *
+ * This will return the minimum number of bytes to which a pointer must be
+ *  aligned to be compatible with SIMD instructions on the current machine.
+ *  For example, if the machine supports SSE only, it will return 16, but if
+ *  it supports AVX-512F, it'll return 64 (etc). This only reports values for
+ *  instruction sets SDL knows about, so if your SDL build doesn't have
+ *  SDL_HasAVX512F(), then it might return 16 for the SSE support it sees and
+ *  not 64 for the AVX-512 instructions that exist but SDL doesn't know about.
+ *  Plan accordingly.
+ */
+extern DECLSPEC size_t SDLCALL SDL_SIMDGetAlignment(void);
 
+/**
+ * \brief Allocate memory in a SIMD-friendly way.
+ *
+ * This will allocate a block of memory that is suitable for use with SIMD
+ *  instructions. Specifically, it will be properly aligned and padded for
+ *  the system's supported vector instructions.
+ *
+ * The memory returned will be padded such that it is safe to read or write
+ *  an incomplete vector at the end of the memory block. This can be useful
+ *  so you don't have to drop back to a scalar fallback at the end of your
+ *  SIMD processing loop to deal with the final elements without overflowing
+ *  the allocated buffer.
+ *
+ * You must free this memory with SDL_FreeSIMD(), not free() or SDL_free()
+ *  or delete[], etc.
+ *
+ * Note that SDL will only deal with SIMD instruction sets it is aware of;
+ *  for example, SDL 2.0.8 knows that SSE wants 16-byte vectors
+ *  (SDL_HasSSE()), and AVX2 wants 32 bytes (SDL_HasAVX2()), but doesn't
+ *  know that AVX-512 wants 64. To be clear: if you can't decide to use an
+ *  instruction set with an SDL_Has*() function, don't use that instruction
+ *  set with memory allocated through here.
+ *
+ * SDL_AllocSIMD(0) will return a non-NULL pointer, assuming the system isn't
+ *  out of memory.
+ *
+ *  \param len The length, in bytes, of the block to allocated. The actual
+ *             allocated block might be larger due to padding, etc.
+ * \return Pointer to newly-allocated block, NULL if out of memory.
+ *
+ * \sa SDL_SIMDAlignment
+ * \sa SDL_SIMDFree
+ */
+extern DECLSPEC void * SDLCALL SDL_SIMDAlloc(const size_t len);
+
+/**
+ * \brief Deallocate memory obtained from SDL_SIMDAlloc
+ *
+ * It is not valid to use this function on a pointer from anything but
+ *  SDL_SIMDAlloc(). It can't be used on pointers from malloc, realloc,
+ *  SDL_malloc, memalign, new[], etc.
+ *
+ * However, SDL_SIMDFree(NULL) is a legal no-op.
+ *
+ * \sa SDL_SIMDAlloc
+ */
+extern DECLSPEC void SDLCALL SDL_SIMDFree(void *ptr);
+
+/* vi: set ts=4 sw=4 expandtab: */
 /* Ends C function definitions when using C++ */
 #ifdef __cplusplus
 }

+ 1 - 1
Engine/lib/sdl/include/SDL_egl.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2018 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2019 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages

+ 1 - 1
Engine/lib/sdl/include/SDL_endian.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2018 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2019 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages

+ 1 - 1
Engine/lib/sdl/include/SDL_error.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2018 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2019 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages

+ 38 - 1
Engine/lib/sdl/include/SDL_events.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2018 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2019 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -85,6 +85,9 @@ typedef enum
                                      Called on Android in onResume()
                                 */
 
+    /* Display events */
+    SDL_DISPLAYEVENT   = 0x150,  /**< Display state change */
+
     /* Window events */
     SDL_WINDOWEVENT    = 0x200, /**< Window state change */
     SDL_SYSWMEVENT,             /**< System specific event */
@@ -144,6 +147,9 @@ typedef enum
     SDL_AUDIODEVICEADDED = 0x1100, /**< A new audio device is available */
     SDL_AUDIODEVICEREMOVED,        /**< An audio device has been removed. */
 
+    /* Sensor events */
+    SDL_SENSORUPDATE = 0x1200,     /**< A sensor was updated */
+
     /* Render events */
     SDL_RENDER_TARGETS_RESET = 0x2000, /**< The render targets have been reset and their contents need to be updated */
     SDL_RENDER_DEVICE_RESET, /**< The device has been reset and all textures need to be recreated */
@@ -168,6 +174,21 @@ typedef struct SDL_CommonEvent
     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
 } SDL_CommonEvent;
 
+/**
+ *  \brief Display state change event data (event.display.*)
+ */
+typedef struct SDL_DisplayEvent
+{
+    Uint32 type;        /**< ::SDL_DISPLAYEVENT */
+    Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
+    Uint32 display;     /**< The associated display index */
+    Uint8 event;        /**< ::SDL_DisplayEventID */
+    Uint8 padding1;
+    Uint8 padding2;
+    Uint8 padding3;
+    Sint32 data1;       /**< event dependent data */
+} SDL_DisplayEvent;
+
 /**
  *  \brief Window state change event data (event.window.*)
  */
@@ -471,6 +492,17 @@ typedef struct SDL_DropEvent
 } SDL_DropEvent;
 
 
+/**
+ *  \brief Sensor event structure (event.sensor.*)
+ */
+typedef struct SDL_SensorEvent
+{
+    Uint32 type;        /**< ::SDL_SENSORUPDATE */
+    Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
+    Sint32 which;       /**< The instance ID of the sensor */
+    float data[6];      /**< Up to 6 values from the sensor - additional values can be queried using SDL_SensorGetData() */
+} SDL_SensorEvent;
+
 /**
  *  \brief The "quit requested" event
  */
@@ -526,6 +558,7 @@ typedef union SDL_Event
 {
     Uint32 type;                    /**< Event type, shared with all events */
     SDL_CommonEvent common;         /**< Common event data */
+    SDL_DisplayEvent display;       /**< Window event data */
     SDL_WindowEvent window;         /**< Window event data */
     SDL_KeyboardEvent key;          /**< Keyboard event data */
     SDL_TextEditingEvent edit;      /**< Text editing event data */
@@ -542,6 +575,7 @@ typedef union SDL_Event
     SDL_ControllerButtonEvent cbutton;  /**< Game Controller button event data */
     SDL_ControllerDeviceEvent cdevice;  /**< Game Controller device event data */
     SDL_AudioDeviceEvent adevice;   /**< Audio device event data */
+    SDL_SensorEvent sensor;         /**< Sensor event data */
     SDL_QuitEvent quit;             /**< Quit request event data */
     SDL_UserEvent user;             /**< Custom event data */
     SDL_SysWMEvent syswm;           /**< System dependent window event data */
@@ -560,6 +594,9 @@ typedef union SDL_Event
     Uint8 padding[56];
 } SDL_Event;
 
+/* Make sure we haven't broken binary compatibility */
+SDL_COMPILE_TIME_ASSERT(SDL_Event, sizeof(SDL_Event) == 56);
+
 
 /* Function prototypes */
 

+ 1 - 1
Engine/lib/sdl/include/SDL_filesystem.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2018 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2019 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages

+ 29 - 1
Engine/lib/sdl/include/SDL_gamecontroller.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2018 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2019 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -175,6 +175,14 @@ extern DECLSPEC SDL_bool SDLCALL SDL_IsGameController(int joystick_index);
  */
 extern DECLSPEC const char *SDLCALL SDL_GameControllerNameForIndex(int joystick_index);
 
+/**
+ *  Get the mapping of a game controller.
+ *  This can be called before any controllers are opened.
+ *
+ *  \return the mapping string.  Must be freed with SDL_free().  Returns NULL if no mapping is available
+ */
+extern DECLSPEC char *SDLCALL SDL_GameControllerMappingForDeviceIndex(int joystick_index);
+
 /**
  *  Open a game controller for use.
  *  The index passed as an argument refers to the N'th game controller on the system.
@@ -196,6 +204,13 @@ extern DECLSPEC SDL_GameController *SDLCALL SDL_GameControllerFromInstanceID(SDL
  */
 extern DECLSPEC const char *SDLCALL SDL_GameControllerName(SDL_GameController *gamecontroller);
 
+/**
+ *  Get the player index of an opened game controller, or -1 if it's not available
+ *
+ *  For XInput controllers this returns the XInput user index.
+ */
+extern DECLSPEC int SDLCALL SDL_GameControllerGetPlayerIndex(SDL_GameController *gamecontroller);
+
 /**
  *  Get the USB vendor ID of an opened controller, if available.
  *  If the vendor ID isn't available this function returns 0.
@@ -345,6 +360,19 @@ SDL_GameControllerGetBindForButton(SDL_GameController *gamecontroller,
 extern DECLSPEC Uint8 SDLCALL SDL_GameControllerGetButton(SDL_GameController *gamecontroller,
                                                           SDL_GameControllerButton button);
 
+/**
+ *  Trigger a rumble effect
+ *  Each call to this function cancels any previous rumble effect, and calling it with 0 intensity stops any rumbling.
+ *
+ *  \param gamecontroller The controller to vibrate
+ *  \param low_frequency_rumble The intensity of the low frequency (left) rumble motor, from 0 to 0xFFFF
+ *  \param high_frequency_rumble The intensity of the high frequency (right) rumble motor, from 0 to 0xFFFF
+ *  \param duration_ms The duration of the rumble effect, in milliseconds
+ *
+ *  \return 0, or -1 if rumble isn't supported on this joystick
+ */
+extern DECLSPEC int SDLCALL SDL_GameControllerRumble(SDL_GameController *gamecontroller, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms);
+
 /**
  *  Close a controller previously opened with SDL_GameControllerOpen().
  */

+ 1 - 1
Engine/lib/sdl/include/SDL_gesture.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2018 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2019 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages

+ 15 - 4
Engine/lib/sdl/include/SDL_haptic.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2018 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2019 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -117,6 +117,17 @@
 extern "C" {
 #endif /* __cplusplus */
 
+/* FIXME: For SDL 2.1, adjust all the magnitude variables to be Uint16 (0xFFFF).
+ *
+ * At the moment the magnitude variables are mixed between signed/unsigned, and
+ * it is also not made clear that ALL of those variables expect a max of 0x7FFF.
+ *
+ * Some platforms may have higher precision than that (Linux FF, Windows XInput)
+ * so we should fix the inconsistency in favor of higher possible precision,
+ * adjusting for platforms that use different scales.
+ * -flibit
+ */
+
 /**
  *  \typedef SDL_Haptic
  *
@@ -656,8 +667,8 @@ typedef struct SDL_HapticRamp
  * This struct is exclusively for the ::SDL_HAPTIC_LEFTRIGHT effect.
  *
  * The Left/Right effect is used to explicitly control the large and small
- * motors, commonly found in modern game controllers. One motor is high
- * frequency, the other is low frequency.
+ * motors, commonly found in modern game controllers. The small (right) motor
+ * is high frequency, and the large (left) motor is low frequency.
  *
  * \sa SDL_HAPTIC_LEFTRIGHT
  * \sa SDL_HapticEffect
@@ -668,7 +679,7 @@ typedef struct SDL_HapticLeftRight
     Uint16 type;            /**< ::SDL_HAPTIC_LEFTRIGHT */
 
     /* Replay */
-    Uint32 length;          /**< Duration of the effect. */
+    Uint32 length;          /**< Duration of the effect in milliseconds. */
 
     /* Rumble */
     Uint16 large_magnitude; /**< Control of the large controller motor. */

+ 252 - 8
Engine/lib/sdl/include/SDL_hints.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2018 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2019 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -262,6 +262,16 @@ extern "C" {
  */
 #define SDL_HINT_GRAB_KEYBOARD              "SDL_GRAB_KEYBOARD"
 
+/**
+ *  \brief  A variable setting the double click time, in milliseconds.
+ */
+#define SDL_HINT_MOUSE_DOUBLE_CLICK_TIME    "SDL_MOUSE_DOUBLE_CLICK_TIME"
+
+/**
+ *  \brief  A variable setting the double click radius, in pixels.
+ */
+#define SDL_HINT_MOUSE_DOUBLE_CLICK_RADIUS    "SDL_MOUSE_DOUBLE_CLICK_RADIUS"
+
 /**
  *  \brief  A variable setting the speed scale for mouse motion, in floating point, when the mouse is not in relative mode
  */
@@ -305,6 +315,16 @@ extern "C" {
  */
 #define SDL_HINT_TOUCH_MOUSE_EVENTS    "SDL_TOUCH_MOUSE_EVENTS"
 
+/**
+ *  \brief  A variable controlling whether mouse events should generate synthetic touch events
+ *
+ *  This variable can be set to the following values:
+ *    "0"       - Mouse events will not generate touch events (default for desktop platforms)
+ *    "1"       - Mouse events will generate touch events (default for mobile platforms, such as Android and iOS)
+ */
+
+#define SDL_HINT_MOUSE_TOUCH_EVENTS    "SDL_MOUSE_TOUCH_EVENTS"
+
 /**
  *  \brief Minimize your SDL_Window if it loses key focus when in fullscreen mode. Defaults to true.
  *
@@ -329,7 +349,7 @@ extern "C" {
 #define SDL_HINT_IDLE_TIMER_DISABLED "SDL_IOS_IDLE_TIMER_DISABLED"
 
 /**
- *  \brief  A variable controlling which orientations are allowed on iOS.
+ *  \brief  A variable controlling which orientations are allowed on iOS/Android.
  *
  *  In some circumstances it is necessary to be able to explicitly control
  *  which UI orientations are allowed.
@@ -426,6 +446,16 @@ extern "C" {
  */
 #define SDL_HINT_GAMECONTROLLERCONFIG "SDL_GAMECONTROLLERCONFIG"
 
+/**
+ *  \brief  A variable that lets you provide a file with extra gamecontroller db entries.
+ *
+ *  The file should contain lines of gamecontroller config data, see SDL_gamecontroller.h
+ *
+ *  This hint must be set before calling SDL_Init(SDL_INIT_GAMECONTROLLER)
+ *  You can update mappings after the system is initialized with SDL_GameControllerMappingForGUID() and SDL_GameControllerAddMapping()
+ */
+#define SDL_HINT_GAMECONTROLLERCONFIG_FILE "SDL_GAMECONTROLLERCONFIG_FILE"
+
 /**
  *  \brief  A variable containing a list of devices to skip when scanning for game controllers.
  *
@@ -465,6 +495,88 @@ extern "C" {
  */
 #define SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS "SDL_JOYSTICK_ALLOW_BACKGROUND_EVENTS"
 
+/**
+ *  \brief  A variable controlling whether the HIDAPI joystick drivers should be used.
+ *
+ *  This variable can be set to the following values:
+ *    "0"       - HIDAPI drivers are not used
+ *    "1"       - HIDAPI drivers are used (the default)
+ *
+ *  This variable is the default for all drivers, but can be overridden by the hints for specific drivers below.
+ */
+#define SDL_HINT_JOYSTICK_HIDAPI "SDL_JOYSTICK_HIDAPI"
+
+/**
+ *  \brief  A variable controlling whether the HIDAPI driver for PS4 controllers should be used.
+ *
+ *  This variable can be set to the following values:
+ *    "0"       - HIDAPI driver is not used
+ *    "1"       - HIDAPI driver is used
+ *
+ *  The default is the value of SDL_HINT_JOYSTICK_HIDAPI
+ */
+#define SDL_HINT_JOYSTICK_HIDAPI_PS4 "SDL_JOYSTICK_HIDAPI_PS4"
+
+/**
+ *  \brief  A variable controlling whether extended input reports should be used for PS4 controllers when using the HIDAPI driver.
+ *
+ *  This variable can be set to the following values:
+ *    "0"       - extended reports are not enabled (the default)
+ *    "1"       - extended reports
+ *
+ *  Extended input reports allow rumble on Bluetooth PS4 controllers, but
+ *  break DirectInput handling for applications that don't use SDL.
+ *
+ *  Once extended reports are enabled, they can not be disabled without
+ *  power cycling the controller.
+ */
+#define SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE "SDL_JOYSTICK_HIDAPI_PS4_RUMBLE"
+
+/**
+ *  \brief  A variable controlling whether the HIDAPI driver for Steam Controllers should be used.
+ *
+ *  This variable can be set to the following values:
+ *    "0"       - HIDAPI driver is not used
+ *    "1"       - HIDAPI driver is used
+ *
+ *  The default is the value of SDL_HINT_JOYSTICK_HIDAPI
+ */
+#define SDL_HINT_JOYSTICK_HIDAPI_STEAM "SDL_JOYSTICK_HIDAPI_STEAM"
+
+/**
+ *  \brief  A variable controlling whether the HIDAPI driver for Nintendo Switch controllers should be used.
+ *
+ *  This variable can be set to the following values:
+ *    "0"       - HIDAPI driver is not used
+ *    "1"       - HIDAPI driver is used
+ *
+ *  The default is the value of SDL_HINT_JOYSTICK_HIDAPI
+ */
+#define SDL_HINT_JOYSTICK_HIDAPI_SWITCH "SDL_JOYSTICK_HIDAPI_SWITCH"
+
+/**
+ *  \brief  A variable controlling whether the HIDAPI driver for XBox controllers should be used.
+ *
+ *  This variable can be set to the following values:
+ *    "0"       - HIDAPI driver is not used
+ *    "1"       - HIDAPI driver is used
+ *
+ *  The default is the value of SDL_HINT_JOYSTICK_HIDAPI
+ */
+#define SDL_HINT_JOYSTICK_HIDAPI_XBOX   "SDL_JOYSTICK_HIDAPI_XBOX"
+
+/**
+ *  \brief  A variable that controls whether Steam Controllers should be exposed using the SDL joystick and game controller APIs
+ *
+ *  The variable can be set to the following values:
+ *    "0"       - Do not scan for Steam Controllers
+ *    "1"       - Scan for Steam Controllers (the default)
+ *
+ *  The default value is "1".  This hint must be set before initializing the joystick subsystem.
+ */
+#define SDL_HINT_ENABLE_STEAM_CONTROLLERS "SDL_ENABLE_STEAM_CONTROLLERS"
+
+
 /**
  *  \brief If set to "0" then never set the top most bit on a SDL Window, even if the video mode expects it.
  *      This is a debugging aid for developers and not expected to be used by end users. The default is "1"
@@ -527,6 +639,10 @@ extern "C" {
 *  This is specially useful if you build SDL against a non glibc libc library (such as musl) which
 *  provides a relatively small default thread stack size (a few kilobytes versus the default 8MB glibc uses).
 *  Support for this hint is currently available only in the pthread, Windows, and PSP backend.
+*
+*  Instead of this hint, in 2.0.9 and later, you can use
+*  SDL_CreateThreadWithStackSize(). This hint only works with the classic
+*  SDL_CreateThread().
 */
 #define SDL_HINT_THREAD_STACK_SIZE              "SDL_THREAD_STACK_SIZE"
 
@@ -740,17 +856,33 @@ extern "C" {
  */
 #define SDL_HINT_IME_INTERNAL_EDITING "SDL_IME_INTERNAL_EDITING"
 
- /**
- * \brief A variable to control whether mouse and touch events are to be treated together or separately
+/**
+ * \brief A variable to control whether we trap the Android back button to handle it manually.
+ *        This is necessary for the right mouse button to work on some Android devices, or
+ *        to be able to trap the back button for use in your code reliably.  If set to true,
+ *        the back button will show up as an SDL_KEYDOWN / SDL_KEYUP pair with a keycode of 
+ *        SDL_SCANCODE_AC_BACK.
  *
  * The variable can be set to the following values:
- *   "0"       - Mouse events will be handled as touch events, and touch will raise fake mouse
- *               events. This is the behaviour of SDL <= 2.0.3. (default)
- *   "1"       - Mouse events will be handled separately from pure touch events.
+ *   "0"       - Back button will be handled as usual for system. (default)
+ *   "1"       - Back button will be trapped, allowing you to handle the key press
+ *               manually.  (This will also let right mouse click work on systems 
+ *               where the right mouse button functions as back.)
  *
  * The value of this hint is used at runtime, so it can be changed at any time.
  */
-#define SDL_HINT_ANDROID_SEPARATE_MOUSE_AND_TOUCH "SDL_ANDROID_SEPARATE_MOUSE_AND_TOUCH"
+#define SDL_HINT_ANDROID_TRAP_BACK_BUTTON "SDL_ANDROID_TRAP_BACK_BUTTON"
+
+/**
+ * \brief A variable to control whether the event loop will block itself when the app is paused.
+ *
+ * The variable can be set to the following values:
+ *   "0"       - Non blocking.
+ *   "1"       - Blocking. (default)
+ *
+ * The value should be set before SDL is initialized.
+ */
+#define SDL_HINT_ANDROID_BLOCK_ON_PAUSE "SDL_ANDROID_BLOCK_ON_PAUSE"
 
  /**
  * \brief A variable to control whether the return key on the soft keyboard
@@ -930,6 +1062,118 @@ extern "C" {
  */
 #define SDL_HINT_AUDIO_CATEGORY   "SDL_AUDIO_CATEGORY"
 
+/**
+ *  \brief  A variable controlling whether the 2D render API is compatible or efficient.
+ *
+ *  This variable can be set to the following values:
+ *
+ *    "0"     - Don't use batching to make rendering more efficient.
+ *    "1"     - Use batching, but might cause problems if app makes its own direct OpenGL calls.
+ *
+ *  Up to SDL 2.0.9, the render API would draw immediately when requested. Now
+ *  it batches up draw requests and sends them all to the GPU only when forced
+ *  to (during SDL_RenderPresent, when changing render targets, by updating a
+ *  texture that the batch needs, etc). This is significantly more efficient,
+ *  but it can cause problems for apps that expect to render on top of the
+ *  render API's output. As such, SDL will disable batching if a specific
+ *  render backend is requested (since this might indicate that the app is
+ *  planning to use the underlying graphics API directly). This hint can
+ *  be used to explicitly request batching in this instance. It is a contract
+ *  that you will either never use the underlying graphics API directly, or
+ *  if you do, you will call SDL_RenderFlush() before you do so any current
+ *  batch goes to the GPU before your work begins. Not following this contract
+ *  will result in undefined behavior.
+ */
+#define SDL_HINT_RENDER_BATCHING  "SDL_RENDER_BATCHING"
+
+
+/**
+ *  \brief  A variable controlling whether SDL logs all events pushed onto its internal queue.
+ *
+ *  This variable can be set to the following values:
+ *
+ *    "0"     - Don't log any events (default)
+ *    "1"     - Log all events except mouse and finger motion, which are pretty spammy.
+ *    "2"     - Log all events.
+ *
+ *  This is generally meant to be used to debug SDL itself, but can be useful
+ *  for application developers that need better visibility into what is going
+ *  on in the event queue. Logged events are sent through SDL_Log(), which
+ *  means by default they appear on stdout on most platforms or maybe
+ *  OutputDebugString() on Windows, and can be funneled by the app with
+ *  SDL_LogSetOutputFunction(), etc.
+ *
+ *  This hint can be toggled on and off at runtime, if you only need to log
+ *  events for a small subset of program execution.
+ */
+#define SDL_HINT_EVENT_LOGGING   "SDL_EVENT_LOGGING"
+
+
+
+/**
+ *  \brief  Controls how the size of the RIFF chunk affects the loading of a WAVE file.
+ *
+ *  The size of the RIFF chunk (which includes all the sub-chunks of the WAVE
+ *  file) is not always reliable. In case the size is wrong, it's possible to
+ *  just ignore it and step through the chunks until a fixed limit is reached.
+ *
+ *  Note that files that have trailing data unrelated to the WAVE file or
+ *  corrupt files may slow down the loading process without a reliable boundary.
+ *  By default, SDL stops after 10000 chunks to prevent wasting time. Use the
+ *  environment variable SDL_WAVE_CHUNK_LIMIT to adjust this value.
+ *
+ *  This variable can be set to the following values:
+ *
+ *    "force"        - Always use the RIFF chunk size as a boundary for the chunk search
+ *    "ignorezero"   - Like "force", but a zero size searches up to 4 GiB (default)
+ *    "ignore"       - Ignore the RIFF chunk size and always search up to 4 GiB
+ *    "maximum"      - Search for chunks until the end of file (not recommended)
+ */
+#define SDL_HINT_WAVE_RIFF_CHUNK_SIZE   "SDL_WAVE_RIFF_CHUNK_SIZE"
+
+/**
+ *  \brief  Controls how a truncated WAVE file is handled.
+ *
+ *  A WAVE file is considered truncated if any of the chunks are incomplete or
+ *  the data chunk size is not a multiple of the block size. By default, SDL
+ *  decodes until the first incomplete block, as most applications seem to do.
+ *
+ *  This variable can be set to the following values:
+ *
+ *    "verystrict" - Raise an error if the file is truncated
+ *    "strict"     - Like "verystrict", but the size of the RIFF chunk is ignored
+ *    "dropframe"  - Decode until the first incomplete sample frame
+ *    "dropblock"  - Decode until the first incomplete block (default)
+ */
+#define SDL_HINT_WAVE_TRUNCATION   "SDL_WAVE_TRUNCATION"
+
+/**
+ *  \brief  Controls how the fact chunk affects the loading of a WAVE file.
+ *
+ *  The fact chunk stores information about the number of samples of a WAVE
+ *  file. The Standards Update from Microsoft notes that this value can be used
+ *  to 'determine the length of the data in seconds'. This is especially useful
+ *  for compressed formats (for which this is a mandatory chunk) if they produce
+ *  multiple sample frames per block and truncating the block is not allowed.
+ *  The fact chunk can exactly specify how many sample frames there should be
+ *  in this case.
+ *
+ *  Unfortunately, most application seem to ignore the fact chunk and so SDL
+ *  ignores it by default as well.
+ *
+ *  This variable can be set to the following values:
+ *
+ *    "truncate"    - Use the number of samples to truncate the wave data if
+ *                    the fact chunk is present and valid
+ *    "strict"      - Like "truncate", but raise an error if the fact chunk
+ *                    is invalid, not present for non-PCM formats, or if the
+ *                    data chunk doesn't have that many samples
+ *    "ignorezero"  - Like "truncate", but ignore fact chunk if the number of
+ *                    samples is zero
+ *    "ignore"      - Ignore fact chunk entirely (default)
+ */
+#define SDL_HINT_WAVE_FACT_CHUNK   "SDL_WAVE_FACT_CHUNK"
+
 /**
  *  \brief  An enumeration of hint priorities
  */

+ 31 - 5
Engine/lib/sdl/include/SDL_joystick.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2018 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2019 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -97,10 +97,10 @@ typedef enum
 typedef enum
 {
     SDL_JOYSTICK_POWER_UNKNOWN = -1,
-    SDL_JOYSTICK_POWER_EMPTY,
-    SDL_JOYSTICK_POWER_LOW,
-    SDL_JOYSTICK_POWER_MEDIUM,
-    SDL_JOYSTICK_POWER_FULL,
+    SDL_JOYSTICK_POWER_EMPTY,   /* <= 5% */
+    SDL_JOYSTICK_POWER_LOW,     /* <= 20% */
+    SDL_JOYSTICK_POWER_MEDIUM,  /* <= 70% */
+    SDL_JOYSTICK_POWER_FULL,    /* <= 100% */
     SDL_JOYSTICK_POWER_WIRED,
     SDL_JOYSTICK_POWER_MAX
 } SDL_JoystickPowerLevel;
@@ -132,6 +132,12 @@ extern DECLSPEC int SDLCALL SDL_NumJoysticks(void);
  */
 extern DECLSPEC const char *SDLCALL SDL_JoystickNameForIndex(int device_index);
 
+/**
+ *  Get the player index of a joystick, or -1 if it's not available
+ *  This can be called before any joysticks are opened.
+ */
+extern DECLSPEC int SDLCALL SDL_JoystickGetDevicePlayerIndex(int device_index);
+
 /**
  *  Return the GUID for the joystick at this index
  *  This can be called before any joysticks are opened.
@@ -194,6 +200,13 @@ extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickFromInstanceID(SDL_JoystickID
  */
 extern DECLSPEC const char *SDLCALL SDL_JoystickName(SDL_Joystick * joystick);
 
+/**
+ *  Get the player index of an opened joystick, or -1 if it's not available
+ *
+ *  For XInput controllers this returns the XInput user index.
+ */
+extern DECLSPEC int SDLCALL SDL_JoystickGetPlayerIndex(SDL_Joystick * joystick);
+
 /**
  *  Return the GUID for this opened joystick
  */
@@ -361,6 +374,19 @@ extern DECLSPEC int SDLCALL SDL_JoystickGetBall(SDL_Joystick * joystick,
 extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetButton(SDL_Joystick * joystick,
                                                     int button);
 
+/**
+ *  Trigger a rumble effect
+ *  Each call to this function cancels any previous rumble effect, and calling it with 0 intensity stops any rumbling.
+ *
+ *  \param joystick The joystick to vibrate
+ *  \param low_frequency_rumble The intensity of the low frequency (left) rumble motor, from 0 to 0xFFFF
+ *  \param high_frequency_rumble The intensity of the high frequency (right) rumble motor, from 0 to 0xFFFF
+ *  \param duration_ms The duration of the rumble effect, in milliseconds
+ *
+ *  \return 0, or -1 if rumble isn't supported on this joystick
+ */
+extern DECLSPEC int SDLCALL SDL_JoystickRumble(SDL_Joystick * joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms);
+
 /**
  *  Close a joystick previously opened with SDL_JoystickOpen().
  */

+ 1 - 1
Engine/lib/sdl/include/SDL_keyboard.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2018 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2019 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages

+ 1 - 1
Engine/lib/sdl/include/SDL_keycode.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2018 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2019 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages

+ 1 - 1
Engine/lib/sdl/include/SDL_loadso.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2018 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2019 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages

+ 1 - 1
Engine/lib/sdl/include/SDL_log.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2018 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2019 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages

+ 28 - 16
Engine/lib/sdl/include/SDL_main.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2018 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2019 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -55,6 +55,10 @@
 /* On iOS SDL provides a main function that creates an application delegate
    and starts the iOS application run loop.
 
+   If you link with SDL dynamically on iOS, the main function can't be in a
+   shared library, so you need to link with libSDLmain.a, which includes a
+   stub main function that calls into the shared library to start execution.
+
    See src/video/uikit/SDL_uikitappdelegate.m for more details.
  */
 #define SDL_MAIN_NEEDED
@@ -82,12 +86,6 @@
 #endif
 #endif /* SDL_MAIN_HANDLED */
 
-#ifdef __cplusplus
-#define C_LINKAGE   "C"
-#else
-#define C_LINKAGE
-#endif /* __cplusplus */
-
 #ifndef SDLMAIN_DECLSPEC
 #define SDLMAIN_DECLSPEC
 #endif
@@ -111,17 +109,18 @@
 #define main    SDL_main
 #endif
 
-/**
- *  The prototype for the application's main() function
- */
-extern C_LINKAGE SDLMAIN_DECLSPEC int SDL_main(int argc, char *argv[]);
-
-
 #include "begin_code.h"
 #ifdef __cplusplus
 extern "C" {
 #endif
 
+/**
+ *  The prototype for the application's main() function
+ */
+typedef int (*SDL_main_func)(int argc, char *argv[]);
+extern SDLMAIN_DECLSPEC int SDL_main(int argc, char *argv[]);
+
+
 /**
  *  This is called by the real SDL main function to let the rest of the
  *  library know that initialization was done properly.
@@ -136,8 +135,7 @@ extern DECLSPEC void SDLCALL SDL_SetMainReady(void);
 /**
  *  This can be called to set the application class at startup
  */
-extern DECLSPEC int SDLCALL SDL_RegisterApp(char *name, Uint32 style,
-                                            void *hInst);
+extern DECLSPEC int SDLCALL SDL_RegisterApp(char *name, Uint32 style, void *hInst);
 extern DECLSPEC void SDLCALL SDL_UnregisterApp(void);
 
 #endif /* __WIN32__ */
@@ -153,10 +151,24 @@ extern DECLSPEC void SDLCALL SDL_UnregisterApp(void);
  *  \return 0 on success, -1 on failure.  On failure, use SDL_GetError to retrieve more
  *      information on the failure.
  */
-extern DECLSPEC int SDLCALL SDL_WinRTRunApp(int (*mainFunction)(int, char **), void * reserved);
+extern DECLSPEC int SDLCALL SDL_WinRTRunApp(SDL_main_func mainFunction, void * reserved);
 
 #endif /* __WINRT__ */
 
+#if defined(__IPHONEOS__)
+
+/**
+ *  \brief Initializes and launches an SDL application.
+ *
+ *  \param argc The argc parameter from the application's main() function
+ *  \param argv The argv parameter from the application's main() function
+ *  \param mainFunction The SDL app's C-style main().
+ *  \return the return value from mainFunction
+ */
+extern DECLSPEC int SDLCALL SDL_UIKitRunApp(int argc, char *argv[], SDL_main_func mainFunction);
+
+#endif /* __IPHONEOS__ */
+
 
 #ifdef __cplusplus
 }

+ 1 - 1
Engine/lib/sdl/include/SDL_messagebox.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2018 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2019 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages

+ 1 - 1
Engine/lib/sdl/include/SDL_mouse.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2018 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2019 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages

+ 1 - 1
Engine/lib/sdl/include/SDL_mutex.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2018 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2019 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages

+ 1 - 1
Engine/lib/sdl/include/SDL_name.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2018 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2019 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages

+ 1 - 1
Engine/lib/sdl/include/SDL_opengl.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2018 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2019 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages

+ 1 - 1
Engine/lib/sdl/include/SDL_opengles.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2018 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2019 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages

+ 1 - 1
Engine/lib/sdl/include/SDL_opengles2.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2018 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2019 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages

+ 3 - 3
Engine/lib/sdl/include/SDL_pixels.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2018 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2019 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -168,7 +168,7 @@ enum
     ((format) && (SDL_PIXELFLAG(format) != 1))
 
 /* Note: If you modify this list, update SDL_GetPixelFormatName() */
-enum
+typedef enum
 {
     SDL_PIXELFORMAT_UNKNOWN,
     SDL_PIXELFORMAT_INDEX1LSB =
@@ -290,7 +290,7 @@ enum
         SDL_DEFINE_PIXELFOURCC('N', 'V', '2', '1'),
     SDL_PIXELFORMAT_EXTERNAL_OES =      /**< Android video texture format */
         SDL_DEFINE_PIXELFOURCC('O', 'E', 'S', ' ')
-};
+} SDL_PixelFormatEnum;
 
 typedef struct SDL_Color
 {

+ 1 - 1
Engine/lib/sdl/include/SDL_platform.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2018 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2019 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages

+ 1 - 1
Engine/lib/sdl/include/SDL_power.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2018 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2019 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages

+ 1 - 1
Engine/lib/sdl/include/SDL_quit.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2018 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2019 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages

+ 29 - 3
Engine/lib/sdl/include/SDL_rect.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2018 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2019 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -40,7 +40,7 @@ extern "C" {
 #endif
 
 /**
- *  \brief  The structure that defines a point
+ *  \brief  The structure that defines a point (integer)
  *
  *  \sa SDL_EnclosePoints
  *  \sa SDL_PointInRect
@@ -52,7 +52,20 @@ typedef struct SDL_Point
 } SDL_Point;
 
 /**
- *  \brief A rectangle, with the origin at the upper left.
+ *  \brief  The structure that defines a point (floating point)
+ *
+ *  \sa SDL_EnclosePoints
+ *  \sa SDL_PointInRect
+ */
+typedef struct SDL_FPoint
+{
+    float x;
+    float y;
+} SDL_FPoint;
+
+
+/**
+ *  \brief A rectangle, with the origin at the upper left (integer).
  *
  *  \sa SDL_RectEmpty
  *  \sa SDL_RectEquals
@@ -67,6 +80,19 @@ typedef struct SDL_Rect
     int w, h;
 } SDL_Rect;
 
+
+/**
+ *  \brief A rectangle, with the origin at the upper left (floating point).
+ */
+typedef struct SDL_FRect
+{
+    float x;
+    float y;
+    float w;
+    float h;
+} SDL_FRect;
+
+
 /**
  *  \brief Returns true if point resides inside a rectangle.
  */

+ 168 - 1
Engine/lib/sdl/include/SDL_render.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2018 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2019 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -835,6 +835,148 @@ extern DECLSPEC int SDLCALL SDL_RenderCopyEx(SDL_Renderer * renderer,
                                            const SDL_Point *center,
                                            const SDL_RendererFlip flip);
 
+
+/**
+ *  \brief Draw a point on the current rendering target.
+ *
+ *  \param renderer The renderer which should draw a point.
+ *  \param x The x coordinate of the point.
+ *  \param y The y coordinate of the point.
+ *
+ *  \return 0 on success, or -1 on error
+ */
+extern DECLSPEC int SDLCALL SDL_RenderDrawPointF(SDL_Renderer * renderer,
+                                                 float x, float y);
+
+/**
+ *  \brief Draw multiple points on the current rendering target.
+ *
+ *  \param renderer The renderer which should draw multiple points.
+ *  \param points The points to draw
+ *  \param count The number of points to draw
+ *
+ *  \return 0 on success, or -1 on error
+ */
+extern DECLSPEC int SDLCALL SDL_RenderDrawPointsF(SDL_Renderer * renderer,
+                                                  const SDL_FPoint * points,
+                                                  int count);
+
+/**
+ *  \brief Draw a line on the current rendering target.
+ *
+ *  \param renderer The renderer which should draw a line.
+ *  \param x1 The x coordinate of the start point.
+ *  \param y1 The y coordinate of the start point.
+ *  \param x2 The x coordinate of the end point.
+ *  \param y2 The y coordinate of the end point.
+ *
+ *  \return 0 on success, or -1 on error
+ */
+extern DECLSPEC int SDLCALL SDL_RenderDrawLineF(SDL_Renderer * renderer,
+                                                float x1, float y1, float x2, float y2);
+
+/**
+ *  \brief Draw a series of connected lines on the current rendering target.
+ *
+ *  \param renderer The renderer which should draw multiple lines.
+ *  \param points The points along the lines
+ *  \param count The number of points, drawing count-1 lines
+ *
+ *  \return 0 on success, or -1 on error
+ */
+extern DECLSPEC int SDLCALL SDL_RenderDrawLinesF(SDL_Renderer * renderer,
+                                                const SDL_FPoint * points,
+                                                int count);
+
+/**
+ *  \brief Draw a rectangle on the current rendering target.
+ *
+ *  \param renderer The renderer which should draw a rectangle.
+ *  \param rect A pointer to the destination rectangle, or NULL to outline the entire rendering target.
+ *
+ *  \return 0 on success, or -1 on error
+ */
+extern DECLSPEC int SDLCALL SDL_RenderDrawRectF(SDL_Renderer * renderer,
+                                               const SDL_FRect * rect);
+
+/**
+ *  \brief Draw some number of rectangles on the current rendering target.
+ *
+ *  \param renderer The renderer which should draw multiple rectangles.
+ *  \param rects A pointer to an array of destination rectangles.
+ *  \param count The number of rectangles.
+ *
+ *  \return 0 on success, or -1 on error
+ */
+extern DECLSPEC int SDLCALL SDL_RenderDrawRectsF(SDL_Renderer * renderer,
+                                                 const SDL_FRect * rects,
+                                                 int count);
+
+/**
+ *  \brief Fill a rectangle on the current rendering target with the drawing color.
+ *
+ *  \param renderer The renderer which should fill a rectangle.
+ *  \param rect A pointer to the destination rectangle, or NULL for the entire
+ *              rendering target.
+ *
+ *  \return 0 on success, or -1 on error
+ */
+extern DECLSPEC int SDLCALL SDL_RenderFillRectF(SDL_Renderer * renderer,
+                                                const SDL_FRect * rect);
+
+/**
+ *  \brief Fill some number of rectangles on the current rendering target with the drawing color.
+ *
+ *  \param renderer The renderer which should fill multiple rectangles.
+ *  \param rects A pointer to an array of destination rectangles.
+ *  \param count The number of rectangles.
+ *
+ *  \return 0 on success, or -1 on error
+ */
+extern DECLSPEC int SDLCALL SDL_RenderFillRectsF(SDL_Renderer * renderer,
+                                                 const SDL_FRect * rects,
+                                                 int count);
+
+/**
+ *  \brief Copy a portion of the texture to the current rendering target.
+ *
+ *  \param renderer The renderer which should copy parts of a texture.
+ *  \param texture The source texture.
+ *  \param srcrect   A pointer to the source rectangle, or NULL for the entire
+ *                   texture.
+ *  \param dstrect   A pointer to the destination rectangle, or NULL for the
+ *                   entire rendering target.
+ *
+ *  \return 0 on success, or -1 on error
+ */
+extern DECLSPEC int SDLCALL SDL_RenderCopyF(SDL_Renderer * renderer,
+                                            SDL_Texture * texture,
+                                            const SDL_Rect * srcrect,
+                                            const SDL_FRect * dstrect);
+
+/**
+ *  \brief Copy a portion of the source texture to the current rendering target, rotating it by angle around the given center
+ *
+ *  \param renderer The renderer which should copy parts of a texture.
+ *  \param texture The source texture.
+ *  \param srcrect   A pointer to the source rectangle, or NULL for the entire
+ *                   texture.
+ *  \param dstrect   A pointer to the destination rectangle, or NULL for the
+ *                   entire rendering target.
+ *  \param angle    An angle in degrees that indicates the rotation that will be applied to dstrect, rotating it in a clockwise direction
+ *  \param center   A pointer to a point indicating the point around which dstrect will be rotated (if NULL, rotation will be done around dstrect.w/2, dstrect.h/2).
+ *  \param flip     An SDL_RendererFlip value stating which flipping actions should be performed on the texture
+ *
+ *  \return 0 on success, or -1 on error
+ */
+extern DECLSPEC int SDLCALL SDL_RenderCopyExF(SDL_Renderer * renderer,
+                                            SDL_Texture * texture,
+                                            const SDL_Rect * srcrect,
+                                            const SDL_FRect * dstrect,
+                                            const double angle,
+                                            const SDL_FPoint *center,
+                                            const SDL_RendererFlip flip);
+
 /**
  *  \brief Read pixels from the current rendering target.
  *
@@ -876,6 +1018,31 @@ extern DECLSPEC void SDLCALL SDL_DestroyTexture(SDL_Texture * texture);
  */
 extern DECLSPEC void SDLCALL SDL_DestroyRenderer(SDL_Renderer * renderer);
 
+/**
+ *  \brief Force the rendering context to flush any pending commands to the
+ *         underlying rendering API.
+ *
+ *  You do not need to (and in fact, shouldn't) call this function unless
+ *  you are planning to call into OpenGL/Direct3D/Metal/whatever directly
+ *  in addition to using an SDL_Renderer.
+ *
+ *  This is for a very-specific case: if you are using SDL's render API,
+ *  you asked for a specific renderer backend (OpenGL, Direct3D, etc),
+ *  you set SDL_HINT_RENDER_BATCHING to "1", and you plan to make
+ *  OpenGL/D3D/whatever calls in addition to SDL render API calls. If all of
+ *  this applies, you should call SDL_RenderFlush() between calls to SDL's
+ *  render API and the low-level API you're using in cooperation.
+ *
+ *  In all other cases, you can ignore this function. This is only here to
+ *  get maximum performance out of a specific situation. In all other cases,
+ *  SDL will do the right thing, perhaps at a performance loss.
+ *
+ *  This function is first available in SDL 2.0.10, and is not needed in
+ *  2.0.9 and earlier, as earlier versions did not queue rendering commands
+ *  at all, instead flushing them to the OS immediately.
+ */
+extern DECLSPEC int SDLCALL SDL_RenderFlush(SDL_Renderer * renderer);
+
 
 /**
  *  \brief Bind the texture to the current OpenGL/ES/ES2 context for use with

+ 2 - 2
Engine/lib/sdl/include/SDL_revision.h

@@ -1,2 +1,2 @@
-#define SDL_REVISION "hg-11914:f1084c419f33"
-#define SDL_REVISION_NUMBER 11914
+#define SDL_REVISION "hg-12952:bc90ce38f1e2"
+#define SDL_REVISION_NUMBER 12952

+ 50 - 13
Engine/lib/sdl/include/SDL_rwops.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2018 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2019 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -176,19 +176,48 @@ extern DECLSPEC void SDLCALL SDL_FreeRW(SDL_RWops * area);
 #define RW_SEEK_END 2       /**< Seek relative to the end of data */
 
 /**
- *  \name Read/write macros
+ *  Return the size of the file in this rwops, or -1 if unknown
+ */
+extern DECLSPEC Sint64 SDLCALL SDL_RWsize(SDL_RWops *context);
+
+/**
+ *  Seek to \c offset relative to \c whence, one of stdio's whence values:
+ *  RW_SEEK_SET, RW_SEEK_CUR, RW_SEEK_END
  *
- *  Macros to easily read and write from an SDL_RWops structure.
+ *  \return the final offset in the data stream, or -1 on error.
  */
-/* @{ */
-#define SDL_RWsize(ctx)         (ctx)->size(ctx)
-#define SDL_RWseek(ctx, offset, whence) (ctx)->seek(ctx, offset, whence)
-#define SDL_RWtell(ctx)         (ctx)->seek(ctx, 0, RW_SEEK_CUR)
-#define SDL_RWread(ctx, ptr, size, n)   (ctx)->read(ctx, ptr, size, n)
-#define SDL_RWwrite(ctx, ptr, size, n)  (ctx)->write(ctx, ptr, size, n)
-#define SDL_RWclose(ctx)        (ctx)->close(ctx)
-/* @} *//* Read/write macros */
+extern DECLSPEC Sint64 SDLCALL SDL_RWseek(SDL_RWops *context,
+                                          Sint64 offset, int whence);
+
+/**
+ *  Return the current offset in the data stream, or -1 on error.
+ */
+extern DECLSPEC Sint64 SDLCALL SDL_RWtell(SDL_RWops *context);
 
+/**
+ *  Read up to \c maxnum objects each of size \c size from the data
+ *  stream to the area pointed at by \c ptr.
+ *
+ *  \return the number of objects read, or 0 at error or end of file.
+ */
+extern DECLSPEC size_t SDLCALL SDL_RWread(SDL_RWops *context,
+                                          void *ptr, size_t size, size_t maxnum);
+
+/**
+ *  Write exactly \c num objects each of size \c size from the area
+ *  pointed at by \c ptr to data stream.
+ *
+ *  \return the number of objects written, or 0 at error or end of file.
+ */
+extern DECLSPEC size_t SDLCALL SDL_RWwrite(SDL_RWops *context,
+                                           const void *ptr, size_t size, size_t num);
+
+/**
+ *  Close and free an allocated SDL_RWops structure.
+ *
+ *  \return 0 if successful or -1 on write error when flushing data.
+ */
+extern DECLSPEC int SDLCALL SDL_RWclose(SDL_RWops *context);
 
 /**
  *  Load all the data from an SDL data stream.
@@ -209,9 +238,17 @@ extern DECLSPEC void *SDLCALL SDL_LoadFile_RW(SDL_RWops * src, size_t *datasize,
 /**
  *  Load an entire file.
  *
- *  Convenience macro.
+ *  The data is allocated with a zero byte at the end (null terminated)
+ *
+ *  If \c datasize is not NULL, it is filled with the size of the data read.
+ *
+ *  If \c freesrc is non-zero, the stream will be closed after being read.
+ *
+ *  The data should be freed with SDL_free().
+ *
+ *  \return the data, or NULL if there was an error.
  */
-#define SDL_LoadFile(file, datasize)   SDL_LoadFile_RW(SDL_RWFromFile(file, "rb"), datasize, 1)
+extern DECLSPEC void *SDLCALL SDL_LoadFile(const char *file, size_t *datasize);
 
 /**
  *  \name Read endian functions

+ 2 - 2
Engine/lib/sdl/include/SDL_scancode.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2018 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2019 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -38,7 +38,7 @@
  *  SDL_Event structure.
  *
  *  The values in this enumeration are based on the USB usage page standard:
- *  http://www.usb.org/developers/hidpage/Hut1_12v2.pdf
+ *  https://www.usb.org/sites/default/files/documents/hut1_12v2.pdf
  */
 typedef enum
 {

+ 251 - 0
Engine/lib/sdl/include/SDL_sensor.h

@@ -0,0 +1,251 @@
+/*
+  Simple DirectMedia Layer
+  Copyright (C) 1997-2019 Sam Lantinga <[email protected]>
+
+  This software is provided 'as-is', without any express or implied
+  warranty.  In no event will the authors be held liable for any damages
+  arising from the use of this software.
+
+  Permission is granted to anyone to use this software for any purpose,
+  including commercial applications, and to alter it and redistribute it
+  freely, subject to the following restrictions:
+
+  1. The origin of this software must not be misrepresented; you must not
+     claim that you wrote the original software. If you use this software
+     in a product, an acknowledgment in the product documentation would be
+     appreciated but is not required.
+  2. Altered source versions must be plainly marked as such, and must not be
+     misrepresented as being the original software.
+  3. This notice may not be removed or altered from any source distribution.
+*/
+
+/**
+ *  \file SDL_sensor.h
+ *
+ *  Include file for SDL sensor event handling
+ *
+ */
+
+#ifndef SDL_sensor_h_
+#define SDL_sensor_h_
+
+#include "SDL_stdinc.h"
+#include "SDL_error.h"
+
+#include "begin_code.h"
+/* Set up for C function definitions, even when using C++ */
+#ifdef __cplusplus
+/* *INDENT-OFF* */
+extern "C" {
+/* *INDENT-ON* */
+#endif
+
+/**
+ *  \brief SDL_sensor.h
+ *
+ *  In order to use these functions, SDL_Init() must have been called
+ *  with the ::SDL_INIT_SENSOR flag.  This causes SDL to scan the system
+ *  for sensors, and load appropriate drivers.
+ */
+
+struct _SDL_Sensor;
+typedef struct _SDL_Sensor SDL_Sensor;
+
+/**
+ * This is a unique ID for a sensor for the time it is connected to the system,
+ * and is never reused for the lifetime of the application.
+ *
+ * The ID value starts at 0 and increments from there. The value -1 is an invalid ID.
+ */
+typedef Sint32 SDL_SensorID;
+
+/* The different sensors defined by SDL
+ *
+ * Additional sensors may be available, using platform dependent semantics.
+ *
+ * Hare are the additional Android sensors:
+ * https://developer.android.com/reference/android/hardware/SensorEvent.html#values
+ */
+typedef enum
+{
+    SDL_SENSOR_INVALID = -1,    /**< Returned for an invalid sensor */
+    SDL_SENSOR_UNKNOWN,         /**< Unknown sensor type */
+    SDL_SENSOR_ACCEL,           /**< Accelerometer */
+    SDL_SENSOR_GYRO             /**< Gyroscope */
+} SDL_SensorType;
+
+/**
+ * Accelerometer sensor
+ *
+ * The accelerometer returns the current acceleration in SI meters per
+ * second squared. This includes gravity, so a device at rest will have
+ * an acceleration of SDL_STANDARD_GRAVITY straight down.
+ *
+ * values[0]: Acceleration on the x axis
+ * values[1]: Acceleration on the y axis
+ * values[2]: Acceleration on the z axis
+ *
+ * For phones held in portrait mode, the axes are defined as follows:
+ * -X ... +X : left ... right
+ * -Y ... +Y : bottom ... top
+ * -Z ... +Z : farther ... closer
+ * 
+ * The axis data is not changed when the phone is rotated.
+ *
+ * \sa SDL_GetDisplayOrientation()
+ */
+#define SDL_STANDARD_GRAVITY    9.80665f
+
+/**
+ * Gyroscope sensor
+ *
+ * The gyroscope returns the current rate of rotation in radians per second.
+ * The rotation is positive in the counter-clockwise direction. That is,
+ * an observer looking from a positive location on one of the axes would
+ * see positive rotation on that axis when it appeared to be rotating
+ * counter-clockwise.
+ *
+ * values[0]: Angular speed around the x axis
+ * values[1]: Angular speed around the y axis
+ * values[2]: Angular speed around the z axis
+ *
+ * For phones held in portrait mode, the axes are defined as follows:
+ * -X ... +X : left ... right
+ * -Y ... +Y : bottom ... top
+ * -Z ... +Z : farther ... closer
+ * 
+ * The axis data is not changed when the phone is rotated.
+ *
+ * \sa SDL_GetDisplayOrientation()
+ */
+
+/* Function prototypes */
+
+/**
+ *  \brief Count the number of sensors attached to the system right now
+ */
+extern DECLSPEC int SDLCALL SDL_NumSensors(void);
+
+/**
+ *  \brief Get the implementation dependent name of a sensor.
+ *
+ *  This can be called before any sensors are opened.
+ * 
+ *  \return The sensor name, or NULL if device_index is out of range.
+ */
+extern DECLSPEC const char *SDLCALL SDL_SensorGetDeviceName(int device_index);
+
+/**
+ *  \brief Get the type of a sensor.
+ *
+ *  This can be called before any sensors are opened.
+ *
+ *  \return The sensor type, or SDL_SENSOR_INVALID if device_index is out of range.
+ */
+extern DECLSPEC SDL_SensorType SDLCALL SDL_SensorGetDeviceType(int device_index);
+
+/**
+ *  \brief Get the platform dependent type of a sensor.
+ *
+ *  This can be called before any sensors are opened.
+ *
+ *  \return The sensor platform dependent type, or -1 if device_index is out of range.
+ */
+extern DECLSPEC int SDLCALL SDL_SensorGetDeviceNonPortableType(int device_index);
+
+/**
+ *  \brief Get the instance ID of a sensor.
+ *
+ *  This can be called before any sensors are opened.
+ *
+ *  \return The sensor instance ID, or -1 if device_index is out of range.
+ */
+extern DECLSPEC SDL_SensorID SDLCALL SDL_SensorGetDeviceInstanceID(int device_index);
+
+/**
+ *  \brief Open a sensor for use.
+ *
+ *  The index passed as an argument refers to the N'th sensor on the system.
+ *
+ *  \return A sensor identifier, or NULL if an error occurred.
+ */
+extern DECLSPEC SDL_Sensor *SDLCALL SDL_SensorOpen(int device_index);
+
+/**
+ * Return the SDL_Sensor associated with an instance id.
+ */
+extern DECLSPEC SDL_Sensor *SDLCALL SDL_SensorFromInstanceID(SDL_SensorID instance_id);
+
+/**
+ *  \brief Get the implementation dependent name of a sensor.
+ *
+ *  \return The sensor name, or NULL if the sensor is NULL.
+ */
+extern DECLSPEC const char *SDLCALL SDL_SensorGetName(SDL_Sensor *sensor);
+
+/**
+ *  \brief Get the type of a sensor.
+ *
+ *  This can be called before any sensors are opened.
+ *
+ *  \return The sensor type, or SDL_SENSOR_INVALID if the sensor is NULL.
+ */
+extern DECLSPEC SDL_SensorType SDLCALL SDL_SensorGetType(SDL_Sensor *sensor);
+
+/**
+ *  \brief Get the platform dependent type of a sensor.
+ *
+ *  This can be called before any sensors are opened.
+ *
+ *  \return The sensor platform dependent type, or -1 if the sensor is NULL.
+ */
+extern DECLSPEC int SDLCALL SDL_SensorGetNonPortableType(SDL_Sensor *sensor);
+
+/**
+ *  \brief Get the instance ID of a sensor.
+ *
+ *  This can be called before any sensors are opened.
+ *
+ *  \return The sensor instance ID, or -1 if the sensor is NULL.
+ */
+extern DECLSPEC SDL_SensorID SDLCALL SDL_SensorGetInstanceID(SDL_Sensor *sensor);
+
+/**
+ *  Get the current state of an opened sensor.
+ *
+ *  The number of values and interpretation of the data is sensor dependent.
+ *
+ *  \param sensor The sensor to query
+ *  \param data A pointer filled with the current sensor state
+ *  \param num_values The number of values to write to data
+ *
+ *  \return 0 or -1 if an error occurred.
+ */
+extern DECLSPEC int SDLCALL SDL_SensorGetData(SDL_Sensor * sensor, float *data, int num_values);
+
+/**
+ *  Close a sensor previously opened with SDL_SensorOpen()
+ */
+extern DECLSPEC void SDLCALL SDL_SensorClose(SDL_Sensor * sensor);
+
+/**
+ *  Update the current state of the open sensors.
+ *
+ *  This is called automatically by the event loop if sensor events are enabled.
+ *
+ *  This needs to be called from the thread that initialized the sensor subsystem.
+ */
+extern DECLSPEC void SDLCALL SDL_SensorUpdate(void);
+
+
+/* Ends C function definitions when using C++ */
+#ifdef __cplusplus
+/* *INDENT-OFF* */
+}
+/* *INDENT-ON* */
+#endif
+#include "close_code.h"
+
+#endif /* SDL_sensor_h_ */
+
+/* vi: set ts=4 sw=4 expandtab: */

+ 1 - 1
Engine/lib/sdl/include/SDL_shape.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2018 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2019 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages

+ 26 - 24
Engine/lib/sdl/include/SDL_stdinc.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2018 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2019 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -86,6 +86,28 @@
 #ifdef HAVE_FLOAT_H
 # include <float.h>
 #endif
+#if defined(HAVE_ALLOCA) && !defined(alloca)
+# if defined(HAVE_ALLOCA_H)
+#  include <alloca.h>
+# elif defined(__GNUC__)
+#  define alloca __builtin_alloca
+# elif defined(_MSC_VER)
+#  include <malloc.h>
+#  define alloca _alloca
+# elif defined(__WATCOMC__)
+#  include <malloc.h>
+# elif defined(__BORLANDC__)
+#  include <malloc.h>
+# elif defined(__DMC__)
+#  include <stdlib.h>
+# elif defined(__AIX__)
+#pragma alloca
+# elif defined(__MRC__)
+void *alloca(unsigned);
+# else
+char *alloca();
+# endif
+#endif
 
 /**
  *  The number of elements in an array.
@@ -328,28 +350,6 @@ SDL_COMPILE_TIME_ASSERT(enum, sizeof(SDL_DUMMY_ENUM) == sizeof(int));
 extern "C" {
 #endif
 
-#if defined(HAVE_ALLOCA) && !defined(alloca)
-# if defined(HAVE_ALLOCA_H)
-#  include <alloca.h>
-# elif defined(__GNUC__)
-#  define alloca __builtin_alloca
-# elif defined(_MSC_VER)
-#  include <malloc.h>
-#  define alloca _alloca
-# elif defined(__WATCOMC__)
-#  include <malloc.h>
-# elif defined(__BORLANDC__)
-#  include <malloc.h>
-# elif defined(__DMC__)
-#  include <stdlib.h>
-# elif defined(__AIX__)
-#pragma alloca
-# elif defined(__MRC__)
-void *alloca(unsigned);
-# else
-char *alloca();
-# endif
-#endif
 #ifdef HAVE_ALLOCA
 #define SDL_stack_alloc(type, count)    (type*)alloca(sizeof(type)*(count))
 #define SDL_stack_free(data)
@@ -445,12 +445,12 @@ SDL_FORCE_INLINE void SDL_memset4(void *dst, Uint32 val, size_t dwords)
 #endif
 }
 
-
 extern DECLSPEC void *SDLCALL SDL_memcpy(SDL_OUT_BYTECAP(len) void *dst, SDL_IN_BYTECAP(len) const void *src, size_t len);
 
 extern DECLSPEC void *SDLCALL SDL_memmove(SDL_OUT_BYTECAP(len) void *dst, SDL_IN_BYTECAP(len) const void *src, size_t len);
 extern DECLSPEC int SDLCALL SDL_memcmp(const void *s1, const void *s2, size_t len);
 
+extern DECLSPEC wchar_t *SDLCALL SDL_wcsdup(const wchar_t *wstr);
 extern DECLSPEC size_t SDLCALL SDL_wcslen(const wchar_t *wstr);
 extern DECLSPEC size_t SDLCALL SDL_wcslcpy(SDL_OUT_Z_CAP(maxlen) wchar_t *dst, const wchar_t *src, size_t maxlen);
 extern DECLSPEC size_t SDLCALL SDL_wcslcat(SDL_INOUT_Z_CAP(maxlen) wchar_t *dst, const wchar_t *src, size_t maxlen);
@@ -514,6 +514,8 @@ extern DECLSPEC double SDLCALL SDL_copysign(double x, double y);
 extern DECLSPEC float SDLCALL SDL_copysignf(float x, float y);
 extern DECLSPEC double SDLCALL SDL_cos(double x);
 extern DECLSPEC float SDLCALL SDL_cosf(float x);
+extern DECLSPEC double SDLCALL SDL_exp(double x);
+extern DECLSPEC float SDLCALL SDL_expf(float x);
 extern DECLSPEC double SDLCALL SDL_fabs(double x);
 extern DECLSPEC float SDLCALL SDL_fabsf(float x);
 extern DECLSPEC double SDLCALL SDL_floor(double x);

+ 9 - 1
Engine/lib/sdl/include/SDL_surface.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2018 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2019 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -53,6 +53,7 @@ extern "C" {
 #define SDL_PREALLOC        0x00000001  /**< Surface uses preallocated memory */
 #define SDL_RLEACCEL        0x00000002  /**< Surface is RLE encoded */
 #define SDL_DONTFREE        0x00000004  /**< Surface is referenced internally */
+#define SDL_SIMD_ALIGNED    0x00000008  /**< Surface uses aligned memory */
 /* @} *//* Surface flags */
 
 /**
@@ -248,6 +249,13 @@ extern DECLSPEC int SDLCALL SDL_SetSurfaceRLE(SDL_Surface * surface,
 extern DECLSPEC int SDLCALL SDL_SetColorKey(SDL_Surface * surface,
                                             int flag, Uint32 key);
 
+/**
+ *  \brief Returns whether the surface has a color key
+ *
+ *  \return SDL_TRUE if the surface has a color key, or SDL_FALSE if the surface is NULL or has no color key
+ */
+extern DECLSPEC SDL_bool SDLCALL SDL_HasColorKey(SDL_Surface * surface);
+
 /**
  *  \brief Gets the color key (transparent pixel) in a blittable surface.
  *

+ 33 - 1
Engine/lib/sdl/include/SDL_system.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2018 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2019 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -76,6 +76,18 @@ extern DECLSPEC SDL_bool SDLCALL SDL_DXGIGetOutputInfo( int displayIndex, int *a
 #endif /* __WIN32__ */
 
 
+/* Platform specific functions for Linux */
+#ifdef __LINUX__
+
+/**
+   \brief Sets the UNIX nice value for a thread, using setpriority() if possible, and RealtimeKit if available.
+
+   \return 0 on success, or -1 on error.
+ */
+extern DECLSPEC int SDLCALL SDL_LinuxSetThreadPriority(Sint64 threadID, int priority);
+ 
+#endif /* __LINUX__ */
+	
 /* Platform specific functions for iOS */
 #if defined(__IPHONEOS__) && __IPHONEOS__
 
@@ -113,6 +125,21 @@ extern DECLSPEC void * SDLCALL SDL_AndroidGetActivity(void);
  */
 extern DECLSPEC SDL_bool SDLCALL SDL_IsAndroidTV(void);
 
+/**
+   \brief Return true if the application is running on a Chromebook
+ */
+extern DECLSPEC SDL_bool SDLCALL SDL_IsChromebook(void);
+
+/**
+  \brief Return true is the application is running on a Samsung DeX docking station
+ */
+extern DECLSPEC SDL_bool SDLCALL SDL_IsDeXMode(void);
+
+/**
+ \brief Trigger the Android system back button behavior.
+ */
+extern DECLSPEC void SDLCALL SDL_AndroidBackButton(void);
+
 /**
    See the official Android developer guide for more information:
    http://developer.android.com/guide/topics/data/data-storage.html
@@ -236,6 +263,11 @@ extern DECLSPEC SDL_WinRT_DeviceFamily SDLCALL SDL_WinRTGetDeviceFamily();
 
 #endif /* __WINRT__ */
 
+/**
+ \brief Return true if the current device is a tablet.
+ */
+extern DECLSPEC SDL_bool SDLCALL SDL_IsTablet(void);
+
 /* Ends C function definitions when using C++ */
 #ifdef __cplusplus
 }

+ 17 - 14
Engine/lib/sdl/include/SDL_syswm.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2018 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2019 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -33,23 +33,17 @@
 #include "SDL_video.h"
 #include "SDL_version.h"
 
-#include "begin_code.h"
-/* Set up for C function definitions, even when using C++ */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 /**
- *  \file SDL_syswm.h
+ *  \brief SDL_syswm.h
  *
  *  Your application has access to a special type of event ::SDL_SYSWMEVENT,
  *  which contains window-manager specific information and arrives whenever
  *  an unhandled window event occurs.  This event is ignored by default, but
  *  you can enable it with SDL_EventState().
  */
-#ifdef SDL_PROTOTYPES_ONLY
 struct SDL_SysWMinfo;
-#else
+
+#if !defined(SDL_PROTOTYPES_ONLY)
 
 #if defined(SDL_VIDEO_DRIVER_WINDOWS)
 #ifndef WIN32_LEAN_AND_MEAN
@@ -109,7 +103,16 @@ typedef void *EGLSurface;
 #if defined(SDL_VIDEO_DRIVER_VIVANTE)
 #include "SDL_egl.h"
 #endif
+#endif /* SDL_PROTOTYPES_ONLY */
+
+
+#include "begin_code.h"
+/* Set up for C function definitions, even when using C++ */
+#ifdef __cplusplus
+extern "C" {
+#endif
 
+#if !defined(SDL_PROTOTYPES_ONLY)
 /**
  *  These are the various supported windowing subsystems
  */
@@ -122,7 +125,7 @@ typedef enum
     SDL_SYSWM_COCOA,
     SDL_SYSWM_UIKIT,
     SDL_SYSWM_WAYLAND,
-    SDL_SYSWM_MIR,
+    SDL_SYSWM_MIR,  /* no longer available, left for API/ABI compatibility. Remove in 2.1! */
     SDL_SYSWM_WINRT,
     SDL_SYSWM_ANDROID,
     SDL_SYSWM_VIVANTE,
@@ -257,11 +260,11 @@ struct SDL_SysWMinfo
             struct wl_shell_surface *shell_surface; /**< Wayland shell_surface (window manager handle) */
         } wl;
 #endif
-#if defined(SDL_VIDEO_DRIVER_MIR)
+#if defined(SDL_VIDEO_DRIVER_MIR)  /* no longer available, left for API/ABI compatibility. Remove in 2.1! */
         struct
         {
-            struct MirConnection *connection;  /**< Mir display server connection */
-            struct MirSurface *surface;  /**< Mir surface */
+            void *connection;  /**< Mir display server connection */
+            void *surface;  /**< Mir surface */
         } mir;
 #endif
 

+ 1 - 1
Engine/lib/sdl/include/SDL_test.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2018 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2019 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages

+ 1 - 1
Engine/lib/sdl/include/SDL_test_assert.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2018 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2019 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages

+ 22 - 5
Engine/lib/sdl/include/SDL_test_common.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2018 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2019 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -140,14 +140,20 @@ SDLTest_CommonState *SDLTest_CommonCreateState(char **argv, Uint32 flags);
  */
 int SDLTest_CommonArg(SDLTest_CommonState * state, int index);
 
+
 /**
- * \brief Returns common usage information
+ * \brief Logs command line usage info.
  *
- * \param state The common state describing the test window to create.
+ * This logs the appropriate command line options for the subsystems in use
+ *  plus other common options, and then any application-specific options.
+ *  This uses the SDL_Log() function and splits up output to be friendly to
+ *  80-character-wide terminals.
  *
- * \returns String with usage information
+ * \param state The common state describing the test window for the app.
+ * \param argv0 argv[0], as passed to main/SDL_main.
+ * \param options an array of strings for application specific options. The last element of the array should be NULL.
  */
-const char *SDLTest_CommonUsage(SDLTest_CommonState * state);
+void SDLTest_CommonLogUsage(SDLTest_CommonState * state, const char *argv0, const char **options);
 
 /**
  * \brief Open test window.
@@ -158,6 +164,17 @@ const char *SDLTest_CommonUsage(SDLTest_CommonState * state);
  */
 SDL_bool SDLTest_CommonInit(SDLTest_CommonState * state);
 
+/**
+ * \brief Easy argument handling when test app doesn't need any custom args.
+ *
+ * \param state The common state describing the test window to create.
+ * \param argc argc, as supplied to SDL_main
+ * \param argv argv, as supplied to SDL_main
+ *
+ * \returns False if app should quit, true otherwise.
+ */
+SDL_bool SDLTest_CommonDefaultArgs(SDLTest_CommonState * state, const int argc, char **argv);
+
 /**
  * \brief Common event handler for test windows.
  *

+ 1 - 1
Engine/lib/sdl/include/SDL_test_compare.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2018 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2019 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages

+ 1 - 1
Engine/lib/sdl/include/SDL_test_crc32.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2018 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2019 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages

+ 1 - 1
Engine/lib/sdl/include/SDL_test_font.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2018 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2019 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages

+ 1 - 1
Engine/lib/sdl/include/SDL_test_fuzzer.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2018 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2019 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages

+ 1 - 1
Engine/lib/sdl/include/SDL_test_harness.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2018 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2019 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages

+ 1 - 1
Engine/lib/sdl/include/SDL_test_images.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2018 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2019 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages

+ 1 - 1
Engine/lib/sdl/include/SDL_test_log.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2018 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2019 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages

+ 1 - 1
Engine/lib/sdl/include/SDL_test_md5.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2018 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2019 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages

+ 3 - 3
Engine/lib/sdl/include/SDL_test_memory.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2018 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2019 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -42,14 +42,14 @@ extern "C" {
  * 
  * \note This should be called before any other SDL functions for complete tracking coverage
  */
-int SDLTest_TrackAllocations();
+int SDLTest_TrackAllocations(void);
 
 /**
  * \brief Print a log of any outstanding allocations
  *
  * \note This can be called after SDL_Quit()
  */
-void SDLTest_LogAllocations();
+void SDLTest_LogAllocations(void);
 
 
 /* Ends C function definitions when using C++ */

+ 1 - 1
Engine/lib/sdl/include/SDL_test_random.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2018 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2019 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages

+ 39 - 4
Engine/lib/sdl/include/SDL_thread.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2018 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2019 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -54,12 +54,13 @@ typedef unsigned int SDL_TLSID;
 /**
  *  The SDL thread priority.
  *
- *  \note On many systems you require special privileges to set high priority.
+ *  \note On many systems you require special privileges to set high or time critical priority.
  */
 typedef enum {
     SDL_THREAD_PRIORITY_LOW,
     SDL_THREAD_PRIORITY_NORMAL,
-    SDL_THREAD_PRIORITY_HIGH
+    SDL_THREAD_PRIORITY_HIGH,
+    SDL_THREAD_PRIORITY_TIME_CRITICAL
 } SDL_ThreadPriority;
 
 /**
@@ -105,14 +106,24 @@ SDL_CreateThread(SDL_ThreadFunction fn, const char *name, void *data,
                  pfnSDL_CurrentBeginThread pfnBeginThread,
                  pfnSDL_CurrentEndThread pfnEndThread);
 
+extern DECLSPEC SDL_Thread *SDLCALL
+SDL_CreateThreadWithStackSize(int (SDLCALL * fn) (void *),
+                 const char *name, const size_t stacksize, void *data,
+                 pfnSDL_CurrentBeginThread pfnBeginThread,
+                 pfnSDL_CurrentEndThread pfnEndThread);
+
+
 /**
  *  Create a thread.
  */
 #if defined(SDL_CreateThread) && SDL_DYNAMIC_API
 #undef SDL_CreateThread
 #define SDL_CreateThread(fn, name, data) SDL_CreateThread_REAL(fn, name, data, (pfnSDL_CurrentBeginThread)_beginthreadex, (pfnSDL_CurrentEndThread)_endthreadex)
+#undef SDL_CreateThreadWithStackSize
+#define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize_REAL(fn, name, stacksize, data, (pfnSDL_CurrentBeginThread)_beginthreadex, (pfnSDL_CurrentEndThread)_endthreadex)
 #else
 #define SDL_CreateThread(fn, name, data) SDL_CreateThread(fn, name, data, (pfnSDL_CurrentBeginThread)_beginthreadex, (pfnSDL_CurrentEndThread)_endthreadex)
+#define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize(fn, name, data, (pfnSDL_CurrentBeginThread)_beginthreadex, (pfnSDL_CurrentEndThread)_endthreadex)
 #endif
 
 #elif defined(__OS2__)
@@ -132,15 +143,31 @@ extern DECLSPEC SDL_Thread *SDLCALL
 SDL_CreateThread(SDL_ThreadFunction fn, const char *name, void *data,
                  pfnSDL_CurrentBeginThread pfnBeginThread,
                  pfnSDL_CurrentEndThread pfnEndThread);
+extern DECLSPEC SDL_Thread *SDLCALL
+SDL_CreateThreadWithStackSize(SDL_ThreadFunction fn, const char *name, const size_t stacksize, void *data,
+                 pfnSDL_CurrentBeginThread pfnBeginThread,
+                 pfnSDL_CurrentEndThread pfnEndThread);
 #if defined(SDL_CreateThread) && SDL_DYNAMIC_API
 #undef SDL_CreateThread
 #define SDL_CreateThread(fn, name, data) SDL_CreateThread_REAL(fn, name, data, (pfnSDL_CurrentBeginThread)_beginthread, (pfnSDL_CurrentEndThread)_endthread)
+#undef SDL_CreateThreadWithStackSize
+#define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize_REAL(fn, name, data, (pfnSDL_CurrentBeginThread)_beginthread, (pfnSDL_CurrentEndThread)_endthread)
 #else
 #define SDL_CreateThread(fn, name, data) SDL_CreateThread(fn, name, data, (pfnSDL_CurrentBeginThread)_beginthread, (pfnSDL_CurrentEndThread)_endthread)
+#define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize(fn, name, stacksize, data, (pfnSDL_CurrentBeginThread)_beginthread, (pfnSDL_CurrentEndThread)_endthread)
 #endif
 
 #else
 
+/**
+ *  Create a thread with a default stack size.
+ *
+ *  This is equivalent to calling:
+ *  SDL_CreateThreadWithStackSize(fn, name, 0, data);
+ */
+extern DECLSPEC SDL_Thread *SDLCALL
+SDL_CreateThread(SDL_ThreadFunction fn, const char *name, void *data);
+
 /**
  *  Create a thread.
  *
@@ -158,9 +185,17 @@ SDL_CreateThread(SDL_ThreadFunction fn, const char *name, void *data,
  *   If a system imposes requirements, SDL will try to munge the string for
  *    it (truncate, etc), but the original string contents will be available
  *    from SDL_GetThreadName().
+ *
+ *   The size (in bytes) of the new stack can be specified. Zero means "use
+ *    the system default" which might be wildly different between platforms
+ *    (x86 Linux generally defaults to eight megabytes, an embedded device
+ *    might be a few kilobytes instead).
+ *
+ *   In SDL 2.1, stacksize will be folded into the original SDL_CreateThread
+ *    function.
  */
 extern DECLSPEC SDL_Thread *SDLCALL
-SDL_CreateThread(SDL_ThreadFunction fn, const char *name, void *data);
+SDL_CreateThreadWithStackSize(SDL_ThreadFunction fn, const char *name, const size_t stacksize, void *data);
 
 #endif
 

+ 1 - 1
Engine/lib/sdl/include/SDL_timer.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2018 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2019 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages

+ 17 - 1
Engine/lib/sdl/include/SDL_touch.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2018 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2019 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -41,6 +41,14 @@ extern "C" {
 typedef Sint64 SDL_TouchID;
 typedef Sint64 SDL_FingerID;
 
+typedef enum
+{
+    SDL_TOUCH_DEVICE_INVALID = -1,
+    SDL_TOUCH_DEVICE_DIRECT,            /* touch screen with window-relative coordinates */
+    SDL_TOUCH_DEVICE_INDIRECT_ABSOLUTE, /* trackpad with absolute device coordinates */
+    SDL_TOUCH_DEVICE_INDIRECT_RELATIVE  /* trackpad with screen cursor-relative coordinates */
+} SDL_TouchDeviceType;
+
 typedef struct SDL_Finger
 {
     SDL_FingerID id;
@@ -52,6 +60,9 @@ typedef struct SDL_Finger
 /* Used as the device ID for mouse events simulated with touch input */
 #define SDL_TOUCH_MOUSEID ((Uint32)-1)
 
+/* Used as the SDL_TouchID for touch events simulated with mouse input */
+#define SDL_MOUSE_TOUCHID ((Sint64)-1)
+
 
 /* Function prototypes */
 
@@ -65,6 +76,11 @@ extern DECLSPEC int SDLCALL SDL_GetNumTouchDevices(void);
  */
 extern DECLSPEC SDL_TouchID SDLCALL SDL_GetTouchDevice(int index);
 
+/**
+ * \brief Get the type of the given touch device.
+ */
+extern DECLSPEC SDL_TouchDeviceType SDLCALL SDL_GetTouchDeviceType(SDL_TouchID touchID);
+
 /**
  *  \brief Get the number of active fingers for a given touch device.
  */

Unele fișiere nu au fost afișate deoarece prea multe fișiere au fost modificate în acest diff