Added support for NDK r6b

This commit is contained in:
pelya
2011-10-10 18:16:34 +03:00
parent 63af8c0944
commit 7145c352a8
3 changed files with 24 additions and 10 deletions

View File

@@ -5,11 +5,11 @@ SDL_MIXER_USE_LIBMAD := 1
endif
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)),)
#$(info NDK version $(NDK_VERSION)) # This warning puzzles ndk-gdb
ifneq ($(filter r1 r2 r3 r4,$(NDK_VERSION)),)
$(error Your NDK $(NDK_VERSION) is too old, please download NDK r4b, r5c or r6 from http://developer.android.com )
endif
ifneq ($(filter r5 r5b, $(NDK_VERSION)),)
ifneq ($(filter r5 r5b,$(NDK_VERSION)),)
$(error Your NDK $(NDK_VERSION) generates invalid code, please use NDK r5c from http://developer.android.com)
endif
ifeq ($(NDK_VERSION)-,-)
@@ -21,7 +21,11 @@ ifneq ($(findstring r4-crystax,$(NDK_VERSION)),)
$(info Building with CrystaX r4 toolchain - internal STLPort disabled)
CRYSTAX_TOOLCHAIN := 1
endif
ifneq ($(findstring r5c r6,$(NDK_VERSION))$(findstring r5-crystax,$(NDK_VERSION)),)
ifneq ($(findstring r6b,$(NDK_VERSION))$(findstring r6-crystax,$(NDK_VERSION)),)
$(info Building with NDK r6)
NDK_R6_TOOLCHAIN := 1
endif
ifneq ($(findstring r5c,$(NDK_VERSION))$(findstring r5-crystax,$(NDK_VERSION))$(NDK_R6_TOOLCHAIN),)
$(info Building with NDK r5c or r6 - internal STLPort disabled)
NDK_R5_TOOLCHAIN := 1
endif

View File

@@ -37,9 +37,16 @@ echo $APP_MODULES | xargs -n 1 echo | while read LIB ; do
done
)
MISSING_INCLUDE=
MISSING_LIB=
if [ -n "$CRYSTAX_WCHAR" ]; then
CRYSTAX_WCHAR_INCLUDE=-isystem$NDK/sources/crystax/include
CRYSTAX_WCHAR_LIB="$NDK/sources/crystax/libs/armeabi/libcrystax_static.a"
MISSING_INCLUDE="$MISSING_INCLUDE -isystem$NDK/sources/crystax/include"
MISSING_LIB="$MISSING_LIB $NDK/sources/crystax/libs/armeabi/libcrystax_static.a"
fi
if [ -n "$MISSING_LIBCXX_PATH" ]; then
MISSING_INCLUDE="$MISSING_INCLUDE -isystem$NDK/sources/cxx-stl/gnu-libstdc++/include"
MISSING_LIB="$MISSING_LIB $NDK/sources/cxx-stl/gnu-libstdc++/libs/armeabi/libstdc++.a"
fi
CFLAGS="\
@@ -53,7 +60,7 @@ CFLAGS="\
-isystem$NDK/sources/cxx-stl/gnu-libstdc++/libs/armeabi/include \
-isystem$LOCAL_PATH/../sdl-1.2/include \
`echo $APP_MODULES | sed \"s@\([-a-zA-Z0-9_.]\+\)@-isystem$LOCAL_PATH/../\1/include@g\"` \
$CRYSTAX_WCHAR_INCLUDE"
$MISSING_INCLUDE"
SHARED="-shared -Wl,-soname,libapplication.so"
if [ -n "$BUILD_EXECUTABLE" ]; then
@@ -79,7 +86,7 @@ $NDK/platforms/$PLATFORMVER/arch-arm/usr/lib/libstdc++.a \
-L$NDK/platforms/$PLATFORMVER/arch-arm/usr/lib \
-L$LOCAL_PATH/../../obj/local/armeabi -Wl,--no-undefined -Wl,-z,noexecstack \
-Wl,-rpath-link=$NDK/platforms/$PLATFORMVER/arch-arm/usr/lib -lsupc++ \
$CRYSTAX_WCHAR_LIB"
$MISSING_LIB"
#echo env CFLAGS=\""$CFLAGS"\" LDFLAGS=\""$LDFLAGS"\" "$@"

View File

@@ -14,11 +14,14 @@ LOCAL_PATH=`cd $LOCAL_PATH && pwd`
SCRIPT=setEnvironment-r4b.sh
CRYSTAX_WCHAR=
if [ -n "`echo $NDK | grep 'android-ndk-r[56]'`" ]; then
if [ -n "`echo $NDK | grep 'android-ndk-r[56789]'`" ]; then
SCRIPT=setEnvironment-r5b.sh
if [ -n "`echo $NDK | grep 'android-ndk-r5-crystax-1'`" ]; then
if [ -n "`echo $NDK | grep 'android-ndk-r[56789]-crystax'`" ]; then
CRYSTAX_WCHAR=1
fi
if [ -n "`echo $NDK | grep 'android-ndk-r[6789]'`" ]; then
MISSING_LIBCXX_PATH=1
fi
fi
env CRYSTAX_WCHAR=$CRYSTAX_WCHAR $LOCAL_PATH/$SCRIPT "$@"