automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 3/6] Add tests for non-default autotools in rebuild rules.


From: Stefano Lattarini
Subject: Re: [PATCH 3/6] Add tests for non-default autotools in rebuild rules.
Date: Sun, 22 Aug 2010 13:48:55 +0200
User-agent: KMail/1.13.3 (Linux/2.6.30-2-686; KDE/4.4.4; i686; ; )

Here is an amendment triggered by Ralf observations and suggestions.
It has been quite tricky to get right (hoping that new it's really 
right...).

In the generated scripts wrapping an autotool, I now use the absolute 
path of the wrapped autotool.  This avoids potential spurious failures
and fork bombs (ugh).  This change required the addition of a new and 
quite lengthy shell function to `tests/defs.in': program_abspath().

Also, I added proper "FIXME" comments w.r.t. use of @PATH_SEPARATOR@
for redefinitions of PATH, and switched from `xbin'  to `bin' for the
name of the directory holding the temporary binaries and wrapper
scripts.

Now the tests passes both when $AUTOCONF and $AUTOM4TE are absolute
paths, and when the are simply resp. `autoconf' and `autom4te'.

Regards,
  Stefano
From ce7eaee53a1a7faf28bfebd558e396404a402155 Mon Sep 17 00:00:00 2001
From: Stefano Lattarini <address@hidden>
Date: Thu, 12 Aug 2010 18:57:25 +0200
Subject: [PATCH 3/6] Add tests for non-default autotools in rebuild rules.

* configure.ac (am_AUTOM4TE): New AC_SUBST'd variable.
* tests/defs.in ($AUTOM4TE): New shell variable, defaulting
to AC_SUBST'd address@hidden@'.
($APIVERSION): New variable, AC_SUBST'd.
($ACLOCAL, $AUTOMAKE): Use it.
(program_abspath): New function.
* tests/remake8a.test: New test.
* tests/remake8b.test: Likewise.
* tests/remake8c.test: Likewise.
* tests/remake8d.test: Likewise.
* tests/remake8e.test: Likewise.
* tests/remake8f.test: Likewise.
* tests/remake8g.test: Likewise.
* tests/remake8h.test: Likewise.
* tests/Makefile.am (TESTS, XFAIL_TESTS): Updated.
---
 ChangeLog                      |   17 ++++
 Makefile.in                    |    1 +
 configure                      |    6 +-
 configure.ac                   |    4 +-
 doc/Makefile.in                |    1 +
 lib/Automake/Makefile.in       |    1 +
 lib/Automake/tests/Makefile.in |    1 +
 lib/Makefile.in                |    1 +
 lib/am/Makefile.in             |    1 +
 m4/Makefile.in                 |    1 +
 tests/Makefile.am              |   12 +++
 tests/Makefile.in              |   13 +++
 tests/defs.in                  |   67 ++++++++++++++-
 tests/remake8a.test            |  105 +++++++++++++++++++++++
 tests/remake8b.test            |  104 +++++++++++++++++++++++
 tests/remake8c.test            |  112 +++++++++++++++++++++++++
 tests/remake8d.test            |  180 ++++++++++++++++++++++++++++++++++++++++
 tests/remake8e.test            |  175 ++++++++++++++++++++++++++++++++++++++
 tests/remake8f.test            |  123 +++++++++++++++++++++++++++
 tests/remake8g.test            |  137 ++++++++++++++++++++++++++++++
 tests/remake8h.test            |   59 +++++++++++++
 21 files changed, 1117 insertions(+), 4 deletions(-)
 create mode 100755 tests/remake8a.test
 create mode 100755 tests/remake8b.test
 create mode 100755 tests/remake8c.test
 create mode 100755 tests/remake8d.test
 create mode 100755 tests/remake8e.test
 create mode 100755 tests/remake8f.test
 create mode 100755 tests/remake8g.test
 create mode 100755 tests/remake8h.test

diff --git a/ChangeLog b/ChangeLog
index 65d7677..b49e47b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,22 @@
 2010-08-21  Stefano Lattarini  <address@hidden>
 
+       Add tests for non-default autotools in rebuild rules.
+       * configure.ac (am_AUTOM4TE): New AC_SUBST'd variable.
+       * tests/defs.in ($AUTOM4TE): New shell variable, defaulting
+       to AC_SUBST'd address@hidden@'.
+       ($APIVERSION): New variable, AC_SUBST'd.
+       ($ACLOCAL, $AUTOMAKE): Use it.
+       (program_abspath): New function.
+       * tests/remake8a.test: New test.
+       * tests/remake8b.test: Likewise.
+       * tests/remake8c.test: Likewise.
+       * tests/remake8d.test: Likewise.
+       * tests/remake8e.test: Likewise.
+       * tests/remake8f.test: Likewise.
+       * tests/remake8g.test: Likewise.
+       * tests/remake8h.test: Likewise.
+       * tests/Makefile.am (TESTS, XFAIL_TESTS): Updated.
+
        Testsuite: fix missing*.test for non-default autotools.
        * tests/missing.test: Build and use our own `autoconf' script, to
        avoid spurious failures due to configure-time value of $AUTOCONF
diff --git a/Makefile.in b/Makefile.in
index 528b80e..0284088 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -194,6 +194,7 @@ abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
 am_AUTOCONF = @am_AUTOCONF@
 am_AUTOHEADER = @am_AUTOHEADER@
+am_AUTOM4TE = @am_AUTOM4TE@
 am__leading_dot = @am__leading_dot@
 am__tar = @am__tar@
 am__untar = @am__untar@
diff --git a/configure b/configure
index ae88625..b51f462 100755
--- a/configure
+++ b/configure
@@ -596,6 +596,7 @@ INSTALL_DATA
 INSTALL_SCRIPT
 INSTALL_PROGRAM
 am_AUTOHEADER
+am_AUTOM4TE
 am_AUTOCONF
 build_os
 build_vendor
@@ -1766,9 +1767,12 @@ case $build_os in *\ *) build_os=`echo "$build_os" | sed 
's/ /-/g'`;; esac
 
 # Save the AUTOCONF setting before AM_INIT_AUTOMAKE overrides it; this
 # way we can run Autoconf tests from configure (or from the test
-# suite) without being bothered by `missing'.  Likewise for autoheader.
+# suite) without being bothered by `missing'.  Likewise for autoheader
+# and autom4te.
 am_AUTOCONF="${AUTOCONF-autoconf}"
 
