我正在尝试从源代码构建openssl和libcurl。乍一看,这看起来应该很容易,但我无法通过我的curl构建来识别我的openssl库。
我尝试了以下步骤:
pwd
$ /home/sossisos/curlssl/
wget https://www.openssl.org/source/openssl-1.0.2i.tar.gz
tar xzf openssl-1.0.2i.tar.gz
cd openssl-1.0.2i
./config
make
cp libcrypto.a libssl.a ../ssl/lib/
cp -R include/ ../ssl/
cd ..
wget https://curl.haxx.se/download/curl-7.50.3.tar.gz
tar xzf curl-7.50.3.tar.gz
cd curl-7.50.3
./configure --with-ssl="/home/sossisos/curlssl/ssl/"
但curl的配置结果显示
curl version: 7.50.3
Host setup: x86_64-pc-linux-gnu
Install prefix: /usr/local
Compiler: gcc
SSL support: no (--with-{ssl,gnutls,nss,polarssl,mbedtls,cyassl,axtls,winssl,darwinssl} )
进一步说它还说
checking whether to enable Windows native SSL/TLS (Windows native builds only)... no
checking whether to enable iOS/Mac OS X native SSL/TLS... no
configure: PKG_CONFIG_LIBDIR will be set to "/home/sossisos/curlssl/ssl/lib/pkgconfig"
checking for HMAC_Update in -lcrypto... no
checking for HMAC_Init_ex in -lcrypto... no
checking for ssl_version in -laxtls... no
configure: WARNING: SSL disabled, you will not be able to use HTTPS, FTPS, NTLM and more.
configure: WARNING: Use --with-ssl, --with-gnutls, --with-polarssl, --with-cyassl, --with-nss, --with-axtls, --with-winssl, or --with-darwinssl to address this.
我还尝试了以下curl配置调用
LDFLAGS="-L/home/sossisos/curlssl/ssl/lib/" ./configure --with-ssl="/home/sossisos/curlssl/ssl/"
我的openssl构建有问题吗?还是我的卷发构建?是否无法将openssl静态链接到curl?
答案 0 :(得分:2)
答案结果非常简单。所需要的只是添加" ldl" lib和" - 禁用共享"标志为curl配置调用,如此
LIBS="-ldl" ./configure --with-ssl="/home/sossisos/curlssl/ssl/" --disable-shared
然后
make
那就是它!