[Commits] SDL: Mark a subsystem as dummy, not disabled, if it was intended...

libsdl.org revision control commits-owner at libsdl.org
Fri Sep 28 21:19:32 PDT 2018


details:   https://hg.libsdl.org/SDL/rev/231245d461a2
changeset: 12258:231245d461a2
user:      Sam Lantinga <slouken at libsdl.org>
date:      Fri Sep 28 21:19:27 2018 -0700
description:
Mark a subsystem as dummy, not disabled, if it was intended to be compiled in.

>From Tom Black:

I'm having problems initializing the sensor module. I'm compiling with a standard ./configure && make && sudo make install, and the module says it's enabled, but SDL_Init(SDL_INIT_EVERYTHING) is failing with SDL_GetError() returning "SDL not built with sensor support".

diffstat:

 CMakeLists.txt |  14 +++++++-------
 configure      |   6 +++---
 configure.in   |   6 +++---
 3 files changed, 13 insertions(+), 13 deletions(-)

diffs (97 lines):

diff -r d7a3aac08fc1 -r 231245d461a2 CMakeLists.txt
--- a/CMakeLists.txt	Fri Sep 28 21:03:39 2018 -0700
+++ b/CMakeLists.txt	Fri Sep 28 21:19:27 2018 -0700
@@ -1565,7 +1565,7 @@
 # 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)
@@ -1573,10 +1573,15 @@
   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)
@@ -1587,11 +1592,6 @@
   file(GLOB FILESYSTEM_SOURCES ${SDL2_SOURCE_DIR}/src/filesystem/dummy/*.c)
   set(SOURCE_FILES ${SOURCE_FILES} ${FILESYSTEM_SOURCES})
 endif()
-if(NOT HAVE_SDL_SENSORS)
-  set(SDL_SENSOR_DISABLED 1)
-  file(GLOB SENSORS_SOURCES ${SDL2_SOURCE_DIR}/src/sensor/dummy/*.c)
-  set(SOURCE_FILES ${SOURCE_FILES} ${SENSORS_SOURCES})
-endif()
 
 # We always need to have threads and timers around
 if(NOT HAVE_SDL_THREADS)
diff -r d7a3aac08fc1 -r 231245d461a2 configure
--- a/configure	Fri Sep 28 21:03:39 2018 -0700
+++ b/configure	Fri Sep 28 21:19:27 2018 -0700
@@ -24819,7 +24819,7 @@
 if test x$have_joystick != xyes; then
     if test x$enable_joystick = xyes; then
 
-$as_echo "#define SDL_JOYSTICK_DISABLED 1" >>confdefs.h
+$as_echo "#define SDL_JOYSTICK_DUMMY 1" >>confdefs.h
 
     fi
     SOURCES="$SOURCES $srcdir/src/joystick/dummy/*.c"
@@ -24827,7 +24827,7 @@
 if test x$have_haptic != xyes; then
     if test x$enable_haptic = xyes; then
 
-$as_echo "#define SDL_HAPTIC_DISABLED 1" >>confdefs.h
+$as_echo "#define SDL_HAPTIC_DUMMY 1" >>confdefs.h
 
     fi
     SOURCES="$SOURCES $srcdir/src/haptic/dummy/*.c"
@@ -24835,7 +24835,7 @@
 if test x$have_sensor != xyes; then
     if test x$enable_sensor = xyes; then
 
-$as_echo "#define SDL_SENSOR_DISABLED 1" >>confdefs.h
+$as_echo "#define SDL_SENSOR_DUMMY 1" >>confdefs.h
 
     fi
     SOURCES="$SOURCES $srcdir/src/sensor/dummy/*.c"
diff -r d7a3aac08fc1 -r 231245d461a2 configure.in
--- a/configure.in	Fri Sep 28 21:03:39 2018 -0700
+++ b/configure.in	Fri Sep 28 21:19:27 2018 -0700
@@ -4012,19 +4012,19 @@
 
 if test x$have_joystick != xyes; then
     if test x$enable_joystick = xyes; then
-        AC_DEFINE(SDL_JOYSTICK_DISABLED, 1, [ ])
+        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_DISABLED, 1, [ ])
+        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_DISABLED, 1, [ ])
+        AC_DEFINE(SDL_SENSOR_DUMMY, 1, [ ])
     fi
     SOURCES="$SOURCES $srcdir/src/sensor/dummy/*.c"
 fi


More information about the commits mailing list