changeset 8372:0e6528551f26 quic

Configure: unbreak with old OpenSSL, --with-http_v3_module added.
author Sergey Kandaurov <pluknet@nginx.com>
date Thu, 30 Apr 2020 15:47:43 +0300
parents 9d9531431c8c
children 796b5b6c43cd
files README auto/lib/openssl/conf auto/modules auto/options src/core/ngx_core.h
diffstat 5 files changed, 54 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/README
+++ b/README
@@ -82,9 +82,10 @@ 2. Installing
 
     $ hg clone https://hg.nginx.org/nginx-quic
     $ cd nginx-quic
-    $ ./auto/configure --with-debug --with-cc-opt="-I../boringssl/include"   \
-                                    --with-ld-opt="-L../boringssl/build/ssl  \
-                                                   -L../boringssl/build/crypto"
+    $ ./auto/configure --with-debug --with-http_v3_module       \
+                       --with-cc-opt="-I../boringssl/include"   \
+                       --with-ld-opt="-L../boringssl/build/ssl  \
+                                      -L../boringssl/build/crypto"
     $ make
 
 3. Configuration
--- a/auto/lib/openssl/conf
+++ b/auto/lib/openssl/conf
@@ -141,11 +141,29 @@ END
 
 fi
 
-ngx_feature="OpenSSL QUIC support"
-ngx_feature_name="NGX_OPENSSL_QUIC"
-ngx_feature_run=no
-ngx_feature_incs="#include <openssl/ssl.h>"
-ngx_feature_path=
-ngx_feature_libs="-lssl -lcrypto $NGX_LIBDL"
-ngx_feature_test="SSL_CTX_set_quic_method(NULL, NULL)"
-. auto/feature
+
+if [ $USE_OPENSSL_QUIC = YES ]; then
+
+    ngx_feature="OpenSSL QUIC support"
+    ngx_feature_name="NGX_OPENSSL_QUIC"
+    ngx_feature_run=no
+    ngx_feature_incs="#include <openssl/ssl.h>"
+    ngx_feature_path=
+    ngx_feature_libs="-lssl -lcrypto $NGX_LIBDL"
+    ngx_feature_test="SSL_CTX_set_quic_method(NULL, NULL)"
+    . auto/feature
+
+    if [ $ngx_found = no ]; then
+
+cat << END
+
+$0: error: certain modules require OpenSSL QUIC support.
+You can either do not enable the modules, or install the OpenSSL library
+into the system, or build the OpenSSL library statically from the source
+with nginx by using --with-openssl=<path> option.
+
+END
+        exit 1
+    fi
+
+fi
--- a/auto/modules
+++ b/auto/modules
@@ -404,9 +404,13 @@ if [ $HTTP = YES ]; then
     ngx_module_type=HTTP
 
     if [ $HTTP_V3 = YES ]; then
+        USE_OPENSSL=YES
+        USE_OPENSSL_QUIC=YES
         have=NGX_HTTP_V3 . auto/have
         have=NGX_HTTP_HEADERS . auto/have
 
+        HTTP_SSL=YES
+
         # XXX for Huffman
         HTTP_V2=YES
 
@@ -1265,19 +1269,24 @@ if [ $USE_OPENSSL = YES ]; then
     ngx_module_type=CORE
     ngx_module_name=ngx_openssl_module
     ngx_module_incs=
-    ngx_module_deps="src/event/ngx_event_openssl.h \
-                     src/event/ngx_event_quic.h \
-                     src/event/ngx_event_quic_transport.h \
-                     src/event/ngx_event_quic_protection.h"
-    ngx_module_srcs="src/event/ngx_event_openssl.c \
-                     src/event/ngx_event_openssl_stapling.c \
-                     src/event/ngx_event_quic.c \
-                     src/event/ngx_event_quic_transport.c \
-                     src/event/ngx_event_quic_protection.c"
+    ngx_module_deps=src/event/ngx_event_openssl.h
+    ngx_module_srcs="src/event/ngx_event_openssl.c
+                     src/event/ngx_event_openssl_stapling.c"
     ngx_module_libs=
     ngx_module_link=YES
     ngx_module_order=
 
+    if [ $USE_OPENSSL_QUIC = YES ]; then
+        ngx_module_deps="$ngx_module_deps \
+                         src/event/ngx_event_quic.h \
+                         src/event/ngx_event_quic_transport.h \
+                         src/event/ngx_event_quic_protection.h"
+        ngx_module_srcs="$ngx_module_srcs \
+                         src/event/ngx_event_quic.c \
+                         src/event/ngx_event_quic_transport.c \
+                         src/event/ngx_event_quic_protection.c"
+    fi
+
     . auto/module
 fi
 
--- a/auto/options
+++ b/auto/options
@@ -59,7 +59,7 @@ HTTP_CHARSET=YES
 HTTP_GZIP=YES
 HTTP_SSL=NO
 HTTP_V2=NO
-HTTP_V3=YES
+HTTP_V3=NO
 HTTP_SSI=YES
 HTTP_REALIP=NO
 HTTP_XSLT=NO
@@ -146,6 +146,7 @@ PCRE_CONF_OPT=
 PCRE_JIT=NO
 
 USE_OPENSSL=NO
+USE_OPENSSL_QUIC=NO
 OPENSSL=NONE
 
 USE_ZLIB=NO
@@ -225,6 +226,7 @@ do
 
         --with-http_ssl_module)          HTTP_SSL=YES               ;;
         --with-http_v2_module)           HTTP_V2=YES                ;;
+        --with-http_v3_module)           HTTP_V3=YES                ;;
         --with-http_realip_module)       HTTP_REALIP=YES            ;;
         --with-http_addition_module)     HTTP_ADDITION=YES          ;;
         --with-http_xslt_module)         HTTP_XSLT=YES              ;;
@@ -440,6 +442,7 @@ cat << END
 
   --with-http_ssl_module             enable ngx_http_ssl_module
   --with-http_v2_module              enable ngx_http_v2_module
+  --with-http_v3_module              enable ngx_http_v3_module
   --with-http_realip_module          enable ngx_http_realip_module
   --with-http_addition_module        enable ngx_http_addition_module
   --with-http_xslt_module            enable ngx_http_xslt_module
--- a/src/core/ngx_core.h
+++ b/src/core/ngx_core.h
@@ -84,10 +84,12 @@ typedef void (*ngx_connection_handler_pt
 #include <ngx_resolver.h>
 #if (NGX_OPENSSL)
 #include <ngx_event_openssl.h>
+#if (NGX_OPENSSL_QUIC)
 #include <ngx_event_quic.h>
 #include <ngx_event_quic_transport.h>
 #include <ngx_event_quic_protection.h>
 #endif
+#endif
 #include <ngx_process_cycle.h>
 #include <ngx_conf_file.h>
 #include <ngx_module.h>