]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
Makefile.m32: allow -nghttp3/-ngtcp2 without -ssl [ci skip]
authorViktor Szakats <commit@vsz.me>
Mon, 15 Aug 2022 02:49:59 +0000 (02:49 +0000)
committerViktor Szakats <commit@vsz.me>
Mon, 15 Aug 2022 02:49:59 +0000 (02:49 +0000)
Before this patch `-nghttp3`/`-ngtcp2` had an effect only when `-ssl`
was also enabled. `-ssl` meaning OpenSSL (and its forks). After
8a13be227eede2601c2b3b1c63e08b3dc9b35dd5 nghttp3/ngtcp2 can also be
used together with wolfSSL. This patch adds the ability to enable
`-nghttp3`/`-ngtcp2` independently from `-ssl` (OpenSSL), allowing to
use it with wolfSSL or other, future TLS backends.

Before this patch, it was fine to enable `-nghttp3`/`-ngtcp2`
unconditionally. After this patch, this is no longer the case, and now
it's the user's responsibility to enable `-nghttp3`/`-ngtcp2` only
together with a compatible TLS backend.

When using a TLS backend other than OpenSSL, the TLS-specific ngtcp2
library must be configured manually, e.g.:
  `export CURL_LDFLAG_EXTRAS=-lngtcp2_crypto_wolfssl`

(or via `NGTCP2_LIBS`)

Closes #9314

docs/examples/Makefile.m32
lib/Makefile.m32
lib/curl_ntlm_core.c
src/Makefile.m32

index f802d55367f0449bab4338644e2626111a4eb75e..cc1fc9772e3124388a3199783101cd05f4a1782e 100644 (file)
@@ -275,21 +275,23 @@ ifdef SSH2
     endif
   endif
 endif
-ifdef SSL
-  ifdef NGHTTP3
-    CFLAGS += -DUSE_NGHTTP3
-    curl_LDADD += -L"$(NGHTTP3_PATH)/lib" -lnghttp3
-    ifdef NGTCP2
-      CFLAGS += -DUSE_NGTCP2
-      curl_LDADD += -L"$(NGTCP2_PATH)/lib"
-      ifdef NGTCP2_LIBS
-        curl_LDADD += $(NGTCP2_LIBS)
-      else
-        curl_LDADD += -lngtcp2 -lngtcp2_crypto_openssl
+ifdef NGHTTP3
+  CFLAGS += -DUSE_NGHTTP3
+  curl_LDADD += -L"$(NGHTTP3_PATH)/lib" -lnghttp3
+  ifdef NGTCP2
+    CFLAGS += -DUSE_NGTCP2
+    curl_LDADD += -L"$(NGTCP2_PATH)/lib"
+    ifdef NGTCP2_LIBS
+      curl_LDADD += $(NGTCP2_LIBS)
+    else
+      curl_LDADD += -lngtcp2
+      ifdef SSL
+        curl_LDADD += -lngtcp2_crypto_openssl
       endif
     endif
   endif
-
+endif
+ifdef SSL
   ifndef OPENSSL_INCLUDE
     ifeq "$(wildcard $(OPENSSL_PATH)/outinc)" "$(OPENSSL_PATH)/outinc"
       OPENSSL_INCLUDE = $(OPENSSL_PATH)/outinc
index e8c9682a63c20e510054c562e82eb58b6f1348f6..9b8a31569d26f488c859cb0f8d0f8c111cc04070 100644 (file)
@@ -291,23 +291,25 @@ ifdef SSH2
     endif
   endif
 endif
-ifdef SSL
-  ifdef NGHTTP3
-    INCLUDES += -I"$(NGHTTP3_PATH)/include"
-    CFLAGS += -DUSE_NGHTTP3
-    DLL_LIBS += -L"$(NGHTTP3_PATH)/lib" -lnghttp3
-    ifdef NGTCP2
-      INCLUDES += -I"$(NGTCP2_PATH)/include"
-      CFLAGS += -DUSE_NGTCP2
-      DLL_LIBS += -L"$(NGTCP2_PATH)/lib"
-      ifdef NGTCP2_LIBS
-        DLL_LIBS += $(NGTCP2_LIBS)
-      else
-        DLL_LIBS += -lngtcp2 -lngtcp2_crypto_openssl
+ifdef NGHTTP3
+  INCLUDES += -I"$(NGHTTP3_PATH)/include"
+  CFLAGS += -DUSE_NGHTTP3
+  DLL_LIBS += -L"$(NGHTTP3_PATH)/lib" -lnghttp3
+  ifdef NGTCP2
+    INCLUDES += -I"$(NGTCP2_PATH)/include"
+    CFLAGS += -DUSE_NGTCP2
+    DLL_LIBS += -L"$(NGTCP2_PATH)/lib"
+    ifdef NGTCP2_LIBS
+      DLL_LIBS += $(NGTCP2_LIBS)
+    else
+      DLL_LIBS += -lngtcp2
+      ifdef SSL
+        DLL_LIBS += -lngtcp2_crypto_openssl
       endif
     endif
   endif
-
+endif
+ifdef SSL
   ifndef OPENSSL_INCLUDE
     ifeq "$(wildcard $(OPENSSL_PATH)/outinc)" "$(OPENSSL_PATH)/outinc"
       OPENSSL_INCLUDE = $(OPENSSL_PATH)/outinc
index eabb000d1486204c1fb28b92a6f9183e2d778fc8..b56c647a5aa9b0b78cf926eaf6e56b8bafd6a1c2 100644 (file)
 
 #if defined(USE_OPENSSL_DES) || defined(USE_WOLFSSL)
 
-#ifdef USE_WOLFSSL
+#if defined(USE_OPENSSL)
+#  include <openssl/des.h>
+#  include <openssl/md5.h>
+#  include <openssl/ssl.h>
+#  include <openssl/rand.h>
+#else
 #  include <wolfssl/options.h>
 #  include <wolfssl/openssl/des.h>
 #  include <wolfssl/openssl/md5.h>
 #  include <wolfssl/openssl/ssl.h>
 #  include <wolfssl/openssl/rand.h>
-#else
-#  include <openssl/des.h>
-#  include <openssl/md5.h>
-#  include <openssl/ssl.h>
-#  include <openssl/rand.h>
 #endif
 
 #  if (defined(OPENSSL_VERSION_NUMBER) && \
index 8ed3fee827a17734c6a0380e0d422da45cde7ca4..633cbaeb8b562de54facd206a079ccacd8145798 100644 (file)
@@ -303,21 +303,23 @@ ifdef SSH2
     endif
   endif
 endif
-ifdef SSL
-  ifdef NGHTTP3
-    CFLAGS += -DUSE_NGHTTP3
-    curl_LDADD += -L"$(NGHTTP3_PATH)/lib" -lnghttp3
-    ifdef NGTCP2
-      CFLAGS += -DUSE_NGTCP2
-      curl_LDADD += -L"$(NGTCP2_PATH)/lib"
-      ifdef NGTCP2_LIBS
-        curl_LDADD += $(NGTCP2_LIBS)
-      else
-        curl_LDADD += -lngtcp2 -lngtcp2_crypto_openssl
+ifdef NGHTTP3
+  CFLAGS += -DUSE_NGHTTP3
+  curl_LDADD += -L"$(NGHTTP3_PATH)/lib" -lnghttp3
+  ifdef NGTCP2
+    CFLAGS += -DUSE_NGTCP2
+    curl_LDADD += -L"$(NGTCP2_PATH)/lib"
+    ifdef NGTCP2_LIBS
+      curl_LDADD += $(NGTCP2_LIBS)
+    else
+      curl_LDADD += -lngtcp2
+      ifdef SSL
+        curl_LDADD += -lngtcp2_crypto_openssl
       endif
     endif
   endif
-
+endif
+ifdef SSL
   ifndef OPENSSL_INCLUDE
     ifeq "$(wildcard $(OPENSSL_PATH)/outinc)" "$(OPENSSL_PATH)/outinc"
       OPENSSL_INCLUDE = $(OPENSSL_PATH)/outinc