sync handling of subsystems - add DUMMY-define in case the subsystem is enabled but not available (filesystem/misc/locale) - add missing PSP/VITA-filesystem defines - sync the order of filesystems in SDL_config.h.cmake/in - add option to disable locale subsystem in configure
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5e0895e..20119d7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2568,19 +2568,19 @@ if(NOT HAVE_SDL_LOADSO)
set(SOURCE_FILES ${SOURCE_FILES} ${LOADSO_SOURCES})
endif()
if(NOT HAVE_SDL_FILESYSTEM)
- set(SDL_FILESYSTEM_DISABLED 1)
+ set(SDL_FILESYSTEM_DUMMY 1)
file(GLOB FILESYSTEM_SOURCES ${SDL2_SOURCE_DIR}/src/filesystem/dummy/*.c)
set(SOURCE_FILES ${SOURCE_FILES} ${FILESYSTEM_SOURCES})
endif()
if(NOT HAVE_SDL_LOCALE)
- set(SDL_LOCALE_DISABLED 1)
+ set(SDL_LOCALE_DUMMY 1)
file(GLOB LOCALE_SOURCES ${SDL2_SOURCE_DIR}/src/locale/dummy/*.c)
set(SOURCE_FILES ${SOURCE_FILES} ${LOCALE_SOURCES})
endif()
if(NOT HAVE_SDL_MISC)
- set(SDL_MISC_DISABLED 1)
- file(GLOB LOCALE_SOURCES ${SDL2_SOURCE_DIR}/src/misc/dummy/*.c)
- set(SOURCE_FILES ${SOURCE_FILES} ${LOCALE_SOURCES})
+ set(SDL_MISC_DUMMY 1)
+ file(GLOB MISC_SOURCES ${SDL2_SOURCE_DIR}/src/misc/dummy/*.c)
+ set(SOURCE_FILES ${SOURCE_FILES} ${MISC_SOURCES})
endif()
# We always need to have threads and timers around
diff --git a/configure b/configure
index f0f27a2..70f786c 100755
--- a/configure
+++ b/configure
@@ -823,6 +823,7 @@ enable_threads
enable_timers
enable_file
enable_misc
+enable_locale
enable_loadso
enable_cpuinfo
enable_assembly
@@ -1601,6 +1602,7 @@ Optional Features:
--enable-timers Enable the timer subsystem [default=yes]
--enable-file Enable the file subsystem [default=yes]
--enable-misc Enable the misc subsystem [default=yes]
+ --enable-locale Enable the locale subsystem [default=yes]
--enable-loadso Enable the shared object loading subsystem
[default=yes]
--enable-cpuinfo Enable the cpuinfo subsystem [default=yes]
@@ -18116,6 +18118,20 @@ $as_echo "#define SDL_MISC_DISABLED 1" >>confdefs.h
else
SUMMARY_modules="${SUMMARY_modules} misc"
fi
+# Check whether --enable-locale was given.
+if test "${enable_locale+set}" = set; then :
+ enableval=$enable_locale;
+else
+ enable_locale=yes
+fi
+
+if test x$enable_locale != xyes; then
+
+$as_echo "#define SDL_LOCALE_DISABLED 1" >>confdefs.h
+
+else
+ SUMMARY_modules="${SUMMARY_modules} locale"
+fi
# Check whether --enable-threads was given.
if test "${enable_threads+set}" = set; then :
enableval=$enable_threads;
@@ -25839,10 +25855,11 @@ $as_echo "#define SDL_VIDEO_DRIVER_ANDROID 1" >>confdefs.h
SOURCES="$SOURCES $srcdir/src/misc/unix/*.c"
have_misc=yes
fi
-
- SOURCES="$SOURCES $srcdir/src/locale/unix/*.c"
- have_locale=yes
-
+ # Set up files for the locale library
+ if test x$enable_locale = xyes; then
+ SOURCES="$SOURCES $srcdir/src/locale/unix/*.c"
+ have_locale=yes
+ fi
# Set up files for the audio library
if test x$enable_audio = xyes; then
case $ARCH in
@@ -26060,9 +26077,10 @@ $as_echo "#define SDL_TIMER_UNIX 1" >>confdefs.h
have_misc=yes
fi
# Use the Windows locale APIs.
- SOURCES="$SOURCES $srcdir/src/locale/windows/*.c"
- have_locale=yes
-
+ if test x$enable_locale = xyes; then
+ SOURCES="$SOURCES $srcdir/src/locale/windows/*.c"
+ have_locale=yes
+ fi
# Set up files for the video library
if test x$enable_video = xyes; then
@@ -26351,9 +26369,10 @@ $as_echo "#define SDL_FILESYSTEM_HAIKU 1" >>confdefs.h
have_misc=yes
fi
# Set up files for the locale library
- SOURCES="$SOURCES $srcdir/src/locale/haiku/*.cc"
- have_locale=yes
-
+ if test x$enable_locale = xyes; then
+ SOURCES="$SOURCES $srcdir/src/locale/haiku/*.cc"
+ have_locale=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"
@@ -26379,9 +26398,10 @@ $as_echo "#define SDL_FILESYSTEM_HAIKU 1" >>confdefs.h
have_misc=yes
fi
# Set up files for the locale library
- SOURCES="$SOURCES $srcdir/src/locale/macosx/*.m"
- have_locale=yes
-
+ if test x$enable_locale = xyes; then
+ SOURCES="$SOURCES $srcdir/src/locale/macosx/*.m"
+ have_locale=yes
+ fi
# Set up files for the audio library
if test x$enable_audio = xyes; then
@@ -26515,9 +26535,10 @@ $as_echo "#define SDL_VIDEO_RENDER_OGL_ES2 1" >>confdefs.h
have_misc=yes
fi
# Set up files for the locale library
- SOURCES="$SOURCES $srcdir/src/locale/macosx/*.m"
- have_locale=yes
-
+ if test x$enable_locale = xyes; then
+ SOURCES="$SOURCES $srcdir/src/locale/macosx/*.m"
+ have_locale=yes
+ fi
# Set up files for the audio library
if test x$enable_audio = xyes; then
@@ -26683,8 +26704,10 @@ $as_echo "#define SDL_TIMER_UNIX 1" >>confdefs.h
have_timers=yes
fi
# Set up files for the locale library
- SOURCES="$SOURCES $srcdir/src/locale/emscripten/*.c"
- have_locale=yes
+ if test x$enable_locale = xyes; then
+ SOURCES="$SOURCES $srcdir/src/locale/emscripten/*.c"
+ have_locale=yes
+ fi
;;
*-*-riscos*)
ARCH=riscos
@@ -26757,8 +26780,10 @@ $as_echo "#define SDL_TIMER_UNIX 1" >>confdefs.h
SOURCES="$SOURCES $srcdir/src/core/os2/geniconv/*.c"
fi
# Use the Unix locale APIs.
- SOURCES="$SOURCES $srcdir/src/locale/unix/*.c"
- have_locale=yes
+ if test x$enable_locale = xyes; then
+ SOURCES="$SOURCES $srcdir/src/locale/unix/*.c"
+ have_locale=yes
+ fi
# Set up files for the video library
if test x$enable_video = xyes; then
@@ -26856,9 +26881,19 @@ INSTALL_SDL2_CONFIG=$enable_sdl2_config
# Verify that we have all the platform specific files we need
if test x$have_misc != xyes; then
+ if test x$enable_misc = xyes; then
+
+$as_echo "#define SDL_MISC_DUMMY 1" >>confdefs.h
+
+ fi
SOURCES="$SOURCES $srcdir/src/misc/dummy/*.c"
fi
if test x$have_locale != xyes; then
+ if test x$enable_locale = xyes; then
+
+$as_echo "#define SDL_LOCALE_DUMMY 1" >>confdefs.h
+
+ fi
SOURCES="$SOURCES $srcdir/src/locale/dummy/*.c"
fi
if test x$have_joystick != xyes; then
@@ -26904,7 +26939,7 @@ fi
if test x$have_filesystem != xyes; then
if test x$enable_filesystem = xyes; then
-$as_echo "#define SDL_FILESYSTEM_DISABLED 1" >>confdefs.h
+$as_echo "#define SDL_FILESYSTEM_DUMMY 1" >>confdefs.h
fi
SOURCES="$SOURCES $srcdir/src/filesystem/dummy/*.c"
diff --git a/configure.ac b/configure.ac
index 8b9388e..87ecb19 100644
--- a/configure.ac
+++ b/configure.ac
@@ -535,6 +535,14 @@ if test x$enable_misc != xyes; then
else
SUMMARY_modules="${SUMMARY_modules} misc"
fi
+AC_ARG_ENABLE(locale,
+[AS_HELP_STRING([--enable-locale], [Enable the locale subsystem [default=yes]])],
+ , enable_locale=yes)
+if test x$enable_locale != xyes; then
+ AC_DEFINE(SDL_LOCALE_DISABLED, 1, [ ])
+else
+ SUMMARY_modules="${SUMMARY_modules} locale"
+fi
AC_ARG_ENABLE(loadso,
[AS_HELP_STRING([--enable-loadso], [Enable the shared object loading subsystem [default=yes]])],
, enable_loadso=yes)
@@ -3728,10 +3736,11 @@ case "$host" in
SOURCES="$SOURCES $srcdir/src/misc/unix/*.c"
have_misc=yes
fi
-
- SOURCES="$SOURCES $srcdir/src/locale/unix/*.c"
- have_locale=yes
-
+ # Set up files for the locale library
+ if test x$enable_locale = xyes; then
+ SOURCES="$SOURCES $srcdir/src/locale/unix/*.c"
+ have_locale=yes
+ fi
# Set up files for the audio library
if test x$enable_audio = xyes; then
case $ARCH in
@@ -3915,9 +3924,10 @@ case "$host" in
have_misc=yes
fi
# Use the Windows locale APIs.
- SOURCES="$SOURCES $srcdir/src/locale/windows/*.c"
- have_locale=yes
-
+ if test x$enable_locale = xyes; then
+ SOURCES="$SOURCES $srcdir/src/locale/windows/*.c"
+ have_locale=yes
+ fi
# Set up files for the video library
if test x$enable_video = xyes; then
AC_DEFINE(SDL_VIDEO_DRIVER_WINDOWS, 1, [ ])
@@ -4106,9 +4116,10 @@ dnl BeOS support removed after SDL 2.0.1. Haiku still works. --ryan.
have_misc=yes
fi
# Set up files for the locale library
- SOURCES="$SOURCES $srcdir/src/locale/haiku/*.cc"
- have_locale=yes
-
+ if test x$enable_locale = xyes; then
+ SOURCES="$SOURCES $srcdir/src/locale/haiku/*.cc"
+ have_locale=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"
@@ -4134,9 +4145,10 @@ dnl BeOS support removed after SDL 2.0.1. Haiku still works. --ryan.
have_misc=yes
fi
# Set up files for the locale library
- SOURCES="$SOURCES $srcdir/src/locale/macosx/*.m"
- have_locale=yes
-
+ if test x$enable_locale = xyes; then
+ SOURCES="$SOURCES $srcdir/src/locale/macosx/*.m"
+ have_locale=yes
+ fi
# Set up files for the audio library
if test x$enable_audio = xyes; then
AC_DEFINE(SDL_AUDIO_DRIVER_COREAUDIO, 1, [ ])
@@ -4248,9 +4260,10 @@ dnl BeOS support removed after SDL 2.0.1. Haiku still works. --ryan.
have_misc=yes
fi
# Set up files for the locale library
- SOURCES="$SOURCES $srcdir/src/locale/macosx/*.m"
- have_locale=yes
-
+ if test x$enable_locale = xyes; then
+ SOURCES="$SOURCES $srcdir/src/locale/macosx/*.m"
+ have_locale=yes
+ fi
# Set up files for the audio library
if test x$enable_audio = xyes; then
AC_DEFINE(SDL_AUDIO_DRIVER_COREAUDIO, 1, [ ])
@@ -4388,8 +4401,10 @@ dnl BeOS support removed after SDL 2.0.1. Haiku still works. --ryan.
have_timers=yes
fi
# Set up files for the locale library
- SOURCES="$SOURCES $srcdir/src/locale/emscripten/*.c"
- have_locale=yes
+ if test x$enable_locale = xyes; then
+ SOURCES="$SOURCES $srcdir/src/locale/emscripten/*.c"
+ have_locale=yes
+ fi
;;
*-*-riscos*)
ARCH=riscos
@@ -4456,8 +4471,10 @@ dnl BeOS support removed after SDL 2.0.1. Haiku still works. --ryan.
SOURCES="$SOURCES $srcdir/src/core/os2/geniconv/*.c"
fi
# Use the Unix locale APIs.
- SOURCES="$SOURCES $srcdir/src/locale/unix/*.c"
- have_locale=yes
+ if test x$enable_locale = xyes; then
+ SOURCES="$SOURCES $srcdir/src/locale/unix/*.c"
+ have_locale=yes
+ fi
# Set up files for the video library
if test x$enable_video = xyes; then
AC_DEFINE(SDL_VIDEO_DRIVER_OS2, 1, [ ])
@@ -4534,9 +4551,15 @@ AC_SUBST([INSTALL_SDL2_CONFIG], [$enable_sdl2_config])
# Verify that we have all the platform specific files we need
if test x$have_misc != xyes; then
+ if test x$enable_misc = xyes; then
+ AC_DEFINE(SDL_MISC_DUMMY, 1, [ ])
+ fi
SOURCES="$SOURCES $srcdir/src/misc/dummy/*.c"
fi
if test x$have_locale != xyes; then
+ if test x$enable_locale = xyes; then
+ AC_DEFINE(SDL_LOCALE_DUMMY, 1, [ ])
+ fi
SOURCES="$SOURCES $srcdir/src/locale/dummy/*.c"
fi
if test x$have_joystick != xyes; then
@@ -4571,7 +4594,7 @@ if test x$have_timers != xyes; then
fi
if test x$have_filesystem != xyes; then
if test x$enable_filesystem = xyes; then
- AC_DEFINE(SDL_FILESYSTEM_DISABLED, 1, [ ])
+ AC_DEFINE(SDL_FILESYSTEM_DUMMY, 1, [ ])
fi
SOURCES="$SOURCES $srcdir/src/filesystem/dummy/*.c"
fi
diff --git a/include/SDL_config.h.cmake b/include/SDL_config.h.cmake
index af135c9..9a1bf67 100644
--- a/include/SDL_config.h.cmake
+++ b/include/SDL_config.h.cmake
@@ -493,6 +493,12 @@
#cmakedefine SDL_FILESYSTEM_VITA @SDL_FILESYSTEM_VITA@
#cmakedefine SDL_FILESYSTEM_PSP @SDL_FILESYSTEM_PSP@
+/* Enable misc subsystem */
+#cmakedefine SDL_MISC_DUMMY @SDL_MISC_DUMMY@
+
+/* Enable locale subsystem */
+#cmakedefine SDL_LOCALE_DUMMY @SDL_LOCALE_DUMMY@
+
/* Enable assembly routines */
#cmakedefine SDL_ASSEMBLY_ROUTINES @SDL_ASSEMBLY_ROUTINES@
#cmakedefine SDL_ALTIVEC_BLITTERS @SDL_ALTIVEC_BLITTERS@
diff --git a/include/SDL_config.h.in b/include/SDL_config.h.in
index 5ef2c15..195b988 100644
--- a/include/SDL_config.h.in
+++ b/include/SDL_config.h.in
@@ -447,16 +447,24 @@
#undef SDL_POWER_HARDWIRED
/* Enable system filesystem support */
+#undef SDL_FILESYSTEM_ANDROID
#undef SDL_FILESYSTEM_HAIKU
#undef SDL_FILESYSTEM_COCOA
#undef SDL_FILESYSTEM_DUMMY
+#undef SDL_FILESYSTEM_RISCOS
#undef SDL_FILESYSTEM_UNIX
#undef SDL_FILESYSTEM_WINDOWS
#undef SDL_FILESYSTEM_NACL
-#undef SDL_FILESYSTEM_ANDROID
#undef SDL_FILESYSTEM_EMSCRIPTEN
#undef SDL_FILESYSTEM_OS2
-#undef SDL_FILESYSTEM_RISCOS
+#undef SDL_FILESYSTEM_VITA
+#undef SDL_FILESYSTEM_PSP
+
+/* Enable misc subsystem */
+#undef SDL_MISC_DUMMY
+
+/* Enable locale subsystem */
+#undef SDL_LOCALE_DUMMY
/* Enable assembly routines */
#undef SDL_ASSEMBLY_ROUTINES