]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
tests: AC_CONFIG_MACRO_DIRS: ignore inevitable failures with old autoconf
authorStefano Lattarini <stefano.lattarini@gmail.com>
Thu, 15 Nov 2012 14:29:40 +0000 (15:29 +0100)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Thu, 15 Nov 2012 14:41:40 +0000 (15:41 +0100)
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.lattarini@gmail.com>
t/aclocal-macrodir.tap
t/aclocal-macrodirs.tap

index 63ede71c8febca726c8eaf1c85fc9f7ef447f0b3..2d3b0d60e48cc7eed16437a5b54f2d9834e762a7 100755 (executable)
@@ -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
 
 :
index 0b6886bfb878be3ad556ea341554eeab165ebbff..10256fd9e44f16523ff626ec0e640a432f70f86c 100755 (executable)
@@ -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
 
 :