automake-commit
[Top][All Lists]
Advanced

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

[Automake-commit] [SCM] GNU Automake branch, master, updated. v1.11-432-


From: Stefano Lattarini
Subject: [Automake-commit] [SCM] GNU Automake branch, master, updated. v1.11-432-g77105a6
Date: Fri, 12 Nov 2010 00:33:53 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Automake".

http://git.sv.gnu.org/gitweb/?p=automake.git;a=commitdiff;h=77105a60057c789a6c4cdae8c2c44c9960837756

The branch, master has been updated
       via  77105a60057c789a6c4cdae8c2c44c9960837756 (commit)
       via  2d037407717bd2d4d0a000b72b74887a347073d6 (commit)
       via  7304de33a6e7968779e6a6d9ea04309f53bb8471 (commit)
       via  f3a5d05517c8f60cc515c835cc15cd86e2b39abd (commit)
       via  b5e533390ea8c3d2952f5a5c57a514274dee9fd2 (commit)
       via  cb23608ac99ce2b62f53f5100f19d1cf8607423d (commit)
       via  8664afc28e9ed03e0f50be76d36b010925bd0d6f (commit)
       via  9a68760e4d3651f66080717568f2517dbadb52fd (commit)
       via  0e6c1d223906537af7480bf623904121bf88a0b2 (commit)
       via  b06239692cb5808af5834b71a3acf45a1c763888 (commit)
       via  733cd3d8445f65e25ec8bdb507fa6dda2dbcb985 (commit)
       via  498bb93fe6fcd255959990c411a438a2d0cf1fa3 (commit)
       via  d402d06c01d3f065ce7d2c0d05885d1873dac410 (commit)
       via  d72613b0ba14ae421daba80b34547e9a970a50b6 (commit)
       via  cdd3cf335605dd91c65c4e6744efe9c94854e9ce (commit)
       via  b191caac0e3ddb749d552565e4804d93a36b470e (commit)
      from  bedc81d667c6b0d9dc65875b9d1fa453a134e540 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 77105a60057c789a6c4cdae8c2c44c9960837756
Merge: 2d03740 cdd3cf3
Author: Stefano Lattarini <address@hidden>
Date:   Fri Nov 12 01:31:25 2010 +0100

    Merge branch 'tests-man-fixes'

commit 2d037407717bd2d4d0a000b72b74887a347073d6
Merge: 7304de3 d72613b
Author: Stefano Lattarini <address@hidden>
Date:   Fri Nov 12 01:24:41 2010 +0100

    Merge branch 'tests-misc-fixes-2'

commit 7304de33a6e7968779e6a6d9ea04309f53bb8471
Merge: bedc81d f3a5d05
Author: Stefano Lattarini <address@hidden>
Date:   Fri Nov 12 01:08:54 2010 +0100

    Merge branch 'tests-init'

commit d72613b0ba14ae421daba80b34547e9a970a50b6
Author: Stefano Lattarini <address@hidden>
Date:   Mon Jun 28 13:44:33 2010 +0200

    Minor improvements and extensions to various tests.
    
    * tests/defun.test: Also run autoconf and grep the generated
    configure to make sure that aclocal truly picks up all the
    required macros.
    * tests/compile_f_c_cxx.test: Prefer trailing `:' over trailing
    `Exit 0'.  Do not create useless dummy source files.  Do not set
    useless `$(foo_LDADD)' variable in `Makefile.am'.  Do not call
    useless macro `AC_F77_LIBRARY_LDFLAGS' in `configure.in'.
    * tests/compile_f90_c_cxx.test: Likewise.
    * tests/suffix10.test: Slighty stricter grepping of make output.
    * tests/compile.test: Add trailing `:' command.
    * tests/defun2.test: Likewise.
    * tests/vars3.test: Likewise.
    * tests/vartar.test: Likewise.
    * tests/vars.test: Likewise.  Also, extend test by checking
    that the definition of `MY_FLAGS*' variables is preserved in
    the generated `Makefile.in'.
    * tests/stamph2.test: Prefer trailing `:' over trailing `Exit 0'.
    Use proper m4 quoting in `configure.in'.

commit cdd3cf335605dd91c65c4e6744efe9c94854e9ce
Author: Stefano Lattarini <address@hidden>
Date:   Mon Jul 12 17:37:33 2010 +0200

    Improve and extend tests on man pages support.
    
    * tests/man.test: Enable `errexit' shell flag, and related changes.
    Make grepping of generated Makefile.in slighty stricter.
    * tests/man3.test:  Add trailing `:' command.
    * tests/man5.test: Prefer cat + here-doc over echo to append to
    configure.in.
    * tests/man2.test: Likewise, and add trailing `:' command.
    * tests/man4.test: More thorough and consistent checking of make
    error messages.  Place fake `help2man' program in a new `bin'
    directory rather than in `.'.  Move the checks using the real
    `help2man' program to ...
    * tests/man6.test: ... this new test, and extend them.  This test
    passes with GNU make and Solaris make, still fails with BSD make.
    * tests/man7.test: New test, extracted from old man4.test, which
    checks for a bug in maintainer-clean w.r.t. generated manpages.
    * tests/man8.test: New test, extracted from old man4.test, which
    checks for a bug in distcheck w.r.t. generated manpages.  Passes
    with GNU make and Solaris make, still fails with BSD make.

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                           |  105 +++++++++
 configure                           |   45 ++++-
 configure.ac                        |    3 +-
 tests/.gitignore                    |    2 +-
 tests/Makefile.am                   |    6 +-
 tests/Makefile.in                   |   18 +-
 tests/compile.test                  |    2 +
 tests/compile_f90_c_cxx.test        |    8 +-
 tests/compile_f_c_cxx.test          |    7 +-
 tests/{defs.in => defs}             |  442 ++++++++++++++++++-----------------
 tests/defs-static.in                |   98 ++++++++
 tests/defun.test                    |   11 +-
 tests/defun2.test                   |    2 +
 tests/man.test                      |   13 +-
 tests/man2.test                     |    8 +-
 tests/man3.test                     |    4 +-
 tests/man4.test                     |   44 ++--
 tests/man5.test                     |    6 +-
 tests/man6.test                     |   99 ++++++++
 tests/{yaccdry.test => man7.test}   |   54 +++--
 tests/{condhook2.test => man8.test} |   49 +++--
 tests/suffix10.test                 |    5 +-
 tests/vars.test                     |    6 +
 tests/vars3.test                    |    2 +
 tests/vartar.test                   |    4 +-
 25 files changed, 717 insertions(+), 326 deletions(-)
 rename tests/{defs.in => defs} (68%)
 create mode 100644 tests/defs-static.in
 create mode 100755 tests/man6.test
 copy tests/{yaccdry.test => man7.test} (63%)
 copy tests/{condhook2.test => man8.test} (65%)

