From: Willy Tarreau Date: Thu, 21 May 2026 12:30:26 +0000 (+0200) Subject: BUILD: makefile: add an option to enable or disable HTTP/2 (USE_H2) X-Git-Url: http://git.kaiwu.me/postgresql/log/contrib/postgres_fdw/static/%7B@url%7D?a=commitdiff_plain;h=382a495649efabde04a54c121738d3b727332941;p=haproxy.git BUILD: makefile: add an option to enable or disable HTTP/2 (USE_H2) USE_H2 is enabled by default and allows to disable HTTP/2 when forced to zero. It saves roughly 127kB on the executable. --- diff --git a/Makefile b/Makefile index e102821a8..9eb9aaaf6 100644 --- a/Makefile +++ b/Makefile @@ -65,6 +65,7 @@ # USE_PTHREAD_EMULATION : replace pthread's rwlocks with ours # USE_SHM_OPEN : use shm_open() for features that can make use of shared memory # USE_KTLS : use kTLS.(requires at least Linux 4.17). +# USE_H2 : enable HTTP/2 subsystem. Always on. # # Options can be forced by specifying "USE_xxx=1" or can be disabled by using # "USE_xxx=" (empty string). The list of enabled and disabled options for a @@ -338,7 +339,7 @@ use_opts = USE_EPOLL USE_KQUEUE USE_NETFILTER USE_POLL \ USE_TPROXY USE_LINUX_TPROXY USE_LINUX_CAP \ USE_LINUX_SPLICE USE_LIBCRYPT USE_CRYPT_H USE_ENGINE \ USE_GETADDRINFO USE_OPENSSL USE_OPENSSL_WOLFSSL USE_OPENSSL_AWSLC \ - USE_ECH USE_TRACE \ + USE_ECH USE_TRACE USE_H2 \ 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 \ @@ -364,6 +365,9 @@ USE_POLL = default # traces are always enabled USE_TRACE = default +# HTTP/2 is always enabled +USE_H2 = default + # SLZ is always supported unless explicitly disabled by passing USE_SLZ="" # or disabled by enabling ZLIB using USE_ZLIB=1 ifeq ($(USE_ZLIB:0=),) @@ -567,6 +571,10 @@ ifneq ($(USE_ZLIB:0=),) ZLIB_LDFLAGS = $(if $(ZLIB_LIB),-L$(ZLIB_LIB)) -lz endif +ifneq ($(USE_H2:0=),) + OPTIONS_OBJS += src/mux_h2.o src/h2.o +endif + ifneq ($(USE_SLZ:0=),) OPTIONS_OBJS += src/slz.o endif @@ -911,7 +919,7 @@ ifneq ($(EXTRA_OBJS),) OBJS += $(EXTRA_OBJS) endif -OBJS += src/mux_h2.o src/mux_h1.o src/mux_fcgi.o src/log.o \ +OBJS += src/mux_h1.o src/mux_fcgi.o src/log.o \ src/server.o src/stream.o src/tcpcheck.o src/http_ana.o \ src/stick_table.o src/tools.o src/mux_spop.o src/sample.o \ src/activity.o src/cfgparse.o src/peers.o src/cli.o \ @@ -929,7 +937,7 @@ OBJS += src/mux_h2.o src/mux_h1.o src/mux_fcgi.o src/log.o \ src/ceba_tree.o src/session.o src/payload.o src/htx.o \ src/cebl_tree.o src/ceb32_tree.o src/ceb64_tree.o \ src/server_state.o src/proto_rhttp.o src/flt_trace.o src/fd.o \ - src/task.o src/map.o src/fcgi-app.o src/h2.o src/mworker.o \ + src/task.o src/map.o src/fcgi-app.o src/mworker.o \ src/tcp_sample.o src/mjson.o src/h1_htx.o src/tcp_act.o \ src/ring.o src/flt_bwlim.o src/acl.o src/thread.o src/queue.o \ src/http_rules.o src/http.o src/channel.o src/proto_tcp.o \