x264 Android build script

build arm

#!/bin/bash

NDK=/Users/ilong/Documents/android-ndk-r11c
PREBUILT=$NDK/toolchains/arm-linux-androideabi-4.9/prebuilt/*-x86_64
PLATFORM=$NDK/platforms/android-9/arch-arm/
PREFIX=`pwd`/android-x264/arm
SOURCE=../vhall_x264
SCRATCH=scratch-x264
CWD=`pwd`

function build_one
{
     

echo "building arm"
mkdir -p "$SCRATCH/arm"
cd "$SCRATCH/arm"
echo $CWD
   ./../../$SOURCE/configure \
   --prefix=$PREFIX \
   --enable-static \
   --enable-strip \
   --enable-pic \
   --host=arm-linux \
   --extra-cflags="-march=armv7-a -mtune=cortex-a9 -mfloat-abi=softfp -mfpu=neon -D__ARM_ARCH_7__ -D__ARM_ARCH_7A__"\
   --cross-prefix=$PREBUILT/bin/arm-linux-androideabi- \
   --sysroot=$PLATFORM

make clean
make
make install 

cd ../../
rm -rf $SCRATCH

echo "Android ARM builds finished"

}

build_one

build arm64

#!/bin/bash

NDK=/Users/ilong/Documents/android-ndk-r11c
PREBUILT=$NDK/toolchains/aarch64-linux-android-4.9/prebuilt/*-x86_64
PLATFORM=$NDK/platforms/android-21/arch-arm64/
PREFIX=`pwd`/android-x264/arm64
SOURCE=../vhall_x264
SCRATCH=scratch-x264
CWD=`pwd`

function build_one
{
     

echo "building arm64"
mkdir -p "$SCRATCH/arm64"
cd "$SCRATCH/arm64"
echo $CWD

   ./../../$SOURCE/configure \
   --prefix=$PREFIX \
   --enable-static \
   --enable-pic \
   --host=aarch64-linux \
   --cross-prefix=$PREBUILT/bin/aarch64-linux-android- \
   --sysroot=$PLATFORM

make clean
make
make install

cd ../../
rm -rf $SCRATCH

echo "Android ARM builds finished"

}

build_one

你可能感兴趣的:(脚本)