From: Viktor Szakats Date: Mon, 15 Aug 2022 02:49:59 +0000 (+0000) Subject: Makefile.m32: allow -nghttp3/-ngtcp2 without -ssl [ci skip] X-Git-Tag: curl-7_85_0~62 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5fd7cd7302d3ea265661822b5eea200f97005133;p=thirdparty%2Fcurl.git Makefile.m32: allow -nghttp3/-ngtcp2 without -ssl [ci skip] 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 --- diff --git a/docs/examples/Makefile.m32 b/docs/examples/Makefile.m32 index f802d55367..cc1fc9772e 100644 --- a/docs/examples/Makefile.m32 +++ b/docs/examples/Makefile.m32 @@ -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 diff --git a/lib/Makefile.m32 b/lib/Makefile.m32 index e8c9682a63..9b8a31569d 100644 --- a/lib/Makefile.m32 +++ b/lib/Makefile.m32 @@ -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 diff --git a/lib/curl_ntlm_core.c b/lib/curl_ntlm_core.c index eabb000d14..b56c647a5a 100644 --- a/lib/curl_ntlm_core.c +++ b/lib/curl_ntlm_core.c @@ -60,17 +60,17 @@ #if defined(USE_OPENSSL_DES) || defined(USE_WOLFSSL) -#ifdef USE_WOLFSSL +#if defined(USE_OPENSSL) +# include +# include +# include +# include +#else # include # include # include # include # include -#else -# include -# include -# include -# include #endif # if (defined(OPENSSL_VERSION_NUMBER) && \ diff --git a/src/Makefile.m32 b/src/Makefile.m32 index 8ed3fee827..633cbaeb8b 100644 --- a/src/Makefile.m32 +++ b/src/Makefile.m32 @@ -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