libcurl 交叉编译

首先需要编译三方库 openssl,下面介绍 x86、arm 平台上的编译方式

x86

  1. git clone https://github.com/openssl/openssl.git
  2. make clean
  3. ./Configure prefix=$(pwd)/build_x86
  4. make install
  5. cd build_x86

arm

  1. git clone 
  2. make clean(在编译完 x86 产物后,一定要 clean 一遍否则在链接的时候会有问题)
  3. ./Configure linux-armv4 --cross-compile-prefix=arm-linux-gnueabihf- --prefix=$(pwd)/build_arm
  4. make install
  5. cd build_arm

产物包括:

  • libcrypto.so
  • libssl.so
  • libssl.so.3
  • libcrypto.so.3

然后开始编译 curl,下面同样介绍两个平台下的编译方式

arm

  1. autoreconf
  2. ./configure --prefix=$PWD/build_arm/ --host=arm --enable-shared --enable-static --with-openssl=openssl_path/build_arm/ CC=arm-linux-gnueabihf-gcc CXX=arm-linux-gnueabihf-g++
  3. make
  4. make install

x86

  1. autoreconf
  2. ./configure --prefix=$PWD/build_x86/
  3. make
  4. make install

产物包括:

  • libcurl.so
  • libcurl.so.4
  • libcurl.so.4.8.0
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值