From: Willy Tarreau Date: Thu, 21 May 2026 12:33:56 +0000 (+0200) Subject: BUILD: makefile: add an option to enable or disable FCGI (USE_FCGI) X-Git-Url: http://git.kaiwu.me/%22data:,/static/gitweb.js?a=commitdiff_plain;h=3939dc057766e15633a721bd875f77a6a973bd32;p=haproxy.git BUILD: makefile: add an option to enable or disable FCGI (USE_FCGI) USE_FCGI is enabled by default and allows to disable FCGI when forced to zero. It saves roughly 75kB on the executable. --- diff --git a/Makefile b/Makefile index 9eb9aaaf6..be1df359a 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_FCGI : enable the FCGI subsystem. Always on. # USE_H2 : enable HTTP/2 subsystem. Always on. # # Options can be forced by specifying "USE_xxx=1" or can be disabled by using @@ -339,7 +340,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_H2 \ + USE_ECH USE_TRACE USE_FCGI 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 \ @@ -365,6 +366,9 @@ USE_POLL = default # traces are always enabled USE_TRACE = default +# FCGI is always enabled +USE_FCGI = default + # HTTP/2 is always enabled USE_H2 = default @@ -575,6 +579,10 @@ ifneq ($(USE_H2:0=),) OPTIONS_OBJS += src/mux_h2.o src/h2.o endif +ifneq ($(USE_FCGI:0=),) + OPTIONS_OBJS += src/mux_fcgi.o src/fcgi-app.o src/fcgi.o +endif + ifneq ($(USE_SLZ:0=),) OPTIONS_OBJS += src/slz.o endif @@ -919,7 +927,7 @@ ifneq ($(EXTRA_OBJS),) OBJS += $(EXTRA_OBJS) endif -OBJS += src/mux_h1.o src/mux_fcgi.o src/log.o \ +OBJS += src/mux_h1.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 \ @@ -937,7 +945,7 @@ OBJS += 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/mworker.o \ + src/task.o src/map.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 \ diff --git a/src/cache.c b/src/cache.c index 31273b74b..79cfa6357 100644 --- a/src/cache.c +++ b/src/cache.c @@ -634,8 +634,10 @@ cache_store_check(struct proxy *px, struct flt_conf *fconf) } else if (f->id == http_comp_req_flt_id || f->id == http_comp_res_flt_id) comp = 1; +#if defined(USE_FCGI) else if (f->id == fcgi_flt_id) continue; +#endif else if ((f->id != fconf->id) && (cconf->flags & CACHE_FLT_F_IMPLICIT_DECL)) { /* Implicit declaration is only allowed with the * compression and fcgi. For other filters, an implicit diff --git a/src/flt_http_comp.c b/src/flt_http_comp.c index a35e92a1d..922483248 100644 --- a/src/flt_http_comp.c +++ b/src/flt_http_comp.c @@ -1137,8 +1137,10 @@ check_implicit_http_comp_flt(struct proxy *proxy) goto end; } } +#if defined(USE_FCGI) else if (fconf->id == fcgi_flt_id) continue; +#endif else explicit = 1; }