Skip to content

Instantly share code, notes, and snippets.

@loentar
Created March 30, 2016 08:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save loentar/2be98bc2af8ee04f2268516ee1e7bc5c to your computer and use it in GitHub Desktop.
Save loentar/2be98bc2af8ee04f2268516ee1e7bc5c to your computer and use it in GitHub Desktop.
diff --git a/android/contrib/tools/do-compile-ffmpeg.sh b/android/contrib/tools/do-compile-ffmpeg.sh
index 37545b2..0e438bc 100755
--- a/android/contrib/tools/do-compile-ffmpeg.sh
+++ b/android/contrib/tools/do-compile-ffmpeg.sh
@@ -49,11 +49,19 @@ if [ -z "$FF_ARCH" ]; then
fi
# try to detect NDK version
-FF_NDK_REL=$(grep -o '^r[0-9]*.*' $ANDROID_NDK/RELEASE.TXT 2>/dev/null|cut -b2-)
+if [ -f "$ANDROID_NDK/RELEASE.TXT" ]
+then
+ FF_NDK_REL=$(grep -o '^r[0-9]*.*' $ANDROID_NDK/RELEASE.TXT 2>/dev/null|cut -b2-)
+elif [ -f "$ANDROID_NDK/source.properties" ]
+then
+ FF_NDK_REL=$(sed -n 's/Pkg.Revision[^0-9]*\([0-9\.]\+\)/\1/p' "$ANDROID_NDK/source.properties") #'
+fi
+echo "FF_NDK_REL = $FF_NDK_REL"
case "$FF_NDK_REL" in
9*|10*)
# we don't use 4.4.3 because it doesn't handle threads correctly.
- if test -d ${ANDROID_NDK}/toolchains/arm-linux-androideabi-4.8
+ FF_NDK_TOOLCHAIN=${ANDROID_NDK}/toolchains/arm-linux-androideabi-4.8
+ if test -d $FF_NDK_TOOLCHAIN
# if gcc 4.8 is present, it's there for all the archs (x86, mips, arm)
then
echo "NDKr$FF_NDK_REL detected"
@@ -61,6 +69,23 @@ case "$FF_NDK_REL" in
echo "You need the NDKr9 or later"
exit 1
fi
+
+ FF_GCC_VER=4.8
+ FF_GCC_64_VER=4.9
+ ;;
+ 11*)
+ FF_NDK_TOOLCHAIN=${ANDROID_NDK}/toolchains/arm-linux-androideabi-4.9
+ if test -d $FF_NDK_TOOLCHAIN
+ # if gcc 4.9 is present, it's there for all the archs (x86, mips, arm)
+ then
+ echo "NDKr$FF_NDK_REL detected"
+ else
+ echo "You need the NDKr9 or later"
+ exit 1
+ fi
+
+ FF_GCC_VER=4.9
+ FF_GCC_64_VER=4.9
;;
*)
echo "You need the NDKr9 or later"
@@ -68,11 +93,10 @@ case "$FF_NDK_REL" in
;;
esac
+echo "FF_NDK_TOOLCHAIN = $FF_NDK_TOOLCHAIN"
+
FF_BUILD_ROOT=`pwd`
FF_ANDROID_PLATFORM=android-9
-FF_GCC_VER=4.8
-FF_GCC_64_VER=4.9
-
FF_BUILD_NAME=
FF_SOURCE=
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment