linux下第三方库的交叉编译参数总结

linux下第三方库的交叉编译参数总结

一、平台类别
1、ios:

--host=arm-apple-darwin
--sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/

--extra-cflags='-arch armv7s'
--extra-ldflags='-arch armv7s -L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/usr/lib/system'

2、android:
--host=arm-linux
--cross-prefix=/opt/android-ndk-r10/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin/arm-linux-androideabi-
--sysroot=/opt/android-ndk-r10/platforms/android-14/arch-arm
--extra-cflags='-march=armv7-a -mtune=cortex-a8 -mfloat-abi=softfp -mfpu=neon -D__ARM_ARCH_7__ -D__ARM_ARCH_7A__'

3、win32:
--host=i686-w64-mingw32
--cross-prefix=i686-w64-mingw32-

注意:
--cross-prefix,--sysroot 不是所有库都需要的。
--prefix很多需要绝对路径


二、范例:
1、编译libopus
linux:
./configure --enable-static --disable-shared --prefix=/home/kevin/studio/opensource/opus-1.1/build

win32:
./configure --enable-static --disable-shared --host=i686-w64-mingw32 --prefix=/home/kevin/studio/opensource/opus-1.1/build-win32

android:
./configure --disable-static --enable-shared --host=arm-linux --prefix=/home/kevin/studio/opensource/opus-1.1/build-android
./configure --disable-shared --enable-static  --host=arm-linux --prefix=/home/kevin/studio/opensource/opus-1.1/build-android --with-sysroot=/opt/android-ndk-r10/platforms/android-14/arch-arm

ios:
./configure --enable-static --disable-shared --host=arm-apple-darwin --prefix=/home/kevin/studio/opensource/opus-1.1/build-ios


2、编译aac
linux:
./configure --enable-static --disable-shared  --with-mp4v2=no --prefix=/home/kevin/studio/opensource/faac-1.28/build 

win32:
./configure --enable-static --disable-shared  --with-mp4v2=no --host=i686-w64-mingw32 --prefix=/home/kevin/studio/opensource/faac-1.28/build-win32

android:
./configure --enable-static --disable-shared  --with-mp4v2=no --host=arm-linux --prefix=/home/kevin/studio/opensource/faac-1.28/build-android

ios:
./configure --enable-static --disable-shared  --with-mp4v2=no --host=arm-apple-darwin --prefix=/home/kevin/studio/opensource/faac-1.28/build-ios



  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值