]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD: makefile: remove the special case of the SSL option
authorWilly Tarreau <w@1wt.eu>
Fri, 23 Dec 2022 14:01:54 +0000 (15:01 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 23 Dec 2022 15:53:35 +0000 (16:53 +0100)
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
include/make/options.mk

index a5ddc70d0e11a3d4e27a20683953223d94ff48f9..b2ff189b1f85b3515331976b83c433bb3395c3c3 100644 (file)
--- 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
 
index 3a58813ce8724912c01a95881b45915f1d3f003c..15e9841d0776677fdcbd65a3bcb8b29b8fd67824 100644 (file)
@@ -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))))