[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnurl] 150/220: configure: use pkg-config to detect quiche
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnurl] 150/220: configure: use pkg-config to detect quiche |
Date: |
Thu, 12 Sep 2019 17:28:30 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository gnurl.
commit 08b99e17df5a2d1d98a2d9ab06eedf7405906105
Author: Alessandro Ghedini <address@hidden>
AuthorDate: Sun Aug 18 15:03:51 2019 +0100
configure: use pkg-config to detect quiche
This removes the need to hard-code the quiche target path in
configure.ac.
This depends on https://github.com/cloudflare/quiche/pull/128
Closes #4237
---
.travis.yml | 4 +--
configure.ac | 86 ++++++++++++++++++++++++++++++++++++++---------------------
docs/HTTP3.md | 6 ++---
3 files changed, 60 insertions(+), 36 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index 810ebb8f2..0a03e3bba 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -101,7 +101,7 @@ matrix:
compiler: gcc
dist: xenial
env:
- - T=novalgrind BORINGSSL=yes QUICHE="yes"
C="--with-ssl=$HOME/boringssl --with-quiche=$home/quiche --enable-alt-svc"
LD_LIBRARY_PATH=/home/travis/boringssl/lib:/usr/local/lib
+ - T=novalgrind BORINGSSL=yes QUICHE="yes"
C="--with-ssl=$HOME/boringssl --with-quiche=$HOME/quiche/target/release
--enable-alt-svc"
LD_LIBRARY_PATH=/home/travis/boringssl/lib:$HOME/quiche/target/release:/usr/local/lib
- OVERRIDE_CC="CC=gcc-8" OVERRIDE_CXX="CXX=g++-8"
addons:
apt:
@@ -435,7 +435,7 @@ before_script:
curl https://sh.rustup.rs -sSf | sh -s -- -y &&
source $HOME/.cargo/env &&
cd quiche &&
- QUICHE_BSSL_PATH=$HOME/boringssl cargo build -v --release)
+ QUICHE_BSSL_PATH=$HOME/boringssl cargo build -v --release --features
pkg-config-meta)
fi
- |
if [ $TRAVIS_OS_NAME = linux ]; then
diff --git a/configure.ac b/configure.ac
index bd837e6a5..718259699 100755
--- a/configure.ac
+++ b/configure.ac
@@ -3534,14 +3534,19 @@ AC_HELP_STRING([--with-quiche=PATH],[Enable quiche
usage])
AC_HELP_STRING([--without-quiche],[Disable quiche usage]),
[OPT_QUICHE=$withval])
case "$OPT_QUICHE" in
- *)
+ no)
+ dnl --without-quiche option used
+ want_quiche="no"
+ ;;
+ yes)
dnl --with-quiche option used without path
want_quiche="default"
want_quiche_path=""
;;
- no)
- dnl --without-quiche option used
- want_quiche="no"
+ *)
+ dnl --with-quiche option used with path
+ want_quiche="yes"
+ want_quiche_path="$withval"
;;
esac
@@ -3551,36 +3556,55 @@ if test X"$want_quiche" != Xno; then
CLEANCPPFLAGS="$CPPFLAGS"
CLEANLIBS="$LIBS"
- LIB_QUICHE="-lquiche -ldl -lpthread"
- CPP_QUICHE="-I$OPT_QUICHE/include"
- LD_QUICHE="-L$OPT_QUICHE/target/release"
+ CURL_CHECK_PKGCONFIG(quiche, $want_quiche_path)
- LDFLAGS="$LDFLAGS $LD_QUICHE"
- CPPFLAGS="$CPPFLAGS $CPP_QUICHE"
- LIBS="$LIB_QUICHE $LIBS"
+ if test "$PKGCONFIG" != "no" ; then
+ LIB_QUICHE=`CURL_EXPORT_PCDIR([$want_quiche_path])
+ $PKGCONFIG --libs-only-l quiche`
+ AC_MSG_NOTICE([-l is $LIB_QUICHE])
+
+ CPP_QUICHE=`CURL_EXPORT_PCDIR([$want_quiche_path]) dnl
+ $PKGCONFIG --cflags-only-I quiche`
+ AC_MSG_NOTICE([-I is $CPP_QUICHE])
+
+ LD_QUICHE=`CURL_EXPORT_PCDIR([$want_quiche_path])
+ $PKGCONFIG --libs-only-L quiche`
+ AC_MSG_NOTICE([-L is $LD_QUICHE])
- if test "x$cross_compiling" != "xyes"; then
- DIR_QUICHE=`echo $LD_QUICHE | $SED -e 's/-L//'`
+ LDFLAGS="$LDFLAGS $LD_QUICHE"
+ CPPFLAGS="$CPPFLAGS $CPP_QUICHE"
+ LIBS="$LIB_QUICHE $LIBS"
+
+ if test "x$cross_compiling" != "xyes"; then
+ DIR_QUICHE=`echo $LD_QUICHE | $SED -e 's/-L//'`
+ fi
+ AC_CHECK_LIB(quiche, quiche_connect,
+ [
+ AC_CHECK_HEADERS(quiche.h,
+ experimental="$experimental HTTP3"
+ AC_MSG_NOTICE([HTTP3 support is experimental])
+ curl_h3_msg="enabled (quiche)"
+ QUICHE_ENABLED=1
+ AC_DEFINE(USE_QUICHE, 1, [if quiche is in use])
+ AC_SUBST(USE_QUICHE, [1])
+ CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_QUICHE"
+ export CURL_LIBRARY_PATH
+ AC_MSG_NOTICE([Added $DIR_QUICHE to CURL_LIBRARY_PATH]),
+ )
+ ],
+ dnl not found, revert back to clean variables
+ LDFLAGS=$CLEANLDFLAGS
+ CPPFLAGS=$CLEANCPPFLAGS
+ LIBS=$CLEANLIBS
+ )
+ else
+ dnl no nghttp3 pkg-config found, deal with it
+ if test X"$want_quiche" != Xdefault; then
+ dnl To avoid link errors, we do not allow --with-nghttp3 without
+ dnl a pkgconfig file
+ AC_MSG_ERROR([--with-quiche was specified but could not find quiche
pkg-config file.])
+ fi
fi
- AC_CHECK_LIB(quiche, quiche_connect,
- [
- AC_CHECK_HEADERS(quiche.h,
- experimental="$experimental HTTP3"
- AC_MSG_NOTICE([HTTP3 support is experimental])
- curl_h3_msg="enabled (quiche)"
- QUICHE_ENABLED=1
- AC_DEFINE(USE_QUICHE, 1, [if quiche is in use])
- AC_SUBST(USE_QUICHE, [1])
- CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_QUICHE"
- export CURL_LIBRARY_PATH
- AC_MSG_NOTICE([Added $DIR_QUICHE to CURL_LIBRARY_PATH]),
- )
- ],
- dnl not found, revert back to clean variables
- LDFLAGS=$CLEANLDFLAGS
- CPPFLAGS=$CLEANCPPFLAGS
- LIBS=$CLEANLIBS
- )
fi
dnl **********************************************************************
diff --git a/docs/HTTP3.md b/docs/HTTP3.md
index e6a8874c8..a646da5af 100644
--- a/docs/HTTP3.md
+++ b/docs/HTTP3.md
@@ -84,10 +84,10 @@ you'll just get ld.so linker errors.
Clone quiche and BoringSSL:
% git clone --recursive https://github.com/cloudflare/quiche
- % cd quiche/deps/boringssl
Build BoringSSL (it needs to be built manually so it can be reused with curl):
+ % cd quiche/deps/boringssl
% mkdir build
% cd build
% cmake -DCMAKE_POSITION_INDEPENDENT_CODE=on ..
@@ -100,7 +100,7 @@ Build BoringSSL (it needs to be built manually so it can be
reused with curl):
Build quiche:
% cd ../..
- % QUICHE_BSSL_PATH=$PWD/deps/boringssl cargo build --release
+ % QUICHE_BSSL_PATH=$PWD/deps/boringssl cargo build --release --features
pkg-config-meta
Clone and build curl:
@@ -108,7 +108,7 @@ Clone and build curl:
% git clone https://github.com/curl/curl
% cd curl
% ./buildconf
- % ./configure --with-ssl=$PWD/../quiche/deps/boringssl/.openssl
--with-quiche=$PWD/../quiche --enable-debug
+ % ./configure LDFLAGS="-Wl,-rpath,$PWD/../quiche/target/release"
--with-ssl=$PWD/../quiche/deps/boringssl/.openssl
--with-quiche=$PWD/../quiche/target/release
% make -j`nproc`
## Running
--
To stop receiving notification emails like this one, please contact
address@hidden.
- [GNUnet-SVN] [gnurl] 130/220: ngtcp2: deal with stream close, (continued)
- [GNUnet-SVN] [gnurl] 130/220: ngtcp2: deal with stream close, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 131/220: ngtcp2: add missing nghttp3_conn_add_write_offset call, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 132/220: ngtcp2: provide the callbacks as a static struct, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 85/220: curl: make use of CURLINFO_RETRY_AFTER when retrying, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 89/220: alt-svc: send Alt-Used: in redirected requests, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 141/220: vssh: move ssh init/cleanup functions into backend code, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 114/220: CURLOPT_ALTSVC_CTRL.3: remove CURLALTSVC_ALTUSED, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 120/220: curl_version_info: make the quic_version a const, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 126/220: connect: connections are persistent by default for HTTP/3, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 134/220: travis: reduce number of torture tests in 'coverage', gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 150/220: configure: use pkg-config to detect quiche,
gnunet <=
- [GNUnet-SVN] [gnurl] 129/220: ngtcp2: Consume QUIC STREAM data properly, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 137/220: travis: add a quiche build, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 149/220: CURLOPT_SSL_VERIFYHOST: treat the value 1 as 2, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 154/220: openssl: build warning free with boringssl, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 165/220: ngtcp2: use nghttp3_version(), gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 166/220: ngtcp2: improve h3 response receiving, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 136/220: http: fix use of credentials from URL when using HTTP proxy, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 155/220: spnego_sspi: add typecast to fix build warning, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 152/220: ngtcp2: make postfields-set posts work, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 162/220: http: the 'closed' struct field is used by both ngh2 and ngh3, gnunet, 2019/09/12