From: Michael Pratt Date: Wed, 22 Jul 2026 10:23:58 +0000 (-0400) Subject: tools: automake: do not error on missing conditional X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=baeee779177110e4482f8b57a86fde8a71e01f70;p=thirdparty%2Fopenwrt.git tools: automake: do not error on missing conditional Now that cond.m4 is not being overwritten and is actively used, make it less aggressive on encountering an undefined conditional not set by a macro which is itself conditionally called, where the condition is set to intentionally not trigger the macro. This prevents the need to further patch a configure.ac file to edit the improper usage of or remove a disabled macro which triggers the error "conditional ___ is not defined..." in the cases where autoreconf is still necessary for another reason, or, if this is the only build issue, autoreconf can now be used to avoid this. Instead of erroring, align the behavior of AM_CONDITIONAL closer to the gnulib variant gl_CONDITIONAL which ignores and disables the conditional in this case. Signed-off-by: Michael Pratt Link: https://github.com/openwrt/openwrt/pull/24362 Signed-off-by: Robert Marko --- diff --git a/tools/automake/patches/010-m4-cond-no-error.patch b/tools/automake/patches/010-m4-cond-no-error.patch new file mode 100644 index 00000000000..787691146c6 --- /dev/null +++ b/tools/automake/patches/010-m4-cond-no-error.patch @@ -0,0 +1,12 @@ +--- a/m4/cond.m4 ++++ b/m4/cond.m4 +@@ -27,6 +27,8 @@ else + fi + AC_CONFIG_COMMANDS_PRE( + [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then +- AC_MSG_ERROR([[conditional "$1" was never defined. ++ [$1]_TRUE='#' ++ [$1]_FALSE='#' ++ AC_MSG_WARN([[conditional "$1" was never defined. + Usually this means the macro was only invoked conditionally.]]) + fi])])