diff --git a/ChangeLog b/ChangeLog
index f289757..24b20ae 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,108 @@
+2010-11-08  Stefano Lattarini  <address@hidden>
+
+       Improve and extend tests on man pages support.
+       * tests/man.test: Enable `errexit' shell flag, and related changes.
+       Make grepping of generated Makefile.in slighty stricter.
+       * tests/man3.test:  Add trailing `:' command.
+       * tests/man5.test: Prefer cat + here-doc over echo to append to
+       configure.in.
+       * tests/man2.test: Likewise, and add trailing `:' command.
+       * tests/man4.test: More thorough and consistent checking of make
+       error messages.  Place fake `help2man' program in a new `bin'
+       directory rather than in `.'.  Move the checks using the real
+       `help2man' program to ...
+       * tests/man6.test: ... this new test, and extend them.  This test
+       passes with GNU make and Solaris make, still fails with BSD make.
+       * tests/man7.test: New test, extracted from old man4.test, which
+       checks for a bug in maintainer-clean w.r.t. generated manpages.
+       * tests/man8.test: New test, extracted from old man4.test, which
+       checks for a bug in distcheck w.r.t. generated manpages.  Passes
+       with GNU make and Solaris make, still fails with BSD make.
+
+2010-11-08  Stefano Lattarini  <address@hidden>
+
+       Minor improvements and extensions to various tests.
+       * tests/defun.test: Also run autoconf and grep the generated
+       configure to make sure that aclocal truly picks up all the
+       required macros.
+       * tests/compile_f_c_cxx.test: Prefer trailing `:' over trailing
+       `Exit 0'.  Do not create useless dummy source files.  Do not set
+       useless `$(foo_LDADD)' variable in `Makefile.am'.  Do not call
+       useless macro `AC_F77_LIBRARY_LDFLAGS' in `configure.in'.
+       * tests/compile_f90_c_cxx.test: Likewise.
+       * tests/suffix10.test: Slighty stricter grepping of make output.
+       * tests/compile.test: Add trailing `:' command.
+       * tests/defun2.test: Likewise.
+       * tests/vars3.test: Likewise.
+       * tests/vartar.test: Likewise.
+       * tests/vars.test: Likewise.  Also, extend test by checking
+       that the definition of `MY_FLAGS*' variables is preserved in
+       the generated `Makefile.in'.
+       * tests/stamph2.test: Prefer trailing `:' over trailing `Exit 0'.
+       Use proper m4 quoting in `configure.in'.
+
+2010-11-11  Stefano Lattarini  <address@hidden>
+
+       Tests defs: improve messages for skipped tests.
+       * tests/defs: Give meaningful messages about the reasons of a
+       test skip; this is especially useful as this file is run without
+       verbose xtraces on.  Related reorderings in the code and new
+       comments.
+
+2010-11-10  Stefano Lattarini  <address@hidden>
+
+       Tests defs: move static definitions in a new file `defs-static'.
+       The new file is meant to be idempotent w.r.t. mutiple inclusions.
+       * tests/defs.in: Removed, its contents split among ...
+       * tests/defs-static.in: ... this new file ...
+       * tests/defs: ... and this new file, including the former.
+       * configure.ac (AC_CONFIG_FILES): Remove `tests/defs', add
+       `tests/defs-static'.
+       (AC_CONFIG_LINKS): Add `tests/defs'.
+       * tests/Makefile.am ($(parallel_tests)): Update.
+       ($(instspc_tests)): Likewise.
+       * tests/.gitignore: Update.
+
+       Tests defs: $testsbuilddir is now AC_SUBST'ed.
+       * tests/defs.in ($testsbuilddir): Substitute from @address@hidden
+       Add sanity check on $testsbuilddir, similar to those on
+       $testsrcdir and $top_testsrcdir.
+
+       Tests defs: do not print message "Running test $0" anymore.
+       * tests/defs.in: Printing the message "=== Running test $0" at
+       the beginning of each tests made sense when Automake used the old
+       test-driver, which sent all the output directly to stdout/stderr.
+       Now that the parallel test-driver is used, which saves output of
+       each test in its correspoding log file, that old message is just
+       useless noise.
+
+       Tests defs: rename $curdir -> $testbuilddir
+       * tests/defs.in: Rename $curdir to $testbuildir, for clarity and
+       consistency with $testsrcdir and $top_testsrcdir.
+
+       Tests defs: prefer "$curdir" over "`pwd`".
+       * tests/defs.in: We already save the value of `pwd` in $curdir
+       early in the file, so there no need to recalculate it later, when
+       the current working directory is not changed.
+
+       Tests defs: use `$me' in more error messages.
+       * tests/defs.in: Also use `$me' in error messages referring to
+       missing `defs' or `defs.in', since that variable is now defined
+       before those checks.
+
+       Tests defs: do not use `Exit' where plain `exit' suffices.
+       * tests/defs.in: Use "exit 77" rather than "Exit 77" to skip the
+       test when required libtool/gettext macros are not found, since
+       such skips would take place before the exit trap is installed.
+
+       Tests defs: improve and extends comments.
+       * tests/defs.in: Improve and extends some comments, especially in
+       relation with the changes introduced by the previous reordering.
+
+       Tests defs: various reorderings.
+       * tests/defs.in: Reordered various snippets of code in a
+       clearer way.
+
 2010-11-09  Stefano Lattarini  <address@hidden>
 
        Fix bug in test `backcompat4.test' (stale autom4te cache).
diff --git a/configure b/configure
index 169d82d..024b620 100755
--- a/configure
+++ b/configure
@@ -2783,7 +2783,9 @@ $as_echo "$as_me: WARNING: \`cd tests && ${MAKE-make} 
clean-local-check'" >&2;}
 sh_errexit_works=$am_cv_sh_errexit_works
 
 
-ac_config_files="$ac_config_files Makefile doc/Makefile lib/Automake/Makefile 
lib/Automake/tests/Makefile lib/Makefile lib/am/Makefile m4/Makefile 
tests/Makefile tests/defs"
+ac_config_files="$ac_config_files Makefile doc/Makefile lib/Automake/Makefile 
lib/Automake/tests/Makefile lib/Makefile lib/am/Makefile m4/Makefile 
tests/Makefile tests/defs-static"
+
+ac_config_links="$ac_config_links tests/defs:tests/defs"
 
 ac_config_files="$ac_config_files tests/aclocal-${APIVERSION}:tests/aclocal.in"
 
@@ -3375,6 +3377,7 @@ esac
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 # Files that config.status was made for.
 config_files="$ac_config_files"
+config_links="$ac_config_links"
 
 _ACEOF
 
@@ -3399,6 +3402,9 @@ Usage: $0 [OPTION]... [TAG]...
 Configuration files:
 $config_files
 
+Configuration links:
+$config_links
+
 Report bugs to <address@hidden>.
 GNU Automake home page: <http://www.gnu.org/software/automake/>.
 General help using GNU software: <http://www.gnu.org/gethelp/>."
@@ -3533,7 +3539,8 @@ do
     "lib/am/Makefile") CONFIG_FILES="$CONFIG_FILES lib/am/Makefile" ;;
     "m4/Makefile") CONFIG_FILES="$CONFIG_FILES m4/Makefile" ;;
     "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;;
-    "tests/defs") CONFIG_FILES="$CONFIG_FILES tests/defs" ;;
+    "tests/defs-static") CONFIG_FILES="$CONFIG_FILES tests/defs-static" ;;
+    "tests/defs") CONFIG_LINKS="$CONFIG_LINKS tests/defs:tests/defs" ;;
     "tests/aclocal-${APIVERSION}") CONFIG_FILES="$CONFIG_FILES 
tests/aclocal-${APIVERSION}:tests/aclocal.in" ;;
     "tests/automake-${APIVERSION}") CONFIG_FILES="$CONFIG_FILES 
tests/automake-${APIVERSION}:tests/automake.in" ;;
 
@@ -3548,6 +3555,7 @@ done
 # bizarre bug on SunOS 4.1.3.
 if $ac_need_defaults; then
   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+  test "${CONFIG_LINKS+set}" = set || CONFIG_LINKS=$config_links
 fi
 
 # Have a temporary directory for convenience.  Make it in the build tree
@@ -3736,7 +3744,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 fi # test -n "$CONFIG_FILES"
 
 
-eval set X "  :F $CONFIG_FILES      "
+eval set X "  :F $CONFIG_FILES    :L $CONFIG_LINKS  "
 shift
 for ac_tag
 do
@@ -3956,7 +3964,38 @@ which seems to be undefined.  Please make sure it is 
defined" >&2;}
   || as_fn_error $? "could not create $ac_file" "$LINENO" 5
  ;;
 
+  :L)
+  #
+  # CONFIG_LINK
+  #
+
+  if test "$ac_source" = "$ac_file" && test "$srcdir" = '.'; then
+    :
+  else
+    # Prefer the file from the source tree if names are identical.
+    if test "$ac_source" = "$ac_file" || test ! -r "$ac_source"; then
+      ac_source=$srcdir/$ac_source
+    fi
 
+    { $as_echo "$as_me:${as_lineno-$LINENO}: linking $ac_source to $ac_file" 
>&5
+$as_echo "$as_me: linking $ac_source to $ac_file" >&6;}
+
+    if test ! -r "$ac_source"; then
+      as_fn_error $? "$ac_source: file not found" "$LINENO" 5
+    fi
+    rm -f "$ac_file"
+
+    # Try a relative symlink, then a hard link, then a copy.
+    case $ac_source in
+    [\\/$]* | ?:[\\/]* ) ac_rel_source=$ac_source ;;
+       *) ac_rel_source=$ac_top_build_prefix$ac_source ;;
+    esac
+    ln -s "$ac_rel_source" "$ac_file" 2>/dev/null ||
+      ln "$ac_source" "$ac_file" 2>/dev/null ||
+      cp -p "$ac_source" "$ac_file" ||
+      as_fn_error $? "cannot link or copy $ac_source to $ac_file" "$LINENO" 5
+  fi
+ ;;
 
   esac
 
diff --git a/configure.ac b/configure.ac
index 079525d..577541c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -203,8 +203,9 @@ AC_CONFIG_FILES([
   lib/am/Makefile
   m4/Makefile
   tests/Makefile
-  tests/defs
+  tests/defs-static
 ])
+AC_CONFIG_LINKS([tests/defs:tests/defs])
 AC_CONFIG_FILES([tests/aclocal-${APIVERSION}:tests/aclocal.in],
                 [chmod +x tests/aclocal-${APIVERSION}],
                [APIVERSION=$APIVERSION])
diff --git a/tests/.gitignore b/tests/.gitignore
index ff89b40..026e261 100644
--- a/tests/.gitignore
+++ b/tests/.gitignore
@@ -1,6 +1,6 @@
 aclocal-*
 automake-*
-defs
+defs-static
 instspc-tests.am
 parallel-tests.am
 *.dir
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 13214ed..a604da5 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -39,8 +39,7 @@ $(parallel_tests): Makefile.am
          echo '# DO NOT EDIT!  GENERATED AUTOMATICALLY!'; \
          echo; \
          echo '# Ensure proper definition of $$testsrcdir.'; \
-         echo 'am_skip_defs=yes'; \
-         echo '. ./defs || exit 99'; \
+         echo '. ./defs-static || exit 99'; \
          echo 'test -n "$$testsrcdir" || exit 99 # sanity check'; \
          echo; \
          echo "# Run the test with Automake's parallel-tests driver enabled."; 
\
@@ -76,8 +75,7 @@ $(instspc_tests): Makefile.am
            echo '# DO NOT EDIT!  GENERATED AUTOMATICALLY!'; \
            echo; \
            echo '# Ensure proper definition of $$testsrcdir.'; \
-           echo 'am_skip_defs=yes'; \
-           echo '. ./defs || exit 99'; \
+           echo '. ./defs-static || exit 99'; \
            echo 'test -n "$$testsrcdir" || exit 99 # sanity check'; \
            echo; \
            echo "instspc_test_name='$$name'"; \
diff --git a/tests/Makefile.in b/tests/Makefile.in
index 95065f2..142ba54 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -49,8 +49,9 @@ PRE_UNINSTALL = :
 POST_UNINSTALL = :
 build_triplet = @build@
 DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
-       $(srcdir)/aclocal.in $(srcdir)/automake.in $(srcdir)/defs.in \
-       $(srcdir)/instspc-tests.am $(srcdir)/parallel-tests.am
+       $(srcdir)/aclocal.in $(srcdir)/automake.in $(srcdir)/defs \
+       $(srcdir)/defs-static.in $(srcdir)/instspc-tests.am \
+       $(srcdir)/parallel-tests.am
 subdir = tests
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/amversion.m4 \
@@ -64,8 +65,9 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/amversion.m4 \
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
 mkinstalldirs = $(SHELL) $(top_srcdir)/lib/mkinstalldirs
-CONFIG_CLEAN_FILES = defs aclocal-${APIVERSION} automake-${APIVERSION}
-CONFIG_CLEAN_VPATH_FILES =
+CONFIG_CLEAN_FILES = defs-static aclocal-${APIVERSION} \
+       automake-${APIVERSION}
+CONFIG_CLEAN_VPATH_FILES = defs
 AM_V_GEN = $(am__v_GEN_$(V))
 am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
 am__v_GEN_0 = @echo "  GEN     " $@;
@@ -1178,7 +1180,7 @@ $(top_srcdir)/configure:  $(am__configure_deps)
 $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
        cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 $(am__aclocal_m4_deps):
-defs: $(top_builddir)/config.status $(srcdir)/defs.in
+defs-static: $(top_builddir)/config.status $(srcdir)/defs-static.in
        cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
 aclocal-${APIVERSION}: $(top_builddir)/config.status $(srcdir)/aclocal.in
        cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
@@ -1497,8 +1499,7 @@ $(parallel_tests): Makefile.am
          echo '# DO NOT EDIT!  GENERATED AUTOMATICALLY!'; \
          echo; \
          echo '# Ensure proper definition of $$testsrcdir.'; \
-         echo 'am_skip_defs=yes'; \
-         echo '. ./defs || exit 99'; \
+         echo '. ./defs-static || exit 99'; \
          echo 'test -n "$$testsrcdir" || exit 99 # sanity check'; \
          echo; \
          echo "# Run the test with Automake's parallel-tests driver enabled."; 
\
@@ -1528,8 +1529,7 @@ $(instspc_tests): Makefile.am
            echo '# DO NOT EDIT!  GENERATED AUTOMATICALLY!'; \
            echo; \
            echo '# Ensure proper definition of $$testsrcdir.'; \
-           echo 'am_skip_defs=yes'; \
-           echo '. ./defs || exit 99'; \
+           echo '. ./defs-static || exit 99'; \
            echo 'test -n "$$testsrcdir" || exit 99 # sanity check'; \
            echo; \
            echo "instspc_test_name='$$name'"; \
diff --git a/tests/compile.test b/tests/compile.test
index 6162861..2bec657 100755
--- a/tests/compile.test
+++ b/tests/compile.test
@@ -42,3 +42,5 @@ test -f a.c
 ./compile touch a.obj -- -o ac.obj a.c
 test ! -f a.obj
 test ac.obj
+
+:
diff --git a/tests/compile_f90_c_cxx.test b/tests/compile_f90_c_cxx.test
index 21ed65d..bb46390 100755
--- a/tests/compile_f90_c_cxx.test
+++ b/tests/compile_f90_c_cxx.test
@@ -27,19 +27,13 @@ cat >> configure.in << 'END'
 AC_PROG_CC
 AC_PROG_CXX
 AC_PROG_FC
-AC_FC_LIBRARY_LDFLAGS
 END
 
 cat > Makefile.am << 'END'
 bin_PROGRAMS = foo
 foo_SOURCES  = foo.f90 bar.c baz.cc
-foo_LDADD    = @FLIBS@
 END
 
-: > foo.f90
-: > bar.c
-: > baz.cc
-
 $ACLOCAL
 $AUTOMAKE
 
@@ -49,4 +43,4 @@ $FGREP '      $(COMPILE)'    Makefile.in
 $FGREP '       $(CXXCOMPILE)' Makefile.in
 $FGREP '       $(FCCOMPILE)'  Makefile.in
 
-Exit 0
+:
diff --git a/tests/compile_f_c_cxx.test b/tests/compile_f_c_cxx.test
index a995527..2ab5349 100755
--- a/tests/compile_f_c_cxx.test
+++ b/tests/compile_f_c_cxx.test
@@ -33,13 +33,8 @@ END
 cat > Makefile.am << 'END'
 bin_PROGRAMS = foo
 foo_SOURCES  = foo.f bar.c baz.cc
-foo_LDADD    = @FLIBS@
 END
 
-: > foo.f
-: > bar.c
-: > baz.cc
-
 $ACLOCAL
 $AUTOMAKE
 
@@ -49,4 +44,4 @@ $FGREP '      $(COMPILE)'    Makefile.in
 $FGREP '       $(CXXCOMPILE)' Makefile.in
 $FGREP '       $(F77COMPILE)' Makefile.in
 
-Exit 0
+:
diff --git a/tests/defs.in b/tests/defs
similarity index 68%
rename from tests/defs.in
rename to tests/defs
index fe67b0f..82c3b5b 100644
--- a/tests/defs.in
+++ b/tests/defs
@@ -1,5 +1,4 @@
 # -*- shell-script -*-
-# @configure_input@
 #
 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
 # 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
@@ -17,81 +16,129 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Defines for Automake testing environment.
-# Tom Tromey <address@hidden>
-
-# Absolutely necessary variable(s).
-testsrcdir='@abs_srcdir@'
-top_testsrcdir='@abs_top_srcdir@'
-
-# Protect this file against multiple inclusion, useful for generated tests.
-if test x"$am_skip_defs" = xyes; then
-  unset am_skip_defs
-
-else # Do proper testcase setup.
-
-# Be more Bourne compatible.
-# (Snippet copied from configure's initialization in Autoconf 2.64)
-DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
-  emulate sh
-  NULLCMD=:
-  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
-  # is contrary to our usage.  Disable this feature.
-  alias -g '${1+"$@"}'='"$@"'
-  setopt NO_GLOB_SUBST
-else
-  case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
-fi
+## -------------------------------------------------------- ##
+##  Source static setup and definitions for the testsuite.  ##
+## -------------------------------------------------------- ##
 
 # Ensure we are running from the right directory.
-test -f ./defs || {
-   echo "defs: not found in current directory" 1>&2
+test -f ./defs-static || {
+   echo "$0: ./defs-static: not found in current directory" >&2
    exit 1
 }
 
+# Source the shell sanitization and variables' definitions.
+. ./defs-static || exit 99
+
+# The name of the current test (without the `.test' suffix.)
+me=`echo "$0" | sed -e 's,.*[\\/],,;s/\.test$//'`
+
+
+## ---------------------------------------- ##
+##  Sanity checks and environment cleanup.  ##
+## ---------------------------------------- ##
+
 # Ensure $testsrcdir is set correctly.
