]> git.ipfire.org Git - thirdparty/autoconf.git/commit
Autoupdate AC_{DIAGNOSE,FATAL,OBSOLETE,WARNING} and _AC_COMPUTE_INT.
authorZack Weinberg <zackw@panix.com>
Tue, 22 Sep 2020 18:24:33 +0000 (14:24 -0400)
committerZack Weinberg <zackw@panix.com>
Tue, 22 Sep 2020 19:46:44 +0000 (15:46 -0400)
commit119beb03250a5ddf9514994c5c5d601692b81fa6
treec8adad651c7f3bb674af8001fd657425d569ec82
parent8cb3442318041c78df6182fc37ad55a2450048fc
Autoupdate AC_{DIAGNOSE,FATAL,OBSOLETE,WARNING} and _AC_COMPUTE_INT.

While working on the previous patches I noticed that all of these
macros are officially obsolete, but autoupdate doesn’t replace them.

_AC_COMPUTE_INT is easy to autoupdate.  AC_{DIAGNOSE,FATAL,WARNING}
require a little special handling because their replacements are
m4sugar macros, and autoupdate normally expands m4sugar macros as it
goes.  Fortunately, the same workaround as is used for AC_FOREACH can
be applied.  AC_OBSOLETE also needs that workaround, and cannot be
fully replaced automatically.

The bulk of the patch is removing internal uses of AC_DIAGNOSE.

* lib/autoconf/autoupdate.m4
* lib/autoconf/c.m4
* lib/autoconf/functions.m4
* lib/autoconf/general.m4
* lib/autoconf/headers.m4
* lib/autoconf/lang.m4
* lib/autoconf/status.m4
* lib/autoconf/types.m4
* tests/local.at
* tests/tools.at:
  Use, and/or refer to, m4_warn instead of AC_DIAGNOSE.

* lib/autoconf/general.m4 (_AC_COMPUTE_INT): Define using AU_DEFUN.
  (AC_DIAGNOSE, AC_FATAL, AC_WARNING): Autoupdate to m4_warn,
  m4_fatal, and m4_warn([syntax], [$1]) respectively, using the same
  paired AU_DEFUN/AC_DEFUN trick that is used for AC_FOREACH.
  (AC_OBSOLETE): Autoupdate to m4_warn([obsolete], [$1]) and advise
  hand-conversion to AU_DEFUN.

* lib/autoconf/autoupdate.m4 (AU_DEFUN): Tweak quoting so m4_warn([$3])
  is emitted into the edited configure.ac instead of being expanded at
  autoupdate time.

* tests/tools.at (autoupdating AC_FOREACH): Adjust grep expressions.
  (autoupdating AC_DIAGNOSE and AC_WARNING): New test.
  (autoupdating AC_FATAL): New test.
  (autoupdating AC_OBSOLETE): New test.
* tests/mktests.sh (ac_exclude_list, au_exclude_list):
  Exclude AC_DIAGNOSE, AC_FATAL, AC_FOREACH, AC_OBSOLETE, and AC_WARNING
  if not already excluded.
13 files changed:
NEWS
lib/autoconf/autoupdate.m4
lib/autoconf/c.m4
lib/autoconf/functions.m4
lib/autoconf/general.m4
lib/autoconf/headers.m4
lib/autoconf/lang.m4
lib/autoconf/specific.m4
lib/autoconf/status.m4
lib/autoconf/types.m4
tests/local.at
tests/mktests.sh
tests/tools.at