From f63311f6c4e2d23de0c37796c0090a04fdab91ff Mon Sep 17 00:00:00 2001 From: pelya Date: Wed, 22 Dec 2010 11:23:48 +0000 Subject: [PATCH] Refusing to build with unsupported NDK version --- project/jni/Android.mk | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/project/jni/Android.mk b/project/jni/Android.mk index a3ff9b0f8..fc473c203 100644 --- a/project/jni/Android.mk +++ b/project/jni/Android.mk @@ -4,11 +4,21 @@ ifneq ($(strip $(filter mad, $(COMPILED_LIBRARIES))),) SDL_MIXER_USE_LIBMAD := 1 endif -ifneq ($(findstring -crystax,$(TARGET_CC)),) +NDK_VERSION := $(strip $(patsubst android-ndk-%,%,$(filter android-ndk-%, $(subst /, ,$(dir $(TARGET_CC)))))) +$(info NDK version $(NDK_VERSION)) +ifneq ($(filter r1 r2 r3 r4, $(NDK_VERSION)),) +$(error Your NDK $(NDK_VERSION) is too old, please download NDK r4b from http://developer.android.com ) +endif +ifneq ($(filter r5, $(NDK_VERSION)),) +$(error Your NDK $(NDK_VERSION) generates invalid code, please download NDK r4b from http://developer.android.com or wait for NDK r5b release. Details: http://groups.google.com/group/android-ndk/browse_thread/thread/6b35728eec7ef52f/b57f52776842041d ) +endif + + +ifneq ($(findstring -crystax,$(NDK_VERSION)),) $(info Building with CrystaX toolchain - RTTI and exceptions enabled, STLPort disabled) CRYSTAX_TOOLCHAIN = 1 endif -ifneq ($(findstring android-ndk-r5,$(TARGET_CC)),) +ifneq ($(findstring r5,$(NDK_VERSION)),) $(info Building with NDK r5) NDK_R5_TOOLCHAIN = 1 endif