交叉编译树莓派的curl库支持ssl

1.开发环境
(1)装有openssl的ubuntu
(2)交叉编译工具arm-linux-gnueabihf-gcc
(3)openssl和libcurl源码
交叉编译工具的安装 https://blog.youkuaiyun.com/qq_46777053/article/details/110221159
libcurl源码的获取 https://github.com/curl/curl/releases/tag/curl-7_71_1
openssl源码的获取 终端输入wget --no-check-certificate https://www.openssl.org/source/openssl-1.1.1a.tar.gz

2.安装openssl
如果系统已经有,不需要再次安装 通过whereis openssl 命令查看
解压后进入openssl-1.1.1a文件夹

./config       //默认安装位置在/usr/local,此时需要在安装curl时 在后面添加 --wirh-ssl,具体的内容看 curl-7.71.1/docs/dINSTALL.md
make 
sudo make install

以上步骤得到的openssl 是x86的

curl-7.71.1/docs/dINSTALL.md的部分内容

The configure script always tries to find a working SSL library unless
explicitly told not to. If you have OpenSSL installed in the default search
path for your compiler/linker, you don't need to do anything special. If you
have OpenSSL installed in `/usr/local/ssl`, you can run configure like:

    ./configure --with-ssl

3.交叉编译curl
进入解压后的curl-7.71.1

./configure --prefix=$PWD/_installPi --host=arm-linux-gnueabihf CC=arm-linux-gnueabihf-gcc    
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值