Makefile.m32: fix to not require OpenSSL with -libssh2 or -rtmp options

Previously, -libssh2/-rtmp options assumed that OpenSSL is also enabled
(and then failed with an error when not finding expected OpenSSL headers),
but this isn't necessarly true, e.g. when building both libssh2 and curl
against Schannel. This patch makes sure to only enable the OpenSSL backend
with -libssh2/-rtmp, when there was no SSL option explicitly selected.

- Re-implement the logic as a single block of script.
- Also fix an indentation while there.

Assisted-by: Jay Satiro

Closes #7895
This commit is contained in:
Viktor Szakats 2021-10-25 19:10:55 +00:00
parent 16a6b02df2
commit 13bbf81c59
No known key found for this signature in database
GPG Key ID: B5ABD165E2AEF201
3 changed files with 24 additions and 9 deletions

View File

@ -178,12 +178,10 @@ ARES = 1
endif
ifeq ($(findstring -rtmp,$(CFG)),-rtmp)
RTMP = 1
SSL = 1
ZLIB = 1
endif
ifeq ($(findstring -ssh2,$(CFG)),-ssh2)
SSH2 = 1
SSL = 1
ZLIB = 1
endif
ifeq ($(findstring -ssl,$(CFG)),-ssl)
@ -230,6 +228,13 @@ ifeq ($(findstring -ngtcp2,$(CFG)),-ngtcp2)
NGTCP2 = 1
endif
# SSH2 and RTMP require an SSL library; assume OpenSSL if none specified
ifneq ($(SSH2)$(RTMP),)
ifeq ($(SSL)$(WINSSL),)
SSL = 1
endif
endif
INCLUDES = -I. -I$(PROOT) -I$(PROOT)/include -I$(PROOT)/lib
ifdef DYN
@ -284,7 +289,7 @@ ifdef SSL
endif
endif
ifneq "$(wildcard $(OPENSSL_INCLUDE)/openssl/opensslv.h)" "$(OPENSSL_INCLUDE)/openssl/opensslv.h"
$(error Invalid path to OpenSSL package: $(OPENSSL_PATH))
$(error Invalid path to OpenSSL package: $(OPENSSL_PATH))
endif
ifndef OPENSSL_LIBPATH
OPENSSL_LIBS = -lssl -lcrypto

View File

@ -179,12 +179,10 @@ SYNC = 1
endif
ifeq ($(findstring -rtmp,$(CFG)),-rtmp)
RTMP = 1
SSL = 1
ZLIB = 1
endif
ifeq ($(findstring -ssh2,$(CFG)),-ssh2)
SSH2 = 1
SSL = 1
ZLIB = 1
endif
ifeq ($(findstring -ssl,$(CFG)),-ssl)
@ -237,6 +235,13 @@ ifeq ($(findstring -unicode,$(CFG)),-unicode)
UNICODE = 1
endif
# SSH2 and RTMP require an SSL library; assume OpenSSL if none specified
ifneq ($(SSH2)$(RTMP),)
ifeq ($(SSL)$(WINSSL),)
SSL = 1
endif
endif
INCLUDES = -I. -I../include
CFLAGS += -DBUILDING_LIBCURL
ifdef SSL
@ -299,7 +304,7 @@ ifdef SSL
endif
endif
ifneq "$(wildcard $(OPENSSL_INCLUDE)/openssl/opensslv.h)" "$(OPENSSL_INCLUDE)/openssl/opensslv.h"
$(error Invalid path to OpenSSL package: $(OPENSSL_PATH))
$(error Invalid path to OpenSSL package: $(OPENSSL_PATH))
endif
ifndef OPENSSL_LIBPATH
ifeq "$(wildcard $(OPENSSL_PATH)/out)" "$(OPENSSL_PATH)/out"

View File

@ -187,12 +187,10 @@ SYNC = 1
endif
ifeq ($(findstring -rtmp,$(CFG)),-rtmp)
RTMP = 1
SSL = 1
ZLIB = 1
endif
ifeq ($(findstring -ssh2,$(CFG)),-ssh2)
SSH2 = 1
SSL = 1
ZLIB = 1
endif
ifeq ($(findstring -ssl,$(CFG)),-ssl)
@ -242,6 +240,13 @@ ifeq ($(findstring -unicode,$(CFG)),-unicode)
UNICODE = 1
endif
# SSH2 and RTMP require an SSL library; assume OpenSSL if none specified
ifneq ($(SSH2)$(RTMP),)
ifeq ($(SSL)$(WINSSL),)
SSL = 1
endif
endif
INCLUDES = -I. -I../include -I../lib
ifdef SSL
ifdef WINSSL
@ -309,7 +314,7 @@ ifdef SSL
endif
endif
ifneq "$(wildcard $(OPENSSL_INCLUDE)/openssl/opensslv.h)" "$(OPENSSL_INCLUDE)/openssl/opensslv.h"
$(error Invalid path to OpenSSL package: $(OPENSSL_PATH))
$(error Invalid path to OpenSSL package: $(OPENSSL_PATH))
endif
ifndef OPENSSL_LIBPATH
OPENSSL_LIBS = -lssl -lcrypto