#!/bin/sh
export ARM_ROOT=/e/android-ndk-r8e
export PATH=$PATH:$ARM_ROOT/toolchains/arm-linux-androideabi-4.7/prebuilt/windows/bin
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.7/prebuilt/windows
export ARM_LIBO=$ARM_TOOL/lib/gcc/arm-linux-androideabi/4.7
export ARM_PRE=arm-linux-androideabi
./configure --enable-static --disable-opencl --disable-gpac --extra-cflags=" -march=armv7 -mfpu=neon -mfloat-abi=softfp -DCAN_USE_VFP_INSTRUCTIONS=1 -DCAN_USE_ARMV7_INSTRUCTIONS=1 -DCAN_USE_UNALIGNED_ACCESSES=1 -I$ARM_INC -fPIC -DANDROID -fpic -mthumb-interwork -ffunction-sections -funwind-tables -fstack-protector -fno-short-enums -mthumb -O3 -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}- --disable-asm --host=arm-linux
具体gcc 的cpu型号选择,可以参考
android cpu信息:
#cat /proc/cpuinfo
Processor : ARMv7 Processor rev 2 (v7l)
BogoMIPS : 407.77
Features : swp half thumb fastmult vfp edsp thumbee neon vfpv3
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x3
CPU part : 0xc08
CPU revision : 2
选择-O3以及对应的march和mfpu差距很大, cpu占用率从95%下降到73%左右,x264版本是官网下载的x264-snapshot-20130521-2245.tar.bz2
阅读(2595) | 评论(0) | 转发(0) |