+am_AUTOM4TE="${AUTOM4TE-autom4te}"
+
 am_AUTOHEADER="${AUTOHEADER-autoheader}"
 
 
diff --git a/configure.ac b/configure.ac
index de4583d..90d23ed 100644
--- a/configure.ac
+++ b/configure.ac
@@ -28,8 +28,10 @@ AC_CANONICAL_BUILD
 
 # Save the AUTOCONF setting before AM_INIT_AUTOMAKE overrides it; this
 # way we can run Autoconf tests from configure (or from the test
-# suite) without being bothered by `missing'.  Likewise for autoheader.
+# suite) without being bothered by `missing'.  Likewise for autoheader
+# and autom4te.
 AC_SUBST([am_AUTOCONF], ["${AUTOCONF-autoconf}"])
+AC_SUBST([am_AUTOM4TE], ["${AUTOM4TE-autom4te}"])
 AC_SUBST([am_AUTOHEADER], ["${AUTOHEADER-autoheader}"])
 
 AM_INIT_AUTOMAKE([1.10a dist-bzip2 filename-length-max=99 color-tests 
parallel-tests])
diff --git a/doc/Makefile.in b/doc/Makefile.in
index 95a8fb8..6674885 100644
--- a/doc/Makefile.in
+++ b/doc/Makefile.in
@@ -161,6 +161,7 @@ abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
 am_AUTOCONF = @am_AUTOCONF@
 am_AUTOHEADER = @am_AUTOHEADER@
+am_AUTOM4TE = @am_AUTOM4TE@
 am__leading_dot = @am__leading_dot@
 am__tar = @am__tar@
 am__untar = @am__untar@
diff --git a/lib/Automake/Makefile.in b/lib/Automake/Makefile.in
index e068ab8..a0ecee3 100644
--- a/lib/Automake/Makefile.in
+++ b/lib/Automake/Makefile.in
@@ -181,6 +181,7 @@ abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
 am_AUTOCONF = @am_AUTOCONF@
 am_AUTOHEADER = @am_AUTOHEADER@
+am_AUTOM4TE = @am_AUTOM4TE@
 am__leading_dot = @am__leading_dot@
 am__tar = @am__tar@
 am__untar = @am__untar@
diff --git a/lib/Automake/tests/Makefile.in b/lib/Automake/tests/Makefile.in
index 3d28072..7f33269 100644
--- a/lib/Automake/tests/Makefile.in
+++ b/lib/Automake/tests/Makefile.in
@@ -197,6 +197,7 @@ abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
 am_AUTOCONF = @am_AUTOCONF@
 am_AUTOHEADER = @am_AUTOHEADER@
+am_AUTOM4TE = @am_AUTOM4TE@
 am__leading_dot = @am__leading_dot@
 am__tar = @am__tar@
 am__untar = @am__untar@
diff --git a/lib/Makefile.in b/lib/Makefile.in
index f90b085..edcd32f 100644
--- a/lib/Makefile.in
+++ b/lib/Makefile.in
@@ -183,6 +183,7 @@ abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
 am_AUTOCONF = @am_AUTOCONF@
 am_AUTOHEADER = @am_AUTOHEADER@
+am_AUTOM4TE = @am_AUTOM4TE@
 am__leading_dot = @am__leading_dot@
 am__tar = @am__tar@
 am__untar = @am__untar@
diff --git a/lib/am/Makefile.in b/lib/am/Makefile.in
index 8924d17..1262c3d 100644
--- a/lib/am/Makefile.in
+++ b/lib/am/Makefile.in
@@ -141,6 +141,7 @@ abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
 am_AUTOCONF = @am_AUTOCONF@
 am_AUTOHEADER = @am_AUTOHEADER@
+am_AUTOM4TE = @am_AUTOM4TE@
 am__leading_dot = @am__leading_dot@
 am__tar = @am__tar@
 am__untar = @am__untar@
diff --git a/m4/Makefile.in b/m4/Makefile.in
index 270ee91..e248cfb 100644
--- a/m4/Makefile.in
+++ b/m4/Makefile.in
@@ -141,6 +141,7 @@ abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
 am_AUTOCONF = @am_AUTOCONF@
 am_AUTOHEADER = @am_AUTOHEADER@
+am_AUTOM4TE = @am_AUTOM4TE@
 am__leading_dot = @am__leading_dot@
 am__tar = @am__tar@
 am__untar = @am__untar@
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 35019bb..4a7a0ae 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -21,6 +21,10 @@ all.test                                     \
 auxdir2.test                                   \
 cond17.test                                    \
 gcj6.test                                      \
+remake8d.test                                  \
+remake8e.test                                  \
+remake8g.test                                  \
+remake8h.test                                  \
 txinfo5.test
 
 include $(srcdir)/parallel-tests.am
@@ -602,6 +606,14 @@ remake4.test \
 remake5.test \
 remake6.test \
 remake7.test \
+remake8a.test \
+remake8b.test \
+remake8c.test \
+remake8d.test \
+remake8e.test \
+remake8f.test \
+remake8g.test \
+remake8h.test \
 regex.test \
 req.test \
 reqd.test \
diff --git a/tests/Makefile.in b/tests/Makefile.in
index 91ebcf7..0b65208 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -202,6 +202,7 @@ abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
 am_AUTOCONF = @am_AUTOCONF@
 am_AUTOHEADER = @am_AUTOHEADER@
