summaryrefslogtreecommitdiff
path: root/lib/autoconf/autoupdate.m4
diff options
context:
space:
mode:
Diffstat (limited to 'lib/autoconf/autoupdate.m4')
-rw-r--r--lib/autoconf/autoupdate.m447
1 files changed, 30 insertions, 17 deletions
diff --git a/lib/autoconf/autoupdate.m4 b/lib/autoconf/autoupdate.m4
index 109d8949..a3e13a69 100644
--- a/lib/autoconf/autoupdate.m4
+++ b/lib/autoconf/autoupdate.m4
@@ -36,20 +36,27 @@
# AU_DEFINE(NAME, CODE)
# ---------------------
-# Define the macro NAME so that it expand to CODE only when
+# Define the macro NAME so that it expands to CODE only when
# autoupdate is running. This is achieved with traces in
# autoupdate itself, so this macro expands to nothing.
#
m4_define([AU_DEFINE], [])
-# AU_DEFUN(NAME, NEW-CODE, [MESSAGE])
+# AU_DEFUN(NAME, NEW-CODE, [MESSAGE], [SILENT])
# -----------------------------------
-# Declare that the macro NAME is now obsoleted, and should be replaced
-# by NEW-CODE. Tell the user she should run autoupdate, and when
-# autoupdate is run, emit MESSAGE as a warning and include it in
-# the updated configure.ac file.
+# Define NAME as a macro whose expansion is NEW-CODE, just like
+# AC_DEFUN, but also declare NAME as obsolete. When autoupdate
+# is run, occurrences of NAME will be replaced with NEW-CODE in
+# the updated configure.ac.
#
-# Also define NAME as a macro which code is NEW-CODE.
+# If MESSAGE is not empty, it should be instructions for manual edits
+# to configure.ac that are required to finish the job of replacing NAME.
+# autoupdate will print MESSAGE, and [m4_warn([obsolete], [MESSAGE])]
+# will be placed next to NEW-CODE in the updated configure.ac.
+#
+# SILENT must be either empty or the word "silent". If it is empty,
+# *autoconf* will issue a generic obsolete-category warning when NAME
+# is expanded, telling the maintainer to run autoupdate.
#
# This allows sharing the same code for both supporting obsoleted macros,
# and to update a configure.ac.
@@ -62,8 +69,8 @@ m4_define([AU_DEFUN],
# unexpanded into the updated configure.ac.
AU_DEFINE([$1],
[m4_ifval([$3], [_au_warn_$1([$3])[m4_warn([obsolete],
-[$3])dnl]
-])dnl
+[$3])dnl
+]])dnl
$2])
# This is an auxiliary macro that is also run when
@@ -76,22 +83,28 @@ AU_DEFINE([_au_warn_$1],
m4_define([_au_warn_$1], [])])
# Finally, this is the expansion that is picked up by
-# autoconf. It tells the user to run autoupdate, and
-# then outputs the replacement expansion. We do not care
-# about autoupdate's warning because that contains
-# information on what to do *after* running autoupdate.
-AC_DEFUN([$1],
+# autoconf, causing NAME to expand to NEW-CODE, plus
+# (if SILENT is not "silent") a m4_warning telling the
+# maintainer to run autoupdate. We don't issue MESSAGE
+# from autoconf, because that's instructions for what
+# to do *after* running autoupdate.
+m4_case([$4],
+ [silent], [AC_DEFUN([$1], [$2])],
+ [], [AC_DEFUN([$1],
[m4_warn([obsolete], [The macro `$1' is obsolete.
You should run autoupdate.])dnl
-$2])])
+$2])],
+ [m4_fatal([SILENT argument to `$0' must be either empty or `silent'])]dnl
+)])
-# AU_ALIAS(OLD-NAME, NEW-NAME)
+# AU_ALIAS(OLD-NAME, NEW-NAME, [SILENT])
# ----------------------------
# The OLD-NAME is no longer used, just use NEW-NAME instead. There is
# little difference with using AU_DEFUN but the fact there is little
# interest in running the test suite on both OLD-NAME and NEW-NAME.
# This macro makes it possible to distinguish such cases.
+# The SILENT argument works the same as for AU_DEFUN.
#
# Do not use `defn' since then autoupdate would replace an old macro
# call with the new macro body instead of the new macro call.
@@ -102,7 +115,7 @@ $2])])
# matters with poorly written macros which test for $# = 0.
#
m4_define([AU_ALIAS],
-[AU_DEFUN([$1], _AU_ALIAS_BODY([$], [$2]))])
+[AU_DEFUN([$1], _AU_ALIAS_BODY([$], [$2]), [], [$4])])
# The body for the AU_DEFUN above should look like:
# [m4_if($#, 0, [NEW-NAME], [NEW-NAME($@)])]