From: Eric Blake Date: Tue, 26 Jul 2011 19:58:26 +0000 (-0600) Subject: include-next, warnings: support older autoconf X-Git-Tag: v0.1~2050 X-Git-Url: http://erislabs.net/gitweb/?a=commitdiff_plain;h=336406c13cc08ee13d6a15cc8cf86efb9132a830;p=gnulib.git include-next, warnings: support older autoconf 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 --- diff --git a/ChangeLog b/ChangeLog index cbf42ee17..2752af0da 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2011-07-26 Eric Blake + + 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 fseek, ftell: Fix doc. diff --git a/m4/include_next.m4 b/m4/include_next.m4 index b3c784918..da313b3aa 100644 --- a/m4/include_next.m4 +++ b/m4/include_next.m4 @@ -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])), diff --git a/m4/warnings.m4 b/m4/warnings.m4 index b2d1a29e2..877c5a78f 100644 --- a/m4/warnings.m4 +++ b/m4/warnings.m4 @@ -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