On 11/02/2012 02:36 PM, Nick Bowler wrote: > On 2012-11-02 10:46 +0100, Stefano Lattarini wrote: >> On 10/23/2012 12:59 AM, Nick Bowler wrote: >>> 4) I get a bunch of new warnings from aclocal, of the form: >>> >>> configure.ac:42: warning: DX_EXPORTED_SH is m4_require'd but not >>> m4_defun'd >>> >>> The invocation comes from an AC_REQUIRE([DX_EXPORTED_SH]) and the >>> DX_EXPORTED_SH macro is expected to be picked up by aclocal -- it is, >>> and things seem to work in the end, but the warnings are annoying >>> (and are printed multiple times). >> >> And you say they weren't there before these series? Or is this regression >> already present in master? I'll investigate. > > It wasn't there before changing the package to use AC_CONFIG_MACRO_DIRS > instead of ACLOCAL_AMFLAGS. > > In previous versions of Automake these same warnings will show up when > invoking aclocal without any -I options. In this case, not passing > those arguments would be an error, and the resulting configure sript > would probably not work since aclocal can't find the macros in question. > > But now, aclocal is being called with no -I options intentionally, and > it is actually finding the macros (and producing working configure > scripts), but these warnings are still being printed. Adding the -I > options again makes the warnings go away. > OK, I've exposed this issue with the patch below. Let's see if I'll manage to fix it as quickly as the other one...
Thanks, Stefano ---- 8< ---- 8< ---- 8< ---- 8< ---- 8< ---- 8< ---- 8< ---- 8< ---- 8< ---- >From 87232828c0c59253ae88c81295cb9048089c7952 Mon Sep 17 00:00:00 2001 Message-Id: <87232828c0c59253ae88c81295cb9048089c7952.1351877539.git.stefano.lattar...@gmail.com> From: Stefano Lattarini <stefano.lattar...@gmail.com> Date: Fri, 2 Nov 2012 18:12:40 +0100 Subject: [PATCH] coverage: expose a bug in aclocal (spurious warnings) When some macro expanded in configure.ac calls AC_REQUIRE on another macro that is defined in one of the local m4 macro dirs specified with one of the macros AC_CONFIG_MACRO_DIRS or AC_CONFIG_MACRO_DIR, aclocal prints spurious warnings like: configure.ac:4: warning: MY_BAR is m4_require'd but not m4_defun'd configure.ac:3: MY_FOO is expanded from... Expose this weakness in our testsuite. Reported by Nick Bowler; see point (4) of: <http://lists.gnu.org/archive/html/autoconf-patches/2012-11/msg00000.html> * t/aclocal-macrodir.tap ("AC_CONFIG_MACRO_DIR interaction with AC_REQUIRE"): New test. * t/aclocal-macrodirs.tap ("AC_CONFIG_MACRO_DIRS interaction with AC_REQUIRE"): Likewise. Signed-off-by: Stefano Lattarini <stefano.lattar...@gmail.com> --- t/aclocal-macrodir.tap | 27 ++++++++++++++++++++++++++- t/aclocal-macrodirs.tap | 33 ++++++++++++++++++++++++++++++++- 2 files changed, 58 insertions(+), 2 deletions(-) diff --git a/t/aclocal-macrodir.tap b/t/aclocal-macrodir.tap index 4114edb..c48b31f 100755 --- a/t/aclocal-macrodir.tap +++ b/t/aclocal-macrodir.tap @@ -20,7 +20,7 @@ am_create_testdir=empty . test-init.sh -plan_ 5 +plan_ 6 ocwd=$(pwd) || fatal_ "getting current working directory" ACLOCAL_PATH=; unset ACLOCAL_PATH @@ -173,4 +173,29 @@ test_end #--------------------------------------------------------------------------- +test_begin "AC_CONFIG_MACRO_DIR interaction with AC_REQUIRE" TODO + +cat > configure.ac <<'END' +AC_INIT([req], [1.0]) +AC_CONFIG_MACRO_DIR([macro-dir]) +AC_DEFUN([MY_FOO], [AC_REQUIRE([MY_BAR])]) +MY_FOO +END + +mkdir macro-dir +echo 'AC_DEFUN([MY_BAR], [//my//bar//])' > macro-dir/x.m4 + +st=0; $ACLOCAL 2>stderr || st=$? +cat stderr >&2 + +test $st -eq 0 \ + && test ! -s stderr \ + && $FGREP 'm4_include([macro-dir/x.m4])' aclocal.m4 \ + && $AUTOCONF \ + && not $EGREP 'MY_(FOO|BAR)' configure \ + && $FGREP '//my//bar//' configure \ + || r='not ok' + +test_end + : diff --git a/t/aclocal-macrodirs.tap b/t/aclocal-macrodirs.tap index 81ca75e..3007ed4 100755 --- a/t/aclocal-macrodirs.tap +++ b/t/aclocal-macrodirs.tap @@ -26,7 +26,7 @@ am_create_testdir=empty END } || skip_all_ "autoconf doesn't define the AC_CONFIG_MACRO_DIRS macro" -plan_ 12 +plan_ 13 ocwd=$(pwd) || fatal_ "getting current working directory" ACLOCAL_PATH=; unset ACLOCAL_PATH @@ -341,4 +341,35 @@ test_end #--------------------------------------------------------------------------- +test_begin "AC_CONFIG_MACRO_DIRS interaction with AC_REQUIRE" TODO + +cat > configure.ac <<'END' +AC_INIT([req], [1.0]) +AC_CONFIG_MACRO_DIRS([m1 m2]) +AC_DEFUN([MY_FOO], [ + AC_REQUIRE([MY_BAR]) + AC_REQUIRE([MY_BAZ]) +]) +MY_FOO +END + +mkdir m1 m2 +echo 'AC_DEFUN([MY_BAR], [^^my^^bar^^])' > m1/x.m4 +echo 'AC_DEFUN([MY_BAZ], [~~my~~baz~~])' > m2/x.m4 + +st=0; $ACLOCAL 2>stderr || st=$? +cat stderr >&2 + +test $st -eq 0 \ + && test ! -s stderr \ + && $FGREP 'm4_include([m1/x.m4])' aclocal.m4 \ + && $FGREP 'm4_include([m2/x.m4])' aclocal.m4 \ + && $AUTOCONF \ + && not $EGREP 'MY_(FOO|BAR|BAZ)' configure \ + && $FGREP '^^my^^bar^^' configure \ + && $FGREP '~~my~~baz~~' configure \ + || r='not ok' + +test_end + : -- 1.8.0 > Cheers,