Fixed bug 2802 - [patch] Fix android build compiling in wrong filesystem implementation
authorPhilipp Wiesemann <philipp.wiesemann@arcor.de>
Mon, 26 Jan 2015 22:00:29 +0100
changeset 9315 541f12d1edcd
parent 9314 8d826bc39a45
child 9316 f4d22285caec
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.
configure
configure.in
include/SDL_config.h.in
--- a/configure	Fri Jan 23 20:29:08 2015 +0100
+++ b/configure	Mon Jan 26 22:00:29 2015 +0100
@@ -23091,11 +23091,22 @@
         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
--- a/configure.in	Fri Jan 23 20:29:08 2015 +0100
+++ b/configure.in	Mon Jan 26 22:00:29 2015 +0100
@@ -2971,9 +2971,18 @@
         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
--- a/include/SDL_config.h.in	Fri Jan 23 20:29:08 2015 +0100
+++ b/include/SDL_config.h.in	Mon Jan 26 22:00:29 2015 +0100
@@ -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 */