ndkr8d编译x264-snapshot-20140213-2245

参考了很多前人的帖子,

#!/bin/bash
export NDK_ROOT=/home/huwenbo/ndk-android-r8d
export PATH=$PATH:$NDK_ROOT
export ARM_ROOT=$NDK_ROOT
export ARM_INC=$ARM_ROOT/platforms/android-14/arch-arm/usr/include
export ARM_LIB=$ARM_ROOT/platforms/android-14/arch-arm/usr/lib
export ARM_TOOL=$ARM_ROOT/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86
export ARM_LIBO=$ARM_TOOL/lib/gcc/arm-linux-androideabi/4.4.3
export ARM_PRE=arm-linux-androideabi这个工具不同的版本使用不同注意
export PREFIX=/home/huwenbo/android-ndk-r8d/x264-snapshot-20140213-2245
export SYSROOT=/home/huwenbo/android-ndk-r8d/x264-snapshot-20140213-2245
export PATH=$ARM_TOOL/bin:$PATH
 
 
./configure \
--sysroot=$SYSROOT \
--disable-gpac --enable-pic --enable-strip --extra-cflags=" -I$ARM_INC -fPIC -DANDROID -fpic -mthumb-interwork -ffunction-sections -funwind-tables -fstack-protector -fno-short-enums -march=armv7-a -mtune=cortex-a9 -mfloat-abi=softfp -mfpu=neon -D__ARM_ARCH_7__ -D__ARM_ARCH_7A__  -Wno-psabi -msoft-float -mthumb -Os -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64 -DANDROID  -Wa,--noexecstack -MMD -MP " --extra-ldflags="-nostdlib -Bdynamic -Wl,--no-undefined -Wl,-z,noexecstack  -Wl,-z,nocopyreloc -Wl,-soname,/system/lib/libz.so -Wl,-rpath-link=$ARM_LIB,-dynamic-linker=/system/bin/linker -L$ARM_LIB -nostdlib $ARM_LIB/crtbegin_dynamic.o $ARM_LIB/crtend_android.o -lc -lm -ldl -lgcc" --cross-prefix=${ARM_PRE}- --host=arm-linux --enable-static \
--prefix=$PREFIX 

export ARM_LINUX_ANDROIDEABI_GCC=/home/huwenbo/ndk-android-r8d/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin
export PATH=$ARM_LINUX_ANDROIDEABI_GCC:$PATH

执行步骤 . build.sh make即可得到Android版本下可以运行的x264可执行程序。

你可能感兴趣的:(ndkr8d编译x264-snapshot-20140213-2245)