-test -f "$testsrcdir/defs.in" || {
-   echo "$testsrcdir/defs.in not found, check \$testsrcdir" 1>&2
+test -f "$testsrcdir/defs-static.in" || {
+   echo "$me: $testsrcdir/defs-static.in not found, check \$testsrcdir" >&2
    exit 1
 }
 
-me=`echo "$0" | sed -e 's,.*[\\/],,;s/\.test$//'`
+# Ensure $testbuilddir is set correctly.
+test -f "$testbuilddir/defs-static" || {
+   echo "$me: $testbuilddir/defs-static not found, check \$testbuilddir" >&2
+   exit 1
+}
+
+# Unset some MAKE... variables that may cause $MAKE to act like a
+# recursively invoked sub-make.  Any $MAKE invocation in a test is
+# conceptually an independent invocation, not part of the main
+# 'automake' build.
+unset MFLAGS MAKEFLAGS AM_MAKEFLAGS MAKELEVEL __MKLVL__ MAKE_JOBS_FIFO
+# Unset verbosity flag.
+unset V
+# Also unset variables that will let `make -e install' divert
+# files into unwanted directories.
+unset DESTDIR
+unset prefix exec_prefix bindir datarootdir datadir docdir dvidir
+unset htmldir includedir infodir libdir libexecdir localedir mandir
+unset oldincludedir pdfdir psdir sbindir sharedstatedir sysconfdir
+# The tests call `make -e' but we do not want $srcdir from the environment
+# to override the definition from the Makefile.
+unset srcdir
+# Also unset variables that control our test driver.  While not
+# conceptually independent, they cause some changed semantics we
+# need to control (and test for) in some of the tests to ensure
+# backward-compatible behavior.
+unset DISABLE_HARD_ERRORS
+unset TESTS
+unset TEST_LOG_COMPILER
+unset TEST_LOGS
+unset RECHECK_LOGS
+unset VERBOSE
+
+
+## ---------------------------- ##
+##  Auxiliary shell functions.  ##
+## ---------------------------- ##
+
+# We use a trap below for cleanup.  This requires us to go through
+# hoops to get the right exit status transported through the signal.
+# So use `Exit STATUS' instead of `exit STATUS' inside of the tests.
+# Turn off errexit here so that we don't trip the bug with OSF1/Tru64
+# sh inside this function.
+Exit ()
+{
+  set +e
+  (exit $1)
+  exit $1
+}
+
+# is_newest FILE FILES
+# --------------------
+# Return false if any file in FILES is newer than FILE.
+# Resolve ties in favor of FILE.
+is_newest ()
+{
+  is_newest_files=`find "$@" -newer "$1"`
+  test -z "$is_newest_files"
+}
+
+# AUTOMAKE_run status [options...]
+# --------------------------------
+# Run Automake with OPTIONS, and fail if automake
+# does not exit with STATUS.
+AUTOMAKE_run ()
+{
+  expected_exitcode=$1
+  shift
+  exitcode=0
+  $AUTOMAKE ${1+"$@"} >stdout 2>stderr || exitcode=$?
+  cat stderr >&2
+  cat stdout
+  test $exitcode = $expected_exitcode || Exit 1
+}
+
+# AUTOMAKE_fails [options...]
+# ---------------------------
+# Run Automake with OPTIONS, and fail if automake
+# does not exit with STATUS.
+AUTOMAKE_fails ()
+{
+  AUTOMAKE_run 1 ${1+"$@"}
+}
 
-APIVERSION='@APIVERSION@'
-PATH_SEPARATOR='@PATH_SEPARATOR@'
-
-# Make sure we override the user shell.
-SHELL='@SHELL@'
-export SHELL
-# User can override various tools used.
-test -z "$PERL" && PERL='@PERL@'
-test -z "$MAKE" && MAKE=make
-test -z "$AUTOCONF" && AUTOCONF="@am_AUTOCONF@"
-test -z "$AUTOHEADER" && AUTOHEADER="@am_AUTOHEADER@"
-test -z "$AUTOUPDATE" && AUTOUPDATE=autoupdate
-test -z "$MISSING" && MISSING=$top_testsrcdir/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="aclocal-$APIVERSION -Werror"
-# Extra flags to pass to aclocal before all other flags added by this script.
-ACLOCAL_TESTSUITE_FLAGS=
-export ACLOCAL_TESTSUITE_FLAGS
-
-# See how Automake should be run.  We put --foreign as the default
-# strictness to avoid having to create lots and lots of files.  A test
-# can override this by specifying a different strictness.  Use -Wall
-# -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="automake-$APIVERSION --foreign -Werror -Wall"
-
-PATH="`pwd`$PATH_SEPARATOR$PATH"
+
+## ----------------------------------------------------------- ##
+##  Checks for required tools, and additional setups (if any)  ##
+##  required by them.                                          ##
+## ----------------------------------------------------------- ##
+
+# Print it here, so that the user will see it also if the test
+# will be skipped due to some tool missing in $PATH itslef.
 echo "$PATH"
-# Some shells forget to export modified environment variables.
-# (See note about `export' in the Autoconf manual.)
-export PATH
 
+# Look for (and maybe set up) required tools and/or system features; skip
+# the current test if they are not found.
 for tool in : $required
 do
   # Check that each required tool is present.
@@ -145,6 +192,7 @@ do
       export GCJ
       echo "$me: running $GCJ --version"
       ( $GCJ --version ) || exit 77
+      echo "$me: running $GCJ -v"
       ( $GCJ -v ) || exit 77
       ;;
     g++)
