从源代码为Linux构建openssl和libcurl

问题描述:

我正在尝试从源代码构建openssl和libcurl。乍一看,这看起来应该很容易,但我无法让我的卷曲构建识别我的openssl库。从源代码为Linux构建openssl和libcurl

我曾尝试以下步骤:

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 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. 

我也试过以下卷曲config call

LDFLAGS="-L/home/sossisos/curlssl/ssl/lib/" ./configure --with-ssl="/home/sossisos/curlssl/ssl/" 

我在做我的openssl构建错误吗?或者我的卷曲构建?是否不可能将openssl静态链接到curl?

+0

如果那是“完全”你在做什么,你不应该指向'/ home/sossisos/curlssl/ssl /',即 './configure --with-ssl =“/ home/sossisos/curlssl/SSL /“' – ZeekHuge

答案结果非常简单。所有这一切都需要的是添加的“低密度” lib和“ - 禁用共享”标志卷曲配置调用,这样

LIBS="-ldl" ./configure --with-ssl="/home/sossisos/curlssl/ssl/" --disable-shared 

然后

make 

这就是它!