无法在RHEL 7.3上构建最新的libcurl 012

问题描述:

解决此编译错误的正确方法是什么?因此,我可以在RHEL 7.3上安装最新的libcurl?无法在RHEL 7.3上构建最新的libcurl 012

我已经能够获得最新的openssl,构建和安装它。 OpenSSL 1.1.1-dev xx XXX xxxx现在由openssl version报告。最新卷曲从https://github.com/curl/curl.git克隆/拉。下面是我使用bash脚本片段:

CD=$(pwd) 
CPPFLAGS="-I$CD/zlib -I$CD/openssl -I$CD/openssl/include" 
LDFLAGS="-L$CD/zlib -L$CD/openssl" 
LIBS="-ldl" 
cd curl 
./buildconf 
./configure --disable-shared --with-zlib --with-ssl 
make 
make install 

sudomake完成运行批处理没有错误。 make install产生这样的:

CC  libcurl_la-openssl.lo 
vtls/openssl.c: In function 'Curl_ossl_seed': 
vtls/openssl.c:279:5: error: implicit declaration of function 'RAND_egd' [- 
Werror=implicit-function-declaration] 
    int ret = RAND_egd(data->set.str[STRING_SSL_EGDSOCKET]? 
^
cc1: some warnings being treated as errors 
make[2]: *** [libcurl_la-openssl.lo] Error 1 
make[2]: Leaving directory `/home/john/curl/lib' 
make[1]: *** [all] Error 2 
make[1]: Leaving directory `/home/john/curl/lib' 
make: *** [all-recursive] Error 1 
+0

哦,这是我今天看到的有关libcurl没有建立的第10篇文章:( – arboreal84

+0

可能是缺少vtls/openssl.c中的#include指令 –

+0

@ arboreal84在发布之前,我也拉了几个旧版本,在RHEL7.3中出现类似的阻塞错误,你仍然认为这是一个curl配置问题? –

编辑:已更新,更清楚地版本 下面是步骤与最新openssl

CD=$(pwd) 
echo Setting up openssl 
if [ ! -d openssl ]; then 
    git clone https://github.com/openssl/openssl.git 
    cd openssl 
else 
    cd openssl 
    git pull 
fi 
# you may not need -Wl,--enable-new-dtags but it works for me 
./config -Wl,--enable-new-dtags --prefix=/usr/local/ssl --openssldir=/usr/local/ssl 
make depend 
make 
sudo make install 
cd .. 

lib=zlib-1.2.11 
echo Setting up zlib 
if [ ! -d zlib ]; then 
    wget http://zlib.net/$lib.tar.gz 
    tar xzvf $lib.tar.gz 
    mv $lib zlib 
fi 
cd zlib 
./configure 
make 
cd .. 

echo Setting up curl ... 
CD=$(pwd) 

if [ ! -d curl ]; then 
    git clone https://github.com/curl/curl.git 
    cd curl 
else 
    cd curl 
    git pull 
fi 

cd curl 
./buildconf 
PKG_CONFIG_PATH=/usr/local/ssl/lib/pkgconfig LIBS="-ldl" ./configure --with- 
zlib=$CD/zlib --disable-shared 
make 
# I use local curl build without installing it 
# make install 
cd .. 

我衷心希望这可以帮助别人建立curl

+0

@DanielStenberg,而不是投我的答案,最好提供一个更正确的答案,但是我已经更新了一个更新的答案,干净的解决方案我相信你现在会赞成。 –

RAND_egd()不再是默认OpenSSL安装的一部分。见this git commit。您可以通过在configure命令中添加enable-egd来解决问题。