Commit b2086d24 authored by Edward Wang's avatar Edward Wang Committed by Rafaël Carré

Automatically detect NDK v7 presence

Alleviates the need to modify files
Signed-off-by: Rafaël Carré's avatarRafaël Carré <funman@videolan.org>
parent f8ef08a2
......@@ -10,7 +10,11 @@
# export NO_NEON=1
# make sure it is set for both the contribs bootstrap next and the configure.sh later.
# Also, if you do not have NDK v7 or later, then set HAS_NDK_V7 to 0 in vlc-android/jni/Android.mk:10
# The script will attempt to automatically detect if you have NDK v7, but you can override this
# If you do not have NDK v7 or later:
# export NO_NDK_V7=1
# or if you are sure you have NDK v7:
# export NO_NDK_V7=0
# to prevent this error message in your compile:
# arm-linux-androideabi-g++: /opt/android-ndk/sources/cxx-stl/gnu-libstdc++/libs/armeabi-v7a/libgnustl_static.a: No such file or directory
......@@ -20,6 +24,14 @@ if [ -z "$ANDROID_NDK" -o -z "$ANDROID_SDK" ]; then
exit 1
fi
if [ -z "$NO_NDK_V7" ]; then
# try to detect NDK version
REL=$(grep -iw "r7" $ANDROID_NDK/RELEASE.TXT)
if [ -z $REL ]; then
export NO_NDK_V7=1
fi
fi
# Add the NDK toolchain to the PATH, needed both for contribs and for building
# stub libraries
export PATH=${ANDROID_NDK}/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin:${PATH}
......
......@@ -7,18 +7,16 @@ LOCAL_SRC_FILES := libvlcjni.c aout.c thumbnailer.c
LOCAL_C_INCLUDES := $(VLC_SRC_DIR)/include
HAS_NDK_V7 = 1
ifeq ($(NO_NEON),)
ARCH=armeabi-v7a
else
ARCH=armeabi
endif
ifeq ($(HAS_NDK_V7),1)
CPP_STATIC=$(ANDROID_NDK)/sources/cxx-stl/gnu-libstdc++/libs/$(ARCH)/libgnustl_static.a
else
ifeq ($(NO_NDK_V7),1)
CPP_STATIC=$(ANDROID_NDK)/sources/cxx-stl/gnu-libstdc++/libs/$(ARCH)/libstdc++.a
else
CPP_STATIC=$(ANDROID_NDK)/sources/cxx-stl/gnu-libstdc++/libs/$(ARCH)/libgnustl_static.a
endif
LOCAL_LDLIBS := -L$(VLC_CONTRIB)/lib \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment