[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[PATCH] maint: Nicer warning if autoconf-archive not available



Prior to this patch, failure to install autoconf-archives prior to
running 'autoreconf' produces the confusing:

Makefile.am: error: Yacc source seen but 'YACC' is undefined
Makefile.am:   The usual way to define 'YACC' is to add 'AC_PROG_YACC'
Makefile.am:   to 'configure.ac' and run 'autoconf' again.

With this change, the error changes to:

configure.ac:117: error: possibly undefined macro: AX_PROG_BISON
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.

which is still not a direct finger pointing to missing
autoconf-archives, but at least provides more relevant hits in a
google search for how to resolve it (compared to recommended remedies
for the first message).

Reported-by: Luis Chamberlain <mcgrof@kernel.org>
Signed-off-by: Eric Blake <eblake@redhat.com>
---
 configure.ac | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/configure.ac b/configure.ac
index c71e7c7..48ba507 100644
--- a/configure.ac
+++ b/configure.ac
@@ -107,6 +107,10 @@ AC_ARG_ENABLE(
   [ENABLE_GZNBD=no]
 )

+dnl We require autoconf-archive to be installed. Warn about undefined macros
+dnl with a uniform message if autoconf could not find those macros.
+m4_pattern_forbid([^AX_])
+
 AC_PROG_CC_C99
 AC_PROG_CPP
 AC_PROG_INSTALL
-- 
2.31.1


Reply to: