正如丹尼尔所解释的在邮件列表上:
我的计划是将 http2 工作基于 nghttp2 库
(https://github.com/tatsuhiro-t/nghttp2) [...] HTTP2 将作为 libcurl 术语中的“功能”启动,而不是专门作为单独的协议。
所以首先你需要安装nghttp2手动[1]。
然后您需要在配置时显式启用 HTTP2 支持--with-nghttp2
:
./configure --with-nghttp2=/path/to/nghttp2/install/dir [...]
[1]:在编写自述文件时指出Ubuntu 中没有打包,所以需要自己构建.
EDIT
请查找以下基本说明,以仅使用默认选项构建库(而不是命令行工具)。
要构建 nghttp2,您首先需要安装其要求(详见nghttp2 文档页面):
# To clone the nghttp2 Github repo
yum install git
# Build essentials
yum install gcc
yum install make
yum install automake
yum install libtool
# Required to build the library
yum install pkgconfig
yum install zlib-devel
完成后克隆存储库:
git clone https://github.com/tatsuhiro-t/nghttp2.git
cd nghttp2
按照说明构建库here:
autoreconf -i
automake
autoconf
# Note: I assume you want to deploy it under /usr/local
# Feel free to adapt to your needs!
./configure --prefix=/usr/local
make
然后部署它:
make install
如果一切正常,那么您需要通过注意启用 nghttp2 来构建 libcurl 7.33.0./configure --with-nghttp2=/usr/local [...]
.
Extras
如果您想另外构建应用程序(nghttp
, ...) 在构建 nghttp2 之前你必须安装额外的软件包:
yum install openssl-devel
yum install libevent-devel
yum install libxml2-devel
yum install jansson-devel