@@ -181,11 +229,16 @@ do
       (echo foo >> $priv_check_temp) >/dev/null 2>&1
       overwrite_status=$?
       rm -f $priv_check_temp
-      test $overwrite_status = 0 && exit 77
+      if test $overwrite_status -eq 0; then
+        echo "$me: cannot drop file write permissions" >&2
+        exit 77
+      fi
       ;;
     perl-threads)
-      # Skip with Devel::Cover: it cannot cope with threads.
-      test "$WANT_NO_THREADS" = yes && exit 77
+      if test "$WANT_NO_THREADS" = "yes"; then
+        echo "$me: skip with Devel::Cover: cannot cope with threads" >&2
+        exit 77
+      fi
       ;;
     python)
       # Python doesn't support --version, it has -V
@@ -201,7 +254,10 @@ do
       (: > $ro_dir_temp/probe) >/dev/null 2>/dev/null
       create_status=$?
       rm -rf $ro_dir_temp
-      test $create_status = 0 && exit 77
+      if test $create_status -eq 0; then
+        echo "$me: cannot drop directory write permissions" >&2
+        exit 77
+      fi
       ;;
     rst2html)
       # Try the variants that are tried in check.am.
@@ -210,6 +266,7 @@ do
           echo "$me: running $r2h --version"
           $r2h --version && break 2
         done
