x264 编译总结

来源:互联网 发布:protel手机版软件 编辑:程序博客网 时间:2024/05/29 23:45
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  i386iPhoneSimulator.platform  i386-apple-darwin

最后执行make
0 0
原创粉丝点击