From e976eda43dd446ddea1cfffadcdbedbdb33bc42c Mon Sep 17 00:00:00 2001 From: "Chris \"Koying\" Browet" Date: Fri, 18 Apr 2014 15:52:38 +0200 Subject: FIX: [droid] enable compilation with NDK >= 9b --- tools/depends/Makefile.include.in | 7 ++++--- tools/depends/configure.in | 6 ++++++ xbmc/android/activity/AndroidExtra.h | 3 +++ 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/tools/depends/Makefile.include.in b/tools/depends/Makefile.include.in index 142092d5bd..3f79caa132 100644 --- a/tools/depends/Makefile.include.in +++ b/tools/depends/Makefile.include.in @@ -2,6 +2,7 @@ abs_top_srcdir=@abs_top_srcdir@ TOOLCHAIN=@use_toolchain@ NDKROOT=@use_ndk@ +NDK_VER=@use_ndk_ver@ SDKROOT=@use_sdk_path@ XBMCROOT=$(abspath $(abs_top_srcdir)/../../) TARBALLS_LOCATION=@use_tarballs@ @@ -47,10 +48,10 @@ READELF=@READELF@ OBJDUMP=@OBJDUMP@ CMAKE=@prefix@/@tool_dir@/bin/cmake -DCMAKE_TOOLCHAIN_FILE=$(PREFIX)/share/Toolchain.cmake -DCMAKE_INSTALL_PREFIX=$(PREFIX) -CFLAGS=@platform_cflags@ @platform_includes@ -isystem @prefix@/@deps_dir@/include +CFLAGS=@platform_cflags@ @platform_includes@ -isystem @prefix@/@deps_dir@/include -DNDK_VER=@use_ndk_ver@ LDFLAGS=-L@prefix@/@deps_dir@/lib @platform_ldflags@ -CXXFLAGS=@platform_cxxflags@ @platform_includes@ -isystem @prefix@/@deps_dir@/include -CPPFLAGS=@platform_cflags@ @platform_includes@ -isystem @prefix@/@deps_dir@/include +CXXFLAGS=@platform_cxxflags@ @platform_includes@ -isystem @prefix@/@deps_dir@/include -DNDK_VER=@use_ndk_ver@ +CPPFLAGS=@platform_cflags@ @platform_includes@ -isystem @prefix@/@deps_dir@/include -DNDK_VER=@use_ndk_ver@ PATH:=@prefix@/@tool_dir@/bin:$(PATH) ifneq (@use_build_toolchain@,) diff --git a/tools/depends/configure.in b/tools/depends/configure.in index 5a75ba6a28..53f102ef85 100644 --- a/tools/depends/configure.in +++ b/tools/depends/configure.in @@ -416,6 +416,11 @@ if test "$platform_os" == "android"; then AC_MSG_ERROR("NDK path is required for android") fi + if ! test -f "$use_ndk/RELEASE.TXT" ; then + AC_MSG_ERROR("$use_ndk is not an NDK directory") + fi + use_ndk_ver=0x`cat $use_ndk/RELEASE.TXT | sed 's/^r\([0-9]\+\)\b/r\10/' | sed 's/^r\(.*\)\b.*/\1/'` + if test -z $use_sdk_path; then AC_MSG_ERROR("SDK path is required for android") fi @@ -478,6 +483,7 @@ if test "$platform_os" == "android"; then echo -e AC_SUBST(use_sdk_path) AC_SUBST(use_ndk) + AC_SUBST(use_ndk_ver) AC_SUBST(use_sdk) fi diff --git a/xbmc/android/activity/AndroidExtra.h b/xbmc/android/activity/AndroidExtra.h index 7b1c9ffa72..84227910fc 100644 --- a/xbmc/android/activity/AndroidExtra.h +++ b/xbmc/android/activity/AndroidExtra.h @@ -21,6 +21,7 @@ /*** Extra's not found in the Android NDK ***/ +#if NDK_VER < 0x9b // missing in early NDKs, is present in r9b+ extern float AMotionEvent_getAxisValue(const AInputEvent* motion_event, int32_t axis, size_t pointer_index); extern typeof(AMotionEvent_getAxisValue) *p_AMotionEvent_getAxisValue; @@ -71,3 +72,5 @@ extern typeof(AMotionEvent_getButtonState) *p_AMotionEvent_getButtonState; #define AMOTION_EVENT_AXIS_RTRIGGER 18 // mouse vertical wheel #define AMOTION_EVENT_AXIS_VSCROLL 0x09 + +#endif -- cgit v1.2.3