I did this
- I found HTTP3: ngtcp2 builds are no longer experimental, and tried to build
curl-8.5.0 with nghttp3-1.1.0, ngtcp2-1.1.0 and boringssl in linux.
- The nghttp3/ngtcp2/boringssl's library were built success, but failed when building curl. The error info was
configure: error: --with-ngtcp2 was specified but could not find ngtcp2_crypto_openssl pkg-config file.
- The configure only
checking for libngtcp2_crypto_openssl options with pkg-config, but not contain libngtcp2_crypto_boringssl. However, the ngtcp2's output just have libngtcp2_crypto_boringssl.a and libngtcp2_crypto_boringssl.pc, so the curl's configure failed.
[yl@yldev-161edcc8c lib]$ ll
total 1512
-rw-r--r-- 1 yl root 1429772 Jan 17 10:22 libngtcp2.a
-rw-r--r-- 1 yl root 105938 Jan 17 10:22 libngtcp2_crypto_boringssl.a
-rwxr-xr-x 1 yl root 1043 Jan 17 10:22 libngtcp2.la
drwxr-xr-x 2 yl root 4096 Jan 17 10:22 pkgconfig
[yl@yldev-161edcc8c lib]$ ll pkgconfig/
total 8
-rw-r--r-- 1 yl root 1435 Jan 17 10:22 libngtcp2_crypto_boringssl.pc
-rw-r--r-- 1 yl root 1384 Jan 17 10:22 libngtcp2.pc
- I tried to fake libngtcp2_crypto_boringssl as libngtcp2_crypto_openssl like below, then built curl success. But not sure that was a safe way.
ln -sfnv libngtcp2_crypto_boringssl.a libngtcp2_crypto_openssl.a
cp -fv libngtcp2_crypto_boringssl.pc libngtcp2_crypto_openssl.pc, and modify Name to libngtcp2_crypto_openssl
- All librarys' building script please see below, is there another way to support libngtcp2_crypto_boringssl?
Detail building script
#!/bin/bash
curPath=$(cd $(dirname $0); pwd)
outPath=${curPath}/output_linux
cmake \
-DCMAKE_INSTALL_PREFIX="${outPath}" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_FLAGS_RELEASE="-fPIC" \
-DCMAKE_CXX_FLAGS_RELEASE="-fPIC" \
-DCMAKE_ASM_FLAGS_RELEASE="-fPIC" \
-DOPENSSL_NO_ASM=1 \
-GNinja \
../..
cmake --build . -v
#!/bin/bash
curPath=$(cd $(dirname $0); pwd)
outPath="${curPath}/output_linux"
set -e
export CFLAGS="-pipe -fPIC -g"
export CXXFLAGS="${CFLAGS}"
./configure --prefix=${outPath} \
--enable-lib-only \
--enable-static \
--disable-shared
make -j8 V=1
make install
#!/bin/bash
curPath=$(cd $(dirname $0); pwd)
outPath="${curPath}/output_linux"
sslPath="${curPath}/../boringssl/output_linux"
nghttp3Path="${curPath}/../nghttp3/output_linux"
set -e
export CFLAGS="-pipe -fPIC -g"
export CXXFLAGS="${CFLAGS}"
export LDFLAGS="-L${sslPath}/lib -L${nghttp3Path}/lib"
export LIBS="-lpthread"
export BORINGSSL_CFLAGS="-I${sslPath}/include"
export BORINGSSL_LIBS="-lssl -lcrypto"
export NGHTTP3_CFLAGS="-I${nghttp3Path}/include"
export NGHTTP3_LIBS="-lnghttp3"
export PKG_CONFIG_PATH="${nghttp3Path}/lib/pkgconfig"
./configure --prefix=${outPath} \
--enable-lib-only \
--enable-static \
--disable-shared \
--with-boringssl \
--with-libnghttp3
make -j8 V=1
make install
#!/bin/bash
curPath=$(cd $(dirname $0); pwd)
outPath="${curPath}/output_linux"
sslPath="${curPath}/../boringssl/output_linux"
nghttp2Path="${curPath}/../nghttp2/output_linux"
nghttp3Path="${curPath}/../nghttp3/output_linux"
ngtcp2Path="${curPath}/../ngtcp2/output_linux"
set -e
export CFLAGS="-pipe -fPIC -g -O0"
./configure --prefix=${outPath} \
--with-ssl=${sslPath} \
--with-nghttp2=${nghttp2Path} \
--with-nghttp3=${nghttp3Path} \
--with-ngtcp2=${ngtcp2Path}
make -j8 V=1
make install
curl/libcurl version
curl-8.5.0 release
operating system
Linux mylinux 3.10.0-693.21.1.el7.x86_64 #1 SMP Wed Mar 7 19:03:37 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
I did this
curl-8.5.0withnghttp3-1.1.0,ngtcp2-1.1.0andboringsslin linux.configure: error: --with-ngtcp2 was specified but could not find ngtcp2_crypto_openssl pkg-config file.checking for libngtcp2_crypto_openssl options with pkg-config, but not containlibngtcp2_crypto_boringssl. However, the ngtcp2's output just havelibngtcp2_crypto_boringssl.aandlibngtcp2_crypto_boringssl.pc, so the curl's configure failed.ln -sfnv libngtcp2_crypto_boringssl.a libngtcp2_crypto_openssl.acp -fv libngtcp2_crypto_boringssl.pc libngtcp2_crypto_openssl.pc, and modify Name tolibngtcp2_crypto_opensslDetail building script
curl/libcurl version
curl-8.5.0 releaseoperating system
Linux mylinux 3.10.0-693.21.1.el7.x86_64 #1 SMP Wed Mar 7 19:03:37 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux