5

我正在尝试在 Ubuntu 16.04 上使用boringssl 构建 curl。

我的boringssl建好了。

使用 curl 7.53 我配置使用:

./configure --with-ssl=/home/john/dev/boringssl

并且输出显示“SSL 支持:启用(BoringSSL)”OK。

但是当我make开始时,我会收到错误

  CC       vtls/libcurl_la-openssl.lo
In file included from vtls/openssl.c:86:0:
/usr/include/openssl/ui.h:85:1: error: unknown type name ‘UI’
 UI *UI_new(void);
 ^
/usr/include/openssl/ui.h:86:1: error: unknown type name ‘UI’
 UI *UI_new_method(const UI_METHOD *method);
 ^
/usr/include/openssl/ui.h:86:25: error: unknown type name ‘UI_METHOD’
 UI *UI_new_method(const UI_METHOD *method);
                         ^

并以

Makefile:2023: recipe for target 'vtls/libcurl_la-openssl.lo' failed
make[2]: *** [vtls/libcurl_la-openssl.lo] Error 1
make[2]: Leaving directory '/home/john/dev/curl-7.53.0/lib'
Makefile:734: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/home/john/dev/curl-7.53.0/lib'
Makefile:893: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1

我不确定/usr/include/openssl/ui.h当 curl 配置为使用boringssl 构建时是否应该使用此标头,看来此文件仅存在于OpenSSL 中,而不存在于boringssl 中。

4

1 回答 1

12

在boringssl 树中没有openssl/ui.h,您的构建清楚地找到了另一组包含文件(我猜是普通的OpenSSL)。

这就是我用boringssl构建的方式:

构建无聊ssl

$HOME/src 是我在此示例中放置代码的位置。你可以选择任何你喜欢的地方。

$ cd $HOME/src
$ git clone https://boringssl.googlesource.com/boringssl
$ cd boringssl
$ mkdir build
$ cd build
$ cmake -DCMAKE_POSITION_INDEPENDENT_CODE=on ..
$ make

设置构建树以被 curl 的配置检测到

在boringssl 源代码树根中,确保有一个lib和一个include目录。目录应该包含两个库(我将lib它们符号链接到构建目录中)。默认情况下,该include目录已经存在。像这样制作和填充lib (在源树根中发出的命令,而不是在build/子目录中)。

$ mkdir lib
$ cd lib
$ ln -s ../build/ssl/libssl.a
$ ln -s ../build/crypto/libcrypto.a

配置卷曲

LIBS=-lpthread ./configure --with-ssl=$HOME/src/boringssl(我指出了boringssl树的根)

验证在配置运行结束时,它应该说它检测到要使用 BoringSSL

构建卷曲

make在 curl 源代码树中运行

make install现在您可以使用etc正常安装 curl 。

于 2017-02-22T12:38:45.943 回答