From 6a2cd335090ddd8eed9a8e1b95248ef4a6cd5781 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Fri, 23 Dec 2022 15:01:54 +0100 Subject: [PATCH] BUILD: makefile: remove the special case of the SSL option By creating USE_SSL and enabling it when USE_OPENSSL is set, we can get rid of the special case that was made with it regarding cflags collect and when resetting options. The option doesn't need to be manually set, though in the future it might prove useful if other non-openssl API are supported. --- Makefile | 3 ++- include/make/options.mk | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index a5ddc70d0e..b2ff189b1f 100644 --- a/Makefile +++ b/Makefile @@ -298,7 +298,7 @@ use_opts = USE_EPOLL USE_KQUEUE USE_NETFILTER \ USE_THREAD USE_PTHREAD_EMULATION USE_BACKTRACE \ USE_STATIC_PCRE USE_STATIC_PCRE2 USE_TPROXY USE_LINUX_TPROXY \ USE_LINUX_SPLICE USE_LIBCRYPT USE_CRYPT_H USE_ENGINE \ - USE_GETADDRINFO USE_OPENSSL USE_OPENSSL_WOLFSSL USE_LUA \ + USE_GETADDRINFO USE_OPENSSL USE_OPENSSL_WOLFSSL USE_SSL USE_LUA \ USE_ACCEPT4 USE_CLOSEFROM USE_ZLIB USE_SLZ USE_CPU_AFFINITY \ USE_TFO USE_NS USE_DL USE_RT USE_LIBATOMIC USE_MATH \ USE_DEVICEATLAS USE_51DEGREES \ @@ -578,6 +578,7 @@ ifneq ($(USE_OPENSSL),) SSL_CFLAGS := $(if $(SSL_INC),-I$(SSL_INC)) SSL_LDFLAGS := $(if $(SSL_LIB),-L$(SSL_LIB)) -lssl -lcrypto endif + USE_SSL := $(if $(USE_SSL),$(USE_SSL),implicit) OPTIONS_OBJS += src/ssl_sock.o src/ssl_ckch.o src/ssl_sample.o src/ssl_crtlist.o src/cfgparse-ssl.o src/ssl_utils.o src/jwt.o src/ssl_ocsp.o endif diff --git a/include/make/options.mk b/include/make/options.mk index 3a58813ce8..15e9841d07 100644 --- a/include/make/options.mk +++ b/include/make/options.mk @@ -36,7 +36,7 @@ disabled_opts = $(foreach opt,$(patsubst USE_%,%,$(use_opts)),$(if $(USE_$(opt reset_opt_vars = $(foreach name,INC LIB CFLAGS LDFLAGS SRC,$(eval $(1)_$(name)=)) # preset all variables for all supported build options among use_opts -reset_opts_vars = $(foreach opt,$(patsubst USE_%,%,$(use_opts)) SSL,$(call reset_opt_vars,$(opt))) +reset_opts_vars = $(foreach opt,$(patsubst USE_%,%,$(use_opts)),$(call reset_opt_vars,$(opt))) # append $(1)_{C,LD}FLAGS into OPTIONS_{C,LD}FLAGS if not empty define collect_opt_flags = @@ -49,4 +49,4 @@ define collect_opt_flags = endef # collect all known USE_foo's foo_{C,LD}FLAGS into OPTIONS_{C,LD}FLAGS -collect_opts_flags = $(foreach opt,$(patsubst USE_%,%,$(use_opts)) SSL,$(eval $(call collect_opt_flags,$(opt)))) +collect_opts_flags = $(foreach opt,$(patsubst USE_%,%,$(use_opts)),$(eval $(call collect_opt_flags,$(opt))))