diff --git a/android/build.py b/android/build.py index 3ec3d9ba3..fab6ecb49 100755 --- a/android/build.py +++ b/android/build.py @@ -46,13 +46,14 @@ class AndroidNdkToolchain: self.ndk_arch = 'arm' android_abi = 'armeabi-v7a' - ndk_platform = 'android-14' + ndk_platform = 'android-21' # select the NDK compiler gcc_version = '4.9' ndk_platform_path = os.path.join(ndk_path, 'platforms', ndk_platform) - sysroot = os.path.join(ndk_platform_path, 'arch-' + self.ndk_arch) + sysroot = os.path.join(ndk_path, 'sysroot') + target_root = os.path.join(ndk_platform_path, 'arch-' + self.ndk_arch) install_prefix = os.path.join(arch_path, 'root') @@ -79,8 +80,15 @@ class AndroidNdkToolchain: self.cflags = '-Os -g ' + common_flags self.cxxflags = '-Os -g ' + common_flags - self.cppflags = '--sysroot=' + self.sysroot + ' -isystem ' + os.path.join(install_prefix, 'include') - self.ldflags = '--sysroot=' + self.sysroot + ' ' + common_flags + ' -L' + os.path.join(install_prefix, 'lib') + self.cppflags = '--sysroot=' + sysroot + \ + ' -isystem ' + os.path.join(install_prefix, 'include') + \ + ' -isystem ' + os.path.join(sysroot, 'usr', 'include', arch) + \ + ' -D__ANDROID_API__=21' + self.ldflags = '--sysroot=' + sysroot + \ + ' -L' + os.path.join(install_prefix, 'lib') + \ + ' -L' + os.path.join(target_root, 'usr', 'lib') + \ + ' -B' + os.path.join(target_root, 'usr', 'lib') + \ + ' ' + common_flags self.libs = '' self.is_arm = self.ndk_arch == 'arm' diff --git a/src/system/EPollFD.cxx b/src/system/EPollFD.cxx index 0a9e2eb9c..39ddbca5e 100644 --- a/src/system/EPollFD.cxx +++ b/src/system/EPollFD.cxx @@ -22,7 +22,7 @@ #include "EPollFD.hxx" #include "FatalError.hxx" -#ifdef __BIONIC__ +#if defined(__BIONIC__) && __ANDROID_API__ < 21 #include #include