[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 6/6] aclocal: avoid spurious warnings from autom4te with AC_C
From: |
Nick Bowler |
Subject: |
Re: [PATCH 6/6] aclocal: avoid spurious warnings from autom4te with AC_CONFIG_MACRO_DIRS |
Date: |
Wed, 7 Nov 2012 15:08:40 -0500 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On 2012-11-03 13:36 +0100, Stefano Lattarini wrote:
> To allow us to work around this issue, autom4te has introduced a new
> "singleton" warning category, 'm4require-without-m4defun', that allow
> us to silence that particular kind of warnings (and only it).
[...]
> diff --git a/configure.ac b/configure.ac
> index 90985da..6eb4300 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -184,6 +184,21 @@ if test "$am_cv_autoconf_version" = no; then
> AC_MSG_ERROR([Autoconf $required_autoconf_version or better is required.])
> fi
>
> +wcat=m4require-without-m4defun
> +AC_CACHE_CHECK([whether autoconf supports the '$wcat' warning category],
> + [am_cv_autoconf_has_warning_for_aclocal],
> +[mkdir conftest
> +dnl Creative quoting required to avoid spurious expansion of AC_PREREQ macro
> +echo 'AC''_INIT' > conftest/conftest.ac
> +if AM_RUN_LOG([cd confetest && $am_AUTOCONF -Werror -W"$wcat" -o/dev/null]);
> +then
> + am_cv_autoconf_has_warning_for_aclocal=yes
> +else
> + am_cv_autoconf_has_warning_for_aclocal=no
> +fi
> +rm -rf conftest])
> +AC_SUBST([am_cv_autoconf_has_warning_for_aclocal])
> +
I really think this test needs to be done at runtime. Two reasons:
(1) A user may first ugprade Automake, then upgrade Autoconf. They
will then get the spurious warnings even though they have
sufficiently recent versions of both Automake and Autoconf.
(2) A user may have more than one version of Autoconf installed, one
without the warning category and one with. The value hardcoded
into aclocal at build time is therefore guaranteed to be wrong
for at least one installed version.
Furthermore, the test itself can be simplified: Just run autom4te
-Werror -Wwhatever on empty input (/dev/null will work). For example:
autom4te -Werror -Wno-m4require-without-m4defun /dev/null
Cheers,
--
Nick Bowler, Elliptic Technologies (http://www.elliptictech.com/)
- [PATCH 0/6] Support for AC_CONFIG_MACRO_DIRS in aclocal, Stefano Lattarini, 2012/11/03
- [PATCH 2/6] aclocal: diagnose non-existing directories in AC_CONFIG_MACRO_DIRS better, Stefano Lattarini, 2012/11/03
- [PATCH 3/6] tests: better coverage for AC_CONFIG_MACRO_DIRS, Stefano Lattarini, 2012/11/03
- [PATCH 4/6] aclocal: smash newlines in arguments of traced macros, Stefano Lattarini, 2012/11/03
- [PATCH 1/6] aclocal: multiple local m4 macro dirs with AC_CONFIG_MACRO_DIRS, Stefano Lattarini, 2012/11/03
- [PATCH 5/6] coverage: expose a bug in aclocal (spurious warnings), Stefano Lattarini, 2012/11/03
- [PATCH 6/6] aclocal: avoid spurious warnings from autom4te with AC_CONFIG_MACRO_DIRS, Stefano Lattarini, 2012/11/03
- Re: [PATCH 6/6] aclocal: avoid spurious warnings from autom4te with AC_CONFIG_MACRO_DIRS,
Nick Bowler <=
[PATCHv2 0/8] Support for AC_CONFIG_MACRO_DIRS in Automake, Stefano Lattarini, 2012/11/10
- [PATCHv2 1/8] aclocal: multiple local m4 macro dirs with AC_CONFIG_MACRO_DIRS, Stefano Lattarini, 2012/11/10
- [PATCHv2 2/8] aclocal: diagnose non-existing directories in AC_CONFIG_MACRO_DIRS better, Stefano Lattarini, 2012/11/10
- [PATCHv2 3/8] tests: better coverage for AC_CONFIG_MACRO_DIRS, Stefano Lattarini, 2012/11/10
- [PATCHv2 4/8] aclocal: smash newlines in arguments of traced macros, Stefano Lattarini, 2012/11/10
- [PATCHv2 5/8] coverage: expose a bug in aclocal (spurious warnings), Stefano Lattarini, 2012/11/10
- [PATCHv2 6/8] aclocal: avoid spurious warnings from autom4te with AC_CONFIG_MACRO_DIRS, Stefano Lattarini, 2012/11/10