新版的curl 支持了更细致时间粒度的curl_easy_getinfo,以及HTTP2, 这里介绍手工编译源码安装方式,并使用openssl1.1.1b
从https://www.openssl.org/ 下载1.1.1 序列的long-term 源码,并编译安装 ./config --prefix=/opt/itc/openssl enable-weak-ssl-ciphers no-shared && make && make install
从https://nghttp2.org/ 下载nghttp2库, curl 需要它才能支持HTTP2,编译安装, OPENSSL_LIBS="/opt/itc/openssl/lib/" ./configure --prefix=/opt/itc/curl/nghttp2–enable-static=yes –enable-shared=no && make && make install
从https://curl.haxx.se/ 下载最新的curl版本,并编译安装,编译参数如下
./configure LDFLAGS="-static" --prefix=/opt/itc/curl --with-ssl=/opt/itc/openssl --with-nghttp2=/opt/itc/curl/nghttp2 --disable-ldaps --without-libidn2 --enable-static=yes --enable-shared=no
make
make install
这样子得到的是不依赖openssl和nghttp2动态链接库的curl,可以拷走给别的机器
./configure LDFLAGS="-static" --prefix=/opt/itc/curl --wi