编译脚本如下:
TOOLCHAIN=$NDK/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64 function build_x264
{
./configure \
--prefix=$PREFIX \
--enable-static \
--cross-prefix=$TOOLCHAIN/bin/arm-linux-androideabi- \
--enable-pic \
--enable-shared \
--disable-cli \
--disable-asm \
--host=arm-linux \
--sysroot=$SYSROOT \
--extra-cflags="-Os -fpic -DANDROID $ADDI_CFLAGS" \
--extra-ldflags="$ADDI_LDFLAGS" \
$ADDITIONAL_CONFIGURE_FLAG \
|| exit
make clean || exit
make -j4 || exit
make install || exit
} CPU=arm
PREFIX=$(pwd)/../x264-build/$CPU
ADDI_CFLAGS="-marm -I$PREFIX/include"
ADDI_LDFLAGS="-Wl,-rpath-link=$SYSROOT/usr/lib -L$SYSROOT/usr/lib -nostdlib -lc -lm -ldl -llog -L$PREFIX/lib"
EABIARCH=arm-linux-androideabi
SONAME=libx264.so
OUT_LIBRARY=$PREFIX/$SONAME
CC=$TOOLCHAIN/bin/$EABIARCH-gcc
NM=$TOOLCHAIN/bin/$EABIARCH-nm build_x264