Browse Source

Fixed bug 2802 - [patch] Fix android build compiling in wrong filesystem implementation

Jonas Kulla

The configure script didn't differentiate between Linux and Android, unconditionally compiling in the unix implementation of SDL_sysfilesystem.c.

I'm probably one of the very few people building SDL for android using classic configure + standalone toolchain, so this has gone undetected all along.
Philipp Wiesemann 10 years ago
parent
commit
b48e54aafe
3 changed files with 26 additions and 5 deletions
  1. 13 2
      configure
  2. 12 3
      configure.in
  3. 1 0
      include/SDL_config.h.in

+ 13 - 2
configure

@@ -23091,11 +23091,22 @@ $as_echo "#define SDL_POWER_ANDROID 1" >>confdefs.h
         fi
         # Set up files for the filesystem library
         if test x$enable_filesystem = xyes; then
+             case $ARCH in
+               linux)
 
 $as_echo "#define SDL_FILESYSTEM_UNIX 1" >>confdefs.h
 
-            SOURCES="$SOURCES $srcdir/src/filesystem/unix/*.c"
-            have_filesystem=yes
+                   SOURCES="$SOURCES $srcdir/src/filesystem/unix/*.c"
+                   have_filesystem=yes
+               ;;
+               android)
+
+$as_echo "#define SDL_FILESYSTEM_ANDROID 1" >>confdefs.h
+
+                   SOURCES="$SOURCES $srcdir/src/filesystem/android/*.c"
+                   have_filesystem=yes
+               ;;
+             esac
         fi
         # Set up files for the timer library
         if test x$enable_timers = xyes; then

+ 12 - 3
configure.in

@@ -2971,9 +2971,18 @@ case "$host" in
         fi
         # Set up files for the filesystem library
         if test x$enable_filesystem = xyes; then
-            AC_DEFINE(SDL_FILESYSTEM_UNIX, 1, [ ])
-            SOURCES="$SOURCES $srcdir/src/filesystem/unix/*.c"
-            have_filesystem=yes
+             case $ARCH in
+               linux)
+                   AC_DEFINE(SDL_FILESYSTEM_UNIX, 1, [ ])
+                   SOURCES="$SOURCES $srcdir/src/filesystem/unix/*.c"
+                   have_filesystem=yes
+               ;;
+               android)
+                   AC_DEFINE(SDL_FILESYSTEM_ANDROID, 1, [ ])
+                   SOURCES="$SOURCES $srcdir/src/filesystem/android/*.c"
+                   have_filesystem=yes
+               ;;
+             esac
         fi
         # Set up files for the timer library
         if test x$enable_timers = xyes; then

+ 1 - 0
include/SDL_config.h.in

@@ -349,6 +349,7 @@
 #undef SDL_FILESYSTEM_UNIX
 #undef SDL_FILESYSTEM_WINDOWS
 #undef SDL_FILESYSTEM_NACL
+#undef SDL_FILESYSTEM_ANDROID
 #undef SDL_FILESYSTEM_EMSCRIPTEN
 
 /* Enable assembly routines */