In Savannah bug #107986, David Wheeler contributed some additional diagnostics for misuse of AC_INIT. I sat down to review them late last week and wound up making so many changes and enhancements that this is effectively a rewrite from scratch. (I would like to apologize to David for making him go through the copyright assignment process and then not actually using any of his code.)
The first patch, which I hope is uncontroversial, makes AC_INIT trim whitespace (via m4_normalize) from all its arguments, and extends the existing checks for inappropriate contents of the first three arguments to cover the fourth and fifth as well. The second patch adds warnings when a configure.ac is missing calls to AC_INIT and/or AC_OUTPUT. The concept here should also be unproblematic, but I’m not entirely happy with the implementation. David’s original implementation used an extra trace pass and custom logic in bin/autoconf.as. I decided it would be better to make these normal syntax warnings, but this involves an m4_wrap hook that’s *not* run when tracing or when freezing, and the clean way to do that would involve adding a feature to autom4te. I found a kludge that works, but I’d like to hear opinions on whether we should instead postpone this patch till after 2.70 so we can coordinate with automake on the addition of the missing autom4te feature. zw Zack Weinberg (2): Trim whitespace from arguments of AC_INIT (#107986) Warn if AC_INIT or AC_OUTPUT are missing from configure.ac (#107986) NEWS | 14 ++++++ bin/autoconf.as | 14 +++++- bin/autoreconf.in | 14 ++++-- doc/autoconf.texi | 7 ++- lib/autoconf/general.m4 | 93 ++++++++++++++++++++++++++--------- lib/autoconf/status.m4 | 6 +++ lib/autoconf/trailer.m4 | 4 ++ lib/local.mk | 3 +- tests/base.at | 106 ++++++++++++++++++++++++++++++++++------ tests/c.at | 1 + tests/compile.at | 26 ++++++++-- tests/m4sh.at | 5 +- tests/semantics.at | 12 ++--- tests/tools.at | 28 +++++++++-- tests/torture.at | 13 +++-- tests/wrapper.as | 3 +- 16 files changed, 284 insertions(+), 65 deletions(-) create mode 100644 lib/autoconf/trailer.m4 -- 2.28.0
