x264 编译总结

1. 编译 x264

cd H264  然后

a.如果编译不上可以单独安装Command line tools, 在终端输入( xcode-select --install ),就可以直接安装。
b.不同平台的编译命令(armv7, armv7s, arm64)

CC=/Applications/Xcode.app/Contents/Developer/usr/bin/gcc ./configure --host=arm-apple-darwin --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk --extra-cflags='-arch arm64' --extra-ldflags='-arch arm64 -L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/lib/system' --enable-static --disable-asm

c.
合成.a
lipo -info  lib1.a  查看 支持的平台
lipo -create lib1.a lib2.a -output lib.a, 
合并不同平台下的版本


d
.拆分.a
lipo /Users/jiabing/Desktop/lib/libavcodec.a -thin arm64 -output /Users/jiabing/Desktop/lib/libavcodec_arm64.a


iPhoneOS8.2.sdk 可能会变,需要修改成最新的版本

CC=/Applications/Xcode.app/Contents/Developer/usr/bin/gcc ./configure --host=arm-apple-darwin --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.2.sdk --extra-cflags='-arch armv7' --extra-ldflags='-arch armv7 -L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.2.sdk/usr/lib/system' --enable-static --disable-asm

CC=/Applications/Xcode.app/Contents/Developer/usr/bin/gcc ./configure --host=arm-apple-darwin --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.2.sdk --extra-cflags='-arch armv7s' --extra-ldflags='-arch armv7s -L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.2.sdk/usr/lib/system' --enable-static --disable-asm

CC=/Applications/Xcode.app/Contents/Developer/usr/bin/gcc ./configure --host=arm-apple-darwin --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.2.sdk --extra-cflags='-arch arm64' --extra-ldflags='-arch arm64 -L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.2.sdk/usr/lib/system' --enable-static --disable-asm

i386
未成功
CC=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc ./configure --host=i386-apple-darwin --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.2.sdk --extra-cflags='-arch i386' --extra-ldflags='-arch i386 -L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.2.sdk/usr/lib/system' --enable-static --disable-asm

有的时候需要手动填写 arm64 armv7 armv7s  i386 iPhoneSimulator.platform  i386-apple-darwin

最后执行 make
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值