一 概述
curl是一个利用URL语法在命令行下工作的文件传输工具,1997年首次发行。它支持文件上传和下载,所以是综合传输工具。在http https 通信中经常用到, 将编译方法总结分享出来。
二 下载 解压 curl
wget http://curl.haxx.se/download/curl-7.63.0.tar.gz
tar -xvzf curl-7.63.0.tar.gz
三 编译curl
Linux 编译
./configure --prefix=/usr/local/curl --disable-shared --enable-static --without-libidn --without-ssl --without-librtmp --without-gnutls --without-nss --without-libssh2 --without-zlib --without-winidn --disable-rtsp --disable-ldap --disable-ldaps --disable-ipv6
make
sudo make install
Arm 编译
./configure --host=arm-linux CC=arm-hisiv600-linux-gcc CXX=arm-hisiv600-linux-g++ --disable-shared --enable-static --without-libidn --without-ssl --without-librtmp --without-gnutls --without-nss --without-libssh2 --without-zlib --without-winidn --disable-rtsp --disable-ldap --disable-ldaps --disable-ipv6 --prefix=/home/xhw/share/arm/arm_hisi/curl
make
make install
四 学习文档
https://blog.csdn.net/andylauren/article/details/78821916
五 错误记录
1 使用curl静态库生成其他动态库 报如下错误:
/usr/local/lib/libcurl.a: could not read symbols: Bad value
解决方案:
在./configure 最后面增加 CFLAGS=-fPIC CPPFLAGS=-fPIC 配置