+        echo "$me: no proper rst2html program found" >&2
         exit 77
       done
       ;;
@@ -217,13 +274,16 @@ do
       # DejaGnu's runtest program. We rely on being able to specify
       # the program on the runtest command-line. This requires
       # DejaGnu 1.4.3 or later.
-      echo "$me: running runtest --version"
+      echo "$me: running runtest SOMEPROGRAM=someprogram --version"
       (runtest SOMEPROGRAM=someprogram --version) || exit 77
       ;;
     tex)
       # No all versions of Tex support `--version', so we use
       # a configure check.
-      test -n "@TEX@" || exit 77
+      if test -z "$TEX"; then
+        echo "$me: TeX is required, but it wasn't found by configure" >&2
+        exit 77
+      fi
       ;;
     texi2dvi-o)
       # Texi2dvi supports `-o' since Texinfo 4.1.
@@ -238,98 +298,36 @@ do
   esac
 done
 
-# We use a trap below for cleanup.  This requires us to go through
-# hoops to get the right exit status transported through the signal.
-# So use `Exit STATUS' instead of `exit STATUS' inside of the tests.
-# Turn off errexit here so that we don't trip the bug with OSF1/Tru64
-# sh inside this function.
-Exit ()
-{
-  set +e
-  (exit $1)
-  exit $1
-}
-
-curdir=`pwd`
-testSubDir=$me.dir
-test ! -d $testSubDir || {
-  find $testSubDir -type d ! -perm -200 -exec chmod u+w {} ";"
-  rm -rf $testSubDir
-}
-mkdir $testSubDir
-
address@hidden@
-if test "$sh_errexit_works" = yes; then
-  trap 'exit_status=$?
-    set +e
-    cd "$curdir"
-    case $exit_status,$keep_testdirs in
-    0,)
-      find $testSubDir -type d ! -perm -200 -exec chmod u+w {} ";"
-      rm -rf $testSubDir
-      ;;
+# Using just `$testbuilddir' for the check here is ok, since the
+# further temporary subdirectory where the test will be run is
+# ensured not to contain any whitespace character.
+case $testbuilddir in
+  *\ *|*\      *)
+    case " $required " in
+      *' libtool '* | *' libtoolize '* )
+        echo "$me: libtool/libtoolized cannot cope correctly" >&2
+        echo "$me: with spaces in the build tree" >&2
+        exit 77
+        ;;
     esac
-    test "$signal" != 0 &&
-      echo "$me: caught signal $signal"
-    echo "$me: exit $exit_status"
-    exit $exit_status
-  ' 0
-  for signal in 1 2 13 15; do
-    trap 'signal='$signal'; { Exit 1; }' $signal
-  done
-fi
-signal=0
-
-# Copy in some files we need.
-for file in install-sh missing depcomp; do
-   cp "$top_testsrcdir/lib/$file" "$testSubDir/$file" || Exit 1
-done
-
-cd ./$testSubDir
-
-# Build appropriate environment in test directory.  Eg create
-# configure.in, touch all necessary files, etc.
-# Don't use AC_OUTPUT, but AC_CONFIG_FILES so that appending
-# still produces a valid configure.ac.  But then, tests running
-# config.status really need to append AC_OUTPUT.
-{
-  echo "AC_INIT([$me], [1.0])"
-  if test x"$parallel_tests" = x"yes"; then
-    echo "AM_INIT_AUTOMAKE([parallel-tests])"
-  else
-    echo "AM_INIT_AUTOMAKE"
-  fi
-  echo "AC_CONFIG_FILES([Makefile])"
-} >configure.in
-
-# Unset some MAKE... variables that may cause $MAKE to act like a
-# recursively invoked sub-make.  Any $MAKE invocation in a test is
-# conceptually an independent invocation, not part of the main
-# 'automake' build.
-unset MFLAGS MAKEFLAGS AM_MAKEFLAGS MAKELEVEL __MKLVL__ MAKE_JOBS_FIFO
-# Unset verbosity flag.
-unset V
-# Also unset variables that will let `make -e install' divert
-# files into unwanted directories.
-unset DESTDIR
-unset prefix exec_prefix bindir datarootdir datadir docdir dvidir
-unset htmldir includedir infodir libdir libexecdir localedir mandir
-unset oldincludedir pdfdir psdir sbindir sharedstatedir sysconfdir
-# The tests call `make -e' but we do not want $srcdir from the environment
-# to override the definition from the Makefile.
-unset srcdir
-# Also unset variables that control our test driver.  While not
-# conceptually independent, they cause some changed semantics we
-# need to control (and test for) in some of the tests to ensure
-# backward-compatible behavior.
-unset DISABLE_HARD_ERRORS
-unset TESTS
-unset TEST_LOG_COMPILER
-unset TEST_LOGS
-unset RECHECK_LOGS
-unset VERBOSE
+    ;;
+esac
 
-echo "=== Running test $0"
+# This test is necessary, although Automake's configure script bails out
+# when $srcdir contains spaces.  This is because $testsrcdir is in not
+# configure-time $srcdir, but is instead configure-time $abs_srcdir, and
+# that is allowed to contain spaces.
+case $testsrcdir in
+  *\ * |*\     *)
+    case " $required " in
+      *' libtool '* | *' libtoolize '* | *' gettext '* )
+        echo "$me: our testsuite setup cannot cope correctly with spaces" >&2
+        echo "$me: in the source tree for libtool/gettext tests" >&2
+        exit 77
+        ;;
+   esac
+   ;;
+esac
 
 # We might need extra macros, e.g., from Libtool or Gettext.
 # Find them on the system.
@@ -340,7 +338,7 @@ echo "=== Running test $0"
 # some third-party .m4 file is underquoted.
 case " $required " in
   *' libtool '* | *' libtoolize '* | *' gettext '* )
