changeset 38776:cbd6f1fbb629

warnings: fix compilation with old autoconf Autoconf older than 2.63b (such as what ships on CentOS 6) had a bug that any AC_DEFUN'd macro name that includes shell meta- characters causes failure due to missing shell quoting during aclocal's use of autom4te. We can work around the problem by using m4_defun instead (same semantics in autom4te, but no longer traced by aclocal, so no longer tickles the shell quoting bug). * m4/warnings.m4 (gl_UNKNOWN_WARNINGS_ARE_ERRORS(C)) (gl_UNKNOWN_WARNINGS_ARE_ERRORS(C++)): Use m4_defun rather than AC_DEFUN. * m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC(C)) (gl_MANYWARN_ALL_GCC(C++)): Likewise. Reported-by: Erik Skultety <eskultet@redhat.com> Signed-off-by: Eric Blake <eblake@redhat.com>
author Eric Blake <eblake@redhat.com>
date Thu, 24 Aug 2017 20:28:52 -0500
parents 956c2a66a77c
children 1b081436f551
files ChangeLog m4/manywarnings.m4 m4/warnings.m4
diffstat 3 files changed, 19 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Thu Aug 24 23:49:08 2017 +0200
+++ b/ChangeLog	Thu Aug 24 20:28:52 2017 -0500
@@ -1,3 +1,12 @@
+2017-08-24  Eric Blake  <eblake@redhat.com>
+
+	warnings: fix compilation with old autoconf
+	* m4/warnings.m4 (gl_UNKNOWN_WARNINGS_ARE_ERRORS(C))
+	(gl_UNKNOWN_WARNINGS_ARE_ERRORS(C++)): Use m4_defun rather than
+	AC_DEFUN.
+	* m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC(C))
+	(gl_MANYWARN_ALL_GCC(C++)): Likewise.
+
 2017-08-24  Bruno Haible  <bruno@clisp.org>
 
 	glob: Fix compilation error on NetBSD 7.0 and OpenBSD 6.0.
--- a/m4/manywarnings.m4	Thu Aug 24 23:49:08 2017 +0200
+++ b/m4/manywarnings.m4	Thu Aug 24 20:28:52 2017 -0500
@@ -1,4 +1,4 @@
-# manywarnings.m4 serial 11
+# manywarnings.m4 serial 12
 dnl Copyright (C) 2008-2017 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -39,7 +39,8 @@
 [_AC_LANG_DISPATCH([$0], _AC_LANG, $@)])
 
 # Specialization for _AC_LANG = C.
-AC_DEFUN([gl_MANYWARN_ALL_GCC(C)],
+# Use of m4_defun rather than AC_DEFUN works around a bug in autoconf < 2.63b.
+m4_defun([gl_MANYWARN_ALL_GCC(C)],
 [
   AC_LANG_PUSH([C])
 
@@ -316,7 +317,8 @@
 ])
 
 # Specialization for _AC_LANG = C++.
-AC_DEFUN([gl_MANYWARN_ALL_GCC(C++)],
+# Use of m4_defun rather than AC_DEFUN works around a bug in autoconf < 2.63b.
+m4_defun([gl_MANYWARN_ALL_GCC(C++)],
 [
   gl_MANYWARN_ALL_GCC_CXX_IMPL([$1])
 ])
--- a/m4/warnings.m4	Thu Aug 24 23:49:08 2017 +0200
+++ b/m4/warnings.m4	Thu Aug 24 20:28:52 2017 -0500
@@ -1,4 +1,4 @@
-# warnings.m4 serial 12
+# warnings.m4 serial 13
 dnl Copyright (C) 2008-2017 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -59,7 +59,8 @@
 [_AC_LANG_DISPATCH([$0], _AC_LANG, $@)])
 
 # Specialization for _AC_LANG = C. This macro can be AC_REQUIREd.
-AC_DEFUN([gl_UNKNOWN_WARNINGS_ARE_ERRORS(C)],
+# Use of m4_defun rather than AC_DEFUN works around a bug in autoconf < 2.63b.
+m4_defun([gl_UNKNOWN_WARNINGS_ARE_ERRORS(C)],
 [
   AC_LANG_PUSH([C])
   gl_UNKNOWN_WARNINGS_ARE_ERRORS_IMPL
@@ -67,7 +68,8 @@
 ])
 
 # Specialization for _AC_LANG = C++. This macro can be AC_REQUIREd.
-AC_DEFUN([gl_UNKNOWN_WARNINGS_ARE_ERRORS(C++)],
+# Use of m4_defun rather than AC_DEFUN works around a bug in autoconf < 2.63b.
+m4_defun([gl_UNKNOWN_WARNINGS_ARE_ERRORS(C++)],
 [
   AC_LANG_PUSH([C++])
   gl_UNKNOWN_WARNINGS_ARE_ERRORS_IMPL