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 9315541f12d1edcd
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
     1.1 --- a/configure	Fri Jan 23 20:29:08 2015 +0100
     1.2 +++ b/configure	Mon Jan 26 22:00:29 2015 +0100
     1.3 @@ -23091,11 +23091,22 @@
     1.4          fi
     1.5          # Set up files for the filesystem library
     1.6          if test x$enable_filesystem = xyes; then
     1.7 +             case $ARCH in
     1.8 +               linux)
     1.9  
    1.10  $as_echo "#define SDL_FILESYSTEM_UNIX 1" >>confdefs.h
    1.11  
    1.12 -            SOURCES="$SOURCES $srcdir/src/filesystem/unix/*.c"
    1.13 -            have_filesystem=yes
    1.14 +                   SOURCES="$SOURCES $srcdir/src/filesystem/unix/*.c"
    1.15 +                   have_filesystem=yes
    1.16 +               ;;
    1.17 +               android)
    1.18 +
    1.19 +$as_echo "#define SDL_FILESYSTEM_ANDROID 1" >>confdefs.h
    1.20 +
    1.21 +                   SOURCES="$SOURCES $srcdir/src/filesystem/android/*.c"
    1.22 +                   have_filesystem=yes
    1.23 +               ;;
    1.24 +             esac
    1.25          fi
    1.26          # Set up files for the timer library
    1.27          if test x$enable_timers = xyes; then
     2.1 --- a/configure.in	Fri Jan 23 20:29:08 2015 +0100
     2.2 +++ b/configure.in	Mon Jan 26 22:00:29 2015 +0100
     2.3 @@ -2971,9 +2971,18 @@
     2.4          fi
     2.5          # Set up files for the filesystem library
     2.6          if test x$enable_filesystem = xyes; then
     2.7 -            AC_DEFINE(SDL_FILESYSTEM_UNIX, 1, [ ])
     2.8 -            SOURCES="$SOURCES $srcdir/src/filesystem/unix/*.c"
     2.9 -            have_filesystem=yes
    2.10 +             case $ARCH in
    2.11 +               linux)
    2.12 +                   AC_DEFINE(SDL_FILESYSTEM_UNIX, 1, [ ])
    2.13 +                   SOURCES="$SOURCES $srcdir/src/filesystem/unix/*.c"
    2.14 +                   have_filesystem=yes
    2.15 +               ;;
    2.16 +               android)
    2.17 +                   AC_DEFINE(SDL_FILESYSTEM_ANDROID, 1, [ ])
    2.18 +                   SOURCES="$SOURCES $srcdir/src/filesystem/android/*.c"
    2.19 +                   have_filesystem=yes
    2.20 +               ;;
    2.21 +             esac
    2.22          fi
    2.23          # Set up files for the timer library
    2.24          if test x$enable_timers = xyes; then
     3.1 --- a/include/SDL_config.h.in	Fri Jan 23 20:29:08 2015 +0100
     3.2 +++ b/include/SDL_config.h.in	Mon Jan 26 22:00:29 2015 +0100
     3.3 @@ -349,6 +349,7 @@
     3.4  #undef SDL_FILESYSTEM_UNIX
     3.5  #undef SDL_FILESYSTEM_WINDOWS
     3.6  #undef SDL_FILESYSTEM_NACL
     3.7 +#undef SDL_FILESYSTEM_ANDROID
     3.8  #undef SDL_FILESYSTEM_EMSCRIPTEN
     3.9  
    3.10  /* Enable assembly routines */