From ccf3cf51cab9aca6ba79c529f1a52085626e4c78 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Fri, 4 Sep 2026 16:43:55 +0100 Subject: [PATCH] * support/config.m4: Rename NONPORTABLE_SUPPORT to EXTRA_SBIN_PROGRAMS; define EXTRA_CHECK_BINARIES. * support/a2md/config2.m4: Add a2md/a2md to EXTRA_SBIN_PROGRAMS and check/bin/a2md to EXTRA_CHECK_BINARIES when a2md is enabled. * support/Makefile.in (sbin_PROGRAMS): Use EXTRA_SBIN_PROGRAMS. (TARGETS): Drop a2md/a2md. (install): Drop the explicit a2md install. (a2md/a2md): Recurse unconditionally. * Makefile.in (check-binaries): Add check/bin/htcacheclean and $(EXTRA_CHECK_BINARIES). (check/bin/htcacheclean, check/bin/a2md): New. * build/config_vars.sh.in: Filter EXTRA_SBIN_PROGRAMS and EXTRA_CHECK_BINARIES instead of NONPORTABLE_SUPPORT. Co-Authored-By: Claude Fable 5.1 --- Makefile.in | 13 +++++++++++-- build/config_vars.sh.in | 3 ++- support/Makefile.in | 18 ++++++------------ support/a2md/config2.m4 | 2 ++ support/config.m4 | 12 ++++++++---- 5 files changed, 29 insertions(+), 19 deletions(-) diff --git a/Makefile.in b/Makefile.in index 38476e607c5..b85dfcc1bc8 100644 --- a/Makefile.in +++ b/Makefile.in @@ -435,14 +435,23 @@ check-conf: check-dirs: @mkdir -p check/htdocs check/logs check/bin -check-binaries: check/bin/apxs check/bin/httpd check/bin/ab +# EXTRA_CHECK_BINARIES is set by configure for optional support programs +# (e.g. check/bin/a2md when a2md is enabled). +check-binaries: check/bin/apxs check/bin/httpd check/bin/ab \ + check/bin/htcacheclean $(EXTRA_CHECK_BINARIES) check/bin/httpd: - ln -s $(top_builddir)/httpd check/bin/httpd + ln -s $(top_builddir)/$(PROGRAM_NAME) check/bin/httpd check/bin/ab: ln -s $(top_builddir)/support/ab check/bin/ab +check/bin/htcacheclean: + ln -s $(top_builddir)/support/htcacheclean check/bin/htcacheclean + +check/bin/a2md: + ln -s $(top_builddir)/support/a2md/a2md check/bin/a2md + # A version of apxs with the PREFIX overridden to point inside the install root check/bin/apxs: mkdir -p check diff --git a/build/config_vars.sh.in b/build/config_vars.sh.in index 26e43f6dace..0a3a59b7006 100644 --- a/build/config_vars.sh.in +++ b/build/config_vars.sh.in @@ -53,7 +53,8 @@ exec sed " /^DSO_MODULES/d /^ENABLED_DSO_MODULES/d /^LOAD_ALL_MODULES/d -/^NONPORTABLE_SUPPORT/d +/^EXTRA_SBIN_PROGRAMS/d +/^EXTRA_CHECK_BINARIES/d /_SRCLIB_DIRS/d /^UNITTEST_/d /^davlockdb/d diff --git a/support/Makefile.in b/support/Makefile.in index 0270a1c380e..205aa1779c9 100644 --- a/support/Makefile.in +++ b/support/Makefile.in @@ -3,11 +3,11 @@ DISTCLEAN_TARGETS = apxs apxs-ng apachectl dbmmanage dbmmanage-ng \ phf_abuse_log.cgi phf_abuse_log-ng.cgi split-logfile split-logfile-ng \ envvars-std -CLEAN_TARGETS = suexec a2md/a2md +CLEAN_TARGETS = suexec bin_PROGRAMS = htpasswd htdigest htdbm firehose ab logresolve httxt2dbm -sbin_PROGRAMS = htcacheclean rotatelogs $(NONPORTABLE_SUPPORT) -TARGETS = $(bin_PROGRAMS) $(sbin_PROGRAMS) a2md/a2md +sbin_PROGRAMS = htcacheclean rotatelogs $(EXTRA_SBIN_PROGRAMS) +TARGETS = $(bin_PROGRAMS) $(sbin_PROGRAMS) PROGRAM_LDADD = $(UTIL_LDFLAGS) $(PROGRAM_DEPENDENCIES) $(EXTRA_LIBS) $(AP_LIBS) PROGRAM_DEPENDENCIES = @@ -37,9 +37,6 @@ install: cp -p envvars-std $(DESTDIR)$(sbindir)/envvars ; \ fi ; \ fi - @if test -f "$(builddir)/a2md/a2md"; then \ - $(INSTALL_PROGRAM) a2md/a2md $(DESTDIR)$(bindir); \ - fi htpasswd.lo: passwd_common.h passwd_common.lo: passwd_common.h @@ -97,12 +94,9 @@ firehose_OBJECTS = firehose.lo firehose: $(firehose_OBJECTS) $(LINK) $(firehose_LTFLAGS) $(firehose_OBJECTS) $(PROGRAM_LDADD) -# Build a2md when the required mod_md dependencies (curl, jansson, openssl) are -# available. @A2MD_LIBS@ is empty when configure determined a2md cannot be built, -# so the sub-make is a no-op in that case. +# a2md is only built and installed when configure added a2md/a2md to +# EXTRA_SBIN_PROGRAMS (mod_md dependencies curl, jansson and openssl found). a2md/a2md: - @if test -n "$(A2MD_LIBS)"; then \ - (cd a2md && $(MAKE) $(MFLAGS) a2md) || exit 1; \ - fi + cd a2md && $(MAKE) $(MFLAGS) a2md diff --git a/support/a2md/config2.m4 b/support/a2md/config2.m4 index 93eef0df1e4..24df28c4d71 100644 --- a/support/a2md/config2.m4 +++ b/support/a2md/config2.m4 @@ -32,6 +32,8 @@ if test "x$enable_a2md" != "xno"; then APR_ADDTO(A2MD_LIBS, [$ap_curl_libs]) APR_ADDTO(A2MD_LIBS, [$ap_jansson_libs]) APR_ADDTO(A2MD_LIBS, [-lssl -lcrypto]) + APR_ADDTO(EXTRA_SBIN_PROGRAMS, [a2md/a2md]) + APR_ADDTO(EXTRA_CHECK_BINARIES, [check/bin/a2md]) AC_MSG_NOTICE([a2md: enabled (curl + jansson + openssl found)]) else if test "x$enable_a2md" = "xyes"; then diff --git a/support/config.m4 b/support/config.m4 index 31c8a777328..f7d237711e3 100644 --- a/support/config.m4 +++ b/support/config.m4 @@ -146,17 +146,21 @@ AC_ARG_ENABLE(a2md,APACHE_HELP_STRING(--enable-a2md,Build the a2md command-line enable_a2md="auto" ]) -# Configure or check which of the non-portable support programs can be enabled. +# Configure or check which of the optional sbin support programs can be +# enabled. support/a2md/config2.m4 may append to these lists; the +# EXTRA_CHECK_BINARIES are symlinked into check/bin for the test suite. -NONPORTABLE_SUPPORT="" +EXTRA_SBIN_PROGRAMS="" +EXTRA_CHECK_BINARIES="" case $host in *mingw*) ;; *) - NONPORTABLE_SUPPORT="checkgid fcgistarter" + EXTRA_SBIN_PROGRAMS="checkgid fcgistarter" ;; esac -APACHE_SUBST(NONPORTABLE_SUPPORT) +APACHE_SUBST(EXTRA_SBIN_PROGRAMS) +APACHE_SUBST(EXTRA_CHECK_BINARIES) # Configure the ulimit -n command used by apachectl.