summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2019-08-10 23:19:55 +0200
committerDaniel Stenberg <daniel@haxx.se>2019-08-12 00:18:53 +0200
commitd85a1cf11d31bbf7a91c406ba011e0235688c527 (patch)
tree509c1a70183bbb03b4134411247ed38c362f2a4f /configure.ac
parent17d1e27d309f16da960fd3b9933e6e2b1db22b17 (diff)
downloadcurl-d85a1cf11d31bbf7a91c406ba011e0235688c527.tar.gz
nghttp3: required when ngtcp2 is used for QUIC
- checked for by configure - updated docs/HTTP3.md - shown in the version string Closes #4210
Diffstat (limited to 'configure.ac')
-rwxr-xr-xconfigure.ac93
1 files changed, 91 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index 020a0e08c..32b25ac6e 100755
--- a/configure.ac
+++ b/configure.ac
@@ -3402,14 +3402,12 @@ if test X"$want_tcp2" != Xno; then
AC_CHECK_LIB(ngtcp2, ngtcp2_conn_client_new,
[
AC_CHECK_HEADERS(ngtcp2/ngtcp2.h,
- curl_h3_msg="enabled (ngtcp2)"
NGTCP2_ENABLED=1
AC_DEFINE(USE_NGTCP2, 1, [if ngtcp2 is in use])
AC_SUBST(USE_NGTCP2, [1])
CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_TCP2"
export CURL_LIBRARY_PATH
AC_MSG_NOTICE([Added $DIR_TCP2 to CURL_LIBRARY_PATH])
- experimental="$experimental HTTP3"
)
],
dnl not found, revert back to clean variables
@@ -3430,6 +3428,97 @@ if test X"$want_tcp2" != Xno; then
fi
dnl **********************************************************************
+dnl Check for nghttp3 (HTTP/3 with ngtcp2)
+dnl **********************************************************************
+
+OPT_NGHTTP3="yes"
+
+if test "x$NGTCP2_ENABLED" = "x"; then
+ # without ngtcp2, nghttp3 is of no use for us
+ OPT_NGHTTP3="no"
+fi
+
+AC_ARG_WITH(nghttp3,
+AC_HELP_STRING([--with-nghttp3=PATH],[Enable nghttp3 usage])
+AC_HELP_STRING([--without-nghttp3],[Disable nghttp3 usage]),
+ [OPT_NGHTTP3=$withval])
+case "$OPT_NGHTTP3" in
+ no)
+ dnl --without-nghttp3 option used
+ want_nghttp3="no"
+ ;;
+ yes)
+ dnl --with-nghttp3 option used without path
+ want_nghttp3="default"
+ want_nghttp3_path=""
+ ;;
+ *)
+ dnl --with-nghttp3 option used with path
+ want_nghttp3="yes"
+ want_nghttp3_path="$withval/lib/pkgconfig"
+ ;;
+esac
+
+curl_http3_msg="disabled (--with-nghttp3)"
+if test X"$want_nghttp3" != Xno; then
+ dnl backup the pre-nghttp3 variables
+ CLEANLDFLAGS="$LDFLAGS"
+ CLEANCPPFLAGS="$CPPFLAGS"
+ CLEANLIBS="$LIBS"
+
+ CURL_CHECK_PKGCONFIG(libnghttp3, $want_nghttp3_path)
+
+ if test "$PKGCONFIG" != "no" ; then
+ LIB_NGHTTP3=`CURL_EXPORT_PCDIR([$want_nghttp3_path])
+ $PKGCONFIG --libs-only-l libnghttp3`
+ AC_MSG_NOTICE([-l is $LIB_NGHTTP3])
+
+ CPP_NGHTTP3=`CURL_EXPORT_PCDIR([$want_nghttp3_path]) dnl
+ $PKGCONFIG --cflags-only-I libnghttp3`
+ AC_MSG_NOTICE([-I is $CPP_NGHTTP3])
+
+ LD_NGHTTP3=`CURL_EXPORT_PCDIR([$want_nghttp3_path])
+ $PKGCONFIG --libs-only-L libnghttp3`
+ AC_MSG_NOTICE([-L is $LD_NGHTTP3])
+
+ LDFLAGS="$LDFLAGS $LD_NGHTTP3"
+ CPPFLAGS="$CPPFLAGS $CPP_NGHTTP3"
+ LIBS="$LIB_NGHTTP3 $LIBS"
+
+ if test "x$cross_compiling" != "xyes"; then
+ DIR_NGHTTP3=`echo $LD_NGHTTP3 | $SED -e 's/-L//'`
+ fi
+ AC_CHECK_LIB(nghttp3, nghttp3_conn_client_new,
+ [
+ AC_CHECK_HEADERS(nghttp3/nghttp3.h,
+ curl_h3_msg="enabled (ngtcp2 + nghttp3)"
+ NGHTTP3_ENABLED=1
+ AC_DEFINE(USE_NGHTTP3, 1, [if nghttp3 is in use])
+ AC_SUBST(USE_NGHTTP3, [1])
+ CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_NGHTTP3"
+ export CURL_LIBRARY_PATH
+ AC_MSG_NOTICE([Added $DIR_NGHTTP3 to CURL_LIBRARY_PATH])
+ experimental="$experimental HTTP3"
+ )
+ ],
+ 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_nghttp3" != Xdefault; then
+ dnl To avoid link errors, we do not allow --with-nghttp3 without
+ dnl a pkgconfig file
+ AC_MSG_ERROR([--with-nghttp3 was specified but could not find nghttp3 pkg-config file.])
+ fi
+ fi
+
+fi
+
+dnl **********************************************************************
dnl Check for quiche (QUIC)
dnl **********************************************************************