ios及android两个平台下x264编译脚本
#!/bin/sh cd x264 DEST=install SDK_VERSION="7.1" echo "Building armv7" ARM="armv7" export CC=`xcodebuild -find clang` DEVPATH=/Applications/XCode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS${SDK_VERSION}.sdk ./configure --host=arm-apple-darwin --sysroot=$DEVPATH --prefix=$DEST/$ARM --extra-cflags="-arch $ARM" --extra-ldflags="-L$DEVPATH/usr/lib/system -arch $ARM" --enable-pic --enable-static --enable-asm make && make install && make clean echo "Installed: $DEST/$ARM" echo "Building i386" SIM="i386" CC=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc DEVPATH=/Applications/XCode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator${SDK_VERSION}.sdk ./configure --host=i386-apple-darwin -sysroot=$DEVPATH --prefix=$DEST/$SIM --extra-cflags="-arch $SIM" --extra-ldflags="-L$DEVPATH/usr/lib/system -arch $SIM" --enable-pic --enable-static --disable-asm make && make install && make clean echo "Installed: $DEST/$SIM" echo "Combining library ......" BUILD_LIBS="libx264.a" OUTPUT_DIR="output" ARCHS="armv7 i386" cd install mkdir $OUTPUT_DIR mkdir $OUTPUT_DIR/lib mkdir $OUTPUT_DIR/include LIPO_CREATE="" for ARCH in $ARCHS; do LIPO_CREATE="$LIPO_CREATE $ARCH/lib/$BUILD_LIBS " done lipo -create $LIPO_CREATE -output $OUTPUT_DIR/lib/$BUILD_LIBS cp -f $ARCH/include/*.* $OUTPUT_DIR/include/ echo "************************************************************" lipo -i $OUTPUT_DIR/lib/$BUILD_LIBS echo "************************************************************" echo "OK, merge done!"
export NDK=/home/mypc/android-ndk-r9d export PREBUILT=$NDK/toolchains/arm-linux-androideabi-4.8/prebuilt export PLATFORM=$NDK/platforms/android-8/arch-arm export PREFIX=/home/mypc/x264 ./configure --prefix=$PREFIX --enable-static --enable-pic --disable-asm --disable-cli --host=arm-linux --cross-prefix=$PREBUILT/linux-x86/bin/arm-linux-androideabi- --sysroot=$PLATFORM
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。