From 15ce5a630b02af7c7104650dfb18e443b4111564 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 16 Aug 2020 12:12:32 +0200 Subject: [PATCH] Assume autoconf >= 2.64. * gnulib-tool (DEFAULT_AUTOCONF_MINVERSION): Set to 2.64. * DEPENDENCIES: Require Autoconf 2.64 or newer. * NEWS: Mention the changed requirement. * m4/00gnulib.m4 (_m4_divert_diversion, AC_DEFUN_ONCE): Remove macros. * m4/gnulib-common.m4 (AS_VAR_IF, AS_VAR_COPY): Remove macros. * m4/absolute-header.m4 (gl_ABSOLUTE_HEADER): Quote pushdef'ed variables. * m4/include_next.m4 (gl_NEXT_HEADERS_INTERNAL): Likewise. * m4/warn-on-use.m4 (gl_WARN_ON_USE_PREPARE): Likewise. * m4/warnings.m4 (gl_COMPILER_OPTION_IF): Likewise. (gl_UNKNOWN_WARNINGS_ARE_ERRORS(C), gl_UNKNOWN_WARNINGS_ARE_ERRORS(C++), gl_UNKNOWN_WARNINGS_ARE_ERRORS(Objective C)): Define through AC_DEFUN. * m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC(C), gl_MANYWARN_ALL_GCC(C++)): Likewise. * m4/iconv.m4 (AM_ICONV): Define through AC_DEFUN_ONCE directly. * m4/libunistring.m4 (gl_LIBUNISTRING): Likewise. * m4/configmake.m4: Update comment. --- ChangeLog | 21 +++++++++++++++++++++ DEPENDENCIES | 2 +- NEWS | 2 ++ gnulib-tool | 10 +++++----- m4/00gnulib.m4 | 38 +++----------------------------------- m4/absolute-header.m4 | 10 ++++------ m4/configmake.m4 | 4 ++-- m4/gnulib-common.m4 | 14 +------------- m4/iconv.m4 | 18 +++++------------- m4/include_next.m4 | 18 ++++++++---------- m4/libunistring.m4 | 19 ++++++------------- m4/manywarnings.m4 | 8 +++----- m4/warn-on-use.m4 | 10 ++++------ m4/warnings.m4 | 19 +++++++------------ 14 files changed, 72 insertions(+), 121 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3325c156e5..f2e8f8472a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,24 @@ +2020-08-16 Bruno Haible + + Assume autoconf >= 2.64. + * gnulib-tool (DEFAULT_AUTOCONF_MINVERSION): Set to 2.64. + * DEPENDENCIES: Require Autoconf 2.64 or newer. + * NEWS: Mention the changed requirement. + * m4/00gnulib.m4 (_m4_divert_diversion, AC_DEFUN_ONCE): Remove macros. + * m4/gnulib-common.m4 (AS_VAR_IF, AS_VAR_COPY): Remove macros. + * m4/absolute-header.m4 (gl_ABSOLUTE_HEADER): Quote pushdef'ed + variables. + * m4/include_next.m4 (gl_NEXT_HEADERS_INTERNAL): Likewise. + * m4/warn-on-use.m4 (gl_WARN_ON_USE_PREPARE): Likewise. + * m4/warnings.m4 (gl_COMPILER_OPTION_IF): Likewise. + (gl_UNKNOWN_WARNINGS_ARE_ERRORS(C), gl_UNKNOWN_WARNINGS_ARE_ERRORS(C++), + gl_UNKNOWN_WARNINGS_ARE_ERRORS(Objective C)): Define through AC_DEFUN. + * m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC(C), gl_MANYWARN_ALL_GCC(C++)): + Likewise. + * m4/iconv.m4 (AM_ICONV): Define through AC_DEFUN_ONCE directly. + * m4/libunistring.m4 (gl_LIBUNISTRING): Likewise. + * m4/configmake.m4: Update comment. + 2020-08-16 Bruno Haible sys_ioctl: Simplify. diff --git a/DEPENDENCIES b/DEPENDENCIES index a7ca044eae..e7b959383a 100644 --- a/DEPENDENCIES +++ b/DEPENDENCIES @@ -31,7 +31,7 @@ at any time. + Download: https://ftp.gnu.org/gnu/m4/ -* Autoconf 2.63 or newer. +* Autoconf 2.64 or newer. + Mandatory. + Homepage: https://www.gnu.org/software/autoconf/ diff --git a/NEWS b/NEWS index 89477472ba..ed88a7ea2b 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,8 @@ Important general notes Date Modules Changes +2020-08-16 (all) Automake >= 1.11 and Autoconf >= 2.64 are required. + 2019-12-11 Support for These modules are now supported in C++ mode as well. ISO C or POSIX This means, while the autoconfiguration uses the C functions compiler, the resulting header files and function diff --git a/gnulib-tool b/gnulib-tool index 20a2a3e2a7..1ce9c30894 100755 --- a/gnulib-tool +++ b/gnulib-tool @@ -48,11 +48,11 @@ nl=' ' IFS=" "" $nl" -# You can set AUTOCONFPATH to empty if autoconf 2.63 is already in your PATH. +# You can set AUTOCONFPATH to empty if autoconf 2.64 is already in your PATH. AUTOCONFPATH= #case $USER in # bruno ) -# AUTOCONFBINDIR=/arch/x86-linux/gnu-inst-autoconf/2.63/bin +# AUTOCONFBINDIR=/arch/x86-linux/gnu-inst-autoconf/2.64/bin # AUTOCONFPATH="eval env PATH=${AUTOCONFBINDIR}:\$PATH " # ;; #esac @@ -1541,7 +1541,7 @@ func_determine_path_separator # Determine the minimum supported autoconf version from the project's # configure.ac. - DEFAULT_AUTOCONF_MINVERSION="2.63" + DEFAULT_AUTOCONF_MINVERSION="2.64" autoconf_minversion= configure_ac= if case "$mode" in import | add-import | remove-import | update) true;; *) false;; esac \ @@ -1588,8 +1588,8 @@ func_determine_path_separator autoconf_minversion=$DEFAULT_AUTOCONF_MINVERSION fi case "$autoconf_minversion" in - 1.* | 2.[0-5]* | 2.6[0-2]*) - func_fatal_error "minimum supported autoconf version is 2.63. Try adding AC_PREREQ([$DEFAULT_AUTOCONF_MINVERSION]) to your configure.ac." ;; + 1.* | 2.[0-5]* | 2.6[0-3]*) + func_fatal_error "minimum supported autoconf version is 2.64. Try adding AC_PREREQ([$DEFAULT_AUTOCONF_MINVERSION]) to your configure.ac." ;; esac # Remove trailing slashes from the directory names. This is necessary for diff --git a/m4/00gnulib.m4 b/m4/00gnulib.m4 index 06eff4f386..14628c363b 100644 --- a/m4/00gnulib.m4 +++ b/m4/00gnulib.m4 @@ -1,44 +1,12 @@ -# 00gnulib.m4 serial 7 +# 00gnulib.m4 serial 8 dnl Copyright (C) 2009-2020 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file must be named something that sorts before all other -dnl gnulib-provided .m4 files. The first part is needed until such time -dnl as we can assume Autoconf 2.64, with its improved AC_DEFUN_ONCE and -dnl m4_divert semantics. The second part is needed until the clang fix -dnl has been included in Autoconf. - -# Until autoconf 2.63, handling of the diversion stack required m4_init -# to be called first; but this does not happen with aclocal. Wrapping -# the entire execution in another layer of the diversion stack fixes this. -# Worse, prior to autoconf 2.62, m4_wrap depended on the underlying m4 -# for whether it was FIFO or LIFO; in order to properly balance with -# m4_init, we need to undo our push just before anything wrapped within -# the m4_init body. The way to ensure this is to wrap both sides of -# m4_init with a one-shot macro that does the pop at the right time. -m4_ifndef([_m4_divert_diversion], -[m4_divert_push([KILL]) -m4_define([gl_divert_fixup], [m4_divert_pop()m4_define([$0])]) -m4_define([m4_init], - [gl_divert_fixup()]m4_defn([m4_init])[gl_divert_fixup()])]) - - -# AC_DEFUN_ONCE([NAME], VALUE) -# ---------------------------- -# Define NAME to expand to VALUE on the first use (whether by direct -# expansion, or by AC_REQUIRE), and to nothing on all subsequent uses. -# Avoid bugs in AC_REQUIRE in Autoconf 2.63 and earlier. This -# definition is slower than the version in Autoconf 2.64, because it -# can only use interfaces that existed since 2.59; but it achieves the -# same effect. Quoting is necessary to avoid confusing Automake. -m4_version_prereq([2.63.263], [], -[m4_define([AC][_DEFUN_ONCE], - [AC][_DEFUN([$1], - [AC_REQUIRE([_gl_DEFUN_ONCE([$1])], - [m4_indir([_gl_DEFUN_ONCE([$1])])])])]dnl -[AC][_DEFUN([_gl_DEFUN_ONCE([$1])], [$2])])]) +dnl gnulib-provided .m4 files. It is needed until the clang fix has +dnl been included in Autoconf. # The following definitions arrange to use a compiler option # -Werror=implicit-function-declaration in AC_CHECK_DECL, when the diff --git a/m4/absolute-header.m4 b/m4/absolute-header.m4 index 39726ba57b..c043233de3 100644 --- a/m4/absolute-header.m4 +++ b/m4/absolute-header.m4 @@ -1,4 +1,4 @@ -# absolute-header.m4 serial 16 +# absolute-header.m4 serial 17 dnl Copyright (C) 2006-2020 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -22,23 +22,21 @@ dnl From Derek Price. AC_DEFUN([gl_ABSOLUTE_HEADER], [AC_REQUIRE([AC_CANONICAL_HOST]) AC_LANG_PREPROC_REQUIRE()dnl -dnl FIXME: gl_absolute_header and ac_header_exists must be used unquoted -dnl until we can assume autoconf 2.64 or newer. m4_foreach_w([gl_HEADER_NAME], [$1], [AS_VAR_PUSHDEF([gl_absolute_header], [gl_cv_absolute_]m4_defn([gl_HEADER_NAME]))dnl AC_CACHE_CHECK([absolute name of <]m4_defn([gl_HEADER_NAME])[>], - m4_defn([gl_absolute_header]), + [gl_absolute_header], [AS_VAR_PUSHDEF([ac_header_exists], [ac_cv_header_]m4_defn([gl_HEADER_NAME]))dnl AC_CHECK_HEADERS_ONCE(m4_defn([gl_HEADER_NAME]))dnl - if test AS_VAR_GET(ac_header_exists) = yes; then + if test AS_VAR_GET([ac_header_exists]) = yes; then gl_ABSOLUTE_HEADER_ONE(m4_defn([gl_HEADER_NAME])) fi AS_VAR_POPDEF([ac_header_exists])dnl ])dnl AC_DEFINE_UNQUOTED(AS_TR_CPP([ABSOLUTE_]m4_defn([gl_HEADER_NAME])), - ["AS_VAR_GET(gl_absolute_header)"], + ["AS_VAR_GET([gl_absolute_header])"], [Define this to an absolute name of <]m4_defn([gl_HEADER_NAME])[>.]) AS_VAR_POPDEF([gl_absolute_header])dnl ])dnl diff --git a/m4/configmake.m4 b/m4/configmake.m4 index 0ca6416ac1..f0f094f5f5 100644 --- a/m4/configmake.m4 +++ b/m4/configmake.m4 @@ -1,4 +1,4 @@ -# configmake.m4 serial 3 +# configmake.m4 serial 4 dnl Copyright (C) 2010-2020 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -9,7 +9,7 @@ AC_PREREQ([2.60]) # gl_CONFIGMAKE_PREP # ------------------ # Guarantee all of the standard directory variables, even when used with -# autoconf 2.63 (runstatedir wasn't supported before 2.70) or +# autoconf 2.64 (runstatedir wasn't supported before 2.70) or # automake 1.11 (runstatedir isn't supported even in 1.16.1). AC_DEFUN([gl_CONFIGMAKE_PREP], [ diff --git a/m4/gnulib-common.m4 b/m4/gnulib-common.m4 index c7d1e34f6a..33e56faa98 100644 --- a/m4/gnulib-common.m4 +++ b/m4/gnulib-common.m4 @@ -1,4 +1,4 @@ -# gnulib-common.m4 serial 56 +# gnulib-common.m4 serial 57 dnl Copyright (C) 2007-2020 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -480,14 +480,6 @@ AC_DEFUN([gl_FEATURES_H], AC_SUBST([HAVE_FEATURES_H]) ]) -# AS_VAR_IF(VAR, VALUE, [IF-MATCH], [IF-NOT-MATCH]) -# ---------------------------------------------------- -# Backport of autoconf-2.63b's macro. -# Remove this macro when we can assume autoconf >= 2.64. -m4_ifndef([AS_VAR_IF], -[m4_define([AS_VAR_IF], -[AS_IF([test x"AS_VAR_GET([$1])" = x""$2], [$3], [$4])])]) - # gl_PROG_CC_C99 # Modifies the value of the shell variable CC in an attempt to make $CC # understand ISO C99 source code. @@ -660,10 +652,6 @@ AC_DEFUN([gl_CACHE_VAL_SILENT], as_echo_n="$saved_as_echo_n" ]) -# AS_VAR_COPY was added in autoconf 2.63b -m4_define_default([AS_VAR_COPY], -[AS_LITERAL_IF([$1[]$2], [$1=$$2], [eval $1=\$$2])]) - dnl Expands to some code for use in .c programs that, on native Windows, defines dnl the Microsoft deprecated alias function names to the underscore-prefixed dnl actual function names. With this macro, these function names are available diff --git a/m4/iconv.m4 b/m4/iconv.m4 index e593b7270a..67dbfed64f 100644 --- a/m4/iconv.m4 +++ b/m4/iconv.m4 @@ -1,4 +1,4 @@ -# iconv.m4 serial 21 +# iconv.m4 serial 22 dnl Copyright (C) 2000-2002, 2007-2014, 2016-2020 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation @@ -7,6 +7,8 @@ dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. +AC_PREREQ([2.64]) + AC_DEFUN([AM_ICONV_LINKFLAGS_BODY], [ dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. @@ -225,8 +227,7 @@ AC_DEFUN([AM_ICONV_LINK], AC_SUBST([LTLIBICONV]) ]) -dnl Define AM_ICONV using AC_DEFUN_ONCE for Autoconf >= 2.64, in order to -dnl avoid warnings like +dnl Define AM_ICONV using AC_DEFUN_ONCE, in order to avoid warnings like dnl "warning: AC_REQUIRE: `AM_ICONV' was expanded before it was required". dnl This is tricky because of the way 'aclocal' is implemented: dnl - It requires defining an auxiliary macro whose name ends in AC_DEFUN. @@ -234,16 +235,7 @@ dnl Otherwise aclocal's initial scan pass would miss the macro definition. dnl - It requires a line break inside the AC_DEFUN_ONCE and AC_DEFUN expansions. dnl Otherwise aclocal would emit many "Use of uninitialized value $1" dnl warnings. -m4_define([gl_iconv_AC_DEFUN], - m4_version_prereq([2.64], - [[AC_DEFUN_ONCE( - [$1], [$2])]], - [m4_ifdef([gl_00GNULIB], - [[AC_DEFUN_ONCE( - [$1], [$2])]], - [[AC_DEFUN( - [$1], [$2])]])])) -gl_iconv_AC_DEFUN([AM_ICONV], +AC_DEFUN_ONCE([AM_ICONV], [ AM_ICONV_LINK if test "$am_cv_func_iconv" = yes; then diff --git a/m4/include_next.m4 b/m4/include_next.m4 index 9009e293b5..33601aa3b4 100644 --- a/m4/include_next.m4 +++ b/m4/include_next.m4 @@ -1,4 +1,4 @@ -# include_next.m4 serial 24 +# include_next.m4 serial 25 dnl Copyright (C) 2006-2020 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -176,42 +176,40 @@ AC_DEFUN([gl_NEXT_HEADERS_INTERNAL], [AC_CHECK_HEADERS_ONCE([$1]) ]) -dnl FIXME: gl_next_header and gl_header_exists must be used unquoted -dnl until we can assume autoconf 2.64 or newer. m4_foreach_w([gl_HEADER_NAME], [$1], [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])[>], - m4_defn([gl_next_header]), + [gl_next_header], [m4_if([$2], [check], [AS_VAR_PUSHDEF([gl_header_exists], [ac_cv_header_]m4_defn([gl_HEADER_NAME])) - if test AS_VAR_GET(gl_header_exists) = yes; then + if test AS_VAR_GET([gl_header_exists]) = yes; then AS_VAR_POPDEF([gl_header_exists]) ]) gl_ABSOLUTE_HEADER_ONE(gl_HEADER_NAME) AS_VAR_COPY([gl_header], [gl_cv_absolute_]AS_TR_SH(gl_HEADER_NAME)) - AS_VAR_SET(gl_next_header, ['"'$gl_header'"']) + AS_VAR_SET([gl_next_header], ['"'$gl_header'"']) 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/libunistring.m4 b/m4/libunistring.m4 index 8b6ef8db8d..a0c36e37d2 100644 --- a/m4/libunistring.m4 +++ b/m4/libunistring.m4 @@ -1,9 +1,11 @@ -# libunistring.m4 serial 11 +# libunistring.m4 serial 12 dnl Copyright (C) 2009-2020 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. +AC_PREREQ([2.64]) + dnl gl_LIBUNISTRING dnl Searches for an installed libunistring. dnl If found, it sets and AC_SUBSTs HAVE_LIBUNISTRING=yes and the LIBUNISTRING @@ -12,8 +14,8 @@ dnl augments the CPPFLAGS variable, and #defines HAVE_LIBUNISTRING to 1. dnl Otherwise, it sets and AC_SUBSTs HAVE_LIBUNISTRING=no and LIBUNISTRING and dnl LTLIBUNISTRING to empty. -dnl Define gl_LIBUNISTRING using AC_DEFUN_ONCE for Autoconf >= 2.64, in order -dnl to avoid warnings like +dnl Define gl_LIBUNISTRING using AC_DEFUN_ONCE, in order dnl to avoid warnings +dnl like dnl "warning: AC_REQUIRE: `gl_LIBUNISTRING' was expanded before it was required". dnl This is tricky because of the way 'aclocal' is implemented: dnl - It requires defining an auxiliary macro whose name ends in AC_DEFUN. @@ -21,16 +23,7 @@ dnl Otherwise aclocal's initial scan pass would miss the macro definition. dnl - It requires a line break inside the AC_DEFUN_ONCE and AC_DEFUN expansions. dnl Otherwise aclocal would emit many "Use of uninitialized value $1" dnl warnings. -m4_define([gl_libunistring_AC_DEFUN], - m4_version_prereq([2.64], - [[AC_DEFUN_ONCE( - [$1], [$2])]], - [m4_ifdef([gl_00GNULIB], - [[AC_DEFUN_ONCE( - [$1], [$2])]], - [[AC_DEFUN( - [$1], [$2])]])])) -gl_libunistring_AC_DEFUN([gl_LIBUNISTRING], +AC_DEFUN_ONCE([gl_LIBUNISTRING], [ AC_BEFORE([$0], [gl_LIBUNISTRING_MODULE]) AC_BEFORE([$0], [gl_LIBUNISTRING_LIBHEADER]) diff --git a/m4/manywarnings.m4 b/m4/manywarnings.m4 index d18da048d9..a37cd15b69 100644 --- a/m4/manywarnings.m4 +++ b/m4/manywarnings.m4 @@ -1,4 +1,4 @@ -# manywarnings.m4 serial 20 +# manywarnings.m4 serial 21 dnl Copyright (C) 2008-2020 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,8 +39,7 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC], [_AC_LANG_DISPATCH([$0], _AC_LANG, $@)]) # Specialization for _AC_LANG = 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_DEFUN([gl_MANYWARN_ALL_GCC(C)], [ AC_LANG_PUSH([C]) @@ -210,8 +209,7 @@ m4_defun([gl_MANYWARN_ALL_GCC(C)], ]) # Specialization for _AC_LANG = 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_DEFUN([gl_MANYWARN_ALL_GCC(C++)], [ gl_MANYWARN_ALL_GCC_CXX_IMPL([$1]) ]) diff --git a/m4/warn-on-use.m4 b/m4/warn-on-use.m4 index 5c8ee45092..f36551c110 100644 --- a/m4/warn-on-use.m4 +++ b/m4/warn-on-use.m4 @@ -1,4 +1,4 @@ -# warn-on-use.m4 serial 6 +# warn-on-use.m4 serial 7 dnl Copyright (C) 2010-2020 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -30,17 +30,15 @@ AC_DEFUN([gl_WARN_ON_USE_PREPARE], [AH_TEMPLATE([HAVE_RAW_DECL_]AS_TR_CPP(m4_defn([gl_decl])), [Define to 1 if ]m4_defn([gl_decl])[ is declared even after undefining macros.])])dnl -dnl FIXME: gl_Symbol must be used unquoted until we can assume -dnl autoconf 2.64 or newer. for gl_func in m4_flatten([$2]); do AS_VAR_PUSHDEF([gl_Symbol], [gl_cv_have_raw_decl_$gl_func])dnl AC_CACHE_CHECK([whether $gl_func is declared without a macro], - gl_Symbol, + [gl_Symbol], [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$1], [@%:@undef $gl_func (void) $gl_func;])], - [AS_VAR_SET(gl_Symbol, [yes])], [AS_VAR_SET(gl_Symbol, [no])])]) - AS_VAR_IF(gl_Symbol, [yes], + [AS_VAR_SET([gl_Symbol], [yes])], [AS_VAR_SET([gl_Symbol], [no])])]) + AS_VAR_IF([gl_Symbol], [yes], [AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_RAW_DECL_$gl_func]), [1]) dnl shortcut - if the raw declaration exists, then set a cache dnl variable to allow skipping any later AC_CHECK_DECL efforts diff --git a/m4/warnings.m4 b/m4/warnings.m4 index d272365f0a..e01dc6c8ee 100644 --- a/m4/warnings.m4 +++ b/m4/warnings.m4 @@ -1,4 +1,4 @@ -# warnings.m4 serial 14 +# warnings.m4 serial 15 dnl Copyright (C) 2008-2020 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -23,8 +23,6 @@ m4_ifdef([AS_VAR_APPEND], # The effects of this macro depend on the current language (_AC_LANG). AC_DEFUN([gl_COMPILER_OPTION_IF], [ -dnl FIXME: gl_Warn must be used unquoted until we can assume Autoconf -dnl 2.64 or newer. AS_VAR_PUSHDEF([gl_Warn], [gl_cv_warn_[]_AC_LANG_ABBREV[]_$1])dnl AS_VAR_PUSHDEF([gl_Flags], [_AC_LANG_PREFIX[]FLAGS])dnl AS_LITERAL_IF([$1], @@ -34,13 +32,13 @@ case $gl_positive in -Wno-*) gl_positive=-W`expr "X$gl_positive" : 'X-Wno-\(.*\)'` ;; esac m4_pushdef([gl_Positive], [$gl_positive])])dnl -AC_CACHE_CHECK([whether _AC_LANG compiler handles $1], m4_defn([gl_Warn]), [ +AC_CACHE_CHECK([whether _AC_LANG compiler handles $1], [gl_Warn], [ gl_save_compiler_FLAGS="$gl_Flags" gl_AS_VAR_APPEND(m4_defn([gl_Flags]), [" $gl_unknown_warnings_are_errors ]m4_defn([gl_Positive])["]) AC_LINK_IFELSE([m4_default([$4], [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])]) gl_Flags="$gl_save_compiler_FLAGS" ]) AS_VAR_IF(gl_Warn, [yes], [$2], [$3]) @@ -59,8 +57,7 @@ AC_DEFUN([gl_UNKNOWN_WARNINGS_ARE_ERRORS], [_AC_LANG_DISPATCH([$0], _AC_LANG, $@)]) # Specialization for _AC_LANG = C. This macro can be AC_REQUIREd. -# 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_DEFUN([gl_UNKNOWN_WARNINGS_ARE_ERRORS(C)], [ AC_LANG_PUSH([C]) gl_UNKNOWN_WARNINGS_ARE_ERRORS_IMPL @@ -68,8 +65,7 @@ m4_defun([gl_UNKNOWN_WARNINGS_ARE_ERRORS(C)], ]) # Specialization for _AC_LANG = C++. This macro can be AC_REQUIREd. -# 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_DEFUN([gl_UNKNOWN_WARNINGS_ARE_ERRORS(C++)], [ AC_LANG_PUSH([C++]) gl_UNKNOWN_WARNINGS_ARE_ERRORS_IMPL @@ -77,8 +73,7 @@ m4_defun([gl_UNKNOWN_WARNINGS_ARE_ERRORS(C++)], ]) # Specialization for _AC_LANG = Objective C. This macro can be AC_REQUIREd. -# Use of m4_defun rather than AC_DEFUN works around a bug in autoconf < 2.63b. -m4_defun([gl_UNKNOWN_WARNINGS_ARE_ERRORS(Objective C)], +AC_DEFUN([gl_UNKNOWN_WARNINGS_ARE_ERRORS(Objective C)], [ AC_LANG_PUSH([Objective C]) gl_UNKNOWN_WARNINGS_ARE_ERRORS_IMPL -- 2.39.5