Skip to content

Commit

Permalink
oMerge branch 'release/v0.3.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
hiteshsondhi88 committed Sep 8, 2014
2 parents e92e320 + e0342a9 commit 27d14a6
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 10 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ FFmpeg-Android
Supported Architecture
----
* armv7
* x86

Instructions
----
Expand Down
20 changes: 14 additions & 6 deletions abi_settings.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,31 @@ case $1 in
armeabi-v7a)
NDK_ABI='arm'
NDK_TOOLCHAIN_ABI='arm-linux-androideabi'
ARCH_CPU='armv7-a'
CFLAGS="$CFLAGS_LIBS -march=$ARCH_CPU"
NDK_CROSS_PREFIX="${NDK_TOOLCHAIN_ABI}"
CFLAGS="$CFLAGS -march=armv7-a"
CFLAGS_LIBS="$CFLAGS_LIBS -mcpu=cortex-a8 -marm -mfloat-abi=softfp"
;;
armeabi-v7a-neon)
NDK_ABI='arm'
NDK_TOOLCHAIN_ABI='arm-linux-androideabi'
ARCH_CPU='armv7-a'
CFLAGS="$CFLAGS -march=$ARCH_CPU -mfpu=neon"
CFLAGS_LIBS="$CFLAGS_LIBS -mfpu=neon"
NDK_CROSS_PREFIX="${NDK_TOOLCHAIN_ABI}"
CFLAGS="$CFLAGS -march=armv7-a -mfpu=neon"
CFLAGS_LIBS="$CFLAGS_LIBS -mcpu=cortex-a8 -marm -mfloat-abi=softfp -mfpu=neon"
;;
x86)
NDK_ABI='x86'
NDK_TOOLCHAIN_ABI='x86'
NDK_CROSS_PREFIX="i686-linux-android"
CFLAGS="$CFLAGS -march=i686"
CFLAGS_LIBS="$CFLAGS_LIBS -march=i686"
;;
esac

TOOLCHAIN_PREFIX=${BASEDIR}/toolchain-android
if [ ! -d "$TOOLCHAIN_PREFIX" ]; then
${ANDROID_NDK_ROOT_PATH}/build/tools/make-standalone-toolchain.sh --toolchain=${NDK_TOOLCHAIN_ABI}-${NDK_TOOLCHAIN_ABI_VERSION} --platform=android-${ANDROID_API_VERSION} --install-dir=${TOOLCHAIN_PREFIX}
fi
CROSS_PREFIX=${TOOLCHAIN_PREFIX}/bin/${NDK_TOOLCHAIN_ABI}-
CROSS_PREFIX=${TOOLCHAIN_PREFIX}/bin/${NDK_CROSS_PREFIX}-
NDK_SYSROOT=${TOOLCHAIN_PREFIX}/sysroot

export PKG_CONFIG_LIBDIR="${TOOLCHAIN_PREFIX}/lib/pkgconfig"
Expand Down
13 changes: 11 additions & 2 deletions ffmpeg_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,22 @@

pushd ffmpeg

case $1 in
armeabi-v7a | armeabi-v7a-neon )
CPU='armv7-a'
;;
x86)
CPU='i686'
;;
esac

make clean

./configure \
--target-os="$TARGET_OS" \
--cross-prefix="$CROSS_PREFIX" \
--arch="$NDK_ABI" \
--cpu=armv7-a \
--cpu="$CPU" \
--enable-runtime-cpudetect \
--sysroot="$NDK_SYSROOT" \
--enable-pic \
Expand All @@ -35,7 +44,7 @@ make clean
--prefix="${2}/build/${1}" \
--extra-cflags="-I${TOOLCHAIN_PREFIX}/include $CFLAGS" \
--extra-ldflags="-L${TOOLCHAIN_PREFIX}/lib $LDFLAGS" \
--extra-libs="-lpng -lexpat" \
--extra-libs="-lpng -lexpat -lm" \
--extra-cxxflags="$CXX_FLAGS" || exit 1

make -j${NUMBER_OF_CORES} && make install || exit 1
Expand Down
1 change: 1 addition & 0 deletions libass_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ make clean
--with-pic \
--host="$NDK_TOOLCHAIN_ABI" \
--disable-enca \
--disable-asm \
--enable-fontconfig \
--disable-harfbuzz \
--enable-static \
Expand Down
Binary file modified libpng_build.sh
Binary file not shown.
4 changes: 2 additions & 2 deletions settings.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

SUPPORTED_ARCHITECTURES=(armeabi-v7a armeabi-v7a-neon)
SUPPORTED_ARCHITECTURES=(armeabi-v7a armeabi-v7a-neon x86)
ANDROID_NDK_ROOT_PATH=${ANDROID_NDK}
if [[ -z "$ANDROID_NDK_ROOT_PATH" ]]; then
echo "You need to set ANDROID_NDK environment variable, please check instructions"
Expand All @@ -16,5 +16,5 @@ TARGET_OS=linux
CFLAGS='-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fno-strict-overflow -fstack-protector-all'
LDFLAGS='-Wl,-z,relro -Wl,-z,now -pie'

CFLAGS_LIBS="-std=gnu99 -mcpu=cortex-a8 -marm -mfloat-abi=softfp"
CFLAGS_LIBS="-std=gnu99"
FFMPEG_PKG_CONFIG="$(pwd)/ffmpeg-pkg-config"
5 changes: 5 additions & 0 deletions x264_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,13 @@ case $1 in
armeabi-v7a | armeabi-v7a-neon)
HOST=arm-linux
;;
x86)
HOST=i686-linux
;;
esac

echo $CFLAGS

./configure \
--cross-prefix="$CROSS_PREFIX" \
--sysroot="$NDK_SYSROOT" \
Expand Down

0 comments on commit 27d14a6

Please sign in to comment.