include-next, warnings: support older autoconf
authorEric Blake <eblake@redhat.com>
Tue, 26 Jul 2011 19:58:26 +0000 (13:58 -0600)
committerEric Blake <eblake@redhat.com>
Tue, 26 Jul 2011 20:11:24 +0000 (14:11 -0600)
Older autoconf did not know how to peer through quoting of the
m4 macro created by AS_VAR_PUSHDEF; while newer autoconf has
been patched to allow typical autoconf quoting rules to still
apply, compatibility with autoconf 2.59 requires the unquoted
use of the macro name for all uses prior to AS_VAR_POPDEF.

absolute-header.m4 and warn-on-use.m4 already got this right.

* m4/include_next.m4 (gl_NEXT_HEADERS_INTERNAL): Use
AS_VAR_PUSHDEF in a way that works with older autoconf.
* m4/warnings.m4 (gl_WARN_ADD): Likewise.
Reported by Daniel P. Berrange.

Signed-off-by: Eric Blake <eblake@redhat.com>
ChangeLog
m4/include_next.m4
m4/warnings.m4

index cbf42ee17c4be500e851ac5ed71a80691943be16..2752af0da4bd9fa66ceb6e3482d9c36869bcdc8f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2011-07-26  Eric Blake  <eblake@redhat.com>
+
+       include-next, warnings: support older autoconf
+       * m4/include_next.m4 (gl_NEXT_HEADERS_INTERNAL): Use
+       AS_VAR_PUSHDEF in a way that works with older autoconf.
+       * m4/warnings.m4 (gl_WARN_ADD): Likewise.
+       Reported by Daniel P. Berrange.
+
 2011-07-25  Bruno Haible  <bruno@clisp.org>
 
        fseek, ftell: Fix doc.
index b3c78491855295c6b0a855438f5fac7ad146e641..da313b3aa72496e337dc962350f17f5a88f6e1c5 100644 (file)
@@ -1,4 +1,4 @@
-# include_next.m4 serial 18
+# include_next.m4 serial 19
 dnl Copyright (C) 2006-2011 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -179,7 +179,7 @@ AC_DEFUN([gl_NEXT_HEADERS_INTERNAL],
     [AS_VAR_PUSHDEF([gl_next_header],
                     [gl_cv_next_]m4_defn([gl_HEADER_NAME]))
      if test $gl_cv_have_include_next = yes; then
-       AS_VAR_SET([gl_next_header], ['<'gl_HEADER_NAME'>'])
+       AS_VAR_SET(gl_next_header, ['<'gl_HEADER_NAME'>'])
      else
        AC_CACHE_CHECK(
          [absolute name of <]m4_defn([gl_HEADER_NAME])[>],
@@ -208,7 +208,7 @@ AC_DEFUN([gl_NEXT_HEADERS_INTERNAL],
                dnl eval is necessary to expand gl_absname_cpp.
                dnl Ultrix and Pyramid sh refuse to redirect output of eval,
                dnl so use subshell.
-               AS_VAR_SET([gl_next_header],
+               AS_VAR_SET(gl_next_header,
                  ['"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD |
                   sed -n '\#/]m4_defn([gl_HEADER_NAME])[#{
                     s#.*"\(.*/]m4_defn([gl_HEADER_NAME])[\)".*#\1#
@@ -218,20 +218,20 @@ AC_DEFUN([gl_NEXT_HEADERS_INTERNAL],
                   }'`'"'])
           m4_if([$2], [check],
             [else
-               AS_VAR_SET([gl_next_header], ['<'gl_HEADER_NAME'>'])
+               AS_VAR_SET(gl_next_header, ['<'gl_HEADER_NAME'>'])
              fi
             ])
          ])
      fi
      AC_SUBST(
        AS_TR_CPP([NEXT_]m4_defn([gl_HEADER_NAME])),
-       [AS_VAR_GET([gl_next_header])])
+       [AS_VAR_GET(gl_next_header)])
      if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
        # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
        gl_next_as_first_directive='<'gl_HEADER_NAME'>'
      else
        # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
-       gl_next_as_first_directive=AS_VAR_GET([gl_next_header])
+       gl_next_as_first_directive=AS_VAR_GET(gl_next_header)
      fi
      AC_SUBST(
        AS_TR_CPP([NEXT_AS_FIRST_DIRECTIVE_]m4_defn([gl_HEADER_NAME])),
index b2d1a29e2a18a577118eeea4ed1e170a0b2abeec..877c5a78fde3deae92bff07376a7de6f447d53d6 100644 (file)
@@ -1,4 +1,4 @@
-# warnings.m4 serial 3
+# warnings.m4 serial 4
 dnl Copyright (C) 2008-2011 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -20,16 +20,16 @@ m4_ifdef([AS_VAR_APPEND],
 # gl_WARN_ADD([-Wparentheses]).
 AC_DEFUN([gl_WARN_ADD],
 [AS_VAR_PUSHDEF([gl_Warn], [gl_cv_warn_$1])dnl
-AC_CACHE_CHECK([whether compiler handles $1], [gl_Warn], [
+AC_CACHE_CHECK([whether compiler handles $1], m4_defn([gl_Warn]), [
   gl_save_CPPFLAGS="$CPPFLAGS"
   CPPFLAGS="${CPPFLAGS} $1"
   AC_PREPROC_IFELSE([AC_LANG_PROGRAM([])],
-                    [AS_VAR_SET([gl_Warn], [yes])],
-                    [AS_VAR_SET([gl_Warn], [no])])
+                    [AS_VAR_SET(gl_Warn, [yes])],
+                    [AS_VAR_SET(gl_Warn, [no])])
   CPPFLAGS="$gl_save_CPPFLAGS"
 ])
 AS_VAR_PUSHDEF([gl_Flags], m4_if([$2], [], [[WARN_CFLAGS]], [[$2]]))dnl
-AS_VAR_IF([gl_Warn], [yes], [gl_AS_VAR_APPEND([gl_Flags], [" $1"])])
+AS_VAR_IF(gl_Warn, [yes], [gl_AS_VAR_APPEND([gl_Flags], [" $1"])])
 AS_VAR_POPDEF([gl_Flags])dnl
 AS_VAR_POPDEF([gl_Warn])dnl
 m4_ifval([$2], [AS_LITERAL_IF([$2], [AC_SUBST([$2])], [])])dnl