When "older" version of autoconf are used (that is, those before commit v2.69-44-g1ed0548), we have no sane way to prevent the autom4te invocation issued from aclocal to possibly display warnings "MACRO m4_require'd but not m4_defun'd". That's not a big deal, because that just means that people using pre-2.70 autoconf with cutting-edge automake will see few spurious warnings, but the actual semantics will remain correct.
However, this blemish was causing a couple of annoying testsuite failures. Solve this by simply skipping the affected tests when older (pre-2.70) autoconf versions are used. * t/aclocl-macrodir.tap ("AC_CONFIG_MACRO_DIR interaction with AC_REQUIRE"): Skip when older autoconf is in use. * t/aclocl-macrodirs.tap ("AC_CONFIG_MACRO_DIR interaction with AC_REQUIRE"): Likewise. Signed-off-by: Stefano Lattarini <stefano.lattar...@gmail.com> --- This patch looks bigger than it actually is, due to re-indentation. Here is the corresponding output of "git log -w -w": diff --git a/t/aclocal-macrodir.tap b/t/aclocal-macrodir.tap index 63ede71..2d3b0d6 100755 --- a/t/aclocal-macrodir.tap +++ b/t/aclocal-macrodir.tap @@ -173,9 +173,13 @@ test_end #--------------------------------------------------------------------------- +# Avoid spurious failures with pre-2.70 autoconf. +# FIXME: remove this in automake 1.14, once we require Autoconf 2.70. +if echo 'AC_INIT AC_CONFIG_MACRO_DIRS' | $AUTOCONF -o/dev/null -; then + test_begin "AC_CONFIG_MACRO_DIR interaction with AC_REQUIRE" -cat > configure.ac <<'END' + unindent > configure.ac <<'END' AC_INIT([req], [1.0]) AC_CONFIG_MACRO_DIR([macro-dir]) AC_DEFUN([MY_FOO], [AC_REQUIRE([MY_BAR])]) @@ -198,4 +202,10 @@ test $st -eq 0 \ test_end +else + + skip_ -r "autoconf is too old (AC_CONFIG_MACRO_DIRS not defined)" + +fi + : diff --git a/t/aclocal-macrodirs.tap b/t/aclocal-macrodirs.tap index 0b6886b..10256fd 100755 --- a/t/aclocal-macrodirs.tap +++ b/t/aclocal-macrodirs.tap @@ -372,9 +372,13 @@ test_end #--------------------------------------------------------------------------- +# Avoid spurious failures with pre-2.70 autoconf. +# FIXME: remove this in automake 1.14, once we require Autoconf 2.70. +if echo 'AC_INIT AC_CONFIG_MACRO_DIRS' | $AUTOCONF -o/dev/null -; then + test_begin "AC_CONFIG_MACRO_DIRS interaction with AC_REQUIRE" -cat > configure.ac <<'END' + unindent > configure.ac <<'END' AC_INIT([req], [1.0]) AC_CONFIG_MACRO_DIRS([m1 m2]) AC_DEFUN([MY_FOO], [ @@ -403,4 +407,10 @@ test $st -eq 0 \ test_end +else + + skip_ -r "autoconf is too old (AC_CONFIG_MACRO_DIRS not defined)" + +fi + : t/aclocal-macrodir.tap | 46 ++++++++++++++++++++++--------------- t/aclocal-macrodirs.tap | 60 ++++++++++++++++++++++++++++--------------------- 2 files changed, 63 insertions(+), 43 deletions(-) diff --git a/t/aclocal-macrodir.tap b/t/aclocal-macrodir.tap index 63ede71..2d3b0d6 100755 --- a/t/aclocal-macrodir.tap +++ b/t/aclocal-macrodir.tap @@ -173,29 +173,39 @@ test_end #--------------------------------------------------------------------------- -test_begin "AC_CONFIG_MACRO_DIR interaction with AC_REQUIRE" +# Avoid spurious failures with pre-2.70 autoconf. +# FIXME: remove this in automake 1.14, once we require Autoconf 2.70. +if echo 'AC_INIT AC_CONFIG_MACRO_DIRS' | $AUTOCONF -o/dev/null -; then -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 + test_begin "AC_CONFIG_MACRO_DIR interaction with AC_REQUIRE" + + unindent > 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 + mkdir macro-dir + echo 'AC_DEFUN([MY_BAR], [//my//bar//])' > macro-dir/x.m4 -st=0; $ACLOCAL 2>stderr || st=$? -cat stderr >&2 + 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 $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 + test_end + +else + + skip_ -r "autoconf is too old (AC_CONFIG_MACRO_DIRS not defined)" + +fi : diff --git a/t/aclocal-macrodirs.tap b/t/aclocal-macrodirs.tap index 0b6886b..10256fd 100755 --- a/t/aclocal-macrodirs.tap +++ b/t/aclocal-macrodirs.tap @@ -372,35 +372,45 @@ test_end #--------------------------------------------------------------------------- -test_begin "AC_CONFIG_MACRO_DIRS interaction with AC_REQUIRE" - -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 +# Avoid spurious failures with pre-2.70 autoconf. +# FIXME: remove this in automake 1.14, once we require Autoconf 2.70. +if echo 'AC_INIT AC_CONFIG_MACRO_DIRS' | $AUTOCONF -o/dev/null -; then + + test_begin "AC_CONFIG_MACRO_DIRS interaction with AC_REQUIRE" + + unindent > 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 + 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 + 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 $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 + test_end + +else + + skip_ -r "autoconf is too old (AC_CONFIG_MACRO_DIRS not defined)" + +fi : -- 1.8.0