-    aclocaldir='@prefix@/share/aclocal'
+    aclocaldir=$testprefix/share/aclocal
     extra_includes=""
     if test -f $aclocaldir/dirlist; then
        extra_includes=`
@@ -361,73 +359,91 @@ case " $required " in
       fi
     done
     case " $required " in
-      *' libtool '* | *' libtoolize '* ) test $libtool_found = yes || Exit 77;;
-      *' gettext '* ) test $gettext_found = yes || Exit 77;;
-    esac
-    # Libtool cannot cope with spaces in the build tree.  Our testsuite setup
-    # cannot cope with spaces in the source tree name for Libtool and gettext
-    # tests.
-    case $testsrcdir,`pwd` in
-      *\ * | *\        *) Exit 77;;
+      *' libtool '*|*' libtoolize '*)
+        if test $libtool_found != yes; then
+          echo "$me: libtool/libtoolize is required, but libtool.m4 wasn't" >&2
+          echo "$me: found in directories $aclocaldir $extra_includes" >&2
+          exit 77
+        fi
+        ;;
+      *' gettext '*)
+        if test $gettext_found != yes; then
+          echo "$me: gettext is required, but gettext.m4 wasn't found" >&2
+          echo "$me: in directories $aclocaldir $extra_includes" >&2
+          exit 77
+        fi
+        ;;
     esac
     ACLOCAL="$ACLOCAL -Wno-syntax -I $top_testsrcdir/m4 $extra_includes -I 
$aclocaldir"
     ;;
 esac
 
-# POSIX no longer requires 'egrep' and 'fgrep',
-# but some hosts lack 'grep -E' and 'grep -F'.
-EGREP='@EGREP@'
-FGREP='@FGREP@'
 
-# The amount we should wait after modifying files depends on the platform.
-# For instance, Windows '95, '98 and ME have 2-second granularity
-# and can be up to 3 seconds in the future w.r.t. the system clock.
-sleep='sleep @MODIFICATION_DELAY@'
+## ---------------------------------------------------------------- ##
+##  Create and set up of the temporary directory used by the test.  ##
+##  Set up of the exit trap for cleanup of said directory.          ##
+## ---------------------------------------------------------------- ##
 
-# An old timestamp that can be given to a file, in "touch -t" format.
-# The time stamp should be portable to all file systems of interest.
-# Just for fun, choose the exact time of the announcement of the GNU project
-# in UTC; see <http://www.gnu.org/gnu/initial-announcement.html>.
-old_timestamp=198309271735.59
+# The subdirectory where the current test script will run and write its
+# temporary/data files.  This will be created shortly, and will be removed
+# by the cleanup trap below if the test passes.  If the test doesn't pass,
+# this directory will be kept, to facilitate debugging.
+testSubDir=$me.dir
 
-# is_newest FILE FILES
-# --------------------
-# Return false if any file in FILES is newer than FILE.
-# Resolve ties in favor of FILE.
-is_newest ()
-{
-  is_newest_files=`find "$@" -newer "$1"`
-  test -z "$is_newest_files"
+test ! -d $testSubDir || {
+  find $testSubDir -type d ! -perm -200 -exec chmod u+w {} ";"
+  rm -rf $testSubDir
 }
+mkdir $testSubDir
 
+cd ./$testSubDir
 
-# AUTOMAKE_run status [options...]
-# --------------------------------
-# Run Automake with OPTIONS, and fail if automake
-# does not exit with STATUS.
-AUTOMAKE_run ()
-{
-  expected_exitcode=$1
-  shift
-  exitcode=0
-  $AUTOMAKE ${1+"$@"} >stdout 2>stderr || exitcode=$?
-  cat stderr >&2
-  cat stdout
-  test $exitcode = $expected_exitcode || Exit 1
-}
+if test "$sh_errexit_works" = yes; then
+  trap 'exit_status=$?
+    set +e
+    cd "$testbuilddir"
+    case $exit_status,$keep_testdirs in
+    0,)
+      find $testSubDir -type d ! -perm -200 -exec chmod u+w {} ";"
+      rm -rf $testSubDir
+      ;;
+    esac
+    test "$signal" != 0 && echo "$me: caught signal $signal"
+    echo "$me: exit $exit_status"
+    exit $exit_status
+  ' 0
+  for signal in 1 2 13 15; do
+    trap 'signal='$signal'; { Exit 1; }' $signal
+  done
+  signal=0
+fi
 
-# AUTOMAKE_fails [options...]
-# ---------------------------
-# Run Automake with OPTIONS, and fail if automake
-# does not exit with STATUS.
-AUTOMAKE_fails ()
+# Copy in some files we need.
+for file in install-sh missing depcomp; do
+   cp "$top_testsrcdir/lib/$file" . || Exit 1
+done
+
+# Build appropriate environment in test directory.  Eg create
+# configure.in, touch all necessary files, etc.
+# Don't use AC_OUTPUT, but AC_CONFIG_FILES so that appending
+# still produces a valid configure.ac.  But then, tests running
+# config.status really need to append AC_OUTPUT.
 {
-  AUTOMAKE_run 1 ${1+"$@"}
-}
+  echo "AC_INIT([$me], [1.0])"
+  if test x"$parallel_tests" = x"yes"; then
+    echo "AM_INIT_AUTOMAKE([parallel-tests])"
+  else
+    echo "AM_INIT_AUTOMAKE"
+  fi
+  echo "AC_CONFIG_FILES([Makefile])"
+} >configure.in
+
+
+## ---------------- ##
+##  Ready to go...  ##
+## ---------------- ##
 
 # Turn on shell traces.
 set -x
 
 pwd
-
-fi # Proper testcase setup.
diff --git a/tests/defs-static.in b/tests/defs-static.in
new file mode 100644
index 0000000..2ca4b57
--- /dev/null
+++ b/tests/defs-static.in
@@ -0,0 +1,98 @@
+# -*- shell-script -*-
+# @configure_input@
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006, 2007, 2008, 2009, 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/>.
+
+# Defines and minimal setup for Automake testing environment.
+# IMPORTANT: Multiple inclusions of this file should be idempotent!
+
+# Be more Bourne compatible.
+# (Snippet copied from configure's initialization in Autoconf 2.64)
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
+fi
+
+testsrcdir='@abs_srcdir@'
+top_testsrcdir='@abs_top_srcdir@'
+testbuilddir='@abs_builddir@'
+testprefix='@prefix@'
+
+APIVERSION='@APIVERSION@'
+PATH_SEPARATOR='@PATH_SEPARATOR@'
+
+# Make sure we override the user shell.
+SHELL='@SHELL@'; export SHELL
+# User can override various tools used.
+test -z "$PERL" && PERL='@PERL@'
+test -z "$MAKE" && MAKE=make
+test -z "$AUTOCONF" && AUTOCONF="@am_AUTOCONF@"
+test -z "$AUTOHEADER" && AUTOHEADER="@am_AUTOHEADER@"
+test -z "$AUTOUPDATE" && AUTOUPDATE=autoupdate
+test -z "$MISSING" && MISSING=$top_testsrcdir/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="aclocal-$APIVERSION -Werror"
+# Extra flags to pass to aclocal before all other flags added by this script.
+ACLOCAL_TESTSUITE_FLAGS=''; export ACLOCAL_TESTSUITE_FLAGS
+
+# See how Automake should be run.  We put --foreign as the default
+# strictness to avoid having to create lots and lots of files.  A test
+# can override this by specifying a different strictness.  Use -Wall
+# -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="automake-$APIVERSION --foreign -Werror -Wall"
+
+# POSIX no longer requires 'egrep' and 'fgrep',
+# but some hosts lack 'grep -E' and 'grep -F'.
+EGREP='@EGREP@'
+FGREP='@FGREP@'
+
+# No all versions of Tex support `--version', so we use a configure
+# check to decide if tex is available.  This decision is embodied in
+# this variable.
+TEX='@TEX@'
+
+# Whether /bin/sh has working 'set -e' with exit trap.
+sh_errexit_works='@sh_errexit_works@'
+
+# The amount we should wait after modifying files depends on the platform.
+# For instance, Windows '95, '98 and ME have 2-second granularity
+# and can be up to 3 seconds in the future w.r.t. the system clock.
+sleep='sleep @MODIFICATION_DELAY@'
+
+# An old timestamp that can be given to a file, in "touch -t" format.
+# The time stamp should be portable to all file systems of interest.
+# Just for fun, choose the exact time of the announcement of the GNU project
+# in UTC; see <http://www.gnu.org/gnu/initial-announcement.html>.
+old_timestamp=198309271735.59
+
+# Make our wrapper scripts accessible by default.  And avoid to uselessly
+# extend $PATH multiple times if this file is sourced multiple times.
+case $PATH in
+  "$testbuilddir$PATH_SEPARATOR"*) ;;
+  *) PATH="$testbuilddir$PATH_SEPARATOR$PATH";;
+esac
+export PATH
diff --git a/tests/defun.test b/tests/defun.test
index 5ffb9a1..6041918 100755
--- a/tests/defun.test
+++ b/tests/defun.test
@@ -21,8 +21,17 @@
 set -e
 
 cat > acinclude.m4 << 'END'
-AC_DEFUN([AM_FUNC_TWO])
+AC_DEFUN([AM_FUNC_THREE])
+AC_DEFUN([AM_FUNC_TWO], address@hidden@AM_FUNC_THREE])
 AC_DEFUN([AM_FUNC_ONE], [AC_REQUIRE([AM_FUNC_TWO])])
 END
 
+cat >>configure.in << 'END'
+AM_FUNC_ONE
+END
+
 $ACLOCAL
+$AUTOCONF
+grep 'address@hidden@$' configure
+
+:
diff --git a/tests/defun2.test b/tests/defun2.test
index 6c10a8f..1e2677d 100755
--- a/tests/defun2.test
+++ b/tests/defun2.test
@@ -38,3 +38,5 @@ END
 
 $ACLOCAL
 $AUTOMAKE
+
+:
diff --git a/tests/man.test b/tests/man.test
index 93b3bb2..1b287a8 100755
--- a/tests/man.test
+++ b/tests/man.test
@@ -1,5 +1,6 @@
 #! /bin/sh
-# Copyright (C) 1996, 1997, 1998, 2001, 2002  Free Software Foundation, Inc.
+# Copyright (C) 1996, 1997, 1998, 2001, 2002, 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
@@ -18,6 +19,8 @@
 
 . ./defs || Exit 1
 
+set -e
+
 cat > Makefile.am << 'END'
 dist_man_MANS = foo.1
 nodist_man1_MANS = bar.man
@@ -26,6 +29,8 @@ END
 : > foo.1
 : > bar.man
 
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
-grep '^MANS ' Makefile.in
+$ACLOCAL
+$AUTOMAKE
+grep '^MANS *=' Makefile.in
+
+:
diff --git a/tests/man2.test b/tests/man2.test
index 0027645..cafef02 100755
--- a/tests/man2.test
+++ b/tests/man2.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2002, 2003, 2004  Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003, 2004, 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
@@ -21,7 +21,9 @@
 
 set -e
 
-echo AC_OUTPUT >> configure.in
+cat >> configure.in <<'END'
+AC_OUTPUT
+END
 
 cat > Makefile.am << 'END'
 man_MANS = foo.2
@@ -49,3 +51,5 @@ DESTDIR="`pwd`/_inst" $MAKE -e uninstall
 test ! -f ./_inst/man/man2/foo.2
 test ! -f ./_inst/man/man4/foo.4
 test ! -f ./_inst/man/man4/bar.4
+
+:
diff --git a/tests/man3.test b/tests/man3.test
index b5afe0e..8b9e3ee 100755
--- a/tests/man3.test
+++ b/tests/man3.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2008  Free Software Foundation, Inc.
+# Copyright (C) 2008, 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
@@ -42,3 +42,5 @@ $AUTOMAKE
 $AUTOCONF
 ./configure
 DISTCHECK_CONFIGURE_FLAGS=foo=bar $MAKE -e distcheck
+
+:
diff --git a/tests/man4.test b/tests/man4.test
index de75f83..3eff468 100755
--- a/tests/man4.test
+++ b/tests/man4.test
@@ -42,9 +42,6 @@ $(srcdir)/foo.1:
        $(HELP2MAN) --output=$@ $(srcdir)/foo
 bar.1:
        $(HELP2MAN) --output=$(srcdir)/bar.1 $(srcdir)/bar
-
-## It is a bug that we need to list $(srcdir)/bar.1 explicitly here.
-MAINTAINERCLEANFILES = $(dist_man_MANS) $(srcdir)/bar.1
 END
 
 cat >>configure.in <<'END'
@@ -62,26 +59,38 @@ while test $# -gt 0; do
   shift
 done
 END
-
 cp foo bar
+chmod +x foo bar
 
-cat > help2man <<'END'
+mkdir bin
+cat > bin/help2man <<'END'
 #! /bin/sh
 # fake help2man script that lets `missing' think it is not installed
 exit 127
 END
+chmod +x bin/help2man
+PATH=`pwd`/bin$PATH_SEPARATOR$PATH
 
-chmod +x foo bar help2man
-save_PATH=$PATH
-PATH=`pwd`$PATH_SEPARATOR$PATH
+grep_error_messages()
+{
+  grep ' man pages contain.*missing help2man.* replacement text' stderr \
+   && grep 'install help2man' stderr \
+   && grep 'regenerate the man pages' stderr \
+   || Exit 1
+}
 
 $ACLOCAL
 $AUTOMAKE
 $AUTOCONF
+
 ./configure
 $MAKE
-$MAKE dist && Exit 1
-$MAKE distcheck && Exit 1
+$MAKE dist 2>stderr && { cat stderr >&2; Exit 1; }
+cat stderr >&2
+grep_error_messages
+$MAKE distcheck 2>stderr && { cat stderr >&2; Exit 1; }
+cat stderr >&2
+grep_error_messages
 $MAKE distclean
 
 mkdir build
@@ -90,20 +99,9 @@ cd build
 $MAKE
 $MAKE dist 2>stderr && { cat stderr >&2; Exit 1; }
 cat stderr >&2
-grep 'install help2man' stderr
+grep_error_messages
 $MAKE distcheck 2>stderr && { cat stderr >&2; Exit 1; }
 cat stderr >&2
-grep 'install help2man' stderr
-
-rm -f ../help2man
-PATH=$save_PATH
-export PATH
+grep_error_messages
 
-# If help2man is installed, then ensure that the recommendation works.
-if (help2man --version) >/dev/null 2>&1; then
-  $MAKE maintainer-clean
-  ../configure
-  $MAKE
-  $MAKE distcheck
-fi
 :
diff --git a/tests/man5.test b/tests/man5.test
index 437dc33..f21a099 100755
--- a/tests/man5.test
+++ b/tests/man5.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2009  Free Software Foundation, Inc.
+# Copyright (C) 2009, 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
@@ -20,7 +20,9 @@
 
 set -e
 
-echo AC_OUTPUT >> configure.in
+cat >> configure.in <<'END'
+AC_OUTPUT
+END
 
 cat > Makefile.am << 'END'
 man_MANS = foo-1.4.5/foo.2 foo-1.4.5/bar.3 baz-1.4.2
diff --git a/tests/man6.test b/tests/man6.test
new file mode 100755
index 0000000..94f59ad
--- /dev/null
+++ b/tests/man6.test
@@ -0,0 +1,99 @@
+#! /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/>.
+
+# Ensure `make distcheck' passes when help2man generates man pages,
+# even if the `missing' script is involved.
+
+required=help2man
+. ./defs || Exit 1
+
+set -e
+
+cat > Makefile.am << 'END'
+dist_man_MANS = $(srcdir)/foobar.1 bazquux.1 zardoz.1
+dist_bin_SCRIPTS = foobar bazquux zardoz
+$(srcdir)/foobar.1:
+       $(HELP2MAN) --output=$@ $(srcdir)/foobar
+bazquux.1:
+       $(HELP2MAN) --output=$@ $(srcdir)/bazquux
+zardoz.1:
+       $(HELP2MAN) --output=$(srcdir)/zardoz.1 $(srcdir)/zardoz
+END
+
+cat >> configure.in <<'END'
+AM_MISSING_PROG([HELP2MAN], [help2man])
+AC_OUTPUT
+END
+
+cat > foobar <<'END'
+#! /bin/sh
+while test $# -gt 0; do
+  case $1 in
+    -h | --help) echo "usage: $0 [OPTIONS]..."; exit 0;;
+    -v | --version) echo "$0 1.0"; exit 0;;
+  esac
+  shift
+done
+END
+
+cp foobar bazquux
+cp foobar zardoz
+
+chmod +x foobar bazquux zardoz
+
+$ACLOCAL
+$AUTOMAKE
+$AUTOCONF
+
+mkdir build
+cd build
+
+../configure
+# sanity check
+grep '^HELP2MAN *=.*/missing --run help2man' Makefile
+
+$MAKE
+$FGREP foobar ../foobar.1
+$FGREP bazquux ./bazquux.1
+$FGREP zardoz ../zardoz.1
+
+$MAKE distdir
+$FGREP foobar  $me-1.0/foobar.1
+$FGREP bazquux $me-1.0/bazquux.1
+$FGREP zardoz  $me-1.0/zardoz.1
+
+$MAKE distcheck
+
+cd ..
+rm -f *.1 # remove leftover generated manpages
+
+./configure
+# sanity check
+grep '^HELP2MAN *=.*/missing --run help2man' Makefile
+
+$MAKE
+$FGREP foobar  foobar.1
+$FGREP bazquux bazquux.1
+$FGREP zardoz  zardoz.1
+
+$MAKE distdir
+$FGREP foobar  $me-1.0/foobar.1
+$FGREP bazquux $me-1.0/bazquux.1
+$FGREP zardoz  $me-1.0/zardoz.1
+
+$MAKE distcheck
+
+:
diff --git a/tests/yaccdry.test b/tests/man7.test
similarity index 63%
copy from tests/yaccdry.test
copy to tests/man7.test
index d11d3fe..748b8f8 100755
--- a/tests/yaccdry.test
+++ b/tests/man7.test
@@ -14,46 +14,48 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Removal recovery rules for headers should not remove files with `make -n'.
+# Check for a bug in maintainer-clean w.r.t. generated manpages.
 
 . ./defs || Exit 1
 
 set -e
 
-cat >> configure.in << 'END'
-AC_PROG_CC
-AC_PROG_YACC
-AC_OUTPUT
-END
-
 cat > Makefile.am << 'END'
-AM_YFLAGS = -d
-bin_PROGRAMS = foo
-foo_SOURCES = foo.c parse.y
+dist_man_MANS = $(srcdir)/foo.1 bar.1
+$(srcdir)/foo.1 bar.1:
+       : > $@
+MAINTAINERCLEANFILES = $(dist_man_MANS)
 END
 
-cat > foo.c << 'END'
-int main () { return 0; }
-END
-
-cat > parse.y << 'END'
-%{
-int yylex () {return 0;}
-void yyerror (char *s) {}
-%}
-%%
-foobar : 'f' 'o' 'o' 'b' 'a' 'r' {};
+cat >> configure.in <<'END'
+AC_OUTPUT
 END
 
 $ACLOCAL
-$AUTOMAKE --add-missing
+$AUTOMAKE
 $AUTOCONF
+
+mkdir build
+cd build
+../configure
+
+$MAKE
+test -f bar.1
+test -f ../foo.1
+
+$MAKE maintainer-clean
+test ! -f bar.1
+test ! -f ../foo.1
+
+cd ..
 ./configure
+
 $MAKE
+test -f bar.1
+test -f foo.1
 
-rm -f parse.h
-$MAKE -n parse.h
-test -f parse.c
-test ! -f parse.h
+$MAKE maintainer-clean
+test ! -f bar.1
+test ! -f foo.1
 
 :
diff --git a/tests/condhook2.test b/tests/man8.test
similarity index 65%
copy from tests/condhook2.test
copy to tests/man8.test
index 45e2d43..2ef52b4 100755
--- a/tests/condhook2.test
+++ b/tests/man8.test
@@ -1,4 +1,4 @@
-#!/bin/sh
+#! /bin/sh
 # Copyright (C) 2010 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
@@ -14,36 +14,45 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Test install when a conditional install-*-hook is defined.
-# Keep this in sync with sister test condhook.test.
+# Check for a bug in distcheck w.r.t. generated manpages.
 
 . ./defs || Exit 1
 
 set -e
 
-cat >> configure.in << 'END'
-AM_CONDITIONAL([TEST], [true])
-AC_OUTPUT
-END
-
 cat > Makefile.am << 'END'
-sysconf_DATA = mumble
-if TEST
-install-data-hook:
-       : > $(top_srcdir)/good
-endif
+dist_man_MANS = foo.1
+foo.1:
+       rm -f $(srcdir)/$@  # fails if $(srcdir) is unwritable
+       : > $(srcdir)/$@
 END
 
-: > mumble
+cat >> configure.in <<'END'
+AC_OUTPUT
+END
 
 $ACLOCAL
-$AUTOCONF
 $AUTOMAKE
+$AUTOCONF
 
-./configure --prefix "`pwd`/inst"
-
-$MAKE install
-test -f inst/etc/mumble
-test -f good
+mkdir build
+cd build
+../configure
+
+$MAKE
+test -f ../foo.1
+$MAKE distdir
+test -f $me-1.0/foo.1
+$MAKE distcheck
+
+cd ..
+rm -f foo.1
+./configure
+
+$MAKE
+test -f foo.1
+$MAKE distdir
+test -f $me-1.0/foo.1
+$MAKE distcheck
 
 :
diff --git a/tests/suffix10.test b/tests/suffix10.test
index 131359c..d85ad8f 100755
--- a/tests/suffix10.test
+++ b/tests/suffix10.test
@@ -37,8 +37,9 @@ libfoo_la_SOURCES = foo.x_
 .x_.y:
        cp $< $@
 
+.PHONY: print
 print:
-       echo BEGIN: $(libfoo_la_OBJECTS) :END
+       @echo BEGIN: $(libfoo_la_OBJECTS) :END
 END
 
 libtoolize --force
@@ -50,6 +51,6 @@ $AUTOMAKE --add-missing
 
 $MAKE print >stdout || { cat stdout; Exit 1; }
 cat stdout
-grep 'BEGIN: foo.lo :END' stdout
+$FGREP 'BEGIN: foo.lo :END' stdout
 
 :
diff --git a/tests/vars.test b/tests/vars.test
index 6163a8d..c88db68 100755
--- a/tests/vars.test
+++ b/tests/vars.test
@@ -30,3 +30,9 @@ END
 
 $ACLOCAL
 $AUTOMAKE
+
+for i in 1 2 3 4; do
+  grep "^MY_FLAGS_$i *= *-DABC=345 *$" Makefile.in
+done
+
+:
diff --git a/tests/vars3.test b/tests/vars3.test
index f7467f5..842d567 100755
--- a/tests/vars3.test
+++ b/tests/vars3.test
@@ -82,3 +82,5 @@ $AUTOMAKE -Wno-portability
 # processed far later).
 echo 'AUTOMAKE_OPTIONS = -Wno-portability' >> Makefile.am
 $AUTOMAKE
+
+:
diff --git a/tests/vartar.test b/tests/vartar.test
index 3a18d77..a33ab64 100755
--- a/tests/vartar.test
+++ b/tests/vartar.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2001, 2002, 2003  Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2003, 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
@@ -37,3 +37,5 @@ install:
 EOF
 sed -n '/^install:/,/^ /p' Makefile.in > target.value
 diff target.expected target.value
+
+:


hooks/post-receive
-- 
GNU Automake



reply via email to

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