autoconf: Work around M4 1.6 warning on undefined macros.

https://github.com/libsdl-org/autoconf/commit/c4a32a009ec9c8a9bb9c75cc1bbb53c7473a020c

From c4a32a009ec9c8a9bb9c75cc1bbb53c7473a020c Mon Sep 17 00:00:00 2001
From: Eric Blake <[EMAIL REDACTED]>
Date: Fri, 11 Jul 2008 08:55:15 -0600
Subject: [PATCH] Work around M4 1.6 warning on undefined macros.

* lib/m4sugar/m4sugar.m4 (changeword, symbols): Don't rename if
not already available as builtins.
* bin/autoupdate.in (_au___undefine): New macro,...
(_au__undefine): ...wrapped by ifdef to silence m4 warnings.
Reported by Ralf Wildenhues.

Signed-off-by: Eric Blake <ebb9@byu.net>
(cherry picked from commit 5fb9f9c1a2a310caf37d45d2bc7640723e40c311)
(cherry picked from commit 4b8a55e1e015fc5ba0ceee63ce3739ea1e41b686)
---
 ChangeLog              | 13 +++++++++++++
 bin/autoupdate.in      |  4 +++-
 lib/m4sugar/m4sugar.m4 | 14 +++++++++-----
 3 files changed, 25 insertions(+), 6 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 3f6a5c01..e9c947fc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2008-07-21  Eric Blake  <ebb9@byu.net>
+
+	Ignore undefined macros, necessary with m4 1.6.
+	* bin/autoupdate.in (_au___undefine): New macro,...
+	(_au__undefine): ...wrapped by ifdef to silence m4 warnings.
+	Reported by Ralf Wildenhues.
+
+2008-07-11  Eric Blake  <ebb9@byu.net>
+
+	Work around M4 1.6 warning on undefined macros.
+	* lib/m4sugar/m4sugar.m4 (changeword, symbols): Don't rename if
+	not already available as builtins.
+
 2008-04-05  Eric Blake  <ebb9@byu.net>
 
 	Release Version 2.62.
diff --git a/bin/autoupdate.in b/bin/autoupdate.in
index 3a01af78..644de19c 100644
--- a/bin/autoupdate.in
+++ b/bin/autoupdate.in
@@ -267,8 +267,10 @@ foreach my $file (@ARGV)
       # Define our special macros:
       define([_au__defn], defn([defn]))
       define([_au__divert], defn([divert]))
+      define([_au__ifdef], defn([ifdef]))
       define([_au__include], defn([include]))
-      define([_au__undefine], defn([undefine]))
+      define([_au___undefine], defn([undefine]))
+      define([_au__undefine], [_au__ifdef([$1], [_au___undefine([$1])])])
       define([_au__save], [m4_ifdef([$1], [m4_copy([$1], [_au_$1])])])
       define([_au__restore],
 	[_au_m4_ifdef([_au_$1],
diff --git a/lib/m4sugar/m4sugar.m4 b/lib/m4sugar/m4sugar.m4
index ae7ce4da..7afe9a13 100644
--- a/lib/m4sugar/m4sugar.m4
+++ b/lib/m4sugar/m4sugar.m4
@@ -117,11 +117,16 @@ m4_define([m4_copy_unm4],
 
 
 # Some m4 internals have names colliding with tokens we might use.
-# Rename them a` la `m4 --prefix-builtins'.
+# Rename them a` la `m4 --prefix-builtins'.  Conditionals first, since
+# some subsequent renames are conditional.
+m4_rename_m4([ifdef])
+m4_rename([ifelse], [m4_if])
+
 m4_rename_m4([builtin])
 m4_rename_m4([changecom])
 m4_rename_m4([changequote])
-m4_undefine([changeword])
+m4_ifdef([changeword],dnl conditionally available in 1.4.x
+[m4_undefine([changeword])])
 m4_rename_m4([debugfile])
 m4_rename_m4([debugmode])
 m4_rename_m4([decr])
@@ -132,8 +137,6 @@ m4_rename_m4([errprint])
 m4_rename_m4([esyscmd])
 m4_rename_m4([eval])
 m4_rename_m4([format])
-m4_rename_m4([ifdef])
-m4_rename([ifelse], [m4_if])
 m4_undefine([include])
 m4_rename_m4([incr])
 m4_rename_m4([index])
@@ -154,7 +157,8 @@ m4_rename([regexp], [m4_bregexp])
 m4_rename_m4([shift])
 m4_undefine([sinclude])
 m4_rename_m4([substr])
-m4_rename_m4([symbols])
+m4_ifdef([symbols],dnl present only in alpha-quality 1.4o
+[m4_rename_m4([symbols])])
 m4_rename_m4([syscmd])
 m4_rename_m4([sysval])
 m4_rename_m4([traceoff])