Mark a subsystem as dummy, not disabled, if it was intended to be compiled in.
authorSam Lantinga <slouken@libsdl.org>
Fri, 28 Sep 2018 21:19:27 -0700
changeset 12258231245d461a2
parent 12257 d7a3aac08fc1
child 12259 c63a539aae19
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".
CMakeLists.txt
configure
configure.in
     1.1 --- a/CMakeLists.txt	Fri Sep 28 21:03:39 2018 -0700
     1.2 +++ b/CMakeLists.txt	Fri Sep 28 21:19:27 2018 -0700
     1.3 @@ -1565,7 +1565,7 @@
     1.4  # This leads to missing internal references on building, since the
     1.5  # src/X/*.c does not get included.
     1.6  if(NOT HAVE_SDL_JOYSTICK)
     1.7 -  set(SDL_JOYSTICK_DISABLED 1)
     1.8 +  set(SDL_JOYSTICK_DUMMY 1)
     1.9    if(SDL_JOYSTICK AND NOT APPLE) # results in unresolved symbols on OSX
    1.10  
    1.11      file(GLOB JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/dummy/*.c)
    1.12 @@ -1573,10 +1573,15 @@
    1.13    endif()
    1.14  endif()
    1.15  if(NOT HAVE_SDL_HAPTIC)
    1.16 -  set(SDL_HAPTIC_DISABLED 1)
    1.17 +  set(SDL_HAPTIC_DUMMY 1)
    1.18    file(GLOB HAPTIC_SOURCES ${SDL2_SOURCE_DIR}/src/haptic/dummy/*.c)
    1.19    set(SOURCE_FILES ${SOURCE_FILES} ${HAPTIC_SOURCES})
    1.20  endif()
    1.21 +if(NOT HAVE_SDL_SENSORS)
    1.22 +  set(SDL_SENSOR_DUMMY 1)
    1.23 +  file(GLOB SENSORS_SOURCES ${SDL2_SOURCE_DIR}/src/sensor/dummy/*.c)
    1.24 +  set(SOURCE_FILES ${SOURCE_FILES} ${SENSORS_SOURCES})
    1.25 +endif()
    1.26  if(NOT HAVE_SDL_LOADSO)
    1.27    set(SDL_LOADSO_DISABLED 1)
    1.28    file(GLOB LOADSO_SOURCES ${SDL2_SOURCE_DIR}/src/loadso/dummy/*.c)
    1.29 @@ -1587,11 +1592,6 @@
    1.30    file(GLOB FILESYSTEM_SOURCES ${SDL2_SOURCE_DIR}/src/filesystem/dummy/*.c)
    1.31    set(SOURCE_FILES ${SOURCE_FILES} ${FILESYSTEM_SOURCES})
    1.32  endif()
    1.33 -if(NOT HAVE_SDL_SENSORS)
    1.34 -  set(SDL_SENSOR_DISABLED 1)
    1.35 -  file(GLOB SENSORS_SOURCES ${SDL2_SOURCE_DIR}/src/sensor/dummy/*.c)
    1.36 -  set(SOURCE_FILES ${SOURCE_FILES} ${SENSORS_SOURCES})
    1.37 -endif()
    1.38  
    1.39  # We always need to have threads and timers around
    1.40  if(NOT HAVE_SDL_THREADS)
     2.1 --- a/configure	Fri Sep 28 21:03:39 2018 -0700
     2.2 +++ b/configure	Fri Sep 28 21:19:27 2018 -0700
     2.3 @@ -24819,7 +24819,7 @@
     2.4  if test x$have_joystick != xyes; then
     2.5      if test x$enable_joystick = xyes; then
     2.6  
     2.7 -$as_echo "#define SDL_JOYSTICK_DISABLED 1" >>confdefs.h
     2.8 +$as_echo "#define SDL_JOYSTICK_DUMMY 1" >>confdefs.h
     2.9  
    2.10      fi
    2.11      SOURCES="$SOURCES $srcdir/src/joystick/dummy/*.c"
    2.12 @@ -24827,7 +24827,7 @@
    2.13  if test x$have_haptic != xyes; then
    2.14      if test x$enable_haptic = xyes; then
    2.15  
    2.16 -$as_echo "#define SDL_HAPTIC_DISABLED 1" >>confdefs.h
    2.17 +$as_echo "#define SDL_HAPTIC_DUMMY 1" >>confdefs.h
    2.18  
    2.19      fi
    2.20      SOURCES="$SOURCES $srcdir/src/haptic/dummy/*.c"
    2.21 @@ -24835,7 +24835,7 @@
    2.22  if test x$have_sensor != xyes; then
    2.23      if test x$enable_sensor = xyes; then
    2.24  
    2.25 -$as_echo "#define SDL_SENSOR_DISABLED 1" >>confdefs.h
    2.26 +$as_echo "#define SDL_SENSOR_DUMMY 1" >>confdefs.h
    2.27  
    2.28      fi
    2.29      SOURCES="$SOURCES $srcdir/src/sensor/dummy/*.c"
     3.1 --- a/configure.in	Fri Sep 28 21:03:39 2018 -0700
     3.2 +++ b/configure.in	Fri Sep 28 21:19:27 2018 -0700
     3.3 @@ -4012,19 +4012,19 @@
     3.4  
     3.5  if test x$have_joystick != xyes; then
     3.6      if test x$enable_joystick = xyes; then
     3.7 -        AC_DEFINE(SDL_JOYSTICK_DISABLED, 1, [ ])
     3.8 +        AC_DEFINE(SDL_JOYSTICK_DUMMY, 1, [ ])
     3.9      fi
    3.10      SOURCES="$SOURCES $srcdir/src/joystick/dummy/*.c"
    3.11  fi
    3.12  if test x$have_haptic != xyes; then
    3.13      if test x$enable_haptic = xyes; then
    3.14 -        AC_DEFINE(SDL_HAPTIC_DISABLED, 1, [ ])
    3.15 +        AC_DEFINE(SDL_HAPTIC_DUMMY, 1, [ ])
    3.16      fi
    3.17      SOURCES="$SOURCES $srcdir/src/haptic/dummy/*.c"
    3.18  fi
    3.19  if test x$have_sensor != xyes; then
    3.20      if test x$enable_sensor = xyes; then
    3.21 -        AC_DEFINE(SDL_SENSOR_DISABLED, 1, [ ])
    3.22 +        AC_DEFINE(SDL_SENSOR_DUMMY, 1, [ ])
    3.23      fi
    3.24      SOURCES="$SOURCES $srcdir/src/sensor/dummy/*.c"
    3.25  fi