+am_AUTOM4TE = @am_AUTOM4TE@
 am__leading_dot = @am__leading_dot@
 am__tar = @am__tar@
 am__untar = @am__untar@
@@ -248,6 +249,10 @@ all.test                                   \
 auxdir2.test                                   \
 cond17.test                                    \
 gcj6.test                                      \
+remake8d.test                                  \
+remake8e.test                                  \
+remake8g.test                                  \
+remake8h.test                                  \
 txinfo5.test
 
 parallel_tests = \
@@ -840,6 +845,14 @@ remake4.test \
 remake5.test \
 remake6.test \
 remake7.test \
+remake8a.test \
+remake8b.test \
+remake8c.test \
+remake8d.test \
+remake8e.test \
+remake8f.test \
+remake8g.test \
+remake8h.test \
 regex.test \
 req.test \
 reqd.test \
diff --git a/tests/defs.in b/tests/defs.in
index 1744a07..a413aaa 100644
--- a/tests/defs.in
+++ b/tests/defs.in
@@ -54,6 +54,8 @@ test -f "$srcdir/defs.in" || {
 
 me=`echo "$0" | sed -e 's,.*[\\/],,;s/\.test$//'`
 
+APIVERSION='@APIVERSION@'
+
 # Make sure we override the user shell.
 SHELL='@SHELL@'
 export SHELL
@@ -61,12 +63,13 @@ export SHELL
 test -z "$PERL" && PERL='@PERL@'
 test -z "$MAKE" && MAKE=make
 test -z "$AUTOCONF" && AUTOCONF="@am_AUTOCONF@"
+test -z "$AUTOM4TE" && AUTOM4TE="@am_AUTOM4TE@"
 test -z "$AUTOHEADER" && AUTOHEADER="@am_AUTOHEADER@"
 test -z "$AUTOUPDATE" && AUTOUPDATE=autoupdate
 test -z "$MISSING" && MISSING=`pwd`/../lib/missing
 # Use -Werror because this also turns some Perl warnings into error.
 # (Tests for which this is inappropriate should use -Wno-error.)
-test -z "$ACLOCAL" && ACLOCAL="address@hidden@ -Werror"
+test -z "$ACLOCAL" && ACLOCAL="aclocal-$APIVERSION -Werror"
 # Extra flags to pass to aclocal before all other flags added by this script.
 ACLOCAL_TESTSUITE_FLAGS=
 export ACLOCAL_TESTSUITE_FLAGS
@@ -77,7 +80,7 @@ export ACLOCAL_TESTSUITE_FLAGS
 # -Werror by default.  Tests for which this is inappropriate
 # (e.g. when testing that a warning is enabled by a specific switch)
 # should use -Wnone or/and -Wno-error
-test -z "$AUTOMAKE" && AUTOMAKE="address@hidden@ --foreign -Werror -Wall"
+test -z "$AUTOMAKE" && AUTOMAKE="automake-$APIVERSION --foreign -Werror -Wall"
 
 PATH="address@hidden@$PATH"
 echo "$PATH"
@@ -424,6 +427,66 @@ AUTOMAKE_fails ()
   AUTOMAKE_run 1 ${1+"$@"}
 }
 
+# program_abspath PROGRAM
+# -----------------------
+# Look for the given PROGRAM in PATH.
+# If it's found, set the global shell variable `program_abspath_result' to
+# its absolute path, and return with success.
+# If it isn't found, set the global shell variable `program_abspath_result'
+# to the empty string, write a proper diagnostic on stderr, and return with
+# failure.
+program_abspath()
+{
+  set +x # temporarly disable traces, to avoid flooding the output.
+  am_p_prog=$1
+  # First, deal with programs already given as absolute paths.
+  case $am_p_prog in
+    /*)
+      if test -f "$am_p_prog" && test -x "$am_p_prog"; then
+        program_abspath_result=$am_p_prog
+        am_p_rc=0
+      else
+        program_abspath_result=''
+        am_p_rc=1
+        echo "$me: program_abspath: \`$am_p_prog':" \
+             "not an executable regular file" >&2
+      fi
+      set -x # re-enable shell traces
+      return $am_p_rc
+      ;;
+  esac
+  # Otherwise, we need to search $PATH.
+  am_p_save_IFS=$IFS
+  IFS='@PATH_SEPARATOR@'
+  am_p_path=''
+  for am_p_dir in $PATH; do
+    IFS=$am_p_save_IFS
+    case $am_p_dir in
+      /*) ;;
+      "") am_p_dir=`pwd`;;
+       *) am_p_dir=`pwd`/$am_p_dir;;
+    esac
+    am_p_path=$am_p_dir/$am_p_prog
+    if test -f "$am_p_path" && test -x "$am_p_path"; then
+      break
+    else
+      am_p_path=''
+    fi
+  done
+  IFS=$am_p_save_IFS
+  if test -n "$am_p_path"; then
+    program_abspath_result=$am_p_path
+    am_p_rc=0
+  else
+    program_abspath_result=''
+    am_p_rc=1
+    echo "$me: program_abspath: \`$am_p_prog' not found in \$PATH" >&2
+    echo "$me: program_abspath: \$PATH was: $PATH" >&2
+  fi
+  set -x # re-enable shell traces
+  return $am_p_rc
+}
+
 # Turn on shell traces.
 set -x
 
diff --git a/tests/remake8a.test b/tests/remake8a.test
new file mode 100755
index 0000000..8177b4b
--- /dev/null
+++ b/tests/remake8a.test
@@ -0,0 +1,105 @@
+#! /bin/sh
+# Copyright (C) 2010 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Make sure that rebuild rules behave properly when no configure-time
+# override of autoconf and autom4te is done.
+
+. ./defs || Exit 1
+
+set -e
+
+# We need the absolute paths of autoconf and autom4te used by
+# the testsuite.
+program_abspath "$AUTOCONF"; autoconf_abspath=$program_abspath_result
+program_abspath "$AUTOM4TE"; autom4te_abspath=$program_abspath_result
+
+: > Makefile.am
+
+cat > configure.in <<END
+AC_INIT([$me], [1.0])
+AM_INIT_AUTOMAKE([foreign -Wall -Werror])
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
+END
+
+mkdir bin
+
+for p in autom4te autoconf; do
+  cat > bin/$p <<END
+#! /bin/sh
+echo "Bad $p called: \$0" >&2
+exit 255
+END
+  cat bin/$p # for debugging
+  chmod a+x bin/$p
+done
+
+# Unfortunately, we cannot just export our $AUTOCONF and $AUTOM4TE for
+# use by automake and aclocal.  POSIX states that if a Makefile contains
+# a macro definition, and this macro has the same name of an exported
+# environment variable, then that variable will be redefined by make to
+# have the same value of the macro, and thus this will be the value seen
+# by make subprocesses.  For example:
+#   $ cat Makefile
+#   x=1
+#   target:; @echo $$x; env | grep '^x='
+#   $ x=2 make
+#   1
+#   x=1
+# Yuck!  So we need to create wrappers for automake and aclocal.
+
+for p in automake aclocal; do
+  cat > bin/$p <<END
+#! /bin/sh
+# This is required, otherwise automake and aclocal will try to use
+# our fake & always failing autoconf and autom4te.
+AUTOCONF='$autoconf_abspath'; export AUTOCONF
+AUTOM4TE='$autom4te_abspath'; export AUTOM4TE
+exec '$curdir/$p-$APIVERSION' \${1+"\$@"}
+END
+  cat bin/$p # for debugging
+  cp bin/$p bin/$p-$APIVERSION
+  chmod a+x bin/$p bin/$p-$APIVERSION
+done
+
+# FIXME: this in unportable; we should use @address@hidden
+PATH=`pwd`/bin:$PATH; export PATH
+
+# We don't want configure to pick these vars up from the environment.
+unset AUTOCONF
+unset AUTOM4TE
+
+AUTOCONF="$autoconf_abspath" AUTOM4TE="$autom4te_abspath" \
+  aclocal-$APIVERSION -Wall -Werror
+AUTOCONF="$autoconf_abspath" AUTOM4TE="$autom4te_abspath" \
+  automake-$APIVERSION -Wall -Werror
+AUTOM4TE="$autom4te_abspath" $autoconf_abspath
+
+./configure
+
+$sleep
+rm -f aclocal.m4
+touch configure.in
+touch Makefile.am
+
+# The `missing' script should save our day w.r.t. broken autoconf,
+# and the rebuild rules shouldn't export the broken autoconf and
+# autom4te to the aclocal and automake calls.
+$MAKE >output 2>&1 || { cat output; Exit 1; }
+cat output
+grep 'WARNING:.*missing' output
+
+:
diff --git a/tests/remake8b.test b/tests/remake8b.test
new file mode 100755
index 0000000..bf6f7b2
--- /dev/null
+++ b/tests/remake8b.test
@@ -0,0 +1,104 @@
+#! /bin/sh
+# Copyright (C) 2010 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Check that automake-generated makefiles wraps autotools calls with
+# the `missing' script by default.
+# Keep this in sync with sister test `remake8c.test'.
+
+required=GNUmake
+. ./defs || Exit 1
+
+set -e
+
+# We need the absolute paths of autoconf and autom4te used by
+# the testsuite.
+program_abspath "$AUTOCONF"; autoconf_abspath=$program_abspath_result
+program_abspath "$AUTOM4TE"; autom4te_abspath=$program_abspath_result
+
+: > Makefile.am
+
+cat > configure.in <<END
+AC_INIT([$me], [1.0])
+AM_INIT_AUTOMAKE([foreign -Wall -Werror])
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
+END
+
+AUTOCONF="$autoconf_abspath" AUTOM4TE="$autom4te_abspath" \
+  aclocal-$APIVERSION -Werror -Wall
+AUTOCONF="$autoconf_abspath" AUTOM4TE="$autom4te_abspath" \
+  automake-$APIVERSION -Werror -Wall
+AUTOM4TE="$autom4te_abspath" "$autoconf_abspath" -Werror -Wall
+
+# We don't want AUTOCONF, AUTOMAKE etc. to be picked up by configure,
+# so unset them in case the've been exported in the environment.
+unset ACLOCAL
+unset AUTOMAKE
+unset AUTOCONF
+unset AUTOM4TE
+
+mkdir bin
+
+for p in autoconf autom4te; do
+  cat > bin/$p <<END
+#! /bin/sh
+echo 'Fake $p that always fails!' >&2
+exit 255
+END
+  chmod a+x bin/$p
+done
+
+for p in automake aclocal; do
+  cat > bin/$p <<END
+#! /bin/sh
+# This is required, otherwise automake and aclocal will try to use
+# our fake & always failing autoconf and autom4te.
+AUTOCONF='$autoconf_abspath'; export AUTOCONF
+AUTOM4TE='$autom4te_abspath'; export AUTOM4TE
+exec '$curdir/$p-$APIVERSION' \${1+"\$@"}
+END
+  cat bin/$p # for debugging
+  cp -f bin/$p bin/$p-$APIVERSION
+  chmod a+x bin/$p bin/$p-$APIVERSION
+done
+
+# FIXME: this in unportable; we should use @address@hidden
+PATH=`pwd`/bin:$PATH; export PATH
+
+./configure
+
+$sleep
+touch configure.in
+# Check that the `missing' script kicks in and saves the day.
+$MAKE >output 2>&1 || { cat output; Exit 1; }
+cat output
+grep 'Fake autoconf that always fails!' output
+grep 'WARNING:.*autoconf.*missing' output
+
+rm -f aclocal.m4
+# Check that the `missing' script kicks in and saves the day.
+$MAKE >output 2>&1 || { cat output; Exit 1; }
+cat output
+grep 'Fake autoconf that always fails!' output
+grep 'WARNING:.*autoconf.*missing' output
+
+# Now check that we try to bypass `missing', failures ensue.
+./configure AUTOCONF=autoconf
+$sleep
+touch configure.in
+$MAKE && Exit 1
+
+:
diff --git a/tests/remake8c.test b/tests/remake8c.test
new file mode 100755
index 0000000..423510c
--- /dev/null
+++ b/tests/remake8c.test
@@ -0,0 +1,112 @@
+#! /bin/sh
+# Copyright (C) 2010 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Check that automake-generated makefiles wraps autotools calls with
+# the `missing' script by default.
+# Keep this in sync with sister test `remake8b.test'.
+
+required=GNUmake
+. ./defs || Exit 1
+
+set -e
+
+: > Makefile.am
+
+cat > configure.in <<END
+AC_INIT([$me], [1.0])
+AM_INIT_AUTOMAKE([foreign -Wall -Werror])
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
+END
+
+AUTOCONF="$AUTOCONF" AUTOM4TE="$AUTOM4TE" aclocal-$APIVERSION -Werror -Wall
+AUTOCONF="$AUTOCONF" AUTOM4TE="$AUTOM4TE" automake-$APIVERSION -Werror -Wall
+AUTOM4TE="$AUTOM4TE" $AUTOCONF -Werror -Wall
+
+# We don't want AUTOCONF, AUTOMAKE etc. to be picked up by configure,
+# so unset them in case the've been exported in the environment.
+unset ACLOCAL
+unset AUTOMAKE
+unset AUTOCONF
+unset AUTOM4TE
+
+mkdir bin
+
+for p in automake aclocal autoconf autom4te; do
+  cat > bin/$p <<END
+#! /bin/sh
+echo 'Fake $p that always fails!' >&2
+exit 255
+END
+  cat bin/$p # for debugging
+  chmod a+x bin/$p
+done
+cp -f bin/automake bin/automake-$APIVERSION
+cp -f bin/aclocal bin/aclocal-$APIVERSION
+
+# FIXME: this in unportable; we should use @address@hidden
+PATH=`pwd`/bin:$PATH; export PATH
+
+./configure
+
+$sleep
+touch Makefile.am
+# Check that the `missing' script kicks in and saves the day.
+$MAKE >output 2>&1 || { cat output; Exit 1; }
+cat output
+grep 'Fake automake that always fails!' output
+grep 'WARNING:.*automake.*missing' output
+
+$sleep
+touch configure.in
+# Check that the `missing' script kicks in and saves the day.
+$MAKE >output 2>&1 || { cat output; Exit 1; }
+cat output
+grep 'Fake automake that always fails!' output
+grep 'WARNING:.*automake.*missing' output
+grep 'Fake autoconf that always fails!' output
+grep 'WARNING:.*autoconf.*missing' output
+
+rm -f aclocal.m4
+# Check that the `missing' script kicks in and saves the day.
+$MAKE >output 2>&1 || { cat output; Exit 1; }
+cat output
+grep 'Fake aclocal that always fails!' output
+grep 'WARNING:.*aclocal.*missing' output
+grep 'Fake automake that always fails!' output
+grep 'WARNING:.*automake.*missing' output
+grep 'Fake autoconf that always fails!' output
+grep 'WARNING:.*autoconf.*missing' output
+
+# Now check that we try to bypass `missing', failures ensue.
+# NOTE: the order of the following tests *is significant*.
+#       Please do not change it.
+
+./configure AUTOMAKE=automake
+$sleep
+touch Makefile.am
+$MAKE && Exit 1
+
+./configure AUTOCONF=autoconf
+$sleep
+touch configure.in
+$MAKE && Exit 1
+
+./configure ACLOCAL=aclocal
+rm -f aclocal.m4
+$MAKE && Exit 1
+
+:
diff --git a/tests/remake8d.test b/tests/remake8d.test
new file mode 100755
index 0000000..859b85e
--- /dev/null
+++ b/tests/remake8d.test
@@ -0,0 +1,180 @@
+#! /bin/sh
+# Copyright (C) 2010 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Make sure configure-time override of autoconf and autom4te are
+# consistently honoured by the automake-generated rebuild rules.
+# Keep this in sync with the sister test `remake8e.test'.
+
+required=GNUmake
+. ./defs || Exit 1
+
+set -e
+
+program_abspath "$AUTOCONF"; autoconf_abspath=$program_abspath_result
+program_abspath "$AUTOM4TE"; autom4te_abspath=$program_abspath_result
+
+ocwd=`pwd` || Exit 1
+
+no_bad_autotools_call()
+{
+  if find "$ocwd" -name '*.autofail' | grep .; then
+    Exit 1
+  else
+    :
+  fi
+}
+
+cat > Makefile.am <<'END'
+ACLOCAL_AMFLAGS = -Werror
+SUBDIRS = sub
+END
+
+mkdir sub
+: > sub/Makefile.am
+
+cat > configure.in <<END
+AC_INIT([$me], [1.0])
+AM_INIT_AUTOMAKE([foreign -Wall -Werror])
+AC_CONFIG_FILES([Makefile sub/Makefile])
+AC_OUTPUT
+END
+
+mkdir bin
+
+cat > bin/wrap--Autoconf <<END
+#! /bin/sh
+exec '$autoconf_abspath' \${1+"\$@"}
+END
+cat > bin/wrap--Autom4te <<END
+#! /bin/sh
+exec '$autom4te_abspath' \${1+"\$@"}
+END
+
+for p in automake aclocal; do
+  p2=`echo $p | sed 's/a/A/'`
+  cat > bin/wrap--$p2 <<END
+#! /bin/sh
+echo "\$0: INFO: AUTOCONF='\$AUTOCONF'" >&2
+echo "\$0: INFO: AUTOM4TE='\$AUTOM4TE'" >&2
+test x"\$AUTOCONF" = x"wrap--Autoconf" || {
+  : > autoconf-from-$p.autofail
+  exit 255
+}
+test x"\$AUTOM4TE" = x"wrap--Autom4te" || {
+  : > autom4te-from-$p.autofail
+  exit 255
+}
+exec '$curdir/$p-$APIVERSION' \${1+"\$@"}
+END
+done
+
+for p in aclocal automake aclocal-$APIVERSION automake-$APIVERSION \
+         autom4te autoconf
+do
+  cat > bin/$p <<END
+#! /bin/sh
+echo "BAD: $p (\$0) called" >&2
+: > $p.autofail
+exit 255
+END
+done
+
+ls -l bin # for debugging
+for f in bin/*; do
+  chmod a+x $f
+  cat $f # for debugging
+done
+
+# FIXME: this in unportable; we should use @address@hidden
+PATH=$ocwd/bin:$PATH; export PATH
+
+unset AUTOCONF
+unset AUTOM4TE
+unset AUTOMAKE
+unset ACLOCAL
+
+AUTOCONF=wrap--Autoconf AUTOM4TE=wrap--Autom4te wrap--Aclocal -Werror
+AUTOCONF=wrap--Autoconf AUTOM4TE=wrap--Autom4te wrap--Automake -Werror -Wall
+AUTOM4TE=wrap--Autom4te wrap--Autoconf -Werror -Wall
+
+# Now check that aclocal and automake calls in Makefile always use
+# the configure-time autoconf and autom4te.
+
+for vpath in : false; do
+
+  if $vpath; then
+    srcdir=$ocwd
+    rm -rf build
+    mkdir build
+    cd build
+  else
+     srcdir=.
+  fi
+
+  "$srcdir"/configure AUTOCONF=wrap--Autoconf AUTOM4TE=wrap--Autom4te \
+                      AUTOMAKE=wrap--Automake ACLOCAL=wrap--Aclocal
+
+  # Try to trigger rebuold rules in different situations.
+  rm -f "$srcdir"/configure "$srcdir"/aclocal.m4
+  rm -f "$srcdir"/Makefile.in "$srcdir"/sub/Makefile.in
+  $MAKE
+  no_bad_autotools_call
+  test -f "$srcdir"/configure
+  test -f "$srcdir"/aclocal.m4
+  test -f "$srcdir"/Makefile.in
+  test -f "$srcdir"/sub/Makefile.in
+
+  rm -f "$srcdir"/Makefile.in "$srcdir"/sub/Makefile.in
+  cd sub
+  $MAKE
+  no_bad_autotools_call
+  cd ..
+  test -f "$srcdir"/sub/Makefile.in
+  # Rebuild rules in subdir are "greedy"
+  test -f "$srcdir"/Makefile.in
+
+  $sleep
+  touch "$srcdir"/Makefile.am
+  $MAKE
+  no_bad_autotools_call
+
+  $sleep
+  touch "$srcdir"/sub/Makefile.am
+  cd sub
+  $MAKE
+  cd ..
+  no_bad_autotools_call
+
+  $sleep
+  touch "$srcdir"/sub/Makefile.am
+  $MAKE
+  no_bad_autotools_call
+
+  $sleep
+  touch "$srcdir"/configure.in
+  rm -f aclocal.m4
+  $MAKE
+  no_bad_autotools_call
+
+  $MAKE distclean
+
+  if $vpath; then
+    cd $srcdir
+  fi
+
+done
+
+:
diff --git a/tests/remake8e.test b/tests/remake8e.test
new file mode 100755
index 0000000..ed0ded6
--- /dev/null
+++ b/tests/remake8e.test
@@ -0,0 +1,175 @@
+#! /bin/sh
+# Copyright (C) 2010 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Make sure configure-time override of autoconf and autom4te are
+# consistently honoured by the automake-generated rebuild rules.
+# Keep this in sync with the sister test `remake8d.test'.
+
+required=GNUmake
+. ./defs || Exit 1
+
+set -e
+
+program_abspath "$AUTOCONF"; autoconf_abspath=$program_abspath_result
+program_abspath "$AUTOM4TE"; autom4te_abspath=$program_abspath_result
+
+ocwd=`pwd` || Exit 1
+
+no_bad_autotools_call()
+{
+  if find "$ocwd" -name '*.autofail' | grep .; then
+    Exit 1
+  else
+    :
+  fi
+}
+
+cat > Makefile.am <<'END'
+ACLOCAL_AMFLAGS = -Werror
+SUBDIRS = sub
+END
+
+mkdir sub
+: > sub/Makefile.am
+
+cat > configure.in <<END
+AC_INIT([$me], [1.0])
+AM_INIT_AUTOMAKE([foreign -Wall -Werror])
+AC_CONFIG_FILES([Makefile sub/Makefile])
+AC_OUTPUT
+END
+
+mkdir bin
+
+cat > bin/wrap--Autoconf <<END
+#! /bin/sh
+exec '$autoconf_abspath' \${1+"\$@"}
+END
+cat > bin/wrap--Autom4te <<END
+#! /bin/sh
+exec '$autom4te_abspath' \${1+"\$@"}
+END
+
+for p in autom4te autoconf; do
+  cat > bin/$p <<END
+#! /bin/sh
+echo "BAD: $p (\$0) called" >&2
+: > $p.autofail
+exit 255
+END
+done
+
+for p in automake aclocal; do
+  cat > bin/$p <<END
+#! /bin/sh
+echo "\$0: INFO: AUTOCONF='\$AUTOCONF'" >&2
+echo "\$0: INFO: AUTOM4TE='\$AUTOM4TE'" >&2
+test x"\$AUTOCONF" = x"wrap--Autoconf" || {
+  : > autoconf-from-$p.autofail
+  exit 255
+}
+test x"\$AUTOM4TE" = x"wrap--Autom4te" || {
+  : > autom4te-from-$p.autofail
+  exit 255
+}
+exec '$curdir/$p-$APIVERSION' \${1+"\$@"}
+END
+done
+
+ls -l bin # for debugging
+for f in bin/*; do
+  chmod a+x $f
+  cat $f # for debugging
+done
+
+PATH=$ocwd/bin:$PATH; export PATH
+
+unset AUTOCONF
+unset AUTOM4TE
+unset AUTOMAKE
+unset ACLOCAL
+
+AUTOCONF=wrap--Autoconf AUTOM4TE=wrap--Autom4te aclocal -Werror
+AUTOCONF=wrap--Autoconf AUTOM4TE=wrap--Autom4te automake --foreign -Werror 
-Wall
+AUTOM4TE=wrap--Autom4te wrap--Autoconf -Werror -Wall
+
+# Now check that aclocal and automake calls in Makefile always use
+# the configure-time autoconf and autom4te.
+
+for vpath in : false; do
+
+  if $vpath; then
+    srcdir=$ocwd
+    rm -rf build
+    mkdir build
+    cd build
+  else
+     srcdir=.
+  fi
+
+  "$srcdir"/configure AUTOCONF=wrap--Autoconf AUTOM4TE=wrap--Autom4te
+
+  # Try to trigger rebuold rules in different situations.
+  rm -f "$srcdir"/configure "$srcdir"/aclocal.m4
+  rm -f "$srcdir"/Makefile.in "$srcdir"/sub/Makefile.in
+  $MAKE
+  no_bad_autotools_call
+  test -f "$srcdir"/configure
+  test -f "$srcdir"/aclocal.m4
+  test -f "$srcdir"/Makefile.in
+  test -f "$srcdir"/sub/Makefile.in
+
+  rm -f "$srcdir"/Makefile.in "$srcdir"/sub/Makefile.in
+  cd sub
+  $MAKE
+  no_bad_autotools_call
+  cd ..
+  test -f "$srcdir"/sub/Makefile.in
+  # Rebuild rules in subdir are "greedy"
+  test -f "$srcdir"/Makefile.in
+
+  $sleep
+  touch "$srcdir"/Makefile.am
+  $MAKE
+  no_bad_autotools_call
+
+  $sleep
+  touch "$srcdir"/sub/Makefile.am
+  cd sub
+  $MAKE
+  cd ..
+  no_bad_autotools_call
+
+  $sleep
+  touch "$srcdir"/sub/Makefile.am
+  $MAKE
+  no_bad_autotools_call
+
+  $sleep
+  touch "$srcdir"/configure.in
+  rm -f aclocal.m4
+  $MAKE
+  no_bad_autotools_call
+
+  $MAKE distclean
+
+  if $vpath; then
+    cd $srcdir
+  fi
+
+done
+
+:
diff --git a/tests/remake8f.test b/tests/remake8f.test
new file mode 100755
index 0000000..36b384c
--- /dev/null
+++ b/tests/remake8f.test
@@ -0,0 +1,123 @@
+#! /bin/sh
+# Copyright (C) 2010 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# We expect the `missing' script *never* to wrap autoconf and autom4te
+# calls *done by automake and aclocal* in our rebuild rules.
+
+required=GNUmake
+. ./defs || Exit 1
+
+program_abspath "$AUTOCONF"; autoconf_abspath=$program_abspath_result
+program_abspath "$AUTOM4TE"; autom4te_abspath=$program_abspath_result
+
+set -e
+
+: > Makefile.am
+
+cat >> configure.in <<END
+AC_OUTPUT
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+mkdir bin
+cat > bin/autoconf <<END
+#! /bin/sh
+# Using absolute path avoids "fork bombs" in case \$AUTOCONF is "autoconf".
+exec '$autoconf_abspath' \${1+"\$@"}
+END
+cat > bin/autom4te <<END
+#! /bin/sh
+# Using absolute path avoids "fork bombs" in case \$AUTOM4TE is "autom4te".
+exec '$autom4te_abspath' \${1+"\$@"}
+END
+chmod a+x bin/autoconf bin/autom4te
+
+PATH=`pwd`/bin:$PATH; export PATH
+
+cat > missing <<'END'
+#! /bin/sh
+if test x"$1" = x"--run"; then
+  shift
+  case $1 in
+    autom4te|autoconf)
+      echo "Oops!  The \`missing' script has called $1!" >&2
+      echo "This should have been never happened in this test." >&2
+      : > missing.fail
+      exit 255
+      ;;
+    *)
+      # Just assume we have the tool, and run it.  This should be safe
+      # given our usage of missing here.
+      exec "$@"
+      exit 255 # notreached
+      ;;
+  esac
+else
+  echo "Botched \`missing' call detected!" >&2
+  echo "Arguments were: $*" >&2
+  exit 255
+fi
+exit 255 # notreached
+END
+chmod a+x missing
+
+no_bad_missing_call()
+{
+  if find . -name missing.fail | grep .; then
+    Exit 1
+  else
+    :
+  fi
+}
+
+# The configure script should not take up any of these from the
+# environment.
+unset ACLOCAL
+unset AUTOMAKE
+unset AUTOCONF
+unset AUTOM4TE
+
+./configure
+
+$sleep
+touch Makefile.am
+$MAKE
+no_bad_missing_call
+
+rm -f Makefile.in
+$MAKE
+no_bad_missing_call
+
+$MAKE distclean
+
+# To test more comprehensive rebuild rules, we have to be able to
+# call autoconf.
+./configure AUTOCONF="$autoconf_abspath"
+
+$sleep
+touch configure.in
+$MAKE
+no_bad_missing_call
+
+$sleep
+rm -f aclocal.m4
+$MAKE
+no_bad_missing_call
+
+:
diff --git a/tests/remake8g.test b/tests/remake8g.test
new file mode 100755
index 0000000..132f945
--- /dev/null
+++ b/tests/remake8g.test
@@ -0,0 +1,137 @@
+#! /bin/sh
+# Copyright (C) 2010 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Make sure configure-time override of autoconf and autom4te are
+# consistently honoured by the automake-generated rebuild rules.
+# Also, check that such rebuild rules are not uselessly run.
+
+required=GNUmake
+. ./defs || Exit 1
+
+set -e
+
+program_abspath "$AUTOCONF"; autoconf_abspath=$program_abspath_result
+program_abspath "$AUTOM4TE"; autom4te_abspath=$program_abspath_result
+
+AUTOCONF=false; export AUTOCONF
+AUTOM4TE=false; export AUTOM4TE
+
+cat > Makefile.am <<'END'
+SUBDIRS = sub
+END
+
+mkdir sub
+: > sub/Makefile.am
+
+cat >> configure.in <<'END'
+AC_CONFIG_FILES([sub/Makefile])
+AC_OUTPUT
+END
+
+AUTOCONF="$autoconf_abspath" AUTOM4TE="$autom4te_abspath" $ACLOCAL
+AUTOCONF="$autoconf_abspath" AUTOM4TE="$autom4te_abspath" $AUTOMAKE
+AUTOM4TE="$autom4te_abspath" $autoconf_abspath -Werror -Wall
+
+# Now check that aclocal and automake calls in Makefile always use
+# the configure-time autoconf and autom4te.
+
+mkdir bin
+cat > bin/wrap-autoconf <<END
+#! /bin/sh
+: > ac.run
+exec '$autoconf_abspath' \${1+"\$@"}
+END
+cat > bin/wrap-autom4te <<END
+#! /bin/sh
+: > am4t.run
+exec '$autom4te_abspath' \${1+"\$@"}
+END
+chmod a+x bin/wrap-autoconf bin/wrap-autom4te
+
+PATH=`pwd`/bin:$PATH; export PATH
+
+./configure AUTOCONF=wrap-autoconf AUTOM4TE=wrap-autom4te
+
+# Try to remove every autotools-generated file, and to remake everything.
+
+rm -f configure aclocal.m4 Makefile.in sub/Makefile.in
+$MAKE
+test -f configure
+test -f aclocal.m4
+test -f Makefile.in
+test -f sub/Makefile.in
+# Check that our autotools wrappers have really run.
+test -f ac.run
+test -f am4t.run
+# Cleanup.
+rm -f *.run sub/*.run
+
+# Redo the same checks, but with subset of generated files.
+# Since we are at it, throw in also some tame "stress" tests.
+
+rm -f Makefile.in
+$MAKE
+test -f Makefile.in
+# Check that our autotools wrappers have really run.
+test -f ac.run
+test -f am4t.run
+# Cleanup.
+rm -f *.run sub/*.run
+
+cd sub
+$sleep
+touch Makefile.am
+$MAKE
+# Check that the expected code path in the Makefile has been triggered.
+# The *.run files must be in `..' because the rebuilt rules are always
+# run in the top srcdir.
+test -f ../am4t.run
+test -f ../ac.run
+test ! -r am4t.run
+test ! -r ac.run
+cd ..
+rm -f *.run sub/*.run
+
+# Now check that rebuild rules are not uselessly triggered.
+$sleep
+echo .PHONY: foo-Bar-QUUX >> Makefile
+$MAKE
+test ! -r ac.run
+test ! -r sub/ac.run
+test ! -r am4t.run
+test ! -r sub/am4t.run
+$FGREP foo-Bar-QUUX Makefile
+$sleep
+echo : foo-Bar-QUUX >> configure
+echo .PHONY: foo-Bar-QUUX >> Makefile.in
+$MAKE
+test ! -r ac.run
+test ! -r sub/ac.run
+test ! -r am4t.run
+test ! -r sub/am4t.run
+$FGREP foo-Bar-QUUX configure
+$FGREP foo-Bar-QUUX Makefile.in
+$FGREP foo-Bar-QUUX Makefile
+$sleep
+touch configure.in
+$MAKE
+test -f ac.run
+test -f am4t.run
+$FGREP foo-Bar-QUUX configure && Exit 1
+$FGREP foo-Bar-QUUX Makefile && Exit 1
+$FGREP foo-Bar-QUUX Makefile.in && Exit 1
+
+:
diff --git a/tests/remake8h.test b/tests/remake8h.test
new file mode 100755
index 0000000..3e83637
--- /dev/null
+++ b/tests/remake8h.test
@@ -0,0 +1,59 @@
+#! /bin/sh
+# Copyright (C) 2010 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Automake-generated remake rules: some grepping checks.
+
+. ./defs || Exit 1
+
+set -e
+
+cat > Makefile.am <<'END'
+SUBDIRS = sub
+END
+
+mkdir sub
+: > sub/Makefile.am
+
+cat >> configure.in <<END
+AC_CONFIG_FILES([sub/Makefile])
+AC_OUTPUT
+END
+
+$ACLOCAL
+$AUTOMAKE
+
+grep '^ACLOCAL *='  Makefile.in
+grep '^AUTOMAKE *=' Makefile.in
+grep '^AUTOCONF *=' Makefile.in
+grep '^AUTOM4TE *=' Makefile.in
+
+$AUTOCONF -Werror -Wall
+
+# We don't want AUTOCONF, AUTOMAKE etc. to be picked up by configure,
+# so unset them in case the've been exported in the environment.
+unset ACLOCAL
+unset AUTOMAKE
+unset AUTOCONF
+unset AUTOM4TE
+
+./configure
+
+grep "^ACLOCAL *=.*/missing --run aclocal-$APIVERSION *$" Makefile
+grep "^AUTOMAKE *=.*/missing --run automake-$APIVERSION *$" Makefile
+grep "^AUTOCONF *=.*/missing --run autoconf *$" Makefile
+grep "^AUTOM4TE *=.*/missing --run autom4te *$" Makefile
+
+:
-- 
1.7.1


reply via email to

[Prev in Thread] Current Thread [Next in Thread]