Merge branch 'tests-man-fixes'
authorStefano Lattarini <stefano.lattarini@gmail.com>
Tue, 21 Dec 2010 01:22:22 +0000 (02:22 +0100)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Tue, 21 Dec 2010 01:22:22 +0000 (02:22 +0100)
386 files changed:
.gitignore
ChangeLog
ChangeLog.09
HACKING
Makefile.am
Makefile.in
NEWS
THANKS
aclocal.in
aclocal.m4
automake.in [changed mode: 0755->0644]
bootstrap
configure
configure.ac
doc/Makefile.am
doc/Makefile.in
doc/automake.texi
lib/Automake/ChannelDefs.pm
lib/Automake/Channels.pm
lib/Automake/Condition.pm
lib/Automake/Config.in
lib/Automake/Configure_ac.pm
lib/Automake/Location.pm
lib/Automake/Makefile.am
lib/Automake/Makefile.in
lib/Automake/Options.pm
lib/Automake/Rule.pm
lib/Automake/RuleDef.pm
lib/Automake/VarDef.pm
lib/Automake/Variable.pm
lib/Automake/Wrap.pm
lib/Automake/XFile.pm
lib/Automake/tests/Cond2.pl [new file with mode: 0644]
lib/Automake/tests/Cond3.pl [new file with mode: 0644]
lib/Automake/tests/Condition-t.pl
lib/Automake/tests/Condition.pl
lib/Automake/tests/DisjCon2.pl [new file with mode: 0644]
lib/Automake/tests/DisjCon3.pl [new file with mode: 0644]
lib/Automake/tests/DisjConditions-t.pl
lib/Automake/tests/DisjConditions.pl
lib/Automake/tests/Makefile.am
lib/Automake/tests/Makefile.in
lib/Automake/tests/Version.pl
lib/Automake/tests/Version2.pl [new file with mode: 0644]
lib/Automake/tests/Version3.pl [new file with mode: 0644]
lib/Automake/tests/Wrap.pl
lib/Makefile.am
lib/Makefile.in
lib/am/Makefile.in
lib/am/dejagnu.am
lib/am/distdir.am
lib/am/install.am
lib/am/library.am
lib/am/ltlib.am
lib/am/ltlibrary.am
lib/am/program.am
lib/am/progs.am
lib/am/tags.am
lib/am/texibuild.am
lib/am/texinfos.am
lib/ar-lib [new file with mode: 0755]
lib/compile
lib/config-ml.in
lib/depcomp
lib/gnupload
m4/Makefile.in
m4/amversion.m4
m4/depend.m4
m4/dmalloc.m4
m4/lispdir.m4
m4/maintainer.m4
m4/multi.m4
m4/regex.m4
m4/sanity.m4
m4/silent.m4
tests/.gitignore
tests/Makefile.am
tests/Makefile.in
tests/README
tests/acloca10.test
tests/acloca18.test
tests/acloca23.test [new file with mode: 0755]
tests/aclocal.test
tests/aclocal9.test
tests/ansi.test
tests/ar-lib.test [new file with mode: 0755]
tests/autohdr.test
tests/autohdr2.test
tests/autohdr3.test
tests/autohdr4.test
tests/auxdir.test
tests/auxdir2.test
tests/auxdir3.test
tests/auxdir4.test
tests/auxdir5.test [new file with mode: 0755]
tests/auxdir6.test [new file with mode: 0755]
tests/auxdir7.test [new file with mode: 0755]
tests/auxdir8.test [new file with mode: 0755]
tests/auxdir9.test [new file with mode: 0755]
tests/backcompat.test [new file with mode: 0755]
tests/backcompat2.test [new file with mode: 0755]
tests/backcompat3.test [new file with mode: 0755]
tests/backcompat4.test [new file with mode: 0755]
tests/backcompat5.test [new file with mode: 0755]
tests/backcompat6.test [new file with mode: 0755]
tests/candist.test [new file with mode: 0755]
tests/canon-name.test
tests/canon.test
tests/canon3.test
tests/canon4.test
tests/canon5.test
tests/canon6.test [new file with mode: 0755]
tests/canon7.test [new file with mode: 0755]
tests/canon8.test [new file with mode: 0755]
tests/check12.test [new file with mode: 0755]
tests/colneq.test
tests/colneq2.test
tests/colneq3.test [new file with mode: 0755]
tests/colon.test
tests/colon2.test
tests/colon3.test
tests/colon5.test
tests/colon6.test
tests/colon7.test
tests/color.test
tests/color2.test
tests/comment5.test
tests/compile.test
tests/compile2.test
tests/compile3.test [new file with mode: 0755]
tests/compile4.test [new file with mode: 0755]
tests/compile5.test [new file with mode: 0755]
tests/compile6.test [new file with mode: 0755]
tests/compile_f90_c_cxx.test
tests/compile_f_c_cxx.test
tests/cond-basic.test [moved from tests/ctarget1.test with 81% similarity]
tests/cond23.test
tests/cond24.test
tests/cond25.test
tests/cond26.test
tests/cond27.test
tests/cond28.test
tests/cond29.test
tests/cond30.test
tests/cond31.test
tests/cond32.test
tests/cond33.test
tests/cond34.test
tests/cond35.test
tests/cond36.test
tests/cond37.test
tests/cond38.test
tests/cond39.test
tests/cond40.test
tests/cond41.test
tests/cond42.test
tests/cond43.test
tests/cond44.test
tests/cond45.test
tests/cond46.test [new file with mode: 0755]
tests/condinc2.test
tests/confdeps.test
tests/confh.test
tests/confh8.test
tests/copy.test
tests/cscope.test [new file with mode: 0755]
tests/cscope2.test [moved from tests/outdir.test with 67% similarity]
tests/cscope3.test [new file with mode: 0755]
tests/defs [moved from tests/defs.in with 55% similarity]
tests/defs-static.in [new file with mode: 0644]
tests/defun.test
tests/defun2.test
tests/dejagnu.test
tests/dejagnu2.test
tests/dejagnu3.test
tests/dejagnu4.test
tests/dejagnu5.test
tests/dejagnu6.test
tests/dejagnu7.test
tests/depdist.test
tests/discover.test
tests/distcom7.test
tests/dollarvar.test
tests/dollarvar2.test
tests/ext3.test [new file with mode: 0755]
tests/extra9.test [new file with mode: 0755]
tests/extradep.test [new file with mode: 0755]
tests/extradep2.test [new file with mode: 0755]
tests/gcj.test
tests/gcj3.test
tests/gen-parallel-tests
tests/header.test
tests/help-depend.test
tests/help-depend2.test
tests/help-dmalloc.test
tests/help-init.test
tests/help-lispdir.test
tests/help-maintainer.test
tests/help-multilib.test
tests/help-silent.test
tests/help-upc.test
tests/help2.test
tests/help4.test
tests/hfs.test
tests/implicit.test
tests/include.test
tests/info.test
tests/init.test
tests/insh2.test
tests/instdat.test
tests/instman2.test
tests/instspc-tests.sh [new file with mode: 0755]
tests/instspc.test [deleted file]
tests/interp.test
tests/interp2.test
tests/javaprim.test
tests/javasubst.test
tests/ldflags.test
tests/lex.test
tests/lex2.test
tests/lex3.test
tests/lex4.test
tests/lex5.test
tests/lexcpp.test [new file with mode: 0755]
tests/lexvpath.test [new file with mode: 0755]
tests/libobj-basic.test [new file with mode: 0755]
tests/libobj10.test
tests/libobj12.test
tests/libobj13.test
tests/libobj14.test
tests/libobj15a.test [moved from tests/libobj11.test with 71% similarity]
tests/libobj15b.test [moved from tests/aclibobj.test with 68% similarity]
tests/libobj15c.test [new file with mode: 0755]
tests/libobj16a.test [new file with mode: 0755]
tests/libobj16b.test [new file with mode: 0755]
tests/libobj17.test [new file with mode: 0755]
tests/libobj18.test [new file with mode: 0755]
tests/libobj19.test [new file with mode: 0755]
tests/libobj2.test
tests/libobj20a.test [new file with mode: 0755]
tests/libobj20b.test [new file with mode: 0755]
tests/libobj20c.test [new file with mode: 0755]
tests/libobj3.test
tests/libobj4.test
tests/libobj5.test
tests/libobj7.test
tests/libobj8.test
tests/library.test
tests/libtool.test
tests/libtool2.test
tests/link_override.test [new file with mode: 0755]
tests/listval.test
tests/location.test
tests/ltinstloc.test
tests/ltlibobjs.test
tests/lzip.test [new file with mode: 0755]
tests/maintclean.test
tests/make.test
tests/makej.test
tests/makevars.test
tests/mclean.test
tests/mdate2.test
tests/mdate3.test
tests/mdate4.test
tests/mdate6.test
tests/mkinst3.test
tests/mkinstall.test
tests/multlib.test
tests/no-outdir-option.test [new file with mode: 0755]
tests/nodist.test
tests/nodist3.test
tests/noinst.test
tests/noinstdir.test
tests/number.test
tests/objc.test
tests/obsolete.test
tests/oldvars.test [new file with mode: 0755]
tests/output.test
tests/output2.test
tests/output3.test
tests/output4.test
tests/override-conditional-1.test [new file with mode: 0755]
tests/override-conditional-2.test [new file with mode: 0755]
tests/override-html.test [new file with mode: 0755]
tests/override-suggest-local.test [moved from tests/overrid.test with 59% similarity]
tests/parallel-am.test
tests/parallel-am2.test
tests/parallel-am3.test
tests/parse.test
tests/percent.test
tests/percent2.test
tests/phony.test
tests/pluseq.test
tests/pluseq5.test
tests/pluseq9.test
tests/posixsubst-data.test [new file with mode: 0755]
tests/posixsubst-extradist.test [new file with mode: 0755]
tests/posixsubst-ldadd.test [new file with mode: 0755]
tests/posixsubst-libraries.test [new file with mode: 0755]
tests/posixsubst-ltlibraries.test [new file with mode: 0755]
tests/posixsubst-programs.test [new file with mode: 0755]
tests/posixsubst-scripts.test [new file with mode: 0755]
tests/posixsubst-sources.test [new file with mode: 0755]
tests/posixsubst-tests.test [new file with mode: 0755]
tests/ppf77.test
tests/python11.test
tests/regex-obsolete.test [new file with mode: 0755]
tests/remake.test
tests/remake10a.test [new file with mode: 0755]
tests/remake10b.test [new file with mode: 0755]
tests/remake10c.test [new file with mode: 0755]
tests/remake11.test [new file with mode: 0755]
tests/remake12.test [new file with mode: 0755]
tests/remake1a.test [new file with mode: 0755]
tests/remake2.test
tests/remake3.test
tests/remake3a.test [new file with mode: 0755]
tests/remake4.test
tests/remake5.test
tests/remake6.test
tests/remake7.test
tests/remake8a.test [new file with mode: 0755]
tests/remake8b.test [new file with mode: 0755]
tests/remake9a.test [new file with mode: 0755]
tests/remake9b.test [new file with mode: 0755]
tests/remake9c.test [new file with mode: 0755]
tests/remake9d.test [new file with mode: 0755]
tests/repeated-options.test [new file with mode: 0755]
tests/req.test
tests/rulepat.test
tests/silent-lex-gcc.test [new file with mode: 0755]
tests/silent-lex-generic.test [moved from tests/silentlex.test with 91% similarity]
tests/silent-many-gcc.test [new file with mode: 0755]
tests/silent-many-generic.test [moved from tests/silent5.test with 88% similarity]
tests/silent-yacc-gcc.test [new file with mode: 0755]
tests/silent-yacc-generic.test [moved from tests/silentyacc.test with 91% similarity]
tests/silent.test
tests/silent2.test
tests/silent3.test
tests/silent4.test
tests/silent6.test
tests/silent7.test
tests/silent8.test [new file with mode: 0755]
tests/silent9.test
tests/silentcxx.test
tests/silentf77.test
tests/silentf90.test
tests/sinclude.test
tests/space.test
tests/specflg3.test
tests/specflg6.test
tests/spell3.test
tests/spelling.test
tests/stamph2.test
tests/strip2.test [new file with mode: 0755]
tests/strip3.test [new file with mode: 0755]
tests/subdir5.test
tests/subobj9.test
tests/subst5.test [new file with mode: 0755]
tests/suffix10.test
tests/syntax.test
tests/tags2.test [new file with mode: 0755]
tests/target-cflags.test
tests/targetclash.test
tests/txinfo22.test
tests/vars.test
tests/vars3.test
tests/vartar.test
tests/vartypo2.test [new file with mode: 0755]
tests/vartypos.test [new file with mode: 0755]
tests/version7.test
tests/warnopts.test
tests/werror.test
tests/werror4.test [new file with mode: 0755]
tests/yacc-basic.test [new file with mode: 0755]
tests/yacc.test
tests/yacc2.test
tests/yacc3.test
tests/yacc4.test
tests/yacc5.test
tests/yacc6.test
tests/yacc7.test
tests/yacc8.test
tests/yaccdry.test
tests/yaccpp.test
tests/yaccvpath.test

index 81e5a98..716ef8b 100644 (file)
@@ -7,5 +7,9 @@ config.log
 config.status
 config.status.lineno
 configure.lineno
+cscope.files
+cscope.in.out
+cscope.out
+cscope.po.out
 tags
 TAGS
index afb60f4..3e76016 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
        * tests/man8.test: Remove shell comments from makefile rule
        commands, as they are not portable to (at least) Tru64 make.
 
+2010-12-21  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       Fix sed-related buglet in test "subdir5.test"
+       * tests/subdir5.test: Always terminate text passed to the
+       `i' sed command with a newline, to work around limitations
+       in e.g. older OpenBSD sed.
+
+2010-12-21  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       Fix spurious failures in tests on AC_CONFIG_AUX_DIR.
+       * tests/auxdir7.test: Do not try to needlessly overwrite the files
+       `install-sh' and `missing'.  This avoid spurious failures in "make
+       distcheck", when those files might be copied as read-only from the
+       `lib' directory.
+       * tests/auxdir8.test: Likewise.
+
+2010-12-18  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       Make test 'posixsubst-script' portable to MinGW/MSYS.
+       * tests/posixsubst-script.test: Ensure that the generated dummy
+       scripts really start with a shebang line, to work around a
+       limitation of 'test -x' on MinGW/MSYS.
+       Reported by Ralf Wildenhues.
+
+       Improve comments in tests `posixsubst*.test'.
+       * tests/posixsubst-data.test: Improve comment explaining why we
+       try also empty match suffix.
+       * tests/posixsubst-extradist.test: Likewise.
+       * tests/posixsubst-ldadd.test: Likewise.
+       * tests/posixsubst-libraries.test: Likewise.
+       * tests/posixsubst-ltlibraries.test: Likewise.
+       * tests/posixsubst-programs.test: Likewise.
+       * tests/posixsubst-scripts.test: Likewise.
+       * tests/posixsubst-sources.test: Likewise.
+       * tests/posixsubst-tests.test: Likewise.
+       Suggested by Ralf Wildenhues.
+
+2010-12-18  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       docs: fix blunder in example about python extension modules
+       * doc/automake.texi (Python): Use `quaternion_la_SOURCES',
+       not `quaternion_SOURCES', to declare the sources of python
+       extension module `quaternion.la'.
+
+2010-12-16  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       docs: list LTLIBRARIES among Automake primaries
+       * doc/automake.texi (Uniform): List `LTLIBRARIES' among
+       the Automake primaries.
+
+2010-12-13  Stefano Lattarini  <stefano.lattarini@gmail.com>
+           Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       Tests defs: requirement 'xsi-shell' must be synced with libtool.
+       * tests/defs (xsi-shell): Add comment telling to keep the
+       XSI-conformance checks in sync with libtool.
+
+2010-12-13  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       Extend, fix and improve tests on Lex and Yacc support.
+       * tests/lexcpp.test: New test script, on support for Lex + C++.
+       * tests/lexvpath.test: New test script, test build and rebuild
+       rules for lexers in VPATH setup.
+       * tests/yacc-basic.test: New test script, run simple "semantic"
+       checks on basic Yacc support (similarly to what lex3.test does
+       for Lex support).
+       * tests/lex.test: Don't create useless dummy source file joe.l.
+       Remove extra blank lines.
+       * tests/lex4.test: Add trailing `:' command.  Do not create dummy
+       useless lex source file.
+       * tests/lex2.test: Likewise.  Call automake with the `-a' option,
+       so that it doesn't fail for the absence of `ylwrap' script.  Make
+       grepping of automake stderr stricter.
+       * tests/yacc7.test: Add trailing `:' command.  Enable `errexit'
+       shell flag earlier (just after having sourced ./defs).
+       * tests/yacc4.test: Likewise.  Also ...
+       (configure.in): Use pre-populated skeleton set up by ./defs,
+       instead of writing one from scratch.
+       Other minor cosmetic changes.
+       * tests/yacc5.test: Likewise.
+       * tests/yaccvpath.test: Likewise. Also ...
+       ($distdir): New variable.
+       Use it throughout.
+       * tests/lex5.test: Likewise.
+       * tests/lex3.test: Likewise.  Check the distdir, rather than
+       grepping the distribution tarball.  Extend the test on the
+       created binary, and be sure to avoid hangs.  Add some comments.
+       * tests/yacc.test: Use stricter grepping.  Add trailing `:'.
+       * tests/yacc6.test: Likewise.
+       * tests/yacc3.test: Likewise.  Do not create the unused file
+       `Makefile.sed'.  Remove useless rules from Makefile.am.  Other
+       minor cosmetic changes.
+       * tests/yacc2.test: Make grepping of generated `Makefile.in' and
+       of automake error messages stricter.  Do not redirect output of
+       grep to /dev/null.  Move call to aclocal earlier.  Reduce the
+       number of empty blank lines.  Fix a typo in comments.
+       * tests/yacc8.test: Fixed bugs that reduced the completeness of
+       the tests.  Added trailing `:' command.
+       (configure.in): Use pre-populated skeleton set up by ./defs,
+       instead of writing one from scratch.
+       * tests/yaccpp.test: Test also extensions `.y++', `.ypp', and
+       `.yxx', rather than only `.yy'.
+       * tests/Makefile.am (TESTS): Update.
+
+2010-12-17  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       Minor cleanups in canon7.test.
+       * tests/canon7.test (_foo_bar_SOURCES): Remove libs.c.
+       (configure.in): Remove AC_PROG_CXX.
+
+2010-12-16  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       Avoid false positive in sc_tests_plain_make maintainer-check.
+       * Makefile.am (sc_tests_plain_make): Ensure to only match full
+       `make' words.  Avoid false positive with remake11.test.
+
+2010-12-16  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       Fix canon7.test failure.
+       * tests/canon7.test (_foo_bar_SOURCES): Add foobar.c.
+       (lib.h, libd.c, libs.c): Use const for constant strings.
+
+2010-12-16  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       Fix typos in test comments.
+       * tests/posixsubst-data.test, tests/posixsubst-extradist.test,
+       tests/posixsubst-ldadd.test, tests/posixsubst-libraries.test,
+       tests/posixsubst-ltlibraries.test, tests/posixsubst-programs.test,
+       tests/posixsubst-scripts.test, tests/posixsubst-sources.test,
+       tests/posixsubst-tests.test: Fix typos.
+
+2010-12-14  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       More uses of AS_HELP_STRING in automake macros.
+       * m4/depend.m4 (AM_DEP_TRACK): Use `AS_HELP_STRING' to format
+       the help message added to the generated configure.
+       * m4/dmalloc.m4 (AM_WITH_DMALLOC): Likewise.
+       * m4/lispdir.m4 (AM_PATH_LISPDIR): Likewise.
+       * m4/maintainer.m4 (AM_MAINTAINER_MODE): Likewise.
+       * m4/multi.m4 (AM_ENABLE_MULTILIB): Likewise.
+       Also, bumped all serial numbers of the modified m4 files.
+
+2010-12-14  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       Improve tests on generated portions of configure help screen.
+       * tests/help-depend.test: Grepping of configure help screen
+       relaxed to cater for possible line wrapping, and tightened in
+       other respects.
+       * tests/help-depend2.test: Likewise.
+       * tests/help-dmalloc.test: Likewise.
+       * tests/help-lispdir.test: Likewise.
+       * tests/help-maintainer.test: Likewise.
+       * tests/help-multilib.test: Likewise.
+       * tests/help-silent.test: Likewise.
+       * tests/help-upc.test: Likewise.
+       * tests/help-init.test: Grepping of configure help screen
+       tightened.
+
+2010-12-15  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       Extended tests on AC_CONFIG_AUX_DIR.
+       * tests/auxdir.test: Enable `errexit' shell flag.  Prefer `$me'
+       over hard-coded test name.  Use proper m4 quoting.  Add trailing
+       `:' command.
+       * tests/auxdir2.test: Likewise.  Try to call automake also with
+       the `-a' option, so that it will not fail for spurious reasons.
+       * tests/auxdir3.test: Add an explanatory comment and a trailing
+       `:' command.
+       * tests/auxdir4.test: Prefer `$me' over hard-coded test name.
+       Make grepping of automake stderr slightly stricter.  Also, now
+       this test just checks about Automake's reaction to unportable
+       auxiliary directory names (and it has been extended in this
+       respect).  Moved the checks about non-existent auxiliary
+       directories to ...
+       * tests/auxdir5.test: ... this new test.
+       * tests/auxdir6.test: New test.
+       * tests/auxdir7.test: Likewise.
+       * tests/auxdir8.test: Likewise.
+       * tests/auxdir9.test: Likewise.
+       * tests/Makefile.am (TESTS): Updated.
+
+2010-12-06  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       Tests: extend checks on remake rules.
+       This adds proper semantical tests (i.e. run make to check the
+       rebuild rules are correctly triggered) in addition to tentative
+       grepping of the generated Makefile.in(s).
+       * tests/remake.test: Enable `errexit' shell flag, and related
+       changes.  Modernize `configure.in'.  Add trailing `:' command.
+       Improve heading comments, and add a reference to new sister test
+       remake1a.test.
+       * tests/remake3.test: Likewise (but with sister test being
+       remake3a.test).
+       * tests/remake2.test: Improve heading comments.  Enable `errexit'
+       shell flag, and related changes.  Modernize `configure.in'.  Make
+       grepping of `Makefile.in' slightly stricter.  Add trailing `:'
+       command.
+       * tests/remake5.test: Also run the `distcheck' target.  Add
+       trailing `:' command.  Use proper m4 quoting in configure.in.
+       * tests/remake4.test: Prefer `$me' over hard-coded test name.
+       * tests/remake7.test: Use the `configure.in' stub created by
+       ./defs, rather than writing it from scratch.
+       * tests/remake6.test: Likewise.  Also, add trailing `:' command,
+       and ensure verbose printing of captured make output.
+       * tests/remake1a.test: New test, sister of remake.test.
+       * tests/remake3a.test: New test, sister of remake3.test.
+       * tests/remake8a.test: New test.
+       * tests/remake8b.test: Likewise.
+       * tests/remake9a.test: Likewise.
+       * tests/remake9b.test: Likewise.
+       * tests/remake9c.test: Likewise.
+       * tests/remake9d.test: Likewise.
+       * tests/remake10a.test: Likewise.
+       * tests/remake10b.test: Likewise.
+       * tests/remake10c.test: Likewise.
+       * tests/remake11.test: Likewise.
+       * tests/remake12.test: Likewise.
+       * tests/Makefile.am (TESTS): Updated.
+
+2010-12-11  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       Improve and extend tests on canonicalization.
+       * tests/canon-name.test: Add trailing `:' command.  When writing
+       configure.in, prefer to use $me instead of hard-coding the test
+       name.
+       * tests/canon3.test: Prefer trailing `:' over trailing `Exit 0'.
+       * tests/canon4.test: Likewise.  Make grepping of Makefile.in
+       stricter.  Improve heading comment, and add reference to ...
+       * tests/canon6.test: ... this new test (sister test of the
+       previous one).
+       * tests/canon.test: Prefer cat + here-doc over echo to append
+       text to configure.in.  Extend grepping of Automake stderr.  Add
+       trailing `:' command.
+       * tests/canon5.test: Likewise.
+       * tests/canon7.test: New file, stress test on canonicalization.
+       * tests/canon8.test: New test, for better coverage (check that
+       the `@' character is not transliterated in canonicalizations).
+       * tests/Makefile.am: Updated.
+
+2010-12-13  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       Libobj tests: refer to automake bug tracker for limitations.
+       * tests/libobj15b.test (configure.in): In the comment explaining
+       why an apparently redundant AC_OUTPUT is indeed needed, refer
+       to the relevant entry in the Automake bug tracker rather than
+       describing the bug in detail with a FIXME-style comment.
+       * tests/libobj15c.test: Likewise.
+       * tests/libobj20b.test: Likewise.
+
+       Libobj tests: do not use `##' automake comments in-line.
+       * tests/libobj19.test (Makefile.am): Do not use inline `##'
+       comments in the definition of AUTOMAKE_OPTIONS.
+       * tests/libobj20c.test: Likewise.
+       Report by Ralf Wildenhues.
+
+2010-12-13  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       Fix testsuite failure of check12.test without DejaGNU.
+       * tests/check12.test: Require runtest.
+
+2010-12-12  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       Tests defs: more uses of $top_testsrcdir.
+       * tests/compile6.test: Use `$top_testsrcdir' instead of
+       `$testsrcdir/..'.
+
+2010-11-12  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       Tests required tools: also try `-v' option for GNU compilers.
+       * tests/defs.in: In the loop on "$required" tools, for gcc
+       and g++, also run "gcc -v" (resp. "g++ -v"), to get more
+       information, and for consistency with gcj.
+
+2010-11-12  Stefano Lattarini  <stefano.lattarini@gmail.com>
+           Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       Tests defs: avoid some useless subshells.
+       * tests/defs: In the loop on "$required" tools: avoid subshells
+       where not needed.
+
+2010-12-09  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       Extend tests on AC_LIBOBJ and friends.
+       * tests/aclibobj.test: Removed, superseded by ...
+       * tests/libobj-basic.test: ... this new test, which runs autoconf,
+       ./configure and make, to ensure everything really works.
+       * tests/libobj3.test: Add trailing `:' command.  Escape literal
+       dot in grep regexp.
+       * tests/libobj4.test: Enable `errexit' shell flag, and related
+       changes.  Add trailing `:' command.  Use proper m4 quoting.
+       * tests/ltlibobjs.test: Likewise.
+       * tests/libobj5.test: Enable `errexit' shell flag, and related
+       changes.  Add trailing `:' command.  Make more robust by using
+       longer filenames to be grepped.
+       * tests/libobj8.test: Enable `errexit' shell flag, and related
+       changes.  Add trailing `:' command.  Use the configure.in
+       stub provided by ./defs, rather than writing it from scratch.
+       * tests/libobj2.test: Likewise.  Also, add calls to autoconf,
+       ./configure and make, to ensure everything really works.
+       * tests/libobj7.test: Likewise, and ensure that at least one
+       function listed in AC_REPLACE_FUNCTIONS is truly replaced.
+       * tests/libobj13.test: Make grepping of Automake stderr slightly
+       stricter.  Add trailing `:' command.
+       * tests/libobj12.test: Likewise.  Also, prefer "cat + here-doc"
+       over "echo" to append to Makefile.am, and some cosmetic changes
+       in spacing.
+       * tests/libobj14.test: Call `Exit 1' if sourcing of ./defs fails.
+       Slighty improve m4 quoting.  Add trailing `:' command.
+       * tests/libobj10.test: Add calls to autoconf, ./configure and
+       make, to ensure everything really works.  Also, remove tests that
+       nonexistent source for AC_LIBOBJ cause an Automake failure: this
+       is already checked by ...
+       * tests/libobj15a.test: ... this new test.
+       * tests/libobj15b.test: New test, sister test of libobj15a.test,
+       checks AC_LIBSOURCE instead of AC_LIBOBJ.
+       * tests/libobj15c.test: New test, sister test of libobj15a.test,
+       checks AC_LIBSOURCES instead of AC_LIBOBJ.
+       * tests/libobj11.test: Removed, superseded by ...
+       * tests/libobj16a.test: ... this new test.
+       * tests/libobj16b.test: New test, sister test of libobj16a.test,
+       but using oldish/deprecated idioms.
+       * tests/libobj17.test: New test.
+       * tests/libobj18.test: Likewise.
+       * tests/libobj19.test: Likewise.
+       * tests/libobj20a.test: Likewise.
+       * tests/libobj20b.test: Likewise.
+       * tests/libobj20c.test: Likewise.
+       * tests/Makefile.am (TESTS): Updated.
+
+2010-12-08  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       Test `$(var:suf=rpl)' expansion in special automake variables.
+       * tests/posixsubst-data.test: New test.
+       * tests/posixsubst-extradist.test: Likewise.
+       * tests/posixsubst-ldadd.test: Likewise.
+       * tests/posixsubst-libraries.test: Likewise.
+       * tests/posixsubst-ltlibraries.test: Likewise.
+       * tests/posixsubst-programs.test: Likewise.
+       * tests/posixsubst-scripts.test: Likewise.
+       * tests/posixsubst-sources.test: Likewise.
+       * tests/posixsubst-tests.test: Likewise.
+       * tests/Makefile.am (TESTS): Update.
+
+2010-12-07  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       Make tests `colon*.test' more "semantic".
+       Prefer running configure and make over grepping the generated
+       files; this is both more correct and less fragile.
+       * tests/colon.test: Made more "semantic", as described above.
+       * tests/colon5.test: Likewise.
+       * tests/colon6.test: Likewise.
+       * tests/colon7.test: Likewise.
+       * tests/colon2.test: Likewise, and improve syncing with sister
+       test `colon3.test'.
+       * tests/colon3.test: Likewise (but with the sister test being
+       `colon2.test' here).
+
+2010-12-10  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       Extend and improve tests on DejaGnu support.
+       * tests/dejagnu.test: Do not create useless dummy test script.
+       Add trailing `:' command.  In heading comments, add reference
+       to ...
+       * tests/check12.test: ... this new "semantic" test, covering
+       concurrent use of dejagnu tests, simple tests and `check-local'
+       target.
+       * tests/dejagnu2.test: Make test more reliable, by avoid weak
+       grepping of make output.  Prefer `cat' over `echo' to append
+       to configure.in.  Quote literal dots in grep regexps.  Prefer
+       `grep -c ...' over `grep ... | wc -l'.  Make grepping of
+       automake stderr slightly stricter.  Add trailing `:' command.
+       * tests/dejagnu3.test: Prefer `cat' over `echo' to append to
+       configure.in.  Check stderr of expected-to-fail "make" call.
+       Remove extra blank lines from Makefile.am.
+       * tests/dejagnu4.test: Prefer `cat' over `echo' to append to
+       configure.in.  Prefer `mv -f' over plain `mv' when the target
+       file already exists.  Avoid extra mkdir calls by creating more
+       directories at once.  Better use of blank lines.  Check that
+       the `*.log' and `*.sum' files are created by runtest also when
+       "make check" fails.
+       * tests/dejagnu7.test: Prefer `cat' over `echo' to append to
+       configure.in.  Better use of blank lines.  Add a trailing `:'
+       command.
+       * tests/dejagnu6.test: Likewise, and give the dejagnu test a
+       more descriptive name.
+       * tests/dejagnu5.test: Likewise.  Also, simply define package
+       name to `$me' rather than using a non-obvious sed script to
+       extract it from `AC_INIT', and write the Makefile.am with only
+       one command.
+       * tests/Makefile.am (TESTS): Updated.
+
+2010-12-10  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       Avoid running installed automake from 'libtool --help'.
+       * tests/subobj9.test: Export AUTOCONF and AUTOMAKE.
+       Together with fixed Libtool, this fixes check-coverage to not
+       invoke installed automake.
+
+2010-12-06  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       Separate checks on target overriding into multiple test scripts.
+       * tests/overrid.test: Deleted, its contents separated into ...
+       * tests/override-suggest-local.test: ... this new test ...
+       * tests/override-html.test: ... and this new test ...
+       * tests/override-conditional-1.test: ... and this new test ...
+       * tests/override-conditional-2.test: ... and this new test (still
+       xfailing).
+       * tests/Makefile.am (TESTS, XFAIL_TESTS): Updated.
+
+       Enable `set -e' in more tests (plus some tweakings).
+       * tests/implicit.test: Enable `errexit' shell flag, and related
+       changes.  Add trailing `:' command.
+       * tests/insh2.test: Likewise.
+       * tests/instman2.test: Likewise.
+       * tests/interp.test: Likewise.
+       * tests/interp2.test: Likewise.
+       * tests/library.test: Likewise.
+       * tests/mclean.test: Likewise.
+       * tests/info.test: Enable `errexit' shell flag, and related
+       changes.  Add trailing `:' command.  Remove useless chaff from
+       generated Makefile.am.  Add a "FIXME" comment.
+       * tests/include.test: Enable `errexit' shell flag, and related
+       changes.  Add trailing `:' command.  Prefer cat + here-doc over
+       echo to append to configure.in.  Make tests more robust by using
+       longer and less common names to grep.  Remove an useless call to
+       echo.  Remove an useless subshell.
+       * tests/header.test: Enable `errexit' shell flag, and related
+       changes.  Use proper m4 quoting.  Add excerpts from the original
+       report of the bug tested for by this script.
+       * tests/gcj.test: Enable `errexit' shell flag, and related
+       changes.  Use proper m4 quoting.  Add trailing `:' command.
+       * tests/gcj3.test: Likewise.
+       * tests/ldflags.test: Likewise.
+       * tests/libtool.test: Likewise.
+       * tests/listval.test: Likewise.
+       * tests/javaprim.test: Likewise, and prefer cat + here-doc over
+       echo to append to configure.in.
+       * tests/javasubst.test: Likewise.
+       * tests/discorver.test: Enable `errexit' shell flag.  Prefer
+       trailing `:' over trailing `Exit 0'.
+       * tests/instdat.test: Enable `errexit' shell flag, and related
+       changes.  Use proper m4 quoting.  Avoid usless subshell.  Prefer
+       cat + here-doc over echo to append to configure.in.
+       * tests/libtool2.test: Enable `errexit' shell flag, and related
+       changes.  Add trailing `:' command.  Use the configure.in
+       stub provided by ./defs, rather than writing it from scratch.
+
+       Modernize, improve and/or tweak some test scripts.
+       * tests/maintclean.test: Use proper m4 quoting.  Add trailing `:'
+       command.
+       * tests/sinclude.test: Likewise, and add a couple of blank lines,
+       for clarity.
+       * tests/make.test: Move setting of `errexit' shell flag earlier in
+       the script (just after inclusion of ./defs).  Use the configure.in
+       stub created by ./defs, rather than writing it from scratch.  Some
+       cosmetic changes in spacing.  Ensure we wait enough time before
+       touching configure.in to trigger the rebuild rules.
+       * tests/makej.test: Use `$me' instead of hard-coding the test
+       name.  Add trailing `:' command.
+       * tests/version7.test: Likewise.
+       * tests/space.test: Enable `errexit' shell flag, and related
+       changes.
+       * tests/makevars.test: Likewise.  Also, prefer trailing `:' over
+       trailing `Exit 0', and be more tolerant of white spaces when
+       grepping Makefile.in.
+
+2010-12-02  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       * tests/silent8.test: Use "|| Exit 1" after ". ./defs".
+
+       Enable `set -e' in more tests (plus some tweakings).
+       * tests/mkinstall.test: Enable `errexit' shell flag, and related
+       changes.  Add a trailing `:' command, if needed.
+       * tests/mdate2.test: Likewise.
+       * tests/objc.test: Likewise.
+       * tests/noinst.test: Likewise.
+       * tests/outdir.test: Likewise.
+       * tests/number.test: Likewise.
+       * tests/pluseq.test: Likewise.
+       * tests/req.test: Likewise.
+       * tests/rulepat.test: Likewise.
+       * tests/specflg6.test: Likewise.
+       * tests/spell3.test: Likewise.
+       * tests/parse.test: Likewise, and ...
+       (configure.in): Use the stub created by ./defs, rather than
+       writing it from scratch.  Remove useless calls to AC_PROG_RANLIB
+       and AC_OUTPUT.
+       * tests/mdate4.test: Likewise.
+       * tests/mkinstall.test: Likewise, and ...
+       (configure.in): ... drop useless call to `AC_OUTPUT'.
+       * tests/output.test: Enable `errexit' shell flag, and related
+       changes.  Add a trailing `:' command.
+       (configure.in): Modernize.
+       * tests/output2.test: Likewise.
+       * tests/output3.test: Likewise.
+       * tests/output4.test: Likewise.
+       * tests/mdate3.test: Enable `errexit' shell flag, and related
+       changes.  Prefer `$me' over hard-coded test name.  Do not move
+       non-existent or useless files in the build auxiliary directory.
+       * tests/nodistdir.test: Enable `errexit' shell flag, and related
+       changes.  Prefer trailing `:' over trailing `Exit 0'.
+       * tests/nodist.test: Likewise.  Also, prefer cat + here-doc over
+       echo to create input test files, and do not create useless dummy
+       C source files.
+       * tests/nodist2.test: Likewise.
+       * tests/ppf77.test: Enable `errexit' shell flag, with related
+       changes.  Add a trailing `:' command.  Do not create useless
+       dummy source files.
+       * tests/spelling.test: Enable `errexit' shell flag, with related
+       changes.  Add a trailing `:' command.  Also, grep Automake error
+       message.
+       * tests/specflg3.test: Enable `errexit' shell flag, with related
+       changes.  Avoid unportable use of `-e' option of fgrep.  Prefer
+       trailing `:' over trailing `Exit 0'.  Remove extra empty lines,
+       and cosmetic changes to whitespaces.
+       * tests/obsolete.test: Enable `errexit' shell flag, with related
+       changes.  Improve verbosity.  Other miscellanous changes.
+
+2010-11-30  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       Improve and extend tests on `:=' variable assignments.
+       * tests/colneq.test: Avoid redundant use of variable assignments
+       in Makefile.am.  Use command-line automake options instead of
+       editing AUTOMAKE_OPTIONS in Makefile.am.  Make grepping of the
+       generated Makefile.in slightly stricter.  Add a trailing `:'
+       command.
+       * tests/colneq2.test: Do not create unneeded dummy files.  Run
+       also autoconf, ./configure and make.  Add trailing `:' command.
+       * tests/colneq3.test: New test, similar to colneq.test, but
+       running also autoconf, ./configure and make.
+       * tests/Makefile.am (TESTS): Update.
+
+2010-11-26  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       Remove long-deprecated options --Werror and --Wno-error.
+       These options has been deprecated at least since commit
+       "Release-1-6-1b-35-gc037f20", dated 2002-07-06.
+       * automake.in (parse_arguments): Do not recognize anymore options
+       `--Werror' and `--Wno-error' as synonyms of respectively `-Werror'
+       and `-Wno-error'.
+       * tests/werror.test: Update: use `-Werror' instead of `--Werror'.
+       * NEWS: Update.
+
+2010-11-25  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       Fix spurious failures in `silent*.test' for $CC != gcc
+       In some tests on automake-produced silent rules, we forced the
+       use of gcc depmode to improve testsuite coverage; but this has
+       unsurprisingly led to spurious failures when some non-GNU C
+       compilers were used.  So we are now careful to require GCC in
+       tests that force gcc depmode.
+       From reports by Ralf Wildenhues.
+       * silent5.test: Test removed, its content split into ...
+       * silent-many-generic.test, silent-many-gcc.test: ... these new
+       sister tests, the latter of which forces gcc depmode and lists
+       "gcc" in $required.
+       * silentlex.test: Test removed, its content split into ...
+       * silent-lex-generic.test, silent-lex-gcc.test: ... these new
+       sister tests, the latter of which forces gcc depmode and lists
+       "gcc" in $required.
+       * silentyacc.test: Test removed, its content split into ...
+       * silent-yacc-generic.test, silent-yacc-gcc.test: ... these new
+       sister tests, the latter of which forces gcc depmode and lists
+       "gcc" in $required.
+       * tests/Makefile.am (TESTS): Updated.
+
+2010-11-21  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       Tests: consistently use "|| Exit 1" after ". ./defs".
+       * tests/autohdr.test: Use `. ./defs || Exit 1', not bare
+       `. ./defs', for consistency with other tests.
+       * tests/autohdr2.test: Likewise.
+       * tests/autohdr3.test: Likewise.
+       * tests/autohdr4.test: Likewise.
+       * tests/cond23.test: Likewise.
+       * tests/cond24.test: Likewise.
+       * tests/cond25.test: Likewise.
+       * tests/cond26.test: Likewise.
+       * tests/cond27.test: Likewise.
+       * tests/cond28.test: Likewise.
+       * tests/cond29.test: Likewise.
+       * tests/cond30.test: Likewise.
+       * tests/cond31.test: Likewise.
+       * tests/cond32.test: Likewise.
+       * tests/cond33.test: Likewise.
+       * tests/cond34.test: Likewise.
+       * tests/cond35.test: Likewise.
+       * tests/cond36.test: Likewise.
+       * tests/cond37.test: Likewise.
+       * tests/cond38.test: Likewise.
+       * tests/cond39.test: Likewise.
+       * tests/cond40.test: Likewise.
+       * tests/cond41.test: Likewise.
+       * tests/cond42.test: Likewise.
+       * tests/cond43.test: Likewise.
+       * tests/cond44.test: Likewise.
+       * tests/cond45.test: Likewise.
+       * tests/dollarvar.test: Likewise.
+       * tests/dollarvar2.test: Likewise.
+       * tests/hfs.test: Likewise.
+       * tests/libobj14.test: Likewise.
+       * tests/percent.test: Likewise.
+       * tests/percent2.test: Likewise.
+       * tests/phony.test: Likewise.
+       * tests/silent.test: Likewise.
+       * tests/silent2.test: Likewise.
+       * tests/silent3.test: Likewise.
+       * tests/silent4.test: Likewise.
+       * tests/silent5.test: Likewise.
+       * tests/silent6.test: Likewise.
+       * tests/silent7.test: Likewise.
+       * tests/silent9.test: Likewise.
+       * tests/silentcxx.test: Likewise.
+       * tests/silentf77.test: Likewise.
+       * tests/silentf90.test: Likewise.
+       * tests/silentlex.test: Likewise.
+       * tests/silentyacc.test: Likewise.
+
+       Avoid useless cleaning in some `silent*.test' tests.
+       * tests/silentf77.test: Removed useless calls to "make clean"
+       and "make maintainer-clean".
+       * tests/silentf90.test: Likewise.
+       * tests/silent3.test: Removed useless call to "make distclean".
+       * tests/silent4.test: Likewise.
+       * tests/silent9.test: Likewise.
+
+2010-11-19  Ian Lance Taylor  <iant@google.com>
+
+       Sync config-ml.in from GCC.
+       * config-ml.in: Add Go support: treat GOC and GOCFLAGS like other
+       compiler/flag environment variables.
+
+2010-11-20  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       release-stats: account for more generated tests.
+       * Makefile.am (release-stats): Be sure to take into account all
+       the generated tests, by grepping the test scripts to decide which
+       ones of them are automatically generated.
+
+2010-11-20  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       Code cleanup after removal of option `--output-directory'.
+       * automake.in ($output_directory): Remove, it's unconditionally
+       defined to `.' and used only ...
+       (generate_makefile): ... in this subroutine, which now has been
+       edited and simplified accordingly.
+
+       Remove obsolete automake option `--output-directory'.
+       This option has been deprecated since version 1.7 (2002/2003).
+       * automake.in ($output_directory): Define to `.' unconditionally.
+       (parse_arguments): Remove handling of equivalent options `-o' and
+       `--output-directory'.
+       * tests/outdir.test: Removed.
+       * tests/no-outdir-option.test: New test.
+       * tests/Makefile.am (TESTS): Updated.
+       * NEWS: Updated.
+
+2010-11-19  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       Automake::Config: remove extra trailing semicolon.
+       * lib/Automake/Config.in: Remove extra trailing semicolon.
+
+       help4.test: fix botched heading comment.
+       * tests/help4.test: Fixed the heading comment, since it
+       didn't correctly describe what checks the testcase was
+       supposed to perform.
+
+       help2.test: add checks on aclocal too.
+       * tests/help2.test: Check that also `aclocal --version' and
+       `aclocal --help' work with configure.in and acinclude.m4 both
+       broken.
+
+2010-11-19  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       New test on repeated automake options.
+       * tests/repeated-options.test: New test, check that automake
+       does not complain on repeated options, nor generate broken or
+       incorrect makefiles.
+       * tests/Makefile.am (TESTS): Updated.
+
+2010-11-17  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       Fix spurious failures of silent-rules tests with Sun Fortran.
+       * tests/silentf77.test: Strip from the make output some verbose
+       messages possibly printed by the SunStudio fortran compilers, to
+       avoid spurious failures.  Add a trailing `:' command.
+       * tests/silentf90.test: Likewise.
+
+2010-11-17  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       Fix spurious failures of silent5.test with Sun Fortran.
+       * tests/silent5.test: Strip from the make output some verbose
+       messages possibly printed by the SunStudio fortran compilers,
+       to avoid spurious failures.  This bug has been there from the
+       very first version of this test script.
+
+2010-11-16  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       Fix regression in colon{5,6}.test (failures on AIX 5.3).
+       * tests/colon5.test: Also substitute `@SHELL@' with `$SHELL' when
+       post-processing the generated Makefile.in, to work around a bug
+       of AIX 5.3 make which doesn't allow setting the `$(SHELL)' macro
+       on the commend line.  Calls to `$MAKE' adjusted accordingly.
+       * tests/colon6.test: Likewise.
+       Regression introduced in commit v1.11-175-gf9fe878 "Modernize,
+       improve and/or extend tests `colon*.test", and reported by Ralf
+       Wildenhues.
+
+2010-11-16  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       Fix regression in ansi.test (failure on AIX 5.3).
+       * tests/ansi.test: Remove redundant hackish check done using a
+       hand-postprocessed Makefile.in.  This check worked by setting
+       the `$(SHELL)' macro on the command line of make, but this is
+       not supported by the AIX 5.3 make implementation.
+       This bug has been lurking for a long time, and was activated by
+       commit v1.11-125-gc1f6cdb "Enable `errexit' shell flag in various
+       tests".  Report by Ralf Wildenhues.
+
+2010-11-16  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       backcompat5.test: avoid '##'-style comments inside recipe commands.
+       * tests/backcompat5.test: Remove double-hash comments
+       from makefile rule commands, they are not part of the
+       Automake API.  Fixes testsuite failure with Tru64 make.
+
+       tests: avoid '##'-style comments inside recipe commands.
+       * tests/confh.test, tests/confh8.test: Remove
+       double-hash comments from makefile rule commands, they
+       are not part of the Automake API.
+
+2010-11-14  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       tests: work around dash quoting issue in case statements.
+       * tests/color.test, tests/color2.test: Quote variable in case
+       pattern, to avoid skipping tests with dash 0.5.5.1.
+
+2010-11-16  Peter Rosin  <peda@lysator.liu.se>
+
+       Skip MSVC oriented tests if the shell is not capable.
+       * tests/defs: New required entry 'xsi-shell'.
+       * tests/ar-lib.test, tests/compile3.test, tests/compile6.test:
+       Require a XSI capable shell.
+       Reported by Ralf Wildenhues.
+
+2010-11-15  Peter Rosin  <peda@lysator.liu.se>
+
+       compile: clear the `eat' variable earlier.
+       * lib/compile: Clear the `eat' variable earlier.
+       ($scriptversion): Update.
+       * tests/compile3.test: Prevent regressions.
+
+2010-11-14  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       More stable configure output from sanity check.
+       * m4/sanity.m4 (AM_SANITY_CHECK): Always print check line
+       about ensuring newer files, even if we don't actually need
+       to wait any more.
+
+2010-11-14  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       Rebuild menus in the manual.
+       * doc/automake.texi: Rebuild menus (using ^C ^U ^A in emacs).
+       Thanks to Ian Lance Taylor for the suggestion.
+
+       Fix install-strip when $(STRIP) contains several words.
+       * lib/am/install.am (install-strip): Update comment.  Use
+       separate sub-make invocations for empty and nonempty $(STRIP),
+       to fix quoting issues.
+       * tests/strip2.test, tests/strip3.test: New tests.
+       * tests/Makefile.am (TESTS): Adjust.
+
+2010-11-10  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       Fix yaccdry.test failure: require bison.
+       * tests/yaccdry.test: Require bison.
+       Found by NixOS Hydra.
+
+2010-11-12  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       Fix bug in test `backcompat6.test' (MSYS portability).
+       * tests/backcompat6.test (Makefile.am): Grep the output from the
+       test program, rather than diffing it, to avoid spurious failures
+       on MinGW/MSYS due to LF vs. CRLF line endings.
+       Reported by Ralf Wildenhues.
+
+2010-11-13  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       Deprecate obsolete macro AM_WITH_REGEX.
+       * m4/regex.m4: Document the `AM_WITH_REGEX' macro as obsolete,
+       and state that it should be removed two years from now.
+       (AM_WITH_REGEX): Raise an m4-time warning of the "obsolete"
+       category when this macro is used.
+       * doc/automake.texi (Public Macros): Move description of
+       `AM_WITH_REGEX' from here ...
+       (Obsolete Macros): ... to here, and declare it as obsolete
+       and "to be removed in a future version".
+       * tests/regex-obsolete.test: New test.
+       * tests/Makefile.am (TESTS): Update.
+
 2010-11-08  Stefano Lattarini  <stefano.lattarini@gmail.com>
 
        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.
+       Make grepping of generated Makefile.in slightly stricter.
        * tests/man3.test:  Add trailing `:' command.
        * tests/man5.test: Prefer cat + here-doc over echo to append to
        configure.in.
        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  <stefano.lattarini@gmail.com>
+
+       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: Slightly 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  <stefano.lattarini@gmail.com>
+
+       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  <stefano.lattarini@gmail.com>
+
+       Tests defs: move static definitions in a new file `defs-static'.
+       The new file is meant to be idempotent w.r.t. multiple 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 @abs_builddir@.
+       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 corresponding 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  <stefano.lattarini@gmail.com>
+
+       Fix bug in test `backcompat4.test' (stale autom4te cache).
+       * tests/backcompat4.test: Remove stale autom4te cache directory
+       before re-running aclocal and automake.  Also, since we are at
+       it, be more verbose in displaying contents of generated files,
+       to ease debuggability.
+       Reported by Ralf Wildenhues.
+
 2010-11-07  Stefano Lattarini  <stefano.lattarini@gmail.com>
 
-       Fix a bug in variable concatanation with `+='.
+       Fix a bug in variable concatenation with `+='.
        * lib/Automake/VarDef.pm (append): Since the content of the
        "appended-to" variable is going to be unconditionally normalized
        later, simply separate the appended value with a single whitespace
-       character, instead of trying to be uselesssly smarter by using
+       character, instead of trying to be uselessly smarter by using
        escaped newlines.  This fixes a bug in which extra backslashes
        where erroneously inserted in the variable's final value.
        * tests/pluseq11.test: New test, exposing the bug.
        * tests/Makefile.am (TESTS): Update.
        Reported by Andy Wingo.
 
+2010-11-07  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       Modernize, improve and/or tweak various test scripts.
+       * tests/stamph2.test: Improve m4 quoting in `configure.in', and
+       prefer trailing `:' over trailing `Exit 0'.
+       * tests/syntax.test: Escape literal dots in grep regexps.
+       * tests/copy.test: Enable `errexit' shell flag.  Extend test by
+       checking with `test' utility that the script `install-sh' is
+       copied, but not symlinked.
+       * tests/depdist.test: Move setting of `errexit' shell flag earlier
+       in the script (just after inclusion of ./defs).  Avoid obsoleted
+       constructs in generated `configure.in'.  Prefer to do our checks
+       by running configure and make over grepping Makefile.in.
+       * tests/target-cflags: Move setting of `errexit' shell flag
+       earlier in the script (just after inclusion of ./defs). Use the
+       `configure.in' stub created by `./defs', rather than writing it
+       from scratch.
+       * tests/target-clash: Do not uselessly run autoconf.
+       * tests/ctarget1.test: Renamed ...
+       * tests/cond-basic.test: ... to this.  Use the `configure.in' stub
+       created by `./defs', rather than writing it from scratch.
+       Move setting of `errexit' shell flag earlier in the script (just
+       after inclusion of ./defs).  Other minor cosmetic changes.
+       * tests/Makefile.am (TESTS): Updated.
+
+2010-11-06  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       New tests on obsoleted usages of automake/autoconf macros (such
+       as AC_INIT, AM_INIT_AUTOMAKE and AC_OUTPUT).
+       * tests/backcompat.test: New test script.
+       * tests/backcompat2.test: Likewise.
+       * tests/backcompat3.test: Likewise.
+       * tests/backcompat4.test: Likewise.
+       * tests/backcompat5.test: Likewise.
+       * tests/backcompat6.test: Likewise.
+       * tests/init.test: Extended and improved, esp. by trying more
+       combinations of calls to AC_INIT and AM_INIT_AUTOMAKE with few
+       arguments.
+       * tests/Makefile.am (TESTS): Updated.
+
 2010-11-06  Stefano Lattarini  <stefano.lattarini@gmail.com>
 
        Fix bug in rules for creating vala vapi/header files.
        New tests.
        * tests/Makefile.am (TESTS): Update.
 
+2010-11-05  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       Fix potential bug in generated tests `instpc-*.test'.
+       This bug is due to the changes introduced by the recently-merged
+       "tests-init" branch.  In that branch, `tests/defs' didn't define
+       anymore `$srcdir', instead defining directly `$testsrcdir'; but
+       the generated tests were using `$srcdir', hence the bug.
+       Luckily, since the Automake parallel test driver automatically
+       exports `srcdir' to a proper value, that prevented the bug from
+       manifesting itself.
+       * tests/Makefile.am ($(instspc_tests)): In the generated test
+       scripts, use `$testsrcdir', not `$srcdir'.
+
+2010-11-03  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       Overhauled and modularized tests in `instspc.test'.
+       The test `instspc.test' was way too big and fragile.  Its running
+       time was very long.  It also produced a log that was nearly
+       unreadable due to its length, making it very difficult to find
+       out the reason for failures.
+       Also, it was too much monolithic, with a single (maybe spurious)
+       failure in a corner case causing the whole test to fail (even if
+       everything worked as expected in the other 99% of cases).
+       The present change should solve these problems, by separating
+       `instspc.test' into many smaller, self-contained, auto-generated
+       tests.
+       * tests/instspc.test: Removed.
+       * tests/instspc-tests.sh: New script, fulfilling a double role:
+       1. it generates a Makefile.am snippet `tests/instspc-tests.am',
+       containing the definition of a list of new tests which will take
+       over the older `instspc.test', and
+       2. it is sourced by said generated tests with proper parameters
+       pre-set, to run the "meat" of the checks.
+       This apparent abuse is indeed required because the test generation
+       code and test execution code are inevitably intertwined.
+       * tests/Makefile.am ($(srcdir)/instspc-tests.am): Include this
+       snippet, which (among the other things) defines ...
+       (instspc_tests): ... this new macro, containing the list of the
+       newly generated `instspc*.test' tests, and ...
+       (instspc_xfail_tests): ... this new macro, containing the list
+       of the `instspc*.test' tests expected to fail.
+       ($(instspc_tests)): New rule, generates the `instspc*.test' tests.
+       ($(instspc_tests:.test=.log)): New rule, registers the dependency
+       of all `instspc*.test' tests on the `instspc-tests.sh' script.
+       (TESTS): Add `$(instspc_tests)', remove `instspc.test'.
+       (XFAIL_TESTS): Add `$(xfail_instspc_tests)'.
+       (EXTRA_DIST): Distribute instspc-tests.sh.
+       (MAINTAINERCLEANFILES): Added $(instspc_tests).
+       Other minor cosmetic changes.
+       * bootstrap: Generate instspc-tests.am.
+       * tests/.gitignore: Updated.
+
 2010-11-01  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
        Add FAQ entry for bug reporting instructions.
        * doc/automake.texi (Reporting Bugs): New section.
        (Introduction): Refer to it.
 
+2010-10-07  Peter Rosin  <peda@lysator.liu.se>
+
+       depcomp: add new one-pass depmode for MSVC 7 and later.
+       * lib/depcomp: Add new depmodes 'msvc7' and 'msvc7msys' which
+       make use of the -showIncludes option added in MSVC 7.
+       * m4/depend.m4 (_AM_DEPENDENCIES): Handle the new depmodes
+       similarly to 'msvisualcpp' and 'msvcmsys' as MSVC does not
+       support the -o option.
+
+2010-10-05  Jim Meyering  <meyering@redhat.com>
+
+       dist-xz, dist-bzip2: don't hard-code -9: honor envvar settings
+       * lib/am/distdir.am (dist-xz): Do not hard-code xz's -9: that
+       made it impossible to override.  Instead, use its XZ_OPT envvar,
+       defaulting to -9 if not defined.  Thus no change in behavior
+       when XZ_OPT is not set, and now, this rule honors the setting
+       of that envvar when it is set.  Suggested by Lasse Collin.
+       (dist-bzip2): Likewise for it's corresponding envvar: BZIP2.
+       * NEWS (Miscellaneous changes): Mention it.
+       * doc/automake.texi (The Types of Distributions): Describe the
+       newly enabled environment variables.
+
 2010-10-04  Stefano Lattarini  <stefano.lattarini@gmail.com>
 
        Add support for newer python versions.
        * tests/help3.test: Likewise, and fix a botched comment.
        * tests/help.test: Likewise.  Also, use "AUTOMAKE_fails ..."
        instead of "$AUTOMAKE ... && Exit 1", for consistency and to
-       please maintainet-check.
+       please maintainer-check.
        * tests/help2.test: Likewise.
 
 2010-10-03  Stefano Lattarini  <stefano.lattarini@gmail.com>
 
 2010-10-03  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
+       tests: fix ar-lib.test for echo that interprets backslashes.
+       * tests/ar-lib.test: Use printf instead of echo.  Avoid test -a.
+       More robust quoting.
+
+2010-10-03  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       maintainer-check coverage for variables before rules.
+       * Makefile.am (sc_ensure_testsuite_has_run): Suggest keeping
+       around the test directories.
+       (sc_tests_makefile_variable_order): New rule with a heuristic to
+       catch ordering violations.
+
        Document and fix expansion of variables before rules.
        * doc/automake.texi (General Operation): Document that variables
        are expanded before rules.
 
 2010-10-02  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
+       Coverage and minor fixes for variable typo detection.
+       * automake.in (check_typos): Remove `EXTRA_' prefix when
+       computing canonical name.
+       * tests/vartypo2.test, tests/vartypos.test: New tests.
+       * tests/Makefile.am (TESTS): Update.
+
+       Implement EXTRA_maude_DEPENDENCIES for programs and libraries.
+       * automake.in (handle_programs, handle_libraries)
+       (handle_ltlibraries): Mark EXTRA_*_DEPENDENCIES as recognized.
+       * doc/automake.texi (Linking, Program and Library Variables)
+       (LIBOBJS): Document EXTRA_*_DEPENDENCIES.
+       * lib/am/library.am (%LIBRARY%): Also depend on
+       $(EXTRA_%XLIBRARY%_DEPENDENCIES).
+       * lib/am/ltlibrary.am (%LTLIBRARY%): Also depend on
+       (%XLTLIBRARY%_DEPENDENCIES).
+       * lib/am/program.am (%PROGRAM%%EXEEXT%): Also depend on
+       $(EXTRA_%XPROGRAM%_DEPENDENCIES).
+       * tests/extradep.test, tests/extradep2.test: New tests.
+       * tests/Makefile.am (TESTS): Update.
+       * NEWS: Update.
+       Suggested by Eric Blake.
+
+       tests: avoid running into timing issues due to sanity change.
+       * tests/acloca10.test, tests/acloca18.test, tests/aclocal9.test:
+       Insert strategic sleep before aclocal reruns, to ensure files
+       are newer.
+       * tests/python11.test: Use --force for repeated autotools runs.
+       Reports from the NixOS Hydra build daemon via Ludovic Courtès.
+
+       Fix timestamp issues by ensuring configure takes at least a second.
+       * m4/sanity.m4 (AM_SANITY_CHECK): If we didn't sleep here,
+       start a sleep in the background and wait for it to finish
+       before creating config.status, hopefully fixing all spurious
+       testsuite failures involving botched time stamps.
+       * NEWS: Update.
+       Reports by Ludovic Courtès, Peter Breitenlohner, and others.
+
+2010-10-02  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
        Revert "parallel-tests: avoid command-line length limit issue."
        This reverts commit 24e3b4ee2f8cb9f72dd94a05a893f3d4e88b7835,
        because it re-opened the bug fixed by v1.11-10-g218e678.
        seems to have been removed, substituted by multiple release
        tarballs now).
 
+2010-09-21  Peter Rosin  <peda@lysator.liu.se>
+
+       compile: implement library search to support MSVC static linking
+       * lib/compile (func_cl_wrapper): Implement library search and
+       -static option so that the user can select whether to prefer
+       dll import libraries or static libraries.  This enables MSVC to
+       link against dlls generated by libtool without requiring libtool
+       or workarounds such as -lfoo.dll etc.  Makes the tests/static.at
+       test case in libtool pass.
+       * tests/compile3.test: Don't trip up if there happens to exist
+       a "foo" library in the library search path.
+       * tests/compile6.test: New test, verifying the library search.
+       * tests/Makefile.am (TESTS): Update.
+
 2010-09-17  Eric Blake  <eblake@redhat.com>
 
        Avoid triple-space after period.
        * tests/help-silent.test: Likewise.
        * tests/help-upc.test: Likewise.
        * tests/mmode.test: Remove tests on `configure --help' output,
-       they are supersed by tests in `help-maintainer.test'.
+       they are superseded by tests in `help-maintainer.test'.
        * tests/Makefile.am (TESTS): Update.
 
 2010-09-14  Stefano Lattarini  <stefano.lattarini@gmail.com>
 
        * HACKING: Hint at old commits with `git describe' output.
 
+2010-09-14  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       Prefer `$(am__cd)' to plain `cd' in our Makefiles.
+       * Makefile.am (recheck, dist-hook, git-dist, path-check, fetch)
+       (release-stats): Use `$(am__cd)' rather than plain `cd'.
+       * tests/Makefile.am ($(srcdir)/parallel-tests.am): Likewise.
+
 2010-09-12  Stefano Lattarini  <stefano.lattarini@gmail.com>
 
        Fix regression in test `colon4.test'.
        * tests/colon4.test: Fix botched editing to `configure.in'
        that made the test useless.  Since we are at it, improve
-       comments and make grepping of generated Makefile.in slighty
+       comments and make grepping of generated Makefile.in slightly
        stricter.
        Regression introduced by change "Modernize, improve and/or
        extend tests `colon*.test" (Stefano Lattarini, 2010-08-08).
        * tests/pr9.test: Likewise.
        From a suggestion by Ralf Wildenhues.
 
+2010-09-09  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       Use AS_HELP_STRING in AM_SILENT_RULES.
+       * m4/silent.m4 (AM_SILENT_RULES): Use `AS_HELP_STRING' to format
+       help message regarding configure options `--enable-silent-rules'
+       and `--disable-silent-rules'.  Also throw in a couple of cosmetic
+       changes in the related `case' statement (indentation, balancing
+       of parentheses).
+       * THANKS: Update.
+       From a report by Jeff A. Daily.
+
+2010-09-08  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
        Make some `confh*.test' tests more "semantic" (plus tweakings).
        * tests/confh.test: Run "autoconf", "configure" and "make check",
        instead of munging/grepping the generated `Makefile.in'.
        * tests/confh4.test: Relax the grepping of Makefile.in w.r.t.
-       white spaces.  Do not create usless dummy source file `foo.c'
+       white spaces.  Do not create useless dummy source file `foo.c'
        and useless dummy header file `acconfig.h'.
        (configure.in): Remove superfluous call to `AC_OUTPUT'.
        * tests/confh6.test: Add trailing `:' command.
        * tests/Makefile.am (TESTS): Updated.
        Prompted by a report from Ralf Wildenhues.
 
+2010-09-08  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
        Remove useless whitespace padding in XFAIL_TESTS definition.
        * tests/Makefile.am (XFAIL_TESTS): Remove whitespace padding.
 
        Posix 2008 requires make to set errexit.
        * lib/am/check.am: Update comment.
 
+2010-09-06  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       Tests defs: remove variable $testaclocaldir.
+       * tests/defs.in ($testaclocaldir): Removed.
+       * tests/aclocal.test: Use `$top_testsrcdir/m4' directly, not
+       `$testaclocaldir'.
+
+       Tests defs: $srcdir and $top_srcdir renaming.
+       * tests/defs.in ($srcdir): Remove, define $testsrcdir directly.
+       * tests/Makefile.am ($(parallel_tests)): Generation of derived
+       tests updated.
+
+       Tests defs: new variable $top_testsrcdir.
+       * tests/defs.in ($top_testsrcdir): Define unconditionally
+       to @abs_top_srcdir@.  Use it throughout.
+       * tests/ar-lib.test: Use `$top_testsrcdir' instead of
+       `$testsrcdir/..'.
+       * tests/auxdir.test: Likewise.
+       * tests/compile.test: Likewise.
+       * tests/compile2.test: Likewise.
+       * tests/compile3.test: Likewise.
+       * tests/compile5.test: Likewise.
+       * tests/mdate6.test: Likewise.
+       * tests/mkinst3.test: Likewise.
+       * tests/multlib.test: Likewise.
+       * tests/txinfo22.test: Likewise.
+
+       Tests defs: $srcdir is unconditionally substituted.
+       * tests/defs.in ($srcdir): Define unconditionally to @abs_srcdir@.
+       Remove code for $srcdir normalization, which is now useless.
+
+2010-09-02  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       Tests defs: make spacing more consistent.
+       * tests/defs.in: Make spacing more consistent in indentation.
+       Especially, indent using only spaces, not tabs.  Also, move
+       a comment to a better position.
+
+       Improve code for requiring libtool and gettext in tests.
+       * tests/defs.in: Stricter (and more correct) detection of wheter
+       libtool, libtoolize and/or gettext are in $required.
+
+
 2010-08-27  Stefano Lattarini  <stefano.lattarini@gmail.com>
 
        Fix bug in test missing6.test.
        that do not support $LINENO.  Also throw in a couple of cosmetic
        changes.
 
+2010-09-02  Peter Rosin  <peda@lysator.liu.se>
+
+       Make ar-lib support backslashed files in archives.
+       * lib/ar-lib: If an archive member contains a backslash, make sure
+       it is escaped when the archive member is extracted.
+       * tests/ar-lib.test: Test the above.
+
+2010-08-31  Peter Rosin  <peda@lysator.liu.se>
+
+       Do file name conversion for object files in the compile wrapper.
+       * lib/compile (func_cl_wrapper): Do file name conversion for object
+       files (i.e. extensions .obj, .OBJ, .o and .O) if needed.
+       * tests/compile4.test: Test the above.
+
 2010-08-21  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
+       Speed up removal of auxiliary linker output files for ltlibraries.
+       * lib/am/ltlib.am (clean-%DIR%LTLIBRARIES): Rewrite using just
+       one `rm' invocation.
+       Report by Bob Friesenhahn.
+
        Improve robustness of mdate-sh script.
        * lib/mdate-sh: Sanitize zsh behavior on startup, to ensure
        $ls_command is word-split properly upon invocation.
        Don't hide the table of contents.
        * doc/automake.texi: Move the table of contents to the beginning.
 
+2010-08-16  Peter Rosin  <peda@lysator.liu.se>
+
+       Optimize compile script on MSYS.
+       * lib/compile (func_file_conv): Add new argument 'lazy' which
+       takes an optional list of conversion types where the requested
+       conversion isn't needed.
+       (func_cl_wrapper): Take advantage of the above for cases where
+       MSYS is doing the conversion for us.
+       Suggested by Ralf Wildenhues.
+
+2010-08-16  Peter Rosin  <peda@lysator.liu.se>
+
+       Support more C++ file extensions for MSVC in the compile script.
+       * lib/compile (func_cl_wrapper): MSVC only recognizes the .cpp
+       file extension as C++, unless it's given a hint. So hint about
+       .cc, .CC, .cxx, .CXX, c++ and C++. Also do path conversion on
+       .c, .cpp, .CPP, .lib, .LIB and .Lib files.
+       * tests/compile3.test: Test the C++ hinting.
+
+2010-08-12  Peter Rosin  <peda@lysator.liu.se>
+
+       Enable the use of "link -lib" as the wrapped archiver.
+       * lib/ar-lib: Enable the use of "link -lib" as the wrapped
+       archiver, as well as allowing some other options to be passed
+       through to the wrapped archiver.
+       * tests/ar-lib.test: Test the above.
+
 2010-08-10  Stefano Lattarini  <stefano.lattarini@gmail.com>
 
        Tweak and/or extend some `acloca*.test' tests.
        `$me' over hard-coded test name.
        * tests/aclocal6.test: Likewise.
        * tests/aclocal18.test: Add trailing `:' command, and make
-       some grepping slighty stricter.
+       some grepping slightly stricter.
        * tests/acloca14.test: Likewise.  Also, prefer `diff' over
        `cmp', and add some "cosmetic" blank lines.
 
        README, NEWS), since we run automake in foreign mode anyway.
        * tests/pr72.test: Enable `errexit' shell flags, and related
        changes.  Extend existing checks a bit.
-       * tests/pr9.test: Likewise.  Also, avoid obolescent constructs in
+       * tests/pr9.test: Likewise.  Also, avoid obsolescent constructs in
        the generated `configure.in', and extend existing checks over the
        generated tarball a bit.
        * tests/pr87.test: Enable `errexit' shell flags, and related
        changes.  Add a trailing `:' command.  Also, do not create dummy
        files required by "gnu" mode (e.g. README, NEWS), since we run
        automake in foreign mode anyway.
-       * tests/pr243.test: Avoid obolescent constructs in the generated
+       * tests/pr243.test: Avoid obsolescent constructs in the generated
        `configure.in'.  Enable the `errexit' shell flag, and related
        changes.  Cosmetic changes to spacing, add trailing `:' command,
        and add a "FIXME" comment.
        * tests/pr266.test: Likewise, and add explicit command line switch
        `--enable-dependecy-tracking' to the ./configure call.
-       * tests/pr279.test: Avoid obolescent constructs in the generated
+       * tests/pr279.test: Avoid obsolescent constructs in the generated
        `configure.in'; also, use the `configure.in' stub created by
        ./defs, rather than writing it from scratch.  Enable `errexit'
        shell flag, and related changes.  Add trailing `:' command.
        * tests/confvar.test: Likewise, and make grepping of Makefile.in
        stricter.
        * tests/confvar2.test: Likewise.
-       * tests/conflnk3.test: Cosmetic changes, and re-enable a temporarly
+       * tests/conflnk3.test: Cosmetic changes.  Re-enable a temporarily
        disabled test (which didn't work with autoconf <= 2.59, but now we
        are requiring autoconf 2.62, so...)
        * tests/conflnk4.test: Cosmetic changes, and extend existing tests
        * tests/depcomp.test: Do not create useless dummy source files.
        Add a trailing `:' command.
        * tests/depcomp2.test: Use `unset' on the CFLAG variable to ensure
-       it's not in in the environment, rather tthan exporting it with an
+       it's not in in the environment, rather than exporting it with an
        empty value.  Do not pass CC=gcc to configure, as that's already
        done in ./defs since we have gcc in $required.  Ensure verbose
        printing of captured stderr, and normalize its checking.  Add a
        and dollar characters in grep regexps.  Explicitly declare phony
        targets as such in the created Makefile.am.  Add a trailing `:'
        command.
-       * tests/depcomp6.test: Consistenty use m4 quoting in the generated
+       * tests/depcomp6.test: Consistently use m4 quoting in the generated
        configure.in.  Cosmetic fixes to spacing.  Make the "dummy" `if'
        statement required by OpenBSD's sh `set -e' more robust, and add
        explanatory comments to it.
        * tests/subobj9.test: Move setting of `errexit' shell flag earlier
        in the script (just after inclusion of ./defs).  Fail the test if
        `make distcheck' fails.  Ensure verbose printing of captured make
-       stdout.  Avoid uselsss fork by doing simple grep instead of using
+       stdout.  Avoid useless fork by doing simple grep instead of using
        test -n "`COMMAND | grep ...`".
        (configure.in): Normalize the call to AC_INIT w.r.t. other tests.
        (Makefile.am): Explicitly mark target "print" as phony.
        * tests/ar2.test: Likewise, and make grepping of generated
        Makefile.in stricter.
 
+2010-08-06  Peter Rosin  <peda@lysator.liu.se>
+
+       Add new auxiliary 'ar-lib' script, wrapping Microsoft lib.
+       * lib/ar-lib: New auxiliary script.
+       * lib/Makefile.am: Add above.
+       * tests/ar-lib.test: New test.
+       * tests/Makefile.am: Add above.
+       * automake.in (@common_files): Distribute the 'ar-lib' script.
+       * doc/automake.texi (Auxiliary Programs): Mention the new
+       'ar-lib' script.
+       (Optional): Mention 'ar-lib' in AC_CONFIG_AUX_DIR.
+       * NEWS: Update.
+
+2010-08-07  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       Fix shell pattern negation in compile script.
+       * lib/compile (func_file_conv): Use `!' not `^' for pattern
+       negation.
+
 2010-08-08  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
        Fix maintainer-check failure.
        * tests/cond5.test: Add delay before the first kill attempt to
        cater for problems with MSYS bash.
 
+2010-08-01  Peter Rosin  <peda@lysator.liu.se>
+
+       Wrap some MSVC options in the compile script.
+       * lib/compile: MSVC supports naming the output file, the option
+       is just not called -o, so transform -o into the appropriate form
+       for MSVC. Also wrap some other options while at it (-L, -l, -Wl,
+       -Xlinker and -I) and convert file names to windows form where
+       needed for those options to make MSVC more usable in an
+       autotooled environment.
+       * doc/automake.texi (Auxiliary Programs): Document the above
+       extension of the compile script.
+       * NEWS: Updated.
+       * tests/defs.in: New required entry 'cl'.
+       * tests/compile3.test: New test.
+       * tests/compile4.test: New test.
+       * tests/compile5.test: New test.
+       * tests/Makefile.am: Update.
+
 2010-07-31  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
        Add example git work flow; discuss merge --log in HACKING.
        source file.
        * tests/suffix7.test: Likewise.
        * tests/suffix5.test: Enable `errexit' shell flag, and related
-       changes.  Make grepping of Makefile.in slighty stricter.
+       changes.  Make grepping of Makefile.in slightly stricter.
        * tests/suffix.test: Enable `errexit' shell flag, and related
        changes.  Also, do not redirect grep output to /dev/null, as this
        might unmotivatedly hide useful information.
        $FGREP rather than plain grep.
        * tests/suffix11.test: Likewise.
        * tests/suffix12.test: Likewise.
-       * tests/suffix9.test: Prefet cat + here-doc over echo to append to
+       * tests/suffix9.test: Prefer cat + here-doc over echo to append to
        the `configure.in' stub.  Cosmetic changes.
        * tests/suffix13.test: Cosmetic spacing change.
 
        * tests/ext.test: Add a comment explaining why an apparently
        useless `if' statement is indeed required.
 
+2010-06-13  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
        Add useful comment in test script obsolete.test.
-       * tests/obsolte.test: Add a comment explaining why we need
+       * tests/obsolete.test: Add a comment explaining why we need
        an indirection in adding $AUTOUPDATE to $required.
 
        Normalize whitespaces in 'tests/Makefile.am'.
        * tests/Makefile.am (TESTS): Use only spaces, not tabs, in the
        definition of this variable.
 
+       Parallel tests generation: improve comments (tiny change).
+       * tests/Makefile.am ($(parallel_tests)): Added useful comment to
+       generated tests.
+
+       Tests defs: truly get rid of `$am_defs_included' (unused variable)
+        * tests/defs.in ($am_defs_included): Remove, its now unused.  It
+       should have been removed in a previous changeset, but the removal
+       was done only partially (oversight).
+
 2010-06-12  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
        Remove a couple of unneeded conditionals from tests.
        changes, and a couple of unrelated cosmetic changes.
        * tests/recurs.test: Use the `configure.in' stub created by
        `./defs', rather than writing one from scratch.  Make grepping
-       of Automake stderr slighty stricter.
+       of Automake stderr slightly stricter.
        * tests/substtarg.test: Likewise.
        * tests/strip.test: Likewise, and move the call to `set -e'
        earlier (just after the inclusion of `./defs'). Also, make sure
        in ./defs).  Avoid potential problems with unpredictable make
        output.  Finally, make grepping of Makefile.in stricter.
        * tests/substre2.test: Ensure verbose printing of the captured
-       make's output, and make its grepping slighty stricter.
+       make's output, and make its grepping slightly stricter.
        * tests/cygwin32.test: Enable `errexit' shell flag, and related
        changes.  Also, do not create useless dummy source/data files.
        * tests/scripts.test: Likewise.
        here-doc, not using echo.
        * tests/pluseq10.test: Make sure that the captured output of
        `make' command is always displayed. Where possible, use $FGREP
-       instead of grep (this change makes some checks slighty stricter).
+       instead of grep (this change makes some checks slightly stricter).
        * tests/pluseq8.test: Enable `errexit' shell flag, with related
        changes.
        * tests/pluseq.test: Likewise.  Also, do not create useless dummy
        * tests/pluseq4.test: Likewise.
        * tests/pluseq6.test: Likewise.
        * tests/pluseq7.test: Do not create useless dummy source file.
-       * tests/pluseq9.test: Slighty extended w.r.t. the grepping of
+       * tests/pluseq9.test: Slightly extended w.r.t. the grepping of
        Automake stderr.  Some unrelated cosmetic changes.
 
+2010-06-12  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       cscope.test: ensure verbose printing of captured stderr.
+       * tests/cscope.test: Print captured stderr before failing.
+
+2010-06-12  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
        Testsuite: ensure verbose printing of captured stderr.
        * tests/acloca18.test: Print captured stderr before either failing
        or grepping it.  Be sure to send captured stderr to stderr, not to
 2010-06-11  Stefano Lattarini  <stefano.lattarini@gmail.com>
 
        Improve determination of PATH separator in bootstrap script.
-       * bootstrap: Detemine what the PATH separator is the same way
+       * bootstrap: Determine what the PATH separator is the same way
        autoconf does.
 
        Minor improvements in bootstrap script.
        $AUTOMAKE, and improve the positioning of an $ACLOCAL call.
        * tests/exeext4.test: Use $FGREP instead of grep, where possible.
        Make auxiliary rules in the generated Makefile more silent.
-       These changes make some checks slighty stricter.
+       These changes make some checks slightly stricter.
        * tests/ext2.test: Call `Exit 1' if inclusion of `./defs' fails.
        * tests/gettext2.test: Place final `:' at the end of the script,
        rather than in the middle.
        * tests/python2.test: Improved verbose messages.
 
        Make test `ammissing.test' stricter.
-       * tests/ammissing.test: Fail if $ACLOCAL succeds unexpectedly.
+       * tests/ammissing.test: Fail if $ACLOCAL succeeds unexpectedly.
        Enable `errexit' shell flag.
 
 2010-06-08  Stefano Lattarini  <stefano.lattarini@gmail.com>
+           Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       Fix error in generation of parallel tests.
+       * tests/defs.in ($am_skip_defs): New variable, to be used when
+       ./defs must be sourced multiple times.  If set, unset it and
+       only define $srcdir; otherwise, also go through the rest of
+       the script.
+       ($am_defs_included): Remove, no more needed.
+       * tests/Makefile.am ($(parallel_tests)): Update accordingly,
+       using only $srcdir from defs.
+       Fixes potential test failures of tests that use $required.
+
+2010-06-08  Stefano Lattarini  <stefano.lattarini@gmail.com>
 
        Enable `errexit' shell flag in some test scripts.
        * tests/subcond.test: Enabled `errexit' shell flag, and related
        * tests/version2.test: Likewise, and avoid deprecated constructs
        in the generated `configure.in'.
 
+2010-06-07  Stefano Lattarini  <stefano.lattarini@gmail.com>
+           Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       Improve declaration of dependencies in the testsuite.
+       * tests/Makefile.am (check_SCRIPTS): Remove.  Instead, let ...
+       ($(TEST_LOGS)): ... all test logs depend on the scripts.
+       * test/gen-parallel-tests: For each parallel test foo-p.test,
+       let `foo-p.log' also depend on `foo.test', since it is sourced.
+
+2010-06-06  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       Coverage for TAGS_DEPENDENCIES warning.
+       * tests/tags2.test: New test.
+       * tests/Makefile.am: Update.
+
+       Coverage for use of anachronistic variables.
+       * tests/oldvars.test: New test.
+       * tests/Makefile.am: Update.
+
+       Testsuite coverage for bogus macro file serial numbers.
+       * tests/acloca18.test: Also test ill-formed serial numbers
+       and serial numbers after macro definitions.
+
+       Coverage for aclocal diagnosing underquoted macros.
+       * tests/acloca23.test: New test.
+       * tests/Makefile.am: Update.
+
 2010-06-06  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
        Prefer AUTOMAKE_fails over `$AUTOMAKE | grep' in tests.
        * tests/mdate.test: Likewise.
        Prompted by Stefano Lattarini's change to discover.test.
 
+2010-06-06  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       More minor message fixes.
+       * aclocal.in (scan_file): Fix recommended info command line.
+       * automake.in (handle_lib_objects): No need to prepend function
+       name to prog_error message.
+       (handle_tags): Add missing word and missing space in error
+       message.
+       (handle_dist): Add missing closing single quote in message.
+       Line-wrap one long message for readability.
+
+2010-06-06  Stefano Lattarini  <stefano.lattarini@gmail.com>
+           Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       Fix distcheck failure with distributed generated parallel tests.
+       * tests/Makefile.am ($(parallel_tests)): Cope with $(srcdir)
+       being different from the value at developer `make dist' time.
+       * tests/defs.in: Protect against mutiple inclusion, by using ...
+       ($am_defs_included): ... this new variable.
+       ($srcdir): Do not compute, but simply define to `@abs_srcdir@'
+       as substituted by configure.
+       Report, suggestions and first fix by Ralf Wildenhues, final
+       patch by Stefano Lattarini.
+
 2010-06-06  Stefano Lattarini  <stefano.lattarini@gmail.com>
 
        Improve tests link*.test (enable `errexit' shell flag).
        * tests/nodep.test: Likewise.
        * tests/nodepcomp.test: Likewise.
        * tests/f90only.test: Likewise, and remove botched/obsoleted
-       comments and unecessary commands.
+       comments and unnecessary commands.
        * tests/fonly.test: Likewise, and remove botched/obsoleted
-       comments and unecessary commands.
+       comments and unnecessary commands.
        * tests/discover.test: Likewise, and made stricter.
 
        Enable `errexit' shell flag in all tests cxx*.test.
 
 2010-06-06  Stefano Lattarini  <stefano.lattarini@gmail.com>
 
+       Tiny fix in silent8.test (display output of `make' command).
+       * tests/silent8.test: Make sure that the captured output of `make'
+       command is always displayed.
+
        Make tests on user extensibility of silent-rules mode stricter.
        * tests/silent6.test: Made stricter w.r.t. the grepping of the
        output produced by `make'.
        * tests/silent5.test: Likewise.
        * tests/silent9.test: Likewise.
 
-2010-01-24  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
-
-       Fix silent-rules output for disabled dependency tracking.
-       * lib/am/depend2.am [!%FASTDEP%]: Rework silent-rules variable
-       expansion code to also work in the case where %AMDEP% expands
-       to FALSE at config.status time, using new substitution string
-       %VERBOSE-NODEP%.
-       * automake.in (verbose_nodep_flag): New function, appending
-       `@am__nodep@' to the verbose-variable name.
-       (handle_languages): If dependencies are not disabled, use it to
-       set %VERBOSE-NODEP%.
-       * m4/depend.m4: Substitute am__nodep as '_no', so the second
-       verbose-variable will always expand to an empty string, if
-       dependencies are enabled.
-       * tests/silent5.test: Also test --disable-dependency-tracking;
-       also test per-target flags for non-C language files.
-       * tests/silent9.test: New test, like silent4.test but disable
-       dependency tracking.
-       * tests/Makefile.am: Adjust.
-       * NEWS, THANKS: Update.
-       Report by Dmitry V. Levin <ldv@altlinux.org>.
-
 2010-05-23  Stefano Lattarini  <stefano.lattarini@gmail.com>
 
        Extend test on `nostdinc' automake option.
        * tests/nostdinc.test: Enable `errexit' shell flag.  Related and
        unrelated minor changes.  Make the grepping of the generated
-       Makefile.in slighty stricter.  Generate and run configure, so that
+       Makefile.in slightly stricter.  Generate and run configure, so that
        the generated Makefile can be grepped too.
 
 2010-05-23  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
 2010-05-23  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
+       Fix truncated comment in Makefile.am.
+       * Makefile.am (sc_tests_logs_duplicate_prefixes): Fix unfinished
+       sentence in comment.
+       Report by Stefano Lattarini.
+
+       Relax silent8.test for NetBSD make.
+       * tests/silent8.test: Accept ./foo.info in output as well.
+
        Fix unportable sed script in maintainer-check test.
        * Makefile.am (sc_tests_Exit_not_exit): Rewrite sed script to
        not contain semicolon after 'b' or brace commands, for NetBSD.
 
 2010-04-25  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
+       Warning and error message formatting cleanups.
+       * aclocal.in (parse_arguments, main): Remove trailing period or
+       newline in error or warning messages, avoid capitalization of
+       the first word of a message.
+       * automake.in (check_user_variables, handle_languages)
+       (handle_ltlibraries, scan_aclocal_m4, scan_autoconf_config_files)
+       (scan_autoconf_files, cond_stack_if, require_file_internal)
+       (usage, generate_makefile, parse_arguments): Likewise.
+       * lib/Automake/ChannelDefs.pm (set_strictness): Likewise.
+       * lib/Automake/Configure_ac.pm (find_configure_ac): Likewise.
+       * lib/Automake/Options.pm (set_strictness): Likewise.
+       * lib/Automake/Rule.pm (define): Likewise.
+       * lib/Automake/Variable.pm (define, variables_dump): Likewise.
+       * tests/ltinstloc.test, tests/suffix11.test: Adjust expected
+       error message.
+       * lib/Automake/Channels.pm (setup_channel): Reword error message
+       to be the same as in msg.
+
+       Fix placing of ellipses in English text and synopses.
+       * Makefile.am: Be sure to add a space before `...' in natural
+       language text.
+       * automake.in (scan_autoconf_traces): Likewise.
+       * lib/Automake/Rule.pm (define): Likewise.
+       * lib/Automake/Variable.pm (define): Likewise.
+       * lib/am/dejagnu.am: Likewise.
+       * lib/am/progs.am: Likewise.
+       * lib/gnupload (dprint, upload): Likewise.
+       * tests/confdeps.test: Likewise.
+       * tests/location.test: Adjust expected output.
+       * automake.in (usage): In synopsis, use singular for OPTION,
+       * remove space before ellipsis.
+       * aclocal.in (usage): Likewise.  Also, fix indentation.
+
+       Fix more duplicate message prefixes.
+       * lib/Automake/XFile.pm (seek): Do not prepend $me.
+       ($me): Remove now-unused package-global.
+       * aclocal.in (check_acinclude): Remove duplicate 'warning: '
+       prefix.
+
        Fix typo in manual.
        * doc/automake.texi (Simple Tests using parallel-tests): Add
        missing closing parenthesis.
        * automake.in (read_main_am_file): Call variables_dump, not
        macros_dump.  Print actual error before list of variables.
 
-2010-04-25  Stefano Lattarini  <stefano.lattarini@gmail.com>
+2010-04-22  Stefano Lattarini  <stefano.lattarini@gmail.com>
 
        Minor improvements in comments of test `silent3.test'.
        * tests/silent3.test: Tell to keep it in sync with `silent9.test'
 
 2010-04-11  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
+       Print 'warnings are treated as errors' note if needed.
+       * lib/Automake/Channels.pm: Fix typo in comment.
+       (_print_message): If -Werror is enabled, print a 'warnings are
+       treated as errors' note before the first such warning.
+       * tests/warnopts.test: Adjust comment to mention expected warning.
+       Adjust code to ignore 'warnings are treated as errors' note.
+       * tests/location.test: Adjust expected output with -Werror.
+       * tests/werror4.test: New test.
+       * tests/Makefile.am: Update.
+       * NEWS: Update.
+
+       Ensure we don't print 'warning:' or 'error:' twice.
+       * Makefile.am (sc_ensure_testsuite_has_run): New helper rule.
+       (sc_tests_logs_duplicate_prefixes): New rule, to check for
+       wrong-looking warning and error messages in the test suite logs.
+       * aclocal.in (scan_configure_dep, scan_file): Remove duplicate
+       `warning: ' prefix.
+       * tests/vars3.test: Rename variable to avoid false positive.
+
+       Prepend type to warning, error, and fatal messages.
+       For the first part of messages of types `error' or `fatal',
+       prepend `error: ' to the message.  Prepend `warning: ' to
+       warning messages, whatever the setting of -Werror.
+       * lib/Automake/Channels.pm (partial): Move up definition.
+       (_format_message): Emit `header' and `footer' strings only with
+       the first resp. last part of a set of partial messages.
+       * lib/Automake/ChannelDefs.pm: Add missing '1;' statement at the
+       end of the module.
+       (Automake::ChannelDefs): Setup warning channels with header
+       `warning: ', error and fatal messages with header `error: '.
+       * tests/condinc2.test, tests/ltinstloc.test: Adjust expected
+       error messages.
+       * tests/comment5.test: Likewise.  Also, include stack notes
+       should not start with `error:'.
+       * tests/location.test: Likewise.  Also, try both -Werror and
+       -Wno-error.
+       * NEWS: Update.
+       Report by Bruno Haible.
+
+       Fix capitalization of error messages, reword one message.
+       * lib/Automake/Variable.pm (define): Do not capitalize the first
+       word in the error message.
+       * automake.in (require_file_internal): Likewise.  Also, reword
+       and line-wrap for better readability.
+       * tests/distcom7.test, tests/pluseq5.test, tests/pluseq9.test:
+       Adjust tests.
+
+       Fix connected warnings about obsolete exeext override.
+       * lib/Automake/Rule.pm (define): Merge two warnings that belong
+       together, by setting the 'partial' flag for the first one.
+
        Fix per-Makefile.am setting of -Werror.
        Before this patch, 'AUTOMAKE_OPTIONS = -Werror' in one
        Makefile.am would carry over to other Makefile.am files
        * NEWS, THANKS: Update.
        Report by Pavel Sanda.
 
+2010-04-11  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       Avoid possible false negatives in cond46.test.
+       * tests/cond46.test: Enable shell `errexit' flag (and bumped
+       copyright years).  Due to this change, the testcase should now
+       fail on unexpected failures in calls to $ACLOCAL/$AUTOMAKE (whose
+       outcomes were previously unchecked), and on failures in grepping
+       the expected diagnostic in Automake stderr.
+
+2010-04-04  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       Generated tests are now just a thin layer around other tests.
+       * tests/Makefile.am: Rewrite the rule to generate the `*-p.test'
+       test scripts so that any of them simply includes the corresponding
+       `*.test' script (after setting `$parallel_tests' to `yes').
+       * tests/.gitignore: Add wildcard for temporary files used in the
+       generation of `*-p.test' tests.
+
 2010-03-30  Stefano Lattarini  <stefano.lattarini@gmail.com>
 
        Avoid an unportable use of `$status' shell variable.
        * tests/parallel-tests6.test: Likewise.
        * tests/parallel-tests7.test: Likewise.
 
+2010-03-01  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       Fix cscope test on systems without working Fortran compiler.
+       * tests/cscope.test: Skip remainder of test if `$MAKE all' fails.
+       * THANKS: Update.
+       Report by Peter Johansson.
+
+2010-02-24  Antonio Diaz Diaz  <ant_diaz@teleline.es>  (tiny change)
+           Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       Add lzip compression support.
+       * automake.in (handle_dist): Recognize dist-lzip.
+       (make_paragraphs): Map LZIP to dist-lzip.
+       * doc/automake.texi (Dist): Add dist-lzip.
+       (Options): Likewise.
+       * lib/Automake/Options.pm (_process_option_list): Add dist-lzip.
+       * lib/am/distdir.am
+       (dist dist-all): Add command to create an lzip-compressed tarball.
+       (distcheck): Handle lzip-compressed tarballs just like the others.
+       * tests/defs.in: Test for lzip, too.
+       * tests/lzip.test: New file, based on nogzip.test.
+       * tests/Makefile.am (TESTS): Add lzip.test.
+       * NEWS: Update.
+
 2010-02-22  Karl Berry  <karl@gnu.org>
 
        Improve help message of mdate-sh.
        Fix some typos in the manual
        * doc/automake.texi (Nested Packages, Rebuilding): Fix typos.
 
+2010-01-24  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       Fix silent-rules output for disabled dependency tracking.
+       * lib/am/depend2.am [!%FASTDEP%]: Rework silent-rules variable
+       expansion code to also work in the case where %AMDEP% expands
+       to FALSE at config.status time, using new substitution string
+       %VERBOSE-NODEP%.
+       * automake.in (verbose_nodep_flag): New function, appending
+       `@am__nodep@' to the verbose-variable name.
+       (handle_languages): If dependencies are not disabled, use it to
+       set %VERBOSE-NODEP%.
+       * m4/depend.m4: Substitute am__nodep as '_no', so the second
+       verbose-variable will always expand to an empty string, if
+       dependencies are enabled.
+       * tests/silent5.test: Also test --disable-dependency-tracking;
+       also test per-target flags for non-C language files.
+       * tests/silent9.test: New test, like silent4.test but disable
+       dependency tracking.
+       * tests/Makefile.am: Adjust.
+       * NEWS, THANKS: Update.
+       Report by Dmitry V. Levin <ldv@altlinux.org>.
+
 2010-01-17  Stefano Lattarini  <stefano.lattarini@gmail.com>
 
        Slighty improve tests acoutbs.test and acoutbs2.test.
index 063c06b..7b07c36 100644 (file)
        * lib/gnupload: Mention ncftpput in `--help' output.
        Report by Bruce Korb.
 
+2009-12-06  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       * NEWS: Update.
+
 2009-12-05  Antonio Diaz Diaz  <ant_diaz@teleline.es>
 
        Replace unlzma, gunzip, bunzip2 with pack tool -d invocation.
        current directory.  Use it instead of `pwd` command substitution,
        to avoid Heirloom/Solaris Sh bug with `set -e'.
 
+2009-12-05  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       Fix requirements of silent8.test.
+       * tests/silent8.test: Require makeinfo --html, tex, texi2dvi -o,
+       dvips.
+
+2009-12-04  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       File `automake.in' is not meant to be executed (only to be
+       preprocessed into `automake'), so don't leave it executable.
+       * automake.in: Remove executable bit.
+
+2009-12-04  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       Don't make the generated Automake's Config.pm executable.
+       * lib/Automake/Makefile.am (Config.pm): Don't make the generated
+       `Config.pm' file executable.
+
 2009-11-28  Jim Meyering  <meyering@redhat.com>
 
        do not put world-writable directories in distribution tarballs
        * Makefile.am (EXTRA_DIST): Add bootstrap.
        Report by Jan Engelhardt.
 
+2009-11-14  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       Coverage for corner cases in derive_suffix.
+       Ensure unrelatex SUFFIXES entries and unrelated inference rules
+       are ignored silently.
+       * tests/ext3.test: New test.
+       * tests/Makefile.am: Update.
+
+       Coverage for user-provided _LINK variables.
+       * tests/link_override.test: New test.
+       * tests/Makefile.am: Adjust.
+
+       Coverage: warn about substitutions that need EXTRA_PRIMARY.
+       * tests/extra9.test: New test.
+       * tests/Makefile.am: Adjust.
+
+       Coverage: warn about configure substitution in EXTRA_PRIMARY.
+       * tests/subst5.test: New test.
+       * tests/Makefile.am: Update.
+
+       Coverage for syntax errors with conditionals in included fragments.
+       * tests/condinc2.test: Amend test.
+
+       Coverage: diagnose variables with forbidden dist_ prefix.
+       * tests/candist.test: New test.
+       * tests/Makefile.am: Update.
+
+       Coverage for conditional `else' and `endif' arguments.
+       * tests/cond46.test: New test.
+       * tests/Makefile.am: Update.
+
 2009-10-31  Jim Meyering  <meyering@redhat.com>
            Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
        * tests/subdir10.test: New test.
        * tests/Makefile.am: Update.
 
+2009-10-18  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       Simplify Variable::_check_ambiguous_condition.
+       * lib/Automake/Variable.pm (_check_ambiguous_condition): No need
+       to check for $def since ambiguous_p returns an empty $message if
+       there is no other condition which is ambiguous to $cond.
+
+       Coverage for DisjConditions.pm.
+       * lib/Automake/tests/DisjConditions.pl (test_basics): Increase
+       test coverage: test ->human, ->merge, ->simplify, ->multiply.
+       * lib/Automake/tests/DisjConditions-t.pl (test_basics): Likewise
+       changes, but including state copies across thread creation.
+       * lib/Automake/tests/DisjCon2.pl: New test.
+       * lib/Automake/tests/DisjCon3.pl: Likewise.
+       * lib/Automake/tests/Makefile.am (TESTS, XFAIL_TESTS): Adjust.
+
+       Coverage and fixes for Condition.pm.
+       * lib/Automake/Condition.pm (new): Catch common programming
+       errors better by checking type of passed argument before
+       munging them to all be strings through split.
+       * lib/Automake/tests/Condition.pl (test_basics): Also test
+       ->human.
+       (test_merge): New function, test ->merge, ->merge_conds,
+       ->strip.
+       * lib/Automake/tests/Condition-t.pl (test_basics, test_merge):
+       Likewise changes, but including state copies across thread
+       creation.
+       * lib/Automake/tests/Cond2.pl: New test for programming error.
+       * lib/Automake/tests/Cond3.pl: Likewise.
+       * lib/Automake/tests/Makefile.am (TESTS, XFAIL_TESTS): Update.
+
+       Coverage for Wrap.pm.
+       * lib/Automake/tests/Wrap.pl (@tests): Add test for word with
+       trailing space.
+       (test_makefile_wrap, @makefile_tests): New function, new list of
+       tests, to test makefile_wrap.
+
+       Coverage for Version.pm.
+       * lib/Automake/tests/Version.pl (test_version_compare): Also
+       try Automake::Version::check for the version pairs, taking into
+       account the special-case naming of code forks.
+       (@tests): Add more test cases.
+       (test_bad_versions, @bad_versions): New function, new test cases,
+       to ensure bad version strings are rejected.
+       * lib/Automake/tests/Version2.pl: New test.
+       * lib/Automake/tests/Version3.pl: Likewise.
+       * lib/Automake/tests/Makefile.am (TESTS): Add tests here ...
+       (XFAIL_TESTS): ... and here, new.
+
+       Pod coverage for Perl modules.
+       * lib/Automake/ChannelDefs.pm (parse_warnings): Fix
+       typo in Pod documentation.
+       * lib/Automake/Condition.pm: Add a couple of missing `=back'
+       lines.
+       (_has): Renamed from ...
+       (has): ... this, as this is an internal method.
+       (strip, false, true_when): Adjust callers.
+       * lib/Automake/Configure_ac.pm: Add Pod `Functions' section with
+       documentation for find_configure_ac and require_configure_ac.
+       * lib/Automake/Location.pm: Fix typo in Pod.  Add `Methods'
+       section, document methods.
+       * lib/Automake/RuleDef.pm: New `Methods' Pod section.
+       * lib/Automake/VarDef.pm: Document `raw_value'.
+       * lib/Automake/Wrap.pm (_tab_length): Rename from ...
+       (tab_length): ... this, as this is an internal method.
+       (wrap): Adjust callers.
+       * lib/Automake/XFile.pm: Reorganize Pod a bit, add `Methods'
+       section.
+
 2009-10-17  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
+       Perl coverage support using Devel::Cover.
+       This introduces makefile rules to run the testsuite with Perl
+       coverage enabled.  It skips tests that use perl ithreads, by
+       unsetting AUTOMAKE_JOBS and setting WANT_NO_THREADS to make the
+       threaded tests skip.
+       * Makefile.am (PERL_COVERAGE_DB, PERL_COVERAGE_FLAGS)
+       (PERL_COVER): New variables.
+       (check-coverage, recheck-coverage, clean-coverage): New phony
+       targets.
+       (check-coverage-run, recheck-coverage-run): New phony helper
+       targets.
+       (clean-local): New, depend on clean-coverage.
+       * lib/Automake/tests/Condition-t.pl: Skip if WANT_NO_THREADS is
+       set.
+       * lib/Automake/tests/DisjConditions-t.pl: Likewise.
+       * tests/defs.in: New required entry 'perl-threads'.
+       * tests/parallel-am.test: Use it to skip if WANT_NO_THREADS is
+       set.
+       * tests/parallel-am2.test: Likewise.
+       * tests/parallel-am3.test: Likewise.
+
+       Add convenience `recheck' target to our toplevel Makefile.am.
+       * Makefile.am (recheck): New convenience target.
+       * tests/README: Give examples for running only failed or
+       outdated or otherwise selected tests.
+
+       dist: allow running several compressors in parallel.
+       * lib/am/distdir.am (am__post_remove_distdir): New internal
+       variable.
+       (DIST_TARGETS): New variable, set to list of chosen distribution
+       formats.  Order formats by expected duration, slowest first, for
+       better parallelism.
+       (dist-gzip, dist-bzip2, dist-lzma, dist-xz, dist-tarZ)
+       (dist-shar, dist-zip): Use $(am__post_remove_distdir).
+       (dist, dist-all): Do not depend on distdir.  Instead of
+       replicating each compression command, use a recursive invocation
+       to allow running all $(DIST_TARGETS) in parallel.
+       * NEWS: Update.
+       Report by Peter Breitenlohner.
+
+       Fix license headers of cscope tests to be GPLv2+.
+       * tests/cscope.test: Revert to GPL version 2.
+       * tests/cscope2.test: Likewise.
+       * tests/cscope3.test: Likewise.
+
        Sync auxiliary files from upstream.
        * INSTALL, lib/INSTALL, lib/config.guess, lib/config.sub,
        lib/texinfo.tex: Sync from upstream.
        `--no-function-argzero', since the latter does not work with
        versions 3.x of Zsh.
 
+2009-09-26  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       Fixups and tests for cscope functionality.
+       It seems cscope is not able to take into account relative
+       file names of included cscope.files files, but it is able to
+       canonicalize file names containing '../' sequences.
+       This patch makes the cscope references relative again, and
+       fixes some corner cases.
+       * NEWS: Reword a bit.
+       * THANKS: Update.
+       * automake.in (handle_tags): Use $(am__cd).  Provide default
+       empty rule for the `cscope' target, for empty sources.
+       * lib/am/tags.am (cscopelist): Construct relative path to files
+       in $(srcdir) if $(srcdir) is relative.
+       [TOPDIR_P] (cscope): Do not depend on cscope-clean.  Only invoke
+       $(CSCOPE) if cscope.files is nonemtpy.
+       (clean-cscope): Rename from ...
+       (cscopeclean): ... this.
+       (cscope.files): Depend on clean-cscope.
+       (distclean-tags) [!TOPDIR_P]: No need to remove cscope files
+       here.
+       * tests/cscope.test, tests/cscope2.test, tests/cscope3.test: New
+       tests.
+       * tests/Makefile.am: Adjust.
+
+2009-09-25  Debarshi Ray  <rishi@gnu.org>
+
+       New target to generate cscope database.
+       * automake.in (handle_tags): Handle cscope.
+       * doc/automake.texi (Tags): Document cscope.
+       * lib/am/tags.am (CSCOPE): New macro.
+       [TOPDIR_P] (AM_RECURSIVE_TARGETS): Add cscope.
+       (cscope): New target.
+       (cscopeclean): Likewise.
+       (cscope.files): Likewise.
+       (cscopelist): Likewise.
+       (distclean-tags): Remove `cscope.out', `cscope.in.out',
+       `cscope.po.out' and `cscope.files'.
+       * NEWS: Update.
+       Based upon earlier patch from Jesse Barnes.
+
+2009-09-25  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       Use silent-rules for building the Automake package.
+       * configure.ac (AM_INIT_AUTOMAKE): Add silent-rules option.
+       * Makefile.am (automake, aclocal, INSTALL): Add silencing
+       variables to recipe.
+       * doc/Makefile.am (update_mans, $(srcdir)/aclocal.1)
+       ($(srcdir)/automake.1, $(srcdir)/amhello-1.0.tar.gz): Likewise.
+       * lib/Automake/Makefile.am (Config.pm): Likewise.
+       * tests/Makefile.am ($(srcdir)/parallel-tests.am)
+       ($(parallel_tests), defs-p): Likewise.
+
+2009-09-25  Jack Kelly  <endgame.dos@gmail.com>
+
+       Add silent rules support for texinfo outputs.
+       * automake.in (define_verbose_texinfo): Define several new verbose
+       tagvars and verbose vars.
+       (define_verbose_tagvar): Increase spacing to 8 to accommodate
+       MAKEINFO, TEXI2DVI, TEXI2PDF.
+       (handle_texinfo): Additional substitution for silencing dvips.
+       (output_texinfo_build_rules): Additional substitutions for
+       silencing texi2dvi and texi2pdf.
+       * lib/am/texibuild.am: Add silencing to makeinfo, makeinfo --html,
+       texi2dvi and texi2pdf rules.
+       * lib/am/texinfos.am: Add silencing to .dvi.ps rule.
+       * tests/Makefile.am: Add silent8.test.
+       * tests/silent8.test: New test: tests that silent texinfo rules
+       produce quiet messages.
+       * NEWS: Update.
+
 2009-09-18  Peter Johansson  <trojkan@gmail.com>  (tiny change)
 
        Fix link to "Recursive Make Considered Harmful" paper.
 
 2009-05-17  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
+       Post-release version bump.
+       * configure.ac, NEWS: Bump version to 1.11a.
+
+2009-05-17  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
        Automake 1.11.
        * configure.ac: Bump version to 1.11.
        * doc/automake.texi (Releases): Add line for 1.11.  Remove line
diff --git a/HACKING b/HACKING
index a3e37f0..dc727d3 100644 (file)
--- a/HACKING
+++ b/HACKING
 * Use `keep_testdirs=yes' to keep test directories for successful
   tests also.
 
+* Use perl coverage information to ensure your new code is thoroughly
+  tested by your new tests.
+
 * See file `tests/README' for more information.
 
 ================================================================
index d19d974..0bdcfbe 100644 (file)
@@ -86,17 +86,35 @@ do_subst = sed \
 automake: automake.in
 aclocal: aclocal.in
 automake aclocal: Makefile
-       rm -f $@ $@.tmp
-       $(do_subst) $(srcdir)/$@.in >$@.tmp
-       chmod +x $@.tmp
-       chmod a-w $@.tmp
-       mv -f $@.tmp $@
+       $(AM_V_GEN)rm -f $@ $@.tmp
+       $(AM_V_at)$(do_subst) $(srcdir)/$@.in >$@.tmp
+       $(AM_V_at)chmod +x $@.tmp
+       $(AM_V_at)chmod a-w $@.tmp
+       $(AM_V_at)mv -f $@.tmp $@
 
 ## The master location for INSTALL is lib/INSTALL.
 ## This is where `make fetch' will install new versions.
 ## Make sure we also update this copy.
 INSTALL: lib/INSTALL
-       cp $(srcdir)/lib/INSTALL $@
+       $(AM_V_GEN)cp $(srcdir)/lib/INSTALL $@
+
+## recheck: convenience proxy target for the test suites.
+TEST_SUBDIRS = lib/Automake/tests tests
+
+.PHONY: recheck
+recheck:
+       @failcom='exit 1'; \
+       for f in x $$MAKEFLAGS; do \
+         case $$f in \
+           *=* | --[!k]*);; \
+           *k*) failcom='fail=yes';; \
+         esac; \
+       done; \
+       for subdir in $(TEST_SUBDIRS); do \
+         ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@) \
+           || eval $$failcom; \
+       done; \
+       test -z "$$fail"
 
 ################################################################
 ##
@@ -106,7 +124,42 @@ INSTALL: lib/INSTALL
 
 # Ensure tests are world-executable
 dist-hook:
-       cd $(distdir)/tests && chmod a+rx *.test
+       $(am__cd) $(distdir)/tests && chmod a+rx *.test
+
+
+# Perl coverage statistics.
+PERL_COVERAGE_DB = $(abs_top_builddir)/cover_db
+PERL_COVERAGE_FLAGS = -MDevel::Cover=-db,$(PERL_COVERAGE_DB),-silent,on,-summary,off
+PERL_COVER = cover
+
+check-coverage-run recheck-coverage-run: all
+       $(mkinstalldirs) $(PERL_COVERAGE_DB)
+       PERL5OPT="$$PERL5OPT $(PERL_COVERAGE_FLAGS)"; export PERL5OPT; \
+       WANT_NO_THREADS=yes; export WANT_NO_THREADS; unset AUTOMAKE_JOBS; \
+       $(MAKE) $(AM_MAKEFLAGS) `echo $@ | sed 's/-coverage-run//'`
+
+check-coverage-report:
+       @if test ! -d "$(PERL_COVERAGE_DB)"; then \
+         echo "No coverage database found in \`$(PERL_COVERAGE_DB)'." >&2; \
+         echo "Please run \`make check-coverage' first" >&2; \
+         exit 1; \
+       fi
+       $(PERL_COVER) $(PERL_COVER_FLAGS) "$(PERL_COVERAGE_DB)"
+
+# We don't use direct dependencies here because we'd like to be able
+# to invoke the report even after interrupted check-coverage.
+check-coverage: check-coverage-run
+       $(MAKE) $(AM_MAKEFLAGS) check-coverage-report
+
+recheck-coverage: recheck-coverage-run
+       $(MAKE) $(AM_MAKEFLAGS) check-coverage-report
+
+clean-coverage:
+       rm -rf "$(PERL_COVERAGE_DB)"
+clean-local: clean-coverage
+
+.PHONY: check-coverage recheck-coverage check-coverage-run \
+       recheck-coverage-run check-coverage-report clean-coverage
 
 # Some simple checks, and then ordinary check.  These are only really
 # guaranteed to work on my machine.
@@ -141,6 +194,8 @@ sc_tests_overriding_macros_on_cmdline \
 sc_tests_plain_sleep \
 sc_tests_plain_egrep_fgrep \
 sc_tests_PATH_SEPARATOR \
+sc_tests_logs_duplicate_prefixes \
+sc_tests_makefile_variable_order \
 sc_mkdir_p \
 sc_perl_at_substs \
 sc_unquoted_DESTDIR \
@@ -287,7 +342,7 @@ sc_tests_make_without_am_makeflags:
 
 ## Tests should never call make directly.
 sc_tests_plain_make:
-       @if grep -v '^#' $(srcdir)/tests/*.test | grep ':[      ]*make'; then \
+       @if grep -v '^#' $(srcdir)/tests/*.test | $(EGREP) ':[  ]*make( |$$)'; then \
          echo 'Do not run "make" in the above tests.  Use "$$MAKE" instead.' 1>&2; \
          exit 1; \
        fi
@@ -410,6 +465,43 @@ sc_tests_plain_egrep_fgrep:
          exit 1; \
        fi
 
+## Rule to ensure that the testsuite has been run before.  We don't depend on `check'
+## here, because that would be very wasteful in the common case.  We could run
+## `make check RECHECK_LOGS=' and avoid toplevel races with AM_RECURSIVE_TARGETS.
+## Suggest keeping test directories around for greppability of the Makefile.in files.
+sc_ensure_testsuite_has_run:
+       @if test ! -f tests/test-suite.log; then \
+         echo "Run \`env keep_testdirs=yes make check' before \`maintainer-check'" >&2; \
+         exit 1; \
+       fi
+.PHONY: sc_ensure_testsuite_has_run
+
+## Ensure our warning and error messages do not contain duplicate 'warning:' prefixes.
+## This test actually depends on the testsuite having been run before.
+sc_tests_logs_duplicate_prefixes: sc_ensure_testsuite_has_run
+       @if grep -E '(warning|error):.*(warning|error):' tests/*.log; then \
+         echo 'Duplicate warning/error message prefixes seen in above tests.' >&2; \
+         exit 1; \
+       fi
+
+## Ensure variables are listed before rules in Makefile.in files we generate.
+sc_tests_makefile_variable_order: sc_ensure_testsuite_has_run
+       @for file in `find tests -name Makefile.in -print`; do \
+         latevars=`sed -n \
+           -e :x -e 's/#.*//' \
+           -e '/\\\\$$/{' -e N -e 'b x' -e '}' \
+## Literal TAB.
+           -e '1,/^    /d' \
+## Allow @ so we match conditionals.
+           -e '/^ *[a-zA-Z_@]\{1,\} *=/p' $$file`; \
+         if test -n "$$latevars"; then \
+           echo 'Ensure variables are expanded before rules' >&2; \
+           echo "Variables are expanded too late in $$file:" >&2; \
+           echo "$$latevars" | sed 's/^/  /' >&2; \
+           exit 1; \
+         fi; \
+       done
+
 ## Using `:' as a PATH separator is not portable.
 sc_tests_PATH_SEPARATOR:
        @if grep -E '\bPATH=.*:.*' $(srcdir)/tests/*.test ; then \
@@ -467,7 +559,7 @@ git-dist: maintainer-check
 ## Finally, if anything was successful, commit the last changes and tag
 ## the release in the repository.  We don't use RCS keywords so it's OK
 ## to distribute the files before they were committed.
-       cd $(srcdir) && git commit -a -s && \
+       $(am__cd) $(srcdir) && git commit -a -s && \
           git tag -s "v$(VERSION)" -m "Release $(VERSION)"
 
 git-release: git-dist
@@ -489,7 +581,7 @@ git-diff:
 
 ## Check our path lengths.
 path-check: distdir
-       (cd $(distdir) && \
+       ($(am__cd) $(distdir) && \
 ## FIXME there's got to be a better way!  pathchk should take the list
 ## of files on stdin, at least.
          find . -print | xargs pathchk -p); \
@@ -521,7 +613,7 @@ fetch:
        rm -rf Fetchdir > /dev/null 2>&1
        mkdir Fetchdir
 ## If a get fails then that is a problem.
-       (cd Fetchdir && \
+       ($(am__cd) Fetchdir && \
        $(WGET_SV_GIT_CF)config.guess -O config.guess && \
        $(WGET_SV_GIT_CF)config.sub -O config.sub && \
        $(WGET_SV_CVS)texinfo/texinfo/doc/texinfo.tex -O texinfo.tex && \
@@ -535,7 +627,7 @@ fetch:
                  >>Fetchdir/update.patch 2>/dev/null; then :; \
          else \
            stat=1; \
-           echo "Updating $(srcdir)/lib/$$file..."; \
+           echo "Updating $(srcdir)/lib/$$file ..."; \
            cp Fetchdir/$$file $(srcdir)/lib/$$file; \
          fi; \
        done; \
@@ -558,7 +650,7 @@ release-stats: ps
        aml=`cat $$dot_am_files | wc -l` && \
        m4f=`ls -1 $(srcdir)/m4/*.m4 | wc -l` && \
        m4l=`cat $(srcdir)/m4/*.m4 | wc -l` && \
-       doc_text=`cd doc && LC_ALL=C pstops 0 automake.ps unused.ps 2>&1` && \
+       doc_text=`$(am__cd) doc && LC_ALL=C pstops 0 automake.ps unused.ps 2>&1` && \
        echo "$$doc_text" && \
        rm -f doc/unused.ps && \
        doc=`echo "$$doc_text" | sed -n 's/.*Wrote \([1-9][0-9]*\) pages.*/\1/p'` && \
@@ -566,7 +658,7 @@ release-stats: ps
        if test . != '$(srcdir)'; then tests="$$tests $(srcdir)/tests/*.test"; \
        else :; fi && \
        t=`ls -1 $$tests | wc -l` && \
-       tgen=`ls -1 $$tests | grep '.-p\.test' | wc -l` && \
+       tgen=`grep 'GENERATED AUTOMATICALLY' $$tests | wc -l` && \
        today=`date +%Y-%m-%d` && \
        echo "add this to the table in doc/automake.texi after verification:" && \
        printf '@item %s @tab %-6s @tab %4d @tab %4d @tab %4d @tab %4d %-4s @tab %4d %-4s @tab %3d @tab %d %-4s\n' \
index 649565b..95489e6 100644 (file)
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11 from Makefile.am.
+# Makefile.in generated by automake 1.11a from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -59,9 +59,9 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/amversion.m4 \
        $(top_srcdir)/m4/install-sh.m4 $(top_srcdir)/m4/lead-dot.m4 \
        $(top_srcdir)/m4/missing.m4 $(top_srcdir)/m4/mkdirp.m4 \
        $(top_srcdir)/m4/options.m4 $(top_srcdir)/m4/runlog.m4 \
-       $(top_srcdir)/m4/sanity.m4 $(top_srcdir)/m4/strip.m4 \
-       $(top_srcdir)/m4/substnot.m4 $(top_srcdir)/m4/tar.m4 \
-       $(top_srcdir)/configure.ac
+       $(top_srcdir)/m4/sanity.m4 $(top_srcdir)/m4/silent.m4 \
+       $(top_srcdir)/m4/strip.m4 $(top_srcdir)/m4/substnot.m4 \
+       $(top_srcdir)/m4/tar.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
 am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
@@ -92,6 +92,12 @@ am__base_list = \
   sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
 am__installdirs = "$(DESTDIR)$(bindir)"
 SCRIPTS = $(bin_SCRIPTS)
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo "  GEN     " $@;
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
 SOURCES =
 DIST_SOURCES =
 RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
@@ -105,9 +111,10 @@ RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive    \
   distclean-recursive maintainer-clean-recursive
 AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
        $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
-       distdir dist dist-all distcheck
+       cscope distdir dist dist-all distcheck
 ETAGS = etags
 CTAGS = ctags
+CSCOPE = cscope
 DIST_SUBDIRS = $(SUBDIRS)
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 distdir = $(PACKAGE)-$(VERSION)
@@ -116,6 +123,7 @@ am__remove_distdir = \
   { test ! -d "$(distdir)" \
     || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
          && rm -fr "$(distdir)"; }; }
+am__post_remove_distdir = $(am__remove_distdir)
 am__relativize = \
   dir0=`pwd`; \
   sed_first='s,^\([^/]*\)/.*$$,\1,'; \
@@ -143,10 +151,12 @@ am__relativize = \
   reldir="$$dir2"
 DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2
 GZIP_ENV = --best
+DIST_TARGETS = dist-bzip2 dist-gzip
 distuninstallcheck_listfiles = find . -type f -print
 distcleancheck_listfiles = find . -type f -print
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 APIVERSION = @APIVERSION@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
@@ -265,6 +275,12 @@ do_subst = sed \
   -e 's,[@]configure_input[@],Generated from $@.in; do not edit by hand.,g' \
   -e 's,[@]datadir[@],$(datadir),g'
 
+TEST_SUBDIRS = lib/Automake/tests tests
+
+# Perl coverage statistics.
+PERL_COVERAGE_DB = $(abs_top_builddir)/cover_db
+PERL_COVERAGE_FLAGS = -MDevel::Cover=-db,$(PERL_COVERAGE_DB),-silent,on,-summary,off
+PERL_COVER = cover
 
 # Some simple checks, and then ordinary check.  These are only really
 # guaranteed to work on my machine.
@@ -299,6 +315,8 @@ sc_tests_overriding_macros_on_cmdline \
 sc_tests_plain_sleep \
 sc_tests_plain_egrep_fgrep \
 sc_tests_PATH_SEPARATOR \
+sc_tests_logs_duplicate_prefixes \
+sc_tests_makefile_variable_order \
 sc_mkdir_p \
 sc_perl_at_substs \
 sc_unquoted_DESTDIR \
@@ -460,6 +478,10 @@ ctags-recursive:
        list='$(SUBDIRS)'; for subdir in $$list; do \
          test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
        done
+cscopelist-recursive:
+       list='$(SUBDIRS)'; for subdir in $$list; do \
+         test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \
+       done
 
 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
        list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
@@ -523,8 +545,32 @@ GTAGS:
          && $(am__cd) $(top_srcdir) \
          && gtags -i $(GTAGS_ARGS) "$$here"
 
+cscope: cscope.files
+       test ! -s cscope.files \
+         || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)
+
+clean-cscope:
+       -rm -f cscope.files
+
+cscope.files: clean-cscope cscopelist-recursive cscopelist
+
+cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP)
+       list='$(SOURCES) $(HEADERS) $(LISP)'; \
+       case "$(srcdir)" in \
+         [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+         *) sdir=$(subdir)/$(srcdir) ;; \
+       esac; \
+       for i in $$list; do \
+         if test -f "$$i"; then \
+           echo "$(subdir)/$$i"; \
+         else \
+           echo "$$sdir/$$i"; \
+         fi; \
+       done >> $(top_builddir)/cscope.files
+
 distclean-tags:
        -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+       -rm -f cscope.out cscope.in.out cscope.po.out cscope.files
 
 distdir: $(DISTFILES)
        $(am__remove_distdir)
@@ -603,36 +649,39 @@ distdir: $(DISTFILES)
        else :; fi
 dist-gzip: distdir
        tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
-       $(am__remove_distdir)
+       $(am__post_remove_distdir)
 dist-bzip2: distdir
-       tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
-       $(am__remove_distdir)
+       tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
+       $(am__post_remove_distdir)
+
+dist-lzip: distdir
+       tardir=$(distdir) && $(am__tar) | lzip -9 -c >$(distdir).tar.lz
+       $(am__post_remove_distdir)
 
 dist-lzma: distdir
        tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
-       $(am__remove_distdir)
+       $(am__post_remove_distdir)
 
 dist-xz: distdir
-       tardir=$(distdir) && $(am__tar) | xz -9 -c >$(distdir).tar.xz
-       $(am__remove_distdir)
+       tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--9} xz -c >$(distdir).tar.xz
+       $(am__post_remove_distdir)
 
 dist-tarZ: distdir
        tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
-       $(am__remove_distdir)
+       $(am__post_remove_distdir)
 
 dist-shar: distdir
        shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
-       $(am__remove_distdir)
+       $(am__post_remove_distdir)
 
 dist-zip: distdir
        -rm -f $(distdir).zip
        zip -rq $(distdir).zip $(distdir)
-       $(am__remove_distdir)
+       $(am__post_remove_distdir)
 
-dist dist-all: distdir
-       tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
-       tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
-       $(am__remove_distdir)
+dist dist-all:
+       $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:'
+       $(am__post_remove_distdir)
 
 # This target untars the dist file and tries a VPATH configuration.  Then
 # it guarantees that the distribution is self-contained by making another
@@ -645,6 +694,8 @@ distcheck: dist
          bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
        *.tar.lzma*) \
          lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\
+       *.tar.lz*) \
+         lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
        *.tar.xz*) \
          xz -dc $(distdir).tar.xz | $(am__untar) ;;\
        *.tar.Z*) \
@@ -687,7 +738,7 @@ distcheck: dist
          && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
          && cd "$$am__cwd" \
          || exit 1
-       $(am__remove_distdir)
+       $(am__post_remove_distdir)
        @(echo "$(distdir) archives ready for distribution: "; \
          list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
          sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
@@ -727,10 +778,15 @@ install-am: all-am
 
 installcheck: installcheck-recursive
 install-strip:
-       $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-         install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-         `test -z '$(STRIP)' || \
-           echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+       if test -z '$(STRIP)'; then \
+         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+             install; \
+       else \
+         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+           "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+       fi
 mostlyclean-generic:
 
 clean-generic:
@@ -745,7 +801,7 @@ maintainer-clean-generic:
        @echo "it deletes files that may require special tools to rebuild."
 clean: clean-recursive
 
-clean-am: clean-generic mostlyclean-am
+clean-am: clean-generic clean-local mostlyclean-am
 
 distclean: distclean-recursive
        -rm -f $(am__CONFIG_DISTCLEAN_FILES)
@@ -814,26 +870,27 @@ ps-am:
 uninstall-am: uninstall-binSCRIPTS
        @$(NORMAL_INSTALL)
        $(MAKE) $(AM_MAKEFLAGS) uninstall-hook
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
-       install-am install-exec-am install-strip tags-recursive \
-       uninstall-am
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) \
+       cscopelist-recursive ctags-recursive install-am \
+       install-exec-am install-strip tags-recursive uninstall-am
 
 .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
-       all all-am am--refresh check check-am clean clean-generic \
-       ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \
-       dist-hook dist-lzma dist-shar dist-tarZ dist-xz dist-zip \
-       distcheck distclean distclean-generic distclean-tags \
-       distcleancheck distdir distuninstallcheck dvi dvi-am html \
-       html-am info info-am install install-am install-binSCRIPTS \
-       install-data install-data-am install-dvi install-dvi-am \
-       install-exec install-exec-am install-exec-hook install-html \
-       install-html-am install-info install-info-am install-man \
-       install-pdf install-pdf-am install-ps install-ps-am \
-       install-strip installcheck installcheck-am installdirs \
-       installdirs-am maintainer-clean maintainer-clean-generic \
-       mostlyclean mostlyclean-generic pdf pdf-am ps ps-am tags \
-       tags-recursive uninstall uninstall-am uninstall-binSCRIPTS \
-       uninstall-hook
+       all all-am am--refresh check check-am clean clean-cscope \
+       clean-generic clean-local cscope cscopelist \
+       cscopelist-recursive ctags ctags-recursive dist dist-all \
+       dist-bzip2 dist-gzip dist-hook dist-lzip dist-lzma dist-shar \
+       dist-tarZ dist-xz dist-zip distcheck distclean \
+       distclean-generic distclean-tags distcleancheck distdir \
+       distuninstallcheck dvi dvi-am html html-am info info-am \
+       install install-am install-binSCRIPTS install-data \
+       install-data-am install-dvi install-dvi-am install-exec \
+       install-exec-am install-exec-hook install-html install-html-am \
+       install-info install-info-am install-man install-pdf \
+       install-pdf-am install-ps install-ps-am install-strip \
+       installcheck installcheck-am installdirs installdirs-am \
+       maintainer-clean maintainer-clean-generic mostlyclean \
+       mostlyclean-generic pdf pdf-am ps ps-am tags tags-recursive \
+       uninstall uninstall-am uninstall-binSCRIPTS uninstall-hook
 
 
 install-exec-hook:
@@ -856,20 +913,64 @@ uninstall-hook:
 automake: automake.in
 aclocal: aclocal.in
 automake aclocal: Makefile
-       rm -f $@ $@.tmp
-       $(do_subst) $(srcdir)/$@.in >$@.tmp
-       chmod +x $@.tmp
-       chmod a-w $@.tmp
-       mv -f $@.tmp $@
+       $(AM_V_GEN)rm -f $@ $@.tmp
+       $(AM_V_at)$(do_subst) $(srcdir)/$@.in >$@.tmp
+       $(AM_V_at)chmod +x $@.tmp
+       $(AM_V_at)chmod a-w $@.tmp
+       $(AM_V_at)mv -f $@.tmp $@
 
 INSTALL: lib/INSTALL
-       cp $(srcdir)/lib/INSTALL $@
+       $(AM_V_GEN)cp $(srcdir)/lib/INSTALL $@
+
+.PHONY: recheck
+recheck:
+       @failcom='exit 1'; \
+       for f in x $$MAKEFLAGS; do \
+         case $$f in \
+           *=* | --[!k]*);; \
+           *k*) failcom='fail=yes';; \
+         esac; \
+       done; \
+       for subdir in $(TEST_SUBDIRS); do \
+         ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@) \
+           || eval $$failcom; \
+       done; \
+       test -z "$$fail"
 
 ################################################################
 
 # Ensure tests are world-executable
 dist-hook:
-       cd $(distdir)/tests && chmod a+rx *.test
+       $(am__cd) $(distdir)/tests && chmod a+rx *.test
+
+check-coverage-run recheck-coverage-run: all
+       $(mkinstalldirs) $(PERL_COVERAGE_DB)
+       PERL5OPT="$$PERL5OPT $(PERL_COVERAGE_FLAGS)"; export PERL5OPT; \
+       WANT_NO_THREADS=yes; export WANT_NO_THREADS; unset AUTOMAKE_JOBS; \
+       $(MAKE) $(AM_MAKEFLAGS) `echo $@ | sed 's/-coverage-run//'`
+
+check-coverage-report:
+       @if test ! -d "$(PERL_COVERAGE_DB)"; then \
+         echo "No coverage database found in \`$(PERL_COVERAGE_DB)'." >&2; \
+         echo "Please run \`make check-coverage' first" >&2; \
+         exit 1; \
+       fi
+       $(PERL_COVER) $(PERL_COVER_FLAGS) "$(PERL_COVERAGE_DB)"
+
+# We don't use direct dependencies here because we'd like to be able
+# to invoke the report even after interrupted check-coverage.
+check-coverage: check-coverage-run
+       $(MAKE) $(AM_MAKEFLAGS) check-coverage-report
+
+recheck-coverage: recheck-coverage-run
+       $(MAKE) $(AM_MAKEFLAGS) check-coverage-report
+
+clean-coverage:
+       rm -rf "$(PERL_COVERAGE_DB)"
+clean-local: clean-coverage
+
+.PHONY: check-coverage recheck-coverage check-coverage-run \
+       recheck-coverage-run check-coverage-report clean-coverage
 
 .PHONY: $(syntax_check_rules)
 $(syntax_check_rules): automake aclocal
@@ -988,7 +1089,7 @@ sc_tests_make_without_am_makeflags:
        fi
 
 sc_tests_plain_make:
-       @if grep -v '^#' $(srcdir)/tests/*.test | grep ':[      ]*make'; then \
+       @if grep -v '^#' $(srcdir)/tests/*.test | $(EGREP) ':[  ]*make( |$$)'; then \
          echo 'Do not run "make" in the above tests.  Use "$$MAKE" instead.' 1>&2; \
          exit 1; \
        fi
@@ -1091,6 +1192,34 @@ sc_tests_plain_egrep_fgrep:
          exit 1; \
        fi
 
+sc_ensure_testsuite_has_run:
+       @if test ! -f tests/test-suite.log; then \
+         echo "Run \`env keep_testdirs=yes make check' before \`maintainer-check'" >&2; \
+         exit 1; \
+       fi
+.PHONY: sc_ensure_testsuite_has_run
+
+sc_tests_logs_duplicate_prefixes: sc_ensure_testsuite_has_run
+       @if grep -E '(warning|error):.*(warning|error):' tests/*.log; then \
+         echo 'Duplicate warning/error message prefixes seen in above tests.' >&2; \
+         exit 1; \
+       fi
+
+sc_tests_makefile_variable_order: sc_ensure_testsuite_has_run
+       @for file in `find tests -name Makefile.in -print`; do \
+         latevars=`sed -n \
+           -e :x -e 's/#.*//' \
+           -e '/\\\\$$/{' -e N -e 'b x' -e '}' \
+           -e '1,/^    /d' \
+           -e '/^ *[a-zA-Z_@]\{1,\} *=/p' $$file`; \
+         if test -n "$$latevars"; then \
+           echo 'Ensure variables are expanded before rules' >&2; \
+           echo "Variables are expanded too late in $$file:" >&2; \
+           echo "$$latevars" | sed 's/^/  /' >&2; \
+           exit 1; \
+         fi; \
+       done
+
 sc_tests_PATH_SEPARATOR:
        @if grep -E '\bPATH=.*:.*' $(srcdir)/tests/*.test ; then \
          echo "Use \`$$PATH_SEPARATOR', not \`:', in PATH definitions above." 1>&2; \
@@ -1139,7 +1268,7 @@ git-dist: maintainer-check
          exit 1;                               \
        fi
        $(MAKE) $(AM_MAKEFLAGS) distcheck
-       cd $(srcdir) && git commit -a -s && \
+       $(am__cd) $(srcdir) && git commit -a -s && \
           git tag -s "v$(VERSION)" -m "Release $(VERSION)"
 
 git-release: git-dist
@@ -1160,7 +1289,7 @@ git-diff:
            > $(PACKAGE)-$$prevno-$(VERSION).diff
 
 path-check: distdir
-       (cd $(distdir) && \
+       ($(am__cd) $(distdir) && \
          find . -print | xargs pathchk -p); \
          estatus=$$?; \
          find $(distdir) -type d '!' -perm -200 -exec chmod u+w {} ';'; \
@@ -1170,7 +1299,7 @@ path-check: distdir
 fetch:
        rm -rf Fetchdir > /dev/null 2>&1
        mkdir Fetchdir
-       (cd Fetchdir && \
+       ($(am__cd) Fetchdir && \
        $(WGET_SV_GIT_CF)config.guess -O config.guess && \
        $(WGET_SV_GIT_CF)config.sub -O config.sub && \
        $(WGET_SV_CVS)texinfo/texinfo/doc/texinfo.tex -O texinfo.tex && \
@@ -1182,7 +1311,7 @@ fetch:
                  >>Fetchdir/update.patch 2>/dev/null; then :; \
          else \
            stat=1; \
-           echo "Updating $(srcdir)/lib/$$file..."; \
+           echo "Updating $(srcdir)/lib/$$file ..."; \
            cp Fetchdir/$$file $(srcdir)/lib/$$file; \
          fi; \
        done; \
@@ -1202,7 +1331,7 @@ release-stats: ps
        aml=`cat $$dot_am_files | wc -l` && \
        m4f=`ls -1 $(srcdir)/m4/*.m4 | wc -l` && \
        m4l=`cat $(srcdir)/m4/*.m4 | wc -l` && \
-       doc_text=`cd doc && LC_ALL=C pstops 0 automake.ps unused.ps 2>&1` && \
+       doc_text=`$(am__cd) doc && LC_ALL=C pstops 0 automake.ps unused.ps 2>&1` && \
        echo "$$doc_text" && \
        rm -f doc/unused.ps && \
        doc=`echo "$$doc_text" | sed -n 's/.*Wrote \([1-9][0-9]*\) pages.*/\1/p'` && \
@@ -1210,7 +1339,7 @@ release-stats: ps
        if test . != '$(srcdir)'; then tests="$$tests $(srcdir)/tests/*.test"; \
        else :; fi && \
        t=`ls -1 $$tests | wc -l` && \
-       tgen=`ls -1 $$tests | grep '.-p\.test' | wc -l` && \
+       tgen=`grep 'GENERATED AUTOMATICALLY' $$tests | wc -l` && \
        today=`date +%Y-%m-%d` && \
        echo "add this to the table in doc/automake.texi after verification:" && \
        printf '@item %s @tab %-6s @tab %4d @tab %4d @tab %4d @tab %4d %-4s @tab %4d %-4s @tab %3d @tab %d %-4s\n' \
diff --git a/NEWS b/NEWS
index 6bc0d6f..5e24313 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,11 +1,48 @@
-New in 1.11.0a:
+New in 1.11a:
+
+* Changes to automake:
+
+  - automake now generates silenced rules for texinfo outputs.
+  - The deprecated options `--output-dir', `--Werror' and `--Wno-error'
+    have been removed.
+
+* New targets:
+
+  - New `cscope' target to build a cscope database for the source tree.
 
 * Miscellaneous changes:
 
+  - The `dist' and `dist-all' targets now can run compressors in parallel.
+
   - The `lzma' compression scheme and associated automake option `dist-lzma'
     is obsoleted by `xz' and `dist-xz' due to upstream changes.
 
-Bugs fixed in 1.11.0a:
+  - "make dist" can now create lzip-compressed tarballs.
+
+  - You may adjust the compression options used in dist-xz and dist-bzip2.
+    The default is still -9 for each, but you may specify a different
+    level via the XZ_OPT and BZIP2 envvars respectively.  E.g.,
+    "make dist-xz XZ_OPT=-7" or "make dist-xz BZIP2=-5"
+
+  - Messages of types warning or error from `automake' and `aclocal' are now
+    prefixed with the respective type, and presence of -Werror is noted.
+
+  - The `compile' script now converts some options for MSVC for a better
+    user experience.  Similarly, the new `ar-lib' script wraps Microsoft lib.
+
+  - Automake's early configure-time sanity check now tries to avoid sleeping
+    for a second, which slowed down cached configure runs noticeably.  In that
+    case, it will check back at the end of the configure script to ensure that
+    at least one second has passed, to avoid time stamp issues with makefile
+    rules rerunning autotools programs.
+
+  - For programs and libraries, automake now detects EXTRA_foo_DEPENDENCIES and
+    adds them to the normal list of dependencies, but without overwriting the
+    foo_DEPENDENCIES variable, which is normally computed by automake.
+
+Bugs fixed in 1.11a:
+
+  - Lots of minor bugfixes.
 
 * Bugs introduced by 1.11:
 
@@ -36,6 +73,11 @@ Bugs fixed in 1.11.0a:
   - AM_PROG_GCJ uses AC_CHECK_TOOLS to look for `gcj' now, so that prefixed
     tools are preferred in a cross-compile setup.
 
+  - The distribution is tarred up with mode 755 now by the `dist*' targets.
+    This fixes a race condition where untrusted users could modify files
+    in the $(PACKAGE)-$(VERSION) distdir before packing if the toplevel
+    build directory was world-searchable.  This is CVE-2009-4029.
+
   - Several scripts as well as the parallel-tests testsuite driver now
     exit with the right exit status upon receiving a signal.
 
diff --git a/THANKS b/THANKS
index 78da1de..f53e7ee 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -67,6 +67,7 @@ danbp                 danpb@nospam.postmaster.co.uk
 Daniel Jacobowitz      drow@false.org
 Daniel Kahn Gillmor    dkg@fifthhorseman.net
 Daniel Richard G.      danielg@teragram.com
+Debarshi Ray           rishi@gnu.org
 Dave Brolley           brolley@redhat.com
 Dave Korn              dave.korn.cygwin@googlemail.com
 Dave Morrison          dave@bnl.gov
@@ -145,6 +146,7 @@ Jared Davis         abiword@aiksaurus.com
 Jason Duell            jcduell@lbl.gov
 Jason Molenda          crash@cygnus.co.jp
 Jeff Bailey            Jbailey@phn.ca
+Jeff A. Daily          jeff.daily@pnl.gov
 Jeff Garzik            jgarzik@pobox.com
 Jeff Squyres           jsquyres@lam-mpi.org
 Jens Elkner            elkner@imsgroup.de
@@ -271,6 +273,7 @@ Per Oyvind Hvidsten poeh@enter.vg
 Peter Breitenlohner    peb@mppmu.mpg.de
 Peter Eisentraut       peter_e@gmx.net
 Peter Gavin            pgavin@debaser.kicks-ass.org
+Peter Johansson                trojkan@gmail.com
 Peter Mattis           petm@scam.XCF.Berkeley.EDU
 Peter Muir             iyhi@yahoo.com
 Peter O'Gorman         peter@pogma.com
index b5c2c41..4c81a47 100644 (file)
@@ -183,8 +183,7 @@ sub check_acinclude ()
   foreach my $key (keys %map)
     {
       # FIXME: should print line number of acinclude.m4.
-      msg ('syntax', "warning: macro `$key' defined in "
-          . "acinclude.m4 but never used")
+      msg ('syntax', "macro `$key' defined in acinclude.m4 but never used")
        if $map{$key} eq 'acinclude.m4' && ! exists $macro_seen{$key};
     }
 }
@@ -435,7 +434,7 @@ sub scan_configure_dep ($)
          # Make this just a warning, because we do not know whether
          # the macro is actually used (it could be called conditionally).
          msg ('unsupported', "$file:$line",
-              "warning: macro `$2' not found in library");
+              "macro `$2' not found in library");
        }
     }
 
@@ -507,7 +506,7 @@ sub scan_file ($$$)
          if ($number !~ /$serial_number_rx/go)
            {
              msg ('syntax', "$file:$.",
-                  "warning: ill-formed serial number `$number', "
+                  "ill-formed serial number `$number', "
                   . "expecting a version string with only digits and dots");
            }
          elsif ($defun_seen)
@@ -559,8 +558,8 @@ sub scan_file ($$$)
          $defun_seen = 1;
          if (! defined $1)
            {
-             msg ('syntax', "$file:$.", "warning: underquoted definition of $2"
-                  . "\n  run info '(automake)Extending aclocal'\n"
+             msg ('syntax', "$file:$.", "underquoted definition of $2"
+                  . "\n  run info Automake 'Extending aclocal'\n"
                   . "  or see http://sources.redhat.com/automake/"
                   . "automake.html#Extending-aclocal")
                unless $underquoted_manual_once;
@@ -870,14 +869,14 @@ sub usage ($)
 {
   my ($status) = @_;
 
-  print "Usage: aclocal [OPTIONS] ...
+  print "Usage: aclocal [OPTION]...
 
 Generate `aclocal.m4' by scanning `configure.ac' or `configure.in'
 
 Options:
       --acdir=DIR           directory holding config files (for debugging)
       --diff[=COMMAND]      run COMMAND [diff -u] on M4 files that would be
-                              changed (implies --install and --dry-run)
+                            changed (implies --install and --dry-run)
       --dry-run             pretend to, but do not actually update any file
       --force               always update output file
       --help                print this help, then exit
@@ -985,13 +984,13 @@ sub parse_arguments ()
        }
       if (exists $argopts{$ARGV[0]})
        {
-         fatal ("option `$ARGV[0]' requires an argument\n"
-                . "Try `$0 --help' for more information.");
+         fatal ("option `$ARGV[0]' requires an argument.\n"
+                . "Try `$0 --help' for more information");
        }
       else
        {
          fatal ("unrecognized option `$ARGV[0]'\n"
-                . "Try `$0 --help' for more information.");
+                . "Try `$0 --help' for more information");
        }
     }
 
@@ -1012,7 +1011,7 @@ sub parse_arguments ()
   if ($install && !@user_includes)
     {
       fatal ("--install should copy macros in the directory indicated by the"
-            . "\nfirst -I option, but no -I was supplied.");
+            . "\nfirst -I option, but no -I was supplied");
     }
 
   if (! -d $system_includes[0])
@@ -1063,7 +1062,7 @@ my $loop = 0;
 while (1)
   {
     ++$loop;
-    prog_error "Too many loops." if $loop > 2;
+    prog_error "too many loops" if $loop > 2;
 
     reset_maps;
     scan_m4_files;
index 2cddefb..c43a368 100644 (file)
@@ -1,4 +1,4 @@
-# generated automatically by aclocal 1.11 -*- Autoconf -*-
+# generated automatically by aclocal 1.11a -*- Autoconf -*-
 
 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
 # 2005, 2006, 2007, 2008, 2009, 2010  Free Software Foundation, Inc.
@@ -29,6 +29,7 @@ m4_include([m4/mkdirp.m4])
 m4_include([m4/options.m4])
 m4_include([m4/runlog.m4])
 m4_include([m4/sanity.m4])
+m4_include([m4/silent.m4])
 m4_include([m4/strip.m4])
 m4_include([m4/substnot.m4])
 m4_include([m4/tar.m4])
old mode 100755 (executable)
new mode 100644 (file)
index 8f3edde..27904f0
@@ -235,9 +235,9 @@ my @libtool_sometimes = qw(ltconfig ltcf-c.sh ltcf-cxx.sh ltcf-gcj.sh);
 my @common_files =
     (qw(ABOUT-GNU ABOUT-NLS AUTHORS BACKLOG COPYING COPYING.DOC COPYING.LIB
        COPYING.LESSER ChangeLog INSTALL NEWS README THANKS TODO
-       ansi2knr.1 ansi2knr.c compile config.guess config.rpath config.sub
-       depcomp elisp-comp install-sh libversion.in mdate-sh missing
-       mkinstalldirs py-compile texinfo.tex ylwrap),
+       ansi2knr.1 ansi2knr.c ar-lib compile config.guess config.rpath
+       config.sub depcomp elisp-comp install-sh libversion.in mdate-sh
+       missing mkinstalldirs py-compile texinfo.tex ylwrap),
      @libtool_files, @libtool_sometimes);
 
 # Commonly used files we auto-include, but only sometimes.  This list
@@ -330,10 +330,6 @@ my @config_headers = ();
 # Names used in AC_CONFIG_LINKS call.
 my @config_links = ();
 
-# Directory where output files go.  Actually, output files are
-# relative to this directory.
-my $output_directory;
-
 # List of Makefile.am's to process, and their corresponding outputs.
 my @input_files = ();
 my %output_files = ();
@@ -1207,11 +1203,25 @@ sub define_verbose_tagvar ($)
     my ($name) = @_;
     if (option 'silent-rules')
       {
-       define_verbose_var ($name, '@echo "  '. $name . ' ' x (6 - length ($name)) . '" $@;');
+       define_verbose_var ($name, '@echo "  '. $name . ' ' x (8 - length ($name)) . '" $@;');
        define_verbose_var ('at', '@');
       }
 }
 
+# define_verbose_texinfo
+# ----------------------
+# Engage the needed `silent-rules' machinery for assorted texinfo commands.
+sub define_verbose_texinfo ()
+{
+  my @tagvars = ('DVIPS', 'MAKEINFO', 'INFOHTML', 'TEXI2DVI', 'TEXI2PDF');
+  foreach my $tag (@tagvars)
+    {
+      define_verbose_tagvar($tag);
+    }
+  define_verbose_var('texinfo', '-q');
+  define_verbose_var('texidevnull', '> /dev/null');
+}
+
 # define_verbose_libtool
 # ----------------------
 # Engage the needed `silent-rules' machinery for `libtool --silent'.
@@ -1313,7 +1323,7 @@ sub check_user_variables (@)
                  msg_cond_var ('gnu', $cond, $flag,
                                "`$flag' is a user variable, "
                                . "you should not override it;\n"
-                               . "use `AM_$flag' instead.");
+                               . "use `AM_$flag' instead");
                }
            }
        }
@@ -1573,7 +1583,7 @@ sub handle_languages
            my $srcdir = dirname ($source);
            if ($lang->ansi && $obj =~ /\$U/)
              {
-               prog_error "`$obj' contains \$U, but `$source' doesn't."
+               prog_error "`$obj' contains \$U, but `$source' doesn't"
                  if $source !~ /\$U/;
 
                (my $source_ = $source) =~ s/\$U/_/g;
@@ -2303,9 +2313,9 @@ sub handle_lib_objects
   my ($xname, $varname) = @_;
 
   my $var = var ($varname);
-  prog_error "handle_lib_objects: `$varname' undefined"
+  prog_error "`$varname' undefined"
     unless $var;
-  prog_error "handle_lib_objects: unexpected variable name `$varname'"
+  prog_error "unexpected variable name `$varname'"
     unless $varname =~ /^(.*)(?:LIB|LD)ADD$/;
   my $prefix = $1 || 'AM_';
 
@@ -2338,7 +2348,7 @@ sub handle_lib_objects
               # FIXME: should display a stack of nested variables
               # as context when $var != $subvar.
               err_var ($var, "linker flags such as `$val' belong in "
-                       . "`${prefix}LDFLAGS");
+                       . "`${prefix}LDFLAGS'");
             }
           return ();
         }
@@ -2664,6 +2674,7 @@ sub handle_programs
                  "use `${xname}_LDADD', not `${xname}_LIBADD'");
 
       set_seen ($xname . '_DEPENDENCIES');
+      set_seen ('EXTRA_' . $xname . '_DEPENDENCIES');
       set_seen ($xname . '_LDFLAGS');
 
       # Determine program to use for link.
@@ -2775,6 +2786,7 @@ sub handle_libraries
 
       # Make sure we at look at this.
       set_seen ($xlib . '_DEPENDENCIES');
+      set_seen ('EXTRA_' . $xlib . '_DEPENDENCIES');
 
       &handle_source_transform ($xlib, $onelib, $obj, $where,
                                NONLIBTOOL => 1, LIBTOOL => 0);
@@ -2880,7 +2892,7 @@ sub handle_ltlibraries
 
                   my $onlyone = ($dir ne $adir) ?
                     ("\nLibtool libraries can be built for only one "
-                     . "destination.") : "";
+                     . "destination") : "";
 
                   error ($liblocations{$val}{$acond},
                          "... and should also be $adirtxt$adircond.$onlyone");
@@ -2954,6 +2966,7 @@ sub handle_ltlibraries
       # Make sure we look at these.
       set_seen ($xlib . '_LDFLAGS');
       set_seen ($xlib . '_DEPENDENCIES');
+      set_seen ('EXTRA_' . $xlib . '_DEPENDENCIES');
 
       # Generate support for conditional object inclusion in
       # libraries.
@@ -3056,7 +3069,7 @@ sub check_typos ()
 
          for my $cond ($var->conditions->conds)
            {
-             $varname =~ /^(?:nobase_)?(?:dist_|nodist_)?(.*)_[[:alnum:]]+$/;
+             $varname =~ /^(?:EXTRA_)?(?:nobase_)?(?:dist_|nodist_)?(.*)_[[:alnum:]]+$/;
              msg_var ('syntax', $var, "variable `$varname' is defined but no"
                       . " program or\nlibrary has `$1' as canonical name"
                       . " (possible typo)")
@@ -3245,6 +3258,9 @@ sub output_texinfo_build_rules ($$$@)
 
   $output_rules .= file_contents ('texibuild',
                                  new Automake::Location,
+                                  AM_V_MAKEINFO    => verbose_flag('MAKEINFO'),
+                                  AM_V_TEXI2DVI    => verbose_flag('TEXI2DVI'),
+                                  AM_V_TEXI2PDF    => verbose_flag('TEXI2PDF'),
                                  DEPS             => "@deps",
                                  DEST_PREFIX      => $dpfx,
                                  DEST_INFO_PREFIX => $dipfx,
@@ -3254,12 +3270,15 @@ sub output_texinfo_build_rules ($$$@)
                                  GENERIC_INFO     => $generic_info,
                                  INSRC            => $insrc,
                                  MAKEINFOFLAGS    => $makeinfoflags,
+                                  SILENT           => silent_flag(),
                                  SOURCE           => ($generic
                                                       ? '$<' : $source),
                                  SOURCE_INFO      => ($generic_info
                                                       ? '$<' : $source),
                                  SOURCE_REAL      => $source,
                                  SOURCE_SUFFIX    => $ssfx,
+                                  TEXIQUIET        => verbose_flag('texinfo'),
+                                  TEXIDEVNULL      => verbose_flag('texidevnull'),
                                  );
   return ($dirstamp, "$dpfx.dvi", "$dpfx.pdf", "$dpfx.ps", "$dpfx.html");
 }
@@ -3568,6 +3587,7 @@ sub handle_texinfo ()
   my ($mostlyclean, $clean, $maintclean) = ('', '', '');
   if ($info_texinfos)
     {
+      define_verbose_texinfo;
       ($mostlyclean, $clean, $maintclean) = handle_texinfo_helper ($info_texinfos);
       chomp $mostlyclean;
       chomp $clean;
@@ -3576,10 +3596,12 @@ sub handle_texinfo ()
 
   $output_rules .=  file_contents ('texinfos',
                                   new Automake::Location,
+                                   AM_V_DVIPS    => verbose_flag('DVIPS'),
                                   MOSTLYCLEAN   => $mostlyclean,
                                   TEXICLEAN     => $clean,
                                   MAINTCLEAN    => $maintclean,
-                                  'LOCAL-TEXIS' => !!$info_texinfos);
+                                  'LOCAL-TEXIS' => !!$info_texinfos,
+                                   TEXIQUIET     => verbose_flag('texinfo'));
 }
 
 
@@ -3736,6 +3758,7 @@ sub handle_tags
 {
     my @tag_deps = ();
     my @ctag_deps = ();
+    my @cscope_deps = ();
     if (var ('SUBDIRS'))
     {
        $output_rules .= ("tags-recursive:\n"
@@ -3759,6 +3782,17 @@ sub handle_tags
        push (@ctag_deps, 'ctags-recursive');
        &depend ('.PHONY', 'ctags-recursive');
        &depend ('.MAKE', 'ctags-recursive');
+
+       $output_rules .= ("cscopelist-recursive:\n"
+                         . "\tlist=\'\$(SUBDIRS)\'; for subdir in \$\$list; do \\\n"
+                         # Never fail here if a subdir fails; it
+                         # isn't important.
+                         . "\t  test \"\$\$subdir\" = . || (\$(am__cd) \$\$subdir"
+                         . " && \$(MAKE) \$(AM_MAKEFLAGS) cscopelist); \\\n"
+                         . "\tdone\n");
+       push (@cscope_deps, 'cscopelist-recursive');
+       &depend ('.PHONY', 'cscopelist-recursive');
+       &depend ('.MAKE', 'cscopelist-recursive');
     }
 
     if (&saw_sources_p (1)
@@ -3781,13 +3815,14 @@ sub handle_tags
                                         new Automake::Location,
                                         CONFIG    => "@config",
                                         TAGSDIRS  => "@tag_deps",
-                                        CTAGSDIRS => "@ctag_deps");
+                                        CTAGSDIRS => "@ctag_deps",
+                                        CSCOPEDIRS => "@cscope_deps");
 
        set_seen 'TAGS_DEPENDENCIES';
     }
     elsif (reject_var ('TAGS_DEPENDENCIES',
-                      "doesn't make sense to define `TAGS_DEPENDENCIES'"
-                      . "without\nsources or `ETAGS_ARGS'"))
+                      "it doesn't make sense to define `TAGS_DEPENDENCIES'"
+                      . " without\nsources or `ETAGS_ARGS'"))
     {
     }
     else
@@ -3796,8 +3831,9 @@ sub handle_tags
        # Otherwise, it would be possible for a top-level "make TAGS"
        # to fail because some subdirectory failed.
        $output_rules .= "tags: TAGS\nTAGS:\n\n";
-       # Ditto ctags.
+       # Ditto ctags and cscope.
        $output_rules .= "ctags: CTAGS\nCTAGS:\n\n";
+       $output_rules .= "cscope cscopelist:\n\n";
     }
 }
 
@@ -3907,9 +3943,9 @@ sub handle_dist ()
     {
       my $archive_defined = option 'no-dist-gzip' ? 0 : 1;
       $archive_defined ||=
-       grep { option "dist-$_" } qw(shar zip tarZ bzip2 lzma xz);
+       grep { option "dist-$_" } qw(shar zip tarZ bzip2 lzip lzma xz);
       error (option 'no-dist-gzip',
-            "no-dist-gzip specified but no dist-* specified, "
+            "no-dist-gzip specified but no dist-* specified,\n"
             . "at least one archive format must be enabled")
        unless $archive_defined;
     }
@@ -4096,7 +4132,7 @@ sub scan_aclocal_m4 ()
       push (@ac_deps, '$(ACLOCAL_M4_SOURCES)');
       msg_var ('obsolete', 'ACLOCAL_M4_SOURCES',
               "`ACLOCAL_M4_SOURCES' is obsolete.\n"
-              . "It should be safe to simply remove it.");
+              . "It should be safe to simply remove it");
     }
 
   # Note that it might be possible that aclocal.m4 doesn't exist but
@@ -5188,8 +5224,8 @@ sub scan_autoconf_config_files ($$)
       my ($local, @rest) = split (/:/);
       @rest = ("$local.in",) unless @rest;
       msg ('portability', $where,
-         "Omit leading `./' from config file names such as `$local',"
-         . "\nas not all make implementations treat `file' and `./file' equally.")
+         "omit leading `./' from config file names such as `$local',"
+         . "\nas not all make implementations treat `file' and `./file' equally")
        if ($local =~ /^\.\//);
       my $input = locate_am @rest;
       if ($input)
@@ -5313,7 +5349,7 @@ sub scan_autoconf_traces ($)
          if ($seen_init_automake)
            {
              error ($where, "AC_CONFIG_AUX_DIR must be called before "
-                    . "AM_INIT_AUTOMAKE...", partial => 1);
+                    . "AM_INIT_AUTOMAKE ...", partial => 1);
              error ($seen_init_automake, "... AM_INIT_AUTOMAKE called here");
            }
          $config_aux_dir = $args[1];
@@ -5549,7 +5585,7 @@ sub scan_autoconf_files ()
              . "should verify that $configure_ac invokes AM_INIT_AUTOMAKE,"
              . "\nthat aclocal.m4 is present in the top-level directory,\n"
              . "and that aclocal.m4 was recently regenerated "
-             . "(using aclocal).");
+             . "(using aclocal)");
     }
   else
     {
@@ -5560,7 +5596,7 @@ sub scan_autoconf_files ()
              error ($seen_init_automake,
                     "your implementation of AM_INIT_AUTOMAKE comes from " .
                     "an\nold Automake version.  You should recreate " .
-                    "aclocal.m4\nwith aclocal and run automake again.\n",
+                    "aclocal.m4\nwith aclocal and run automake again",
                     # $? = 63 is used to indicate version mismatch to missing.
                     exit_code => 63);
            }
@@ -5568,9 +5604,9 @@ sub scan_autoconf_files ()
            {
              error ($seen_init_automake,
                     "no proper implementation of AM_INIT_AUTOMAKE was " .
-                    "found,\nprobably because aclocal.m4 is missing...\n" .
+                    "found,\nprobably because aclocal.m4 is missing.\n" .
                     "You should run aclocal to create this file, then\n" .
-                    "run automake again.\n");
+                    "run automake again");
            }
        }
     }
@@ -6363,7 +6399,7 @@ sub cond_stack_if ($$$)
          my $mac = $_am_macro_for_cond{$cond};
          $text .= "\n  The usual way to define `$cond' is to add ";
          $text .= ($mac =~ / /) ? $mac : "`$mac'";
-         $text .= "\n  to `$configure_ac' and run `aclocal' and `autoconf' again.";
+         $text .= "\n  to `$configure_ac' and run `aclocal' and `autoconf' again";
          # These warnings appear in Automake files (depend2.am),
          # so there is no need to display them more than once:
          $scope = US_GLOBAL;
@@ -7059,6 +7095,7 @@ sub make_paragraphs ($%)
 
                 'XZ'          => !! option 'dist-xz',
                 'LZMA'        => !! option 'dist-lzma',
+                'LZIP'        => !! option 'dist-lzip',
                 'BZIP2'       => !! option 'dist-bzip2',
                 'COMPRESS'    => !! option 'dist-tarZ',
                 'GZIP'        =>  ! option 'no-dist-gzip',
@@ -7840,7 +7877,7 @@ sub require_file_internal ($$$@)
                          $trailer2 = "\n    Consider adding the COPYING file"
                                    . " to the version control system"
                                    . "\n    for your code, to avoid questions"
-                                   . " about which license your project uses.";
+                                   . " about which license your project uses";
                        }
 
                      # Windows Perl will hang if we try to delete a
@@ -7874,8 +7911,9 @@ sub require_file_internal ($$$@)
                          # the top level Makefile.  Furthermore Automake
                          # hasn't been asked to create the Makefile.in
                          # that distributes the aux dir files.
-                         error ($where, 'Please make a full run of automake'
-                                . " so $fullfile gets distributed.");
+                         error ($where, 'please rerun automake without '
+                                . "Makefile arguments\n"
+                                . "so $fullfile gets distributed");
                        }
                    }
                }
@@ -8238,18 +8276,13 @@ sub generate_makefile ($$)
 
   check_typos;
 
-  my ($out_file) = $output_directory . '/' . $makefile_in;
-
   if ($exit_code != 0)
     {
-      verb "not writing $out_file because of earlier errors";
+      verb "not writing $makefile_in because of earlier errors";
       return;
     }
 
-  if (! -d ($output_directory . '/' . $am_relative_dir))
-    {
-      mkdir ($output_directory . '/' . $am_relative_dir, 0755);
-    }
+  mkdir ($am_relative_dir, 0755) if ! -d $am_relative_dir;
 
   # We make sure that `all:' is the first target.
   my $output =
@@ -8268,25 +8301,25 @@ sub generate_makefile ($$)
   #  * other dependencies, specific to the Makefile.am being processed
   #    (such as the Makefile.am itself, or any Makefile fragment
   #    it includes).
-  my $timestamp = mtime $out_file;
+  my $timestamp = mtime $makefile_in;
   if (! $force_generation
       && $configure_deps_greatest_timestamp < $timestamp
       && $output_deps_greatest_timestamp < $timestamp
-      && $output eq contents ($out_file))
+      && $output eq contents ($makefile_in))
     {
-      verb "$out_file unchanged";
+      verb "$makefile_in unchanged";
       # No need to update.
       return;
     }
 
-  if (-e $out_file)
+  if (-e $makefile_in)
     {
-      unlink ($out_file)
-       or fatal "cannot remove $out_file: $!\n";
+      unlink ($makefile_in)
+       or fatal "cannot remove $makefile_in: $!";
     }
 
-  my $gm_file = new Automake::XFile "> $out_file";
-  verb "creating $out_file";
+  my $gm_file = new Automake::XFile "> $makefile_in";
+  verb "creating $makefile_in";
   print $gm_file $output;
 }
 
@@ -8300,7 +8333,7 @@ sub generate_makefile ($$)
 # Print usage information.
 sub usage ()
 {
-    print "Usage: $0 [OPTION] ... [Makefile]...
+    print "Usage: $0 [OPTION]... [Makefile]...
 
 Generate Makefile.in for configure from Makefile.am.
 
@@ -8427,15 +8460,10 @@ sub parse_arguments ()
                                                    $cli_where); },
      'no-force'        => sub { $force_generation = 0; },
      'f|force-missing'  => \$force_missing,
-     'o|output-dir=s'  => \$output_directory,
      'a|add-missing'   => \$add_missing,
      'c|copy'          => \$copy_missing,
      'v|verbose'       => sub { setup_channel 'verb', silent => 0; },
      'W|warnings=s'     => \&parse_warnings,
-     # These long options (--Werror and --Wno-error) for backward
-     # compatibility.  Use -Werror and -Wno-error today.
-     'Werror'           => sub { parse_warnings 'W', 'error'; },
-     'Wno-error'        => sub { parse_warnings 'W', 'no-error'; },
      );
   use Getopt::Long;
   Getopt::Long::config ("bundling", "pass_through");
@@ -8464,16 +8492,6 @@ sub parse_arguments ()
   Getopt::Long::GetOptions %cli_options, 'version' => sub {}, 'help' => sub {}
     or exit 1;
 
-  if (defined $output_directory)
-    {
-      msg 'obsolete', "`--output-dir' is deprecated\n";
-    }
-  else
-    {
-      # In the next release we'll remove this entirely.
-      $output_directory = '.';
-    }
-
   return unless @ARGV;
 
   if ($ARGV[0] =~ /^-./)
@@ -8493,20 +8511,20 @@ sub parse_arguments ()
        }
       elsif (exists $argopts{$ARGV[0]})
        {
-         fatal ("option `$ARGV[0]' requires an argument\n"
-                . "Try `$0 --help' for more information.");
+         fatal ("option `$ARGV[0]' requires an argument.\n"
+                . "Try `$0 --help' for more information");
        }
       else
        {
          fatal ("unrecognized option `$ARGV[0]'.\n"
-                . "Try `$0 --help' for more information.");
+                . "Try `$0 --help' for more information");
        }
     }
 
   my $errspec = 0;
   foreach my $arg (@ARGV)
     {
-      fatal ("empty argument\nTry `$0 --help' for more information.")
+      fatal ("empty argument\nTry `$0 --help' for more information")
        if ($arg eq '');
 
       # Handle $local:$input syntax.
index 9f1a8d8..41f1f4e 100755 (executable)
--- a/bootstrap
+++ b/bootstrap
@@ -103,9 +103,10 @@ dosubst m4/amversion.in m4/amversion.m4
 # Create temporary replacement for automake.
 dosubst automake.in automake.tmp
 
-# Create tests/parallel-tests.am.
+# Create required makefile snippets.
 cd tests
 $BOOTSTRAP_SHELL ./gen-parallel-tests > parallel-tests.am
+$BOOTSTRAP_SHELL ./instspc-tests.sh --generate-makefile > instspc-tests.am
 cd ..
 
 # Run the autotools.
index 5af3df8..089b32a 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.68 for GNU Automake 1.11.
+# Generated by GNU Autoconf 2.68 for GNU Automake 1.11a.
 #
 # Report bugs to <bug-automake@gnu.org>.
 #
@@ -560,8 +560,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='GNU Automake'
 PACKAGE_TARNAME='automake'
-PACKAGE_VERSION='1.11'
-PACKAGE_STRING='GNU Automake 1.11'
+PACKAGE_VERSION='1.11a'
+PACKAGE_STRING='GNU Automake 1.11a'
 PACKAGE_BUGREPORT='bug-automake@gnu.org'
 PACKAGE_URL='http://www.gnu.org/software/automake/'
 
@@ -580,6 +580,8 @@ PERL_THREADS
 PERL
 pkgvdatadir
 APIVERSION
+AM_BACKSLASH
+AM_DEFAULT_VERBOSITY
 am__untar
 am__tar
 AMTAR
@@ -650,6 +652,7 @@ SHELL'
 ac_subst_files=''
 ac_user_opts='
 enable_option_checking
+enable_silent_rules
 '
       ac_precious_vars='build_alias
 host_alias
@@ -1196,7 +1199,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures GNU Automake 1.11 to adapt to many kinds of systems.
+\`configure' configures GNU Automake 1.11a to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1265,10 +1268,17 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of GNU Automake 1.11:";;
+     short | recursive ) echo "Configuration of GNU Automake 1.11a:";;
    esac
   cat <<\_ACEOF
 
+Optional Features:
+  --disable-option-checking  ignore unrecognized --enable/--with options
+  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
+  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
+  --enable-silent-rules   less verbose build output (undo: `make V=1')
+  --disable-silent-rules  verbose build output (undo: `make V=0')
+
 Report bugs to <bug-automake@gnu.org>.
 GNU Automake home page: <http://www.gnu.org/software/automake/>.
 General help using GNU software: <http://www.gnu.org/gethelp/>.
@@ -1334,7 +1344,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-GNU Automake configure 1.11
+GNU Automake configure 1.11a
 generated by GNU Autoconf 2.68
 
 Copyright (C) 2010 Free Software Foundation, Inc.
@@ -1351,7 +1361,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by GNU Automake $as_me 1.11, which was
+It was created by GNU Automake $as_me 1.11a, which was
 generated by GNU Autoconf 2.68.  Invocation command line was
 
   $ $0 $@
@@ -1780,7 +1790,7 @@ am_AUTOCONF="${AUTOCONF-autoconf}"
 am_AUTOHEADER="${AUTOHEADER-autoheader}"
 
 
-am__api_version='1.11'
+am__api_version='1.11a'
 
 # Find a good install program.  We prefer a C program (faster),
 # so one script is as good as another.  But avoid the broken or
@@ -1896,14 +1906,14 @@ esac
 # (eg FreeBSD returns the mod time of the symlink's containing
 # directory).
 if (
+   am_has_slept=no
    for am_try in 1 2; do
-     echo timestamp > conftest.file
+     echo "timestamp, slept: $am_has_slept" > conftest.file
      set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
      if test "$*" = "X"; then
        # -L didn't work.
        set X `ls -t "$srcdir/configure" conftest.file`
      fi
-     rm -f conftest.file
      if test "$*" != "X $srcdir/configure conftest.file" \
        && test "$*" != "X conftest.file $srcdir/configure"; then
 
@@ -1919,6 +1929,7 @@ if (
      fi
      # Just in case.
      sleep 1
+     am_has_slept=yes
    done
    test "$2" = conftest.file
    )
@@ -1931,6 +1942,16 @@ Check your system clock" "$LINENO" 5
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
+# If we didn't sleep, we still need to ensure time stamps of config.status and
+# generated files are strictly newer.
+am_sleep_pid=
+if grep 'slept: no' conftest.file >/dev/null 2>&1; then
+  ( sleep 1 ) &
+  am_sleep_pid=$!
+fi
+
+rm -f conftest.file
+
 test "$program_prefix" != NONE &&
   program_transform_name="s&^&$program_prefix&;$program_transform_name"
 # Use a double $ so make ignores it.
@@ -2200,6 +2221,18 @@ else
 fi
 rmdir .tst 2>/dev/null
 
+# Check whether --enable-silent-rules was given.
+if test "${enable_silent_rules+set}" = set; then :
+  enableval=$enable_silent_rules;
+fi
+
+case $enable_silent_rules in # (((
+  yes) AM_DEFAULT_VERBOSITY=0;;
+   no) AM_DEFAULT_VERBOSITY=1;;
+    *) AM_DEFAULT_VERBOSITY=1;;
+esac
+AM_BACKSLASH='\'
+
 if test "`cd $srcdir && pwd`" != "`pwd`"; then
   # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
   # is not polluted with repeated "-I."
@@ -2222,7 +2255,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='automake'
- VERSION='1.11'
+ VERSION='1.11a'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -2750,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"
 
@@ -2902,6 +2937,13 @@ LIBOBJS=$ac_libobjs
 LTLIBOBJS=$ac_ltlibobjs
 
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5
+$as_echo_n "checking that generated files are newer than configure... " >&6; }
+   if test -n "$am_sleep_pid"; then
+     wait $am_sleep_pid
+   fi
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5
+$as_echo "done" >&6; }
 
 
 : "${CONFIG_STATUS=./config.status}"
@@ -3312,7 +3354,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by GNU Automake $as_me 1.11, which was
+This file was extended by GNU Automake $as_me 1.11a, which was
 generated by GNU Autoconf 2.68.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -3335,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
 
@@ -3359,6 +3402,9 @@ Usage: $0 [OPTION]... [TAG]...
 Configuration files:
 $config_files
 
+Configuration links:
+$config_links
+
 Report bugs to <bug-automake@gnu.org>.
 GNU Automake home page: <http://www.gnu.org/software/automake/>.
 General help using GNU software: <http://www.gnu.org/gethelp/>."
@@ -3367,7 +3413,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-GNU Automake config.status 1.11
+GNU Automake config.status 1.11a
 configured by $0, generated by GNU Autoconf 2.68,
   with options \\"\$ac_cs_config\\"
 
@@ -3493,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" ;;
 
@@ -3508,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
@@ -3696,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
@@ -3916,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
 
index de4583d..577541c 100644 (file)
@@ -16,7 +16,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-AC_INIT([GNU Automake], [1.11], [bug-automake@gnu.org])
+AC_INIT([GNU Automake], [1.11a], [bug-automake@gnu.org])
 
 m4_ifndef([AC_PACKAGE_URL],
          [AC_SUBST([PACKAGE_URL], [http://www.gnu.org/software/automake/])])
@@ -32,7 +32,8 @@ AC_CANONICAL_BUILD
 AC_SUBST([am_AUTOCONF], ["${AUTOCONF-autoconf}"])
 AC_SUBST([am_AUTOHEADER], ["${AUTOHEADER-autoheader}"])
 
-AM_INIT_AUTOMAKE([1.10a dist-bzip2 filename-length-max=99 color-tests parallel-tests])
+AM_INIT_AUTOMAKE([1.10a dist-bzip2 filename-length-max=99 color-tests
+                 parallel-tests silent-rules])
 
 # The API version is the base version.  We must guarantee
 # compatibility for all releases with the same API version.
@@ -202,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])
index bb48fa2..01cf663 100644 (file)
@@ -27,12 +27,12 @@ dist_man1_MANS = \
   $(srcdir)/automake-$(APIVERSION).1
 MAINTAINERCLEANFILES = $(dist_man1_MANS)
 update_mans = \
-  PATH="`pwd`/../tests$(PATH_SEPARATOR)$$PATH" && \
+  $(AM_V_GEN)PATH="`pwd`/../tests$(PATH_SEPARATOR)$$PATH" && \
   export PATH && \
   $(HELP2MAN) --output=$@
 $(dist_man1_MANS): $(top_srcdir)/configure.ac
 $(srcdir)/aclocal.1 $(srcdir)/automake.1:
-       f=`echo $@ | sed 's|.*/||; s|\.1$$||; $(transform)'`; \
+       $(AM_V_GEN)f=`echo $@ | sed 's|.*/||; s|\.1$$||; $(transform)'`; \
        echo ".so man1/$$f-$(APIVERSION).1" > $@
 $(srcdir)/aclocal-$(APIVERSION).1: $(srcdir)/../aclocal.in
        $(update_mans) aclocal-$(APIVERSION)
@@ -70,7 +70,7 @@ dist_doc_DATA = $(srcdir)/amhello-1.0.tar.gz
 # aclocal-$(APIVERSION) and automake-$(APIVERSION) are generated by
 # configure in tests/.
 $(srcdir)/amhello-1.0.tar.gz: $(amhello_sources) $(top_srcdir)/configure.ac
-       PATH="`pwd`/../tests$(PATH_SEPARATOR)$$PATH" && \
+       $(AM_V_GEN)PATH="`pwd`/../tests$(PATH_SEPARATOR)$$PATH" && \
        export PATH && \
        cd $(srcdir)/amhello && \
        ACLOCAL=aclocal-$(APIVERSION) AUTOMAKE=automake-$(APIVERSION) \
index 95a8fb8..758ccbe 100644 (file)
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11 from Makefile.am.
+# Makefile.in generated by automake 1.11a from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -59,16 +59,43 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/amversion.m4 \
        $(top_srcdir)/m4/install-sh.m4 $(top_srcdir)/m4/lead-dot.m4 \
        $(top_srcdir)/m4/missing.m4 $(top_srcdir)/m4/mkdirp.m4 \
        $(top_srcdir)/m4/options.m4 $(top_srcdir)/m4/runlog.m4 \
-       $(top_srcdir)/m4/sanity.m4 $(top_srcdir)/m4/strip.m4 \
-       $(top_srcdir)/m4/substnot.m4 $(top_srcdir)/m4/tar.m4 \
-       $(top_srcdir)/configure.ac
+       $(top_srcdir)/m4/sanity.m4 $(top_srcdir)/m4/silent.m4 \
+       $(top_srcdir)/m4/strip.m4 $(top_srcdir)/m4/substnot.m4 \
+       $(top_srcdir)/m4/tar.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
 mkinstalldirs = $(SHELL) $(top_srcdir)/lib/mkinstalldirs
 CONFIG_CLEAN_FILES =
 CONFIG_CLEAN_VPATH_FILES =
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo "  GEN     " $@;
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
 SOURCES =
 DIST_SOURCES =
+AM_V_DVIPS = $(am__v_DVIPS_$(V))
+am__v_DVIPS_ = $(am__v_DVIPS_$(AM_DEFAULT_VERBOSITY))
+am__v_DVIPS_0 = @echo "  DVIPS   " $@;
+AM_V_MAKEINFO = $(am__v_MAKEINFO_$(V))
+am__v_MAKEINFO_ = $(am__v_MAKEINFO_$(AM_DEFAULT_VERBOSITY))
+am__v_MAKEINFO_0 = @echo "  MAKEINFO" $@;
+AM_V_INFOHTML = $(am__v_INFOHTML_$(V))
+am__v_INFOHTML_ = $(am__v_INFOHTML_$(AM_DEFAULT_VERBOSITY))
+am__v_INFOHTML_0 = @echo "  INFOHTML" $@;
+AM_V_TEXI2DVI = $(am__v_TEXI2DVI_$(V))
+am__v_TEXI2DVI_ = $(am__v_TEXI2DVI_$(AM_DEFAULT_VERBOSITY))
+am__v_TEXI2DVI_0 = @echo "  TEXI2DVI" $@;
+AM_V_TEXI2PDF = $(am__v_TEXI2PDF_$(V))
+am__v_TEXI2PDF_ = $(am__v_TEXI2PDF_$(AM_DEFAULT_VERBOSITY))
+am__v_TEXI2PDF_0 = @echo "  TEXI2PDF" $@;
+AM_V_texinfo = $(am__v_texinfo_$(V))
+am__v_texinfo_ = $(am__v_texinfo_$(AM_DEFAULT_VERBOSITY))
+am__v_texinfo_0 = -q
+AM_V_texidevnull = $(am__v_texidevnull_$(V))
+am__v_texidevnull_ = $(am__v_texidevnull_$(AM_DEFAULT_VERBOSITY))
+am__v_texidevnull_0 = > /dev/null
 INFO_DEPS = $(srcdir)/automake.info
 TEXINFO_TEX = $(top_srcdir)/lib/texinfo.tex
 am__TEXINFO_TEX_DIR = $(top_srcdir)/lib
@@ -114,6 +141,7 @@ CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 APIVERSION = @APIVERSION@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
@@ -212,7 +240,7 @@ dist_man1_MANS = \
 
 MAINTAINERCLEANFILES = $(dist_man1_MANS)
 update_mans = \
-  PATH="`pwd`/../tests$(PATH_SEPARATOR)$$PATH" && \
+  $(AM_V_GEN)PATH="`pwd`/../tests$(PATH_SEPARATOR)$$PATH" && \
   export PATH && \
   $(HELP2MAN) --output=$@
 
@@ -278,7 +306,7 @@ $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 $(am__aclocal_m4_deps):
 
 .texi.info:
-       restore=: && backupdir="$(am__leading_dot)am$$$$" && \
+       $(AM_V_MAKEINFO)restore=: && backupdir="$(am__leading_dot)am$$$$" && \
        am__cwd=`pwd` && $(am__cd) $(srcdir) && \
        rm -rf $$backupdir && mkdir $$backupdir && \
        if ($(MAKEINFO) --version) >/dev/null 2>&1; then \
@@ -300,18 +328,18 @@ $(am__aclocal_m4_deps):
        rm -rf $$backupdir; exit $$rc
 
 .texi.dvi:
-       TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
+       $(AM_V_TEXI2DVI)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
        MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \
-       $(TEXI2DVI) $<
+       $(TEXI2DVI) $(AM_V_texinfo) $< $(AM_V_texidevnull)
 
 .texi.pdf:
-       TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
+       $(AM_V_TEXI2PDF)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
        MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \
-       $(TEXI2PDF) $<
+       $(TEXI2PDF) $(AM_V_texinfo) $< $(AM_V_texidevnull)
 
 .texi.html:
-       rm -rf $(@:.html=.htp)
-       if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \
+       $(AM_V_MAKEINFO)rm -rf $(@:.html=.htp)
+       $(AM_V_at)if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \
         -o $(@:.html=.htp) $<; \
        then \
          rm -rf $@; \
@@ -346,8 +374,8 @@ mostlyclean-vti:
 maintainer-clean-vti:
        -rm -f $(srcdir)/stamp-vti $(srcdir)/version.texi
 .dvi.ps:
-       TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
-       $(DVIPS) -o $@ $<
+       $(AM_V_DVIPS)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
+       $(DVIPS) $(AM_V_texinfo) -o $@ $<
 
 uninstall-dvi-am:
        @$(NORMAL_UNINSTALL)
@@ -548,6 +576,20 @@ GTAGS:
          && $(am__cd) $(top_srcdir) \
          && gtags -i $(GTAGS_ARGS) "$$here"
 
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+       list='$(SOURCES) $(HEADERS) $(LISP)'; \
+       case "$(srcdir)" in \
+         [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+         *) sdir=$(subdir)/$(srcdir) ;; \
+       esac; \
+       for i in $$list; do \
+         if test -f "$$i"; then \
+           echo "$(subdir)/$$i"; \
+         else \
+           echo "$$sdir/$$i"; \
+         fi; \
+       done >> $(top_builddir)/cscope.files
+
 distclean-tags:
        -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
@@ -614,10 +656,15 @@ install-am: all-am
 
 installcheck: installcheck-am
 install-strip:
-       $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-         install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-         `test -z '$(STRIP)' || \
-           echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+       if test -z '$(STRIP)'; then \
+         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+             install; \
+       else \
+         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+           "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+       fi
 mostlyclean-generic:
 
 clean-generic:
@@ -780,24 +827,25 @@ uninstall-man: uninstall-man1
 .MAKE: install-am install-strip
 
 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-aminfo \
-       clean-generic ctags dist-info distclean distclean-generic \
-       distclean-tags distdir dvi dvi-am html html-am info info-am \
-       install install-am install-data install-data-am \
-       install-dist_docDATA install-dvi install-dvi-am install-exec \
-       install-exec-am install-html install-html-am install-info \
-       install-info-am install-man install-man1 install-pdf \
-       install-pdf-am install-ps install-ps-am install-strip \
-       installcheck installcheck-am installdirs maintainer-clean \
-       maintainer-clean-aminfo maintainer-clean-generic \
-       maintainer-clean-vti mostlyclean mostlyclean-aminfo \
-       mostlyclean-generic mostlyclean-vti pdf pdf-am ps ps-am tags \
-       uninstall uninstall-am uninstall-dist_docDATA uninstall-dvi-am \
-       uninstall-html-am uninstall-info-am uninstall-man \
-       uninstall-man1 uninstall-pdf-am uninstall-ps-am
+       clean-generic cscopelist ctags dist-info distclean \
+       distclean-generic distclean-tags distdir dvi dvi-am html \
+       html-am info info-am install install-am install-data \
+       install-data-am install-dist_docDATA install-dvi \
+       install-dvi-am install-exec install-exec-am install-html \
+       install-html-am install-info install-info-am install-man \
+       install-man1 install-pdf install-pdf-am install-ps \
+       install-ps-am install-strip installcheck installcheck-am \
+       installdirs maintainer-clean maintainer-clean-aminfo \
+       maintainer-clean-generic maintainer-clean-vti mostlyclean \
+       mostlyclean-aminfo mostlyclean-generic mostlyclean-vti pdf \
+       pdf-am ps ps-am tags uninstall uninstall-am \
+       uninstall-dist_docDATA uninstall-dvi-am uninstall-html-am \
+       uninstall-info-am uninstall-man uninstall-man1 \
+       uninstall-pdf-am uninstall-ps-am
 
 $(dist_man1_MANS): $(top_srcdir)/configure.ac
 $(srcdir)/aclocal.1 $(srcdir)/automake.1:
-       f=`echo $@ | sed 's|.*/||; s|\.1$$||; $(transform)'`; \
+       $(AM_V_GEN)f=`echo $@ | sed 's|.*/||; s|\.1$$||; $(transform)'`; \
        echo ".so man1/$$f-$(APIVERSION).1" > $@
 $(srcdir)/aclocal-$(APIVERSION).1: $(srcdir)/../aclocal.in
        $(update_mans) aclocal-$(APIVERSION)
@@ -809,7 +857,7 @@ $(srcdir)/automake-$(APIVERSION).1: $(srcdir)/../automake.in
 # aclocal-$(APIVERSION) and automake-$(APIVERSION) are generated by
 # configure in tests/.
 $(srcdir)/amhello-1.0.tar.gz: $(amhello_sources) $(top_srcdir)/configure.ac
-       PATH="`pwd`/../tests$(PATH_SEPARATOR)$$PATH" && \
+       $(AM_V_GEN)PATH="`pwd`/../tests$(PATH_SEPARATOR)$$PATH" && \
        export PATH && \
        cd $(srcdir)/amhello && \
        ACLOCAL=aclocal-$(APIVERSION) AUTOMAKE=automake-$(APIVERSION) \
index 79f3f5a..38142ec 100644 (file)
@@ -164,8 +164,8 @@ General ideas
 * General Operation::           General operation of Automake
 * Strictness::                  Standards conformance checking
 * Uniform::                     The Uniform Naming Scheme
-* Canonicalization::            How derived variables are named
 * Length Limitations::          Staying below the command line length limit
+* Canonicalization::            How derived variables are named
 * User Variables::              Variables reserved for the user
 * Auxiliary Programs::          Programs automake might require
 
@@ -239,7 +239,7 @@ Building a program
 * Program Sources::             Defining program sources
 * Linking::                     Linking with libraries or extra objects
 * Conditional Sources::         Handling conditional sources
-* Conditional Programs::        Building program conditionally
+* Conditional Programs::        Building program conditionally
 
 Building a Shared Library
 
@@ -253,6 +253,11 @@ Building a Shared Library
 * LTLIBOBJS::                   Using $(LTLIBOBJS) and $(LTALLOCA)
 * Libtool Issues::              Common Issues Related to Libtool's Use
 
+Common Issues Related to Libtool's Use
+
+* Error required file ltmain.sh not found::  The need to run libtoolize
+* Objects created both with libtool and without::  Avoid a specific build race
+
 Fortran 77 Support
 
 * Preprocessing Fortran 77::    Preprocessing Fortran 77 sources
@@ -291,7 +296,7 @@ Building documentation
 * Texinfo::                     Texinfo
 * Man Pages::                   Man pages
 
-Installation
+What Gets Installed
 
 * Basics of Installation::      What gets installed where
 * The Two Parts of Install::    Installing data and programs separately
@@ -299,7 +304,7 @@ Installation
 * Staged Installs::             Installation in a temporary location
 * Install Rules for the User::  Useful additional rules
 
-Distribution
+What Goes in a Distribution
 
 * Basics of Distribution::      Files distributed by default
 * Fine-grained Distribution Control::  @code{dist_} and @code{nodist_} prefixes
@@ -307,7 +312,7 @@ Distribution
 * Checking the Distribution::   @samp{make distcheck} explained
 * The Types of Distributions::  A variety of formats and compression methods
 
-Support for Test Suites
+Support for test suites
 
 * Simple Tests::                Listing programs and scripts in @code{TESTS}
 * Simple Tests using parallel-tests::  More powerful test driver
@@ -316,7 +321,7 @@ Support for Test Suites
 
 Miscellaneous Rules
 
-* Tags::                        Interfacing to etags and mkid
+* Tags::                        Interfacing to cscope, etags and mkid
 * Suffixes::                    Handling new file extensions
 * Multilibs::                   Support for multilibs.
 
@@ -351,12 +356,12 @@ History of Automake
 * Dependency Tracking Evolution::  Evolution of Automatic Dependency Tracking
 * Releases::                    Statistics about Automake Releases
 
-Dependency Tracking Evolution
+Dependency Tracking in Automake
 
 * First Take on Dependencies::  Precomputed dependency tracking
 * Dependencies As Side Effects::  Update at developer compile time
 * Dependencies for the User::   Update at user compile time
-* Techniques for Dependencies:: Alternative approaches
+* Techniques for Dependencies::  Alternative approaches
 * Recommendations for Tool Writers::  What tool writers can do to help
 * Future Directions for Dependencies::  Languages Automake does not know
 
@@ -1742,8 +1747,8 @@ understand how Automake works.
 * General Operation::           General operation of Automake
 * Strictness::                  Standards conformance checking
 * Uniform::                     The Uniform Naming Scheme
-* Canonicalization::            How derived variables are named
 * Length Limitations::          Staying below the command line length limit
+* Canonicalization::            How derived variables are named
 * User Variables::              Variables reserved for the user
 * Auxiliary Programs::          Programs automake might require
 @end menu
@@ -2019,10 +2024,12 @@ should not be built until the @samp{make check} command is run.  Those
 objects are not installed either.
 
 The current primary names are @samp{PROGRAMS}, @samp{LIBRARIES},
-@samp{LISP}, @samp{PYTHON}, @samp{JAVA}, @samp{SCRIPTS}, @samp{DATA},
-@samp{HEADERS}, @samp{MANS}, and @samp{TEXINFOS}.
+@samp{LTLIBRARIES}, @samp{LISP}, @samp{PYTHON}, @samp{JAVA},
+@samp{SCRIPTS}, @samp{DATA}, @samp{HEADERS}, @samp{MANS}, and
+@samp{TEXINFOS}.
 @vindex PROGRAMS
 @vindex LIBRARIES
+@vindex LTLIBRARIES
 @vindex LISP
 @vindex PYTHON
 @vindex JAVA
@@ -2168,6 +2175,10 @@ copies are updated before each release, but we mention the original
 source in case you need more recent versions.
 
 @table @code
+@item ar-lib
+This is a wrapper primarily for the Microsoft lib archiver, to make
+it more POSIX-like.
+
 @item ansi2knr.c
 @itemx ansi2knr.1
 These two files are used for de-ANSI-fication support (obsolete
@@ -2176,7 +2187,11 @@ These two files are used for de-ANSI-fication support (obsolete
 @item compile
 This is a wrapper for compilers that do not accept options @option{-c}
 and @option{-o} at the same time.  It is only used when absolutely
-required.  Such compilers are rare.
+required.  Such compilers are rare, with the Microsoft C/C++ Compiler
+as the most notable exception. This wrapper also makes the following
+common options available for that compiler, while performing file name
+translation where needed: @option{-I}, @option{-L}, @option{-l},
+@option{-Wl,} and @option{-Xlinker}.
 
 @item config.guess
 @itemx config.sub
@@ -2841,12 +2856,12 @@ The Autoconf Manual}.
 Automake will look for various helper scripts, such as
 @file{install-sh}, in the directory named in this macro invocation.
 @c This list is accurate relative to version 1.8
-(The full list of scripts is: @file{config.guess}, @file{config.sub},
-@file{depcomp}, @file{elisp-comp}, @file{compile}, @file{install-sh},
-@file{ltmain.sh}, @file{mdate-sh}, @file{missing}, @file{mkinstalldirs},
-@file{py-compile}, @file{texinfo.tex}, and @file{ylwrap}.)  Not all
-scripts are always searched for; some scripts will only be sought if the
-generated @file{Makefile.in} requires them.
+(The full list of scripts is: @file{ar-lib}, @file{config.guess},
+@file{config.sub}, @file{depcomp}, @file{elisp-comp}, @file{compile},
+@file{install-sh}, @file{ltmain.sh}, @file{mdate-sh}, @file{missing},
+@file{mkinstalldirs}, @file{py-compile}, @file{texinfo.tex}, and
+@file{ylwrap}.)  Not all scripts are always searched for; some scripts
+will only be sought if the generated @file{Makefile.in} requires them.
 
 If @code{AC_CONFIG_AUX_DIR} is not given, the scripts are looked for in
 their standard locations.  For @file{mdate-sh},
@@ -3913,19 +3928,6 @@ Add support for the @uref{http://dmalloc.com/, Dmalloc package}.  If
 the user runs @command{configure} with @option{--with-dmalloc}, then
 define @code{WITH_DMALLOC} and add @option{-ldmalloc} to @code{LIBS}.
 
-@item AM_WITH_REGEX
-@acindex AM_WITH_REGEX
-@vindex WITH_REGEX
-@opindex --with-regex
-@cindex regex package
-@cindex rx package
-Adds @option{--with-regex} to the @command{configure} command line.  If
-specified (the default), then the @samp{regex} regular expression
-library is used, @file{regex.o} is put into @code{LIBOBJS}, and
-@code{WITH_REGEX} is defined.  If @option{--without-regex} is given, then
-the @code{rx} regular expression library is used, and @file{rx.o} is put
-into @code{LIBOBJS}.
-
 @end table
 
 
@@ -4001,6 +4003,21 @@ system.  If so, set the shell variable @code{am_cv_sys_posix_termios} to
 @samp{yes}.  If not, set the variable to @samp{no}.  This macro is obsolete,
 you should use Autoconf's @code{AC_SYS_POSIX_TERMIOS} instead.
 
+@item AM_WITH_REGEX
+@acindex AM_WITH_REGEX
+@vindex WITH_REGEX
+@opindex --with-regex
+@cindex regex package
+@cindex rx package
+Adds @option{--with-regex} to the @command{configure} command line.  If
+specified (the default), then the @samp{regex} regular expression
+library is used, @file{regex.o} is put into @code{LIBOBJS}, and
+@code{WITH_REGEX} is defined.  If @option{--without-regex} is given, then
+the @samp{rx} regular expression library is used, and @file{rx.o} is put
+into @code{LIBOBJS}.  This macro is obsolete now (since @samp{rx} doesn't
+seem to be maintained), and will be removed in a future version of
+Automake.  Consider using gnulib if you need regex functionality.
+
 @end table
 
 
@@ -4691,11 +4708,12 @@ this purpose.
 
 @cindex @code{_DEPENDENCIES}, defined
 @vindex maude_DEPENDENCIES
+@vindex EXTRA_maude_DEPENDENCIES
 It is also occasionally useful to have a program depend on some other
 target that is not actually part of that program.  This can be done
-using the @code{@var{prog}_DEPENDENCIES} variable.  Each program
-depends on the contents of such a variable, but no further
-interpretation is done.
+using either the @code{@var{prog}_DEPENDENCIES} or the
+@code{EXTRA_@var{prog}_DEPENDENCIES} variable.  Each program depends on
+the contents both variables, but no further interpretation is done.
 
 Since these dependencies are associated to the link rule used to
 create the programs they should normally list files used by the link
@@ -4718,6 +4736,10 @@ generated.
 @ref{Conditional Sources} shows a situation where @code{_DEPENDENCIES}
 may be used.
 
+The @code{EXTRA_@var{prog}_DEPENDENCIES} may be useful for cases where
+you merely want to augment the @command{automake}-generated
+@code{@var{prog}_DEPENDENCIES} rather than replacing it.
+
 @cindex @code{LDADD} and @option{-l}
 @cindex @option{-l} and @code{LDADD}
 We recommend that you avoid using @option{-l} options in @code{LDADD}
@@ -5370,8 +5392,8 @@ performed automatically by Autoconf (@pxref{AC_LIBOBJ vs LIBOBJS, ,
 @subsection Common Issues Related to Libtool's Use
 
 @menu
-* Error required file ltmain.sh not found::      The need to run libtoolize
-* Objects created both with libtool and without:: Avoid a specific build race
+* Error required file ltmain.sh not found::  The need to run libtoolize
+* Objects created both with libtool and without::  Avoid a specific build race
 @end menu
 
 @node Error required file ltmain.sh not found
@@ -5585,6 +5607,7 @@ option, so they should not be mode-specific options (those belong to
 the compiler or linker flags).  @xref{Libtool Flags}.
 
 @item maude_DEPENDENCIES
+@itemx EXTRA_maude_DEPENDENCIES
 It is also occasionally useful to have a target (program or library)
 depend on some other file that is not actually part of that target.
 This can be done using the @code{_DEPENDENCIES} variable.  Each
@@ -5615,6 +5638,10 @@ compilation using an @code{AC_SUBST} variable that contains a list of
 objects.  @xref{Conditional Sources}, and @ref{Conditional Libtool
 Sources}.
 
+The @code{EXTRA_*_DEPENDENCIES} variable may be useful for cases where
+you merely want to augment the @command{automake}-generated
+@code{_DEPENDENCIES} variable rather than replacing it.
+
 @item maude_LINK
 You can override the linker on a per-program basis.  By default the
 linker is chosen according to the languages used by the program.  For
@@ -5825,9 +5852,10 @@ However there is no need to list the corresponding sources in
 automatically adds @samp{$(LIBOBJS)} and @samp{$(ALLOCA)} to the
 dependencies, and it will discover the list of corresponding source
 files automatically (by tracing the invocations of the
-@code{AC_LIBSOURCE} Autoconf macros).  However, if you have already
-defined @samp{*_DEPENDENCIES} explicitly for an unrelated reason, then
-you have to add these variables manually.
+@code{AC_LIBSOURCE} Autoconf macros).  If you have already defined
+@samp{*_DEPENDENCIES} explicitly for an unrelated reason, then you
+either need to add these variables manually, or use
+@samp{EXTRA_*_DEPENDENCIES} instead of @samp{*_DEPENDENCIES}.
 
 These variables are usually used to build a portability library that
 is linked with all the programs of the project.  We now review a
@@ -7625,7 +7653,7 @@ as follows to Automake:
 
 @example
 pyexec_LTLIBRARIES = quaternion.la
-quaternion_SOURCES = quaternion.c support.c support.h
+quaternion_la_SOURCES = quaternion.c support.c support.h
 quaternion_la_LDFLAGS = -avoid-version -module
 @end example
 
@@ -8439,15 +8467,24 @@ Automake generates rules to provide archives of the project for
 distributions in various formats.  Their targets are:
 
 @table @asis
+@vindex BZIP2
 @item @code{dist-bzip2}
 Generate a bzip2 tar archive of the distribution.  bzip2 archives are
 frequently smaller than gzipped archives.
+By default, this rule makes @samp{bzip2} use a compression option of @option{-9}.
+To make it use a different one, set the @env{BZIP2} environment variable.
+For example, @samp{make dist-bzip2 BZIP2=-7}.
 @trindex dist-bzip2
 
 @item @code{dist-gzip}
 Generate a gzip tar archive of the distribution.
 @trindex dist-gzip
 
+@item @code{dist-lzip}
+Generate an @samp{lzip} tar archive of the distribution.  @command{lzip}
+archives are frequently smaller than @command{bzip2}-compressed archives.
+@trindex dist-lzip
+
 @item @code{dist-lzma}
 Generate an @samp{lzma} tar archive of the distribution.  @command{lzma}
 archives are frequently smaller than @command{bzip2}-compressed archives.
@@ -8459,10 +8496,15 @@ instead.
 Generate a shar archive of the distribution.
 @trindex dist-shar
 
+@vindex XZ_OPT
 @item @code{dist-xz}
 Generate an @samp{xz} tar archive of the distribution.  @command{xz}
 archives are frequently smaller than @command{bzip2}-compressed archives.
 The @samp{xz} format displaces the obsolete @samp{lzma} format.
+By default, this rule makes @samp{xz} use a compression option of @option{-9}.
+To make it use a different one, set the @env{XZ_OPT} environment variable.
+For example, run this command to use the default compression ratio, but
+with a progress indicator: @samp{make dist-xz XZ_OPT=-7e}.
 @trindex dist-xz
 
 @item @code{dist-zip}
@@ -8998,6 +9040,12 @@ Cause @command{dejagnu}-specific rules to be generated.  @xref{DejaGnu Tests}.
 Hook @code{dist-bzip2} to @code{dist}.
 @trindex dist-bzip2
 
+@item @option{dist-lzip}
+@cindex Option, @option{dist-lzip}
+@opindex dist-lzip
+Hook @code{dist-lzip} to @code{dist}.
+@trindex dist-lzip
+
 @item @option{dist-lzma}
 @cindex Option, @option{dist-lzma}
 @opindex dist-lzma
@@ -9270,7 +9318,8 @@ In order to use this option with C sources, you should add
 These three mutually exclusive options select the tar format to use
 when generating tarballs with @samp{make dist}.  (The tar file created
 is then compressed according to the set of @option{no-dist-gzip},
-@option{dist-bzip2}, @option{dist-xz} and @option{dist-tarZ} options in use.)
+@option{dist-bzip2}, @option{dist-lzip}, @option{dist-tarZ} and
+@option{dist-xz} options in use.)
 
 These options must be passed as arguments to @code{AM_INIT_AUTOMAKE}
 (@pxref{Macros}) because they can require additional configure checks.
@@ -9342,7 +9391,7 @@ the @code{AM_INIT_AUTOMAKE} macro in @file{configure.ac}.
 There are a few rules and variables that didn't fit anywhere else.
 
 @menu
-* Tags::                        Interfacing to etags and mkid
+* Tags::                        Interfacing to cscope, etags and mkid
 * Suffixes::                    Handling new file extensions
 * Multilibs::                   Support for multilibs.
 @end menu
@@ -9404,6 +9453,14 @@ Automake will also generate an @code{ID} rule that will run
 directory-by-directory basis.
 @trindex id
 
+Similarly, the @code{cscope} rule will create a list of all the source
+files in the tree and run @command{cscope} to build an inverted index
+database.  The variable @code{CSCOPE} is the name of the program to invoke
+(by default @command{cscope}); @code{CSCOPEFLAGS} and
+@code{CSCOPE_ARGS} can be used by the user to pass additional flags and
+file names respectively, while @code{AM_CSCOPEFLAGS} can be used by the
+@file{Makefile.am}.
+
 Finally, Automake also emits rules to support the
 @uref{http://www.gnu.org/software/global/, GNU Global Tags program}.
 The @code{GTAGS} rule runs Global Tags and puts the
@@ -12558,7 +12615,7 @@ for dependency tracking work in Automake.
 * First Take on Dependencies::  Precomputed dependency tracking
 * Dependencies As Side Effects::  Update at developer compile time
 * Dependencies for the User::   Update at user compile time
-* Techniques for Dependencies:: Alternative approaches
+* Techniques for Dependencies::  Alternative approaches
 * Recommendations for Tool Writers::  What tool writers can do to help
 * Future Directions for Dependencies::  Languages Automake does not know
 @end menu
@@ -13035,4 +13092,4 @@ parentheses is the number of generated test cases.
 @c  LocalWords:  LTALLOCA MALLOC malloc memcmp strdup alloca libcompat xyz DFOO
 @c  LocalWords:  unprefixed buildable preprocessed DBAZ DDATADIR WARNINGCFLAGS
 @c  LocalWords:  LIBFOOCFLAGS LIBFOOLDFLAGS ftable testSubDir obj LIBTOOLFLAGS
-@c  LocalWords:  barexec Pinard's automatize initialize lzma xz
+@c  LocalWords:  barexec Pinard's automatize initialize lzip lzma xz cscope
index aaca979..470e6c7 100644 (file)
@@ -44,7 +44,7 @@ Automake::ChannelDefs - channel definitions for Automake and helper functions
   verb ($MESSAGE, [%OPTIONS]);
   switch_warning ($CATEGORY);
   parse_WARNINGS ();
-  parse_warning ($OPTION, $ARGUMENT);
+  parse_warnings ($OPTION, $ARGUMENT);
   Automake::ChannelDefs::set_strictness ($STRICTNESS_NAME);
 
 =head1 DESCRIPTION
@@ -163,6 +163,10 @@ register_channel 'verb', type => 'debug', silent => 1, uniq_part => UP_NONE,
   ordered => 0;
 register_channel 'note', type => 'debug', silent => 0;
 
+setup_channel_type 'warning', header => 'warning: ';
+setup_channel_type 'error', header => 'error: ';
+setup_channel_type 'fatal', header => 'error: ';
+
 =head2 FUNCTIONS
 
 =over 4
@@ -308,7 +312,7 @@ sub parse_WARNINGS ()
     }
 }
 
-=item C<parse_warning ($OPTION, $ARGUMENT)>
+=item C<parse_warnings ($OPTION, $ARGUMENT)>
 
 Parse the argument of C<--warning=CATEGORY> or C<-WCATEGORY>.
 
@@ -365,7 +369,7 @@ sub set_strictness ($)
     }
   else
     {
-      prog_error "level `$name' not recognized\n";
+      prog_error "level `$name' not recognized";
     }
 }
 
@@ -381,6 +385,8 @@ Written by Alexandre Duret-Lutz E<lt>F<adl@gnu.org>E<gt>.
 
 =cut
 
+1;
+
 ### Setup "GNU" style for perl-mode and cperl-mode.
 ## Local Variables:
 ## perl-indent-level: 2
index 9a2732c..06f0443 100644 (file)
@@ -164,7 +164,7 @@ functions.  The possible keys, with their default value are:
 The type of the channel.  One of C<'debug'>, C<'warning'>, C<'error'>, or
 C<'fatal'>.  Fatal messages abort the program when they are output.
 Error messages update the exit status.  Debug and warning messages are
-harmless, except that warnings can be treated as errors of
+harmless, except that warnings are treated as errors if
 C<$warnings_are_errors> is set.
 
 =item C<exit_code =E<gt> 1>
@@ -204,10 +204,14 @@ C<US_LOCAL>, and C<US_GLOBAL> constants above.
 =item C<header =E<gt> ''>
 
 A string to prepend to each message emitted through this channel.
+With partial messages, only the first part will have C<header>
+prepended.
 
 =item C<footer =E<gt> ''>
 
 A string to append to each message emitted through this channel.
+With partial messages, only the final part will have C<footer>
+appended.
 
 =item C<backtrace =E<gt> 0>
 
@@ -399,20 +403,24 @@ sub _format_sub_message ($$)
   return $leader . join ("\n" . $leader, split ("\n", $message)) . "\n";
 }
 
+# Store partial messages here. (See the 'partial' option.)
+use vars qw ($partial);
+$partial = '';
+
 # _format_message ($LOCATION, $MESSAGE, %OPTIONS)
 # -----------------------------------------------
 # Format the message.  Return a string ready to print.
 sub _format_message ($$%)
 {
   my ($location, $message, %opts) = @_;
-  my $msg = '';
+  my $msg = ($partial eq '' ? $opts{'header'} : '') . $message
+           . ($opts{'partial'} ? '' : $opts{'footer'});
   if (ref $location)
     {
       # If $LOCATION is a reference, assume it's an instance of the
       # Automake::Location class and display contexts.
       my $loc = $location->get || $me;
-      $msg = _format_sub_message ("$loc: ", $opts{'header'}
-                                 . $message . $opts{'footer'});
+      $msg = _format_sub_message ("$loc: ", $msg);
       for my $pair ($location->get_contexts)
        {
          $msg .= _format_sub_message ($pair->[0] . ":   ", $pair->[1]);
@@ -421,8 +429,7 @@ sub _format_message ($$%)
   else
     {
       $location ||= $me;
-      $msg = _format_sub_message ("$location: ", $opts{'header'}
-                                 . $message . $opts{'footer'});
+      $msg = _format_sub_message ("$location: ", $msg);
     }
   return $msg;
 }
@@ -484,10 +491,6 @@ sub _dequeue ($)
 }
 
 
-# Store partial messages here. (See the 'partial' option.)
-use vars qw ($partial);
-$partial = '';
-
 # _print_message ($LOCATION, $MESSAGE, %OPTIONS)
 # ----------------------------------------------
 # Format the message, check duplicates, and print it.
@@ -511,6 +514,9 @@ sub _print_message ($$%)
       $partial = '';
     }
 
+  msg ('note', '', 'warnings are treated as errors', uniq_scope => US_GLOBAL)
+    if ($opts{'type'} eq 'warning' && $warnings_are_errors);
+
   # Check for duplicate message if requested.
   my $to_filter;
   if ($opts{'uniq_part'} ne UP_NONE)
@@ -674,7 +680,7 @@ Override the options of C<$channel> with those specified by C<%options>.
 sub setup_channel ($%)
 {
   my ($name, %opts) = @_;
-  confess "channel $name doesn't exist" unless exists $channels{$name};
+  confess "unknown channel $name" unless exists $channels{$name};
   _merge_options %{$channels{$name}}, %opts;
 }
 
index 2d649f6..5c54b8b 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 1997, 2001, 2002, 2003, 2006, 2008  Free Software
+# Copyright (C) 1997, 2001, 2002, 2003, 2006, 2008, 2009  Free Software
 # Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
@@ -180,18 +180,21 @@ sub new ($;@)
   };
   bless $self, $class;
 
-  # Accept strings like "FOO BAR" as shorthand for ("FOO", "BAR").
-  @conds = map { split (' ', $_) } @conds;
-
   for my $cond (@conds)
     {
-      next if $cond eq 'TRUE';
-
       # Catch some common programming errors:
       # - A Condition passed to new
       confess "`$cond' is a reference, expected a string" if ref $cond;
       # - A Condition passed as a string to new
       confess "`$cond' does not look like a condition" if $cond =~ /::/;
+    }
+
+  # Accept strings like "FOO BAR" as shorthand for ("FOO", "BAR").
+  @conds = map { split (' ', $_) } @conds;
+
+  for my $cond (@conds)
+    {
+      next if $cond eq 'TRUE';
 
       # Detect cases when @conds can be simplified to FALSE.
       if (($cond eq 'FALSE' && $#conds > 0)
@@ -250,7 +253,7 @@ except those of C<$minuscond>.  This is the opposite of C<merge>.
 sub strip ($$)
 {
   my ($self, $minus) = @_;
-  my @res = grep { not $minus->has ($_) } $self->conds;
+  my @res = grep { not $minus->_has ($_) } $self->conds;
   return new Automake::Condition @res;
 }
 
@@ -274,7 +277,7 @@ sub conds ($ )
 }
 
 # Undocumented, shouldn't be needed outside of this class.
-sub has ($$)
+sub _has ($$)
 {
   my ($self, $cond) = @_;
   return exists $self->{'hash'}{$cond};
@@ -289,7 +292,7 @@ Return 1 iff this condition is always false.
 sub false ($ )
 {
   my ($self) = @_;
-  return $self->has ('FALSE');
+  return $self->_has ('FALSE');
 }
 
 =item C<$cond-E<gt>true>
@@ -426,7 +429,7 @@ sub true_when ($$)
   # exists in $WHEN.
   foreach my $cond ($self->conds)
     {
-      return 0 unless $when->has ($cond);
+      return 0 unless $when->_has ($cond);
     }
   return 1;
 }
@@ -518,6 +521,8 @@ sub multiply ($@)
   return (values %res);
 }
 
+=back
+
 =head2 Other helper functions
 
 =over 4
@@ -615,6 +620,8 @@ sub conditional_negate ($)
   return $cond;
 }
 
+=back
+
 =head1 SEE ALSO
 
 L<Automake::DisjConditions>.
index 7e87044..b6674dc 100644 (file)
@@ -34,7 +34,7 @@ our $VERSION = '@VERSION@';
 our $libdir = '@datadir@/@PACKAGE@-@APIVERSION@';
 our $perl_threads = @PERL_THREADS@;
 
-1;;
+1;
 
 ### Setup "GNU" style for perl-mode and cperl-mode.
 ## Local Variables:
index e2bebef..3574035 100644 (file)
@@ -1,4 +1,5 @@
-# Copyright (C) 2003, 2005, 2006, 2010 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2005, 2006, 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
@@ -49,6 +50,20 @@ Automake::Configure_ac - Locate configure.ac or configure.in.
   my $file_name = find_configure_ac ($dir);
   my $file_name = require_configure_ac ($dir);
 
+=over 4
+
+=back
+
+=head2 Functions
+
+=over 4
+
+=item C<$configure_ac = find_configure_ac ([$directory])>
+
+Find a F<configure.ac> or F<configure.in> file in C<$directory>,
+defaulting to the current directory.  Complain if both files are present.
+Return the name of the file found, or the former if neither is present.
+
 =cut
 
 sub find_configure_ac (;@)
@@ -66,7 +81,7 @@ sub find_configure_ac (;@)
        {
          msg ('unsupported',
               "`$configure_ac' and `$configure_in' both present.\n"
-              . "proceeding with `$configure_ac'.");
+              . "proceeding with `$configure_ac'");
        }
       return $configure_ac
     }
@@ -78,6 +93,12 @@ sub find_configure_ac (;@)
 }
 
 
+=item C<$configure_ac = require_configure_ac ([$directory])>
+
+Like C<find_configure_ac>, but fail if neither is present.
+
+=cut
+
 sub require_configure_ac (;$)
 {
   my $res = find_configure_ac (@_);
index 613dc80..1dc81dc 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2002, 2003, 2008  Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003, 2008, 2009  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
@@ -50,7 +50,7 @@ Automake::Location - a class for location tracking, with a stack of contexts
       ...
     }
 
-  # Pop a context, and reset the location from the previous context.
+  # Pop a context, and reset the location to the previous context.
   $where->pop_context;
 
   # Clone a Location.  Use this when storing the state of a location
@@ -84,6 +84,16 @@ You can pass a C<Location> to C<Automake::Channels::msg>.
 
 =cut
 
+=head2 Methods
+
+=over
+
+=item C<$where = new Automake::Location ([$position])>
+
+Create and return a new Location object.
+
+=cut
+
 sub new ($;$)
 {
   my ($class, $position) = @_;
@@ -95,18 +105,36 @@ sub new ($;$)
   return $self;
 }
 
+=item C<$location-E<gt>set ($position)>
+
+Change the location to be C<$position>.
+
+=cut
+
 sub set ($$)
 {
   my ($self, $position) = @_;
   $self->{'position'} = $position;
 }
 
+=item C<$location-E<gt>get>
+
+Get the location (without context).
+
+=cut
+
 sub get ($)
 {
   my ($self) = @_;
   return $self->{'position'};
 }
 
+=item C<$location-E<gt>push_context ($context)>
+
+Push a context to the location.
+
+=cut
+
 sub push_context ($$)
 {
   my ($self, $context) = @_;
@@ -114,6 +142,12 @@ sub push_context ($$)
   $self->set (undef);
 }
 
+=item C<$where = $location-E<gt>pop_context ($context)>
+
+Pop a context, and reset the location to the previous context.
+
+=cut
+
 sub pop_context ($)
 {
   my ($self) = @_;
@@ -122,12 +156,25 @@ sub pop_context ($)
   return @{$pair};
 }
 
+=item C<@contexts = $location-E<gt>get_contexts>
+
+Return the array of contexts.
+
+=cut
+
 sub get_contexts ($)
 {
   my ($self) = @_;
   return @{$self->{'contexts'}};
 }
 
+=item C<$location = $location-E<gt>clone>
+
+Clone a Location.  Use this when storing the state of a location
+that would otherwise be modified.
+
+=cut
+
 sub clone ($)
 {
   my ($self) = @_;
@@ -140,6 +187,12 @@ sub clone ($)
   return $other;
 }
 
+=item C<$res = $location-E<gt>dump>
+
+Print the location and the stack of context (for debugging).
+
+=cut
+
 sub dump ($)
 {
   my ($self) = @_;
@@ -152,6 +205,13 @@ sub dump ($)
   return $res;
 }
 
+=item C<@array = $location-E<gt>serialize>
+
+Serialize a Location object (for passing through a thread queue,
+for example).
+
+=cut
+
 sub serialize ($)
 {
   my ($self) = @_;
@@ -166,6 +226,12 @@ sub serialize ($)
   return @serial;
 }
 
+=item C<new Automake::Location::deserialize ($queue)>
+
+De-serialize: recreate a Location object from a queue.
+
+=cut
+
 sub deserialize ($)
 {
   my ($queue) = @_;
@@ -179,6 +245,8 @@ sub deserialize ($)
   return $self;
 }
 
+=back
+
 =head1 SEE ALSO
 
 L<Automake::Channels>
index 0858b68..e4c2572 100644 (file)
@@ -64,10 +64,9 @@ do_subst = in=`echo $@ | sed 's/\.[^.]*$$//'`; sed \
 ## $(datadir) or other do_subst'ituted variables change.
 ## Use chmod a-w to prevent people from editing the wrong file by accident.
 Config.pm: Config.in Makefile
-       rm -f Config.tmp Config.pm
-       $(do_subst) $(srcdir)/Config.in >Config.tmp
-       chmod +x Config.tmp
-       chmod a-w Config.tmp
-       mv -f Config.tmp Config.pm
+       $(AM_V_GEN)rm -f Config.tmp Config.pm
+       $(AM_V_at)$(do_subst) $(srcdir)/Config.in >Config.tmp
+       $(AM_V_at)chmod a-w Config.tmp
+       $(AM_V_at)mv -f Config.tmp Config.pm
 
 EXTRA_DIST = Config.in
index e068ab8..c12e43e 100644 (file)
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11 from Makefile.am.
+# Makefile.in generated by automake 1.11a from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -58,14 +58,20 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/amversion.m4 \
        $(top_srcdir)/m4/install-sh.m4 $(top_srcdir)/m4/lead-dot.m4 \
        $(top_srcdir)/m4/missing.m4 $(top_srcdir)/m4/mkdirp.m4 \
        $(top_srcdir)/m4/options.m4 $(top_srcdir)/m4/runlog.m4 \
-       $(top_srcdir)/m4/sanity.m4 $(top_srcdir)/m4/strip.m4 \
-       $(top_srcdir)/m4/substnot.m4 $(top_srcdir)/m4/tar.m4 \
-       $(top_srcdir)/configure.ac
+       $(top_srcdir)/m4/sanity.m4 $(top_srcdir)/m4/silent.m4 \
+       $(top_srcdir)/m4/strip.m4 $(top_srcdir)/m4/substnot.m4 \
+       $(top_srcdir)/m4/tar.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
 mkinstalldirs = $(SHELL) $(top_srcdir)/lib/mkinstalldirs
 CONFIG_CLEAN_FILES =
 CONFIG_CLEAN_VPATH_FILES =
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo "  GEN     " $@;
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
 SOURCES =
 DIST_SOURCES =
 RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
@@ -134,6 +140,7 @@ am__relativize = \
   reldir="$$dir2"
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 APIVERSION = @APIVERSION@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
@@ -406,6 +413,10 @@ ctags-recursive:
        list='$(SUBDIRS)'; for subdir in $$list; do \
          test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
        done
+cscopelist-recursive:
+       list='$(SUBDIRS)'; for subdir in $$list; do \
+         test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \
+       done
 
 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
        list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
@@ -469,6 +480,20 @@ GTAGS:
          && $(am__cd) $(top_srcdir) \
          && gtags -i $(GTAGS_ARGS) "$$here"
 
+cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP)
+       list='$(SOURCES) $(HEADERS) $(LISP)'; \
+       case "$(srcdir)" in \
+         [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+         *) sdir=$(subdir)/$(srcdir) ;; \
+       esac; \
+       for i in $$list; do \
+         if test -f "$$i"; then \
+           echo "$(subdir)/$$i"; \
+         else \
+           echo "$$sdir/$$i"; \
+         fi; \
+       done >> $(top_builddir)/cscope.files
+
 distclean-tags:
        -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
@@ -548,10 +573,15 @@ install-am: all-am
 
 installcheck: installcheck-recursive
 install-strip:
-       $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-         install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-         `test -z '$(STRIP)' || \
-           echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+       if test -z '$(STRIP)'; then \
+         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+             install; \
+       else \
+         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+           "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+       fi
 mostlyclean-generic:
 
 clean-generic:
@@ -630,17 +660,18 @@ ps-am:
 
 uninstall-am: uninstall-dist_perllibDATA uninstall-nodist_perllibDATA
 
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
-       install-am install-strip tags-recursive
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) \
+       cscopelist-recursive ctags-recursive install-am install-strip \
+       tags-recursive
 
 .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
-       all all-am check check-am clean clean-generic ctags \
-       ctags-recursive distclean distclean-generic distclean-tags \
-       distdir dvi dvi-am html html-am info info-am install \
-       install-am install-data install-data-am \
-       install-dist_perllibDATA install-dvi install-dvi-am \
-       install-exec install-exec-am install-html install-html-am \
-       install-info install-info-am install-man \
+       all all-am check check-am clean clean-generic cscopelist \
+       cscopelist-recursive ctags ctags-recursive distclean \
+       distclean-generic distclean-tags distdir dvi dvi-am html \
+       html-am info info-am install install-am install-data \
+       install-data-am install-dist_perllibDATA install-dvi \
+       install-dvi-am install-exec install-exec-am install-html \
+       install-html-am install-info install-info-am install-man \
        install-nodist_perllibDATA install-pdf install-pdf-am \
        install-ps install-ps-am install-strip installcheck \
        installcheck-am installdirs installdirs-am maintainer-clean \
@@ -650,11 +681,10 @@ uninstall-am: uninstall-dist_perllibDATA uninstall-nodist_perllibDATA
 
 
 Config.pm: Config.in Makefile
-       rm -f Config.tmp Config.pm
-       $(do_subst) $(srcdir)/Config.in >Config.tmp
-       chmod +x Config.tmp
-       chmod a-w Config.tmp
-       mv -f Config.tmp Config.pm
+       $(AM_V_GEN)rm -f Config.tmp Config.pm
+       $(AM_V_at)$(do_subst) $(srcdir)/Config.in >Config.tmp
+       $(AM_V_at)chmod a-w Config.tmp
+       $(AM_V_at)mv -f Config.tmp Config.pm
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
index 9543aa5..a6d65a8 100644 (file)
@@ -260,7 +260,7 @@ sub _process_option_list (\%$@)
       elsif ($_ eq 'no-installman' || $_ eq 'no-installinfo'
             || $_ eq 'dist-shar' || $_ eq 'dist-zip'
             || $_ eq 'dist-tarZ' || $_ eq 'dist-bzip2'
-            || $_ eq 'dist-lzma' || $_ eq 'dist-xz'
+            || $_ eq 'dist-lzip' || $_ eq 'dist-lzma' || $_ eq 'dist-xz'
             || $_ eq 'no-dist-gzip' || $_ eq 'no-dist'
             || $_ eq 'dejagnu' || $_ eq 'no-texinfo.tex'
             || $_ eq 'readme-alpha' || $_ eq 'check-news'
@@ -369,7 +369,7 @@ sub set_strictness ($)
     }
   else
     {
-      prog_error "level `$strictness_name' not recognized\n";
+      prog_error "level `$strictness_name' not recognized";
     }
 }
 
index 8fc5250..b603120 100644 (file)
@@ -615,7 +615,8 @@ sub define ($$$$$)
          msg ('obsolete', $tdef->location,
               "deprecated feature: target `$noexe' overrides "
               . "`$noexe\$(EXEEXT)'\n"
-              . "change your target to read `$noexe\$(EXEEXT)'");
+              . "change your target to read `$noexe\$(EXEEXT)'",
+              partial => 1);
          msg ('obsolete', $where, "target `$target' was defined here");
        }
       # Don't `return ()' now, as this might hide target clashes
@@ -657,7 +658,7 @@ sub define ($$$$$)
                  ## is legitimate. (This is phony.test.)
 
                  # msg ('syntax', $where,
-                 #      "redefinition of `$target'$condmsg...", partial => 1);
+                 #      "redefinition of `$target'$condmsg ...", partial => 1);
                  # msg_cond_rule ('syntax', $cond, $target,
                  #                "... `$target' previously defined here");
                }
@@ -693,7 +694,7 @@ sub define ($$$$$)
 
              msg_cond_rule ('override', $cond, $target,
                             "user target `$target' defined here"
-                            . "$condmsg...", partial => 1);
+                            . "$condmsg ...", partial => 1);
              msg ('override', $where,
                   "... overrides Automake target `$oldname' defined here",
                   partial => $hint);
@@ -717,7 +718,7 @@ sub define ($$$$$)
              my $oldsource = $tdef->source;
              return () if $source eq $oldsource && $target eq $oldname;
 
-             msg ('syntax', $where, "redefinition of `$target'$condmsg...",
+             msg ('syntax', $where, "redefinition of `$target'$condmsg ...",
                   partial => 1);
              msg_cond_rule ('syntax', $cond, $target,
                             "... `$oldname' previously defined here");
@@ -725,7 +726,7 @@ sub define ($$$$$)
            }
        }
       # Never reached.
-      prog_error ("Unreachable place reached.");
+      prog_error ("unreachable place reached");
     }
 
   # Conditions for which the rule should be defined.
@@ -817,7 +818,7 @@ sub define ($$$$$)
   # definitions of multiple inference rules.  It's also
   # disallowed to mix plain targets with inference rules.
   msg ('portability', $where,
-       "Inference rules can have only one target before the colon (POSIX).")
+       "inference rules can have only one target before the colon (POSIX)")
     if $inference_rule_count > 0 && $target_count > 1;
 
   return @conds;
index 20bc106..3bd506d 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2003  Free Software Foundation, Inc.
+# Copyright (C) 2003, 2009  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
@@ -36,6 +36,7 @@ Automake::RuleDef - a class for rule definitions
 =head1 DESCRIPTION
 
 This class gathers data related to one Makefile-rule definition.
+It shouldn't be needed outside of F<Rule.pm>.
 
 =head2 Constants
 
@@ -50,6 +51,20 @@ Possible owners for rules.
 use constant RULE_AUTOMAKE => 0; # Rule defined by Automake.
 use constant RULE_USER => 1;     # Rule defined in the user's Makefile.am.
 
+=back
+
+=head2 Methods
+
+=over 4
+
+=item C<new Automake::RuleDef ($name, $comment, $location, $owner, $source)>
+
+Create a new rule definition with target C<$name>, with associated comment
+C<$comment>, Location C<$location> and owner C<$owner>, defined in file
+C<$source>.
+
+=cut
+
 sub new ($$$$$)
 {
   my ($class, $name, $comment, $location, $owner, $source) = @_;
@@ -60,12 +75,24 @@ sub new ($$$$$)
   return $self;
 }
 
+=item C<$source = $rule-E<gt>source>
+
+Return the source of the rule.
+
+=cut
+
 sub source ($)
 {
   my ($self) = @_;
   return $self->{'source'};
 }
 
+=item C<$name = $rule-E<gt>name>
+
+Return the name of the rule.
+
+=cut
+
 sub name ($)
 {
   my ($self) = @_;
index 568c82a..033aa05 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2003, 2004, 2006  Free Software Foundation, Inc.
+# Copyright (C) 2003, 2004, 2006, 2009  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
@@ -195,6 +195,8 @@ sub append ($$$)
 
 =item C<$def-E<gt>value>
 
+=item C<$def-E<gt>raw_value>
+
 =item C<$def-E<gt>type>
 
 =item C<$def-E<gt>pretty>
index cb9d182..9b2c838 100644 (file)
@@ -470,7 +470,7 @@ sub _check_ambiguous_condition ($$$)
   # We allow silent variables to be overridden silently,
   # by either silent or non-silent variables.
   my $def = $self->def ($ambig_cond);
-  if ($message && !($def && $def->pretty == VAR_SILENT))
+  if ($message && $def->pretty != VAR_SILENT)
     {
       msg 'syntax', $where, "$message ...", partial => 1;
       msg_var ('syntax', $var, "... `$var' previously defined here");
@@ -881,10 +881,10 @@ sub define ($$$$$$$$)
        {
          error ($def->location,
                 "Automake variable `$var' was set with `"
-                . $def->type . "=' here...", partial => 1);
+                . $def->type . "=' here ...", partial => 1);
          error ($where, "... and is now set with `$type=' here.");
          prog_error ("Automake variable assignments should be consistently\n"
-                     . "defined with the same sign.");
+                     . "defined with the same sign");
        }
 
       # If Automake tries to override a value specified by the user,
@@ -896,7 +896,7 @@ sub define ($$$$$$$$)
              my $condmsg = ($cond == TRUE
                             ? '' : (" in condition `" . $cond->human . "'"));
              msg_cond_var ('override', $cond, $var,
-                           "user variable `$var' defined here$condmsg...",
+                           "user variable `$var' defined here$condmsg ...",
                            partial => 1);
              msg ('override', $where,
                   "... overrides Automake variable `$var' defined here");
@@ -996,10 +996,10 @@ sub define ($$$$$$$$)
          if (! $undef_cond->false)
            {
              error ($where,
-                    "Cannot apply `+=' because `$var' is not defined "
+                    "cannot apply `+=' because `$var' is not defined "
                     . "in\nthe following conditions:\n  "
                     . join ("\n  ", map { $_->human } $undef_cond->conds)
-                    . "\nEither define `$var' in these conditions,"
+                    . "\neither define `$var' in these conditions,"
                     . " or use\n`+=' in the same conditions as"
                     . " the definitions.");
            }
@@ -1078,7 +1078,7 @@ For debugging.
 
 sub variables_dump ()
 {
-  my $text = "All variables:\n{\n";
+  my $text = "all variables:\n{\n";
   foreach my $var (sort { $a->name cmp $b->name } variables)
     {
       $text .= $var->dump;
index 66213d1..59b3e5a 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2003, 2006  Free Software Foundation, Inc.
+# Copyright (C) 2003, 2006, 2009  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
@@ -48,10 +48,10 @@ maximum length allowed.  (Ticket #17141, fixed in Perl 5.8.0.)
 
 =cut
 
-# tab_length ($TXT)
-# -----------------
+# _tab_length ($TXT)
+# ------------------
 # Compute the length of TXT, counting tab characters as 8 characters.
-sub tab_length($)
+sub _tab_length($)
 {
   my ($txt) = @_;
   my $len = length ($txt);
@@ -78,16 +78,16 @@ sub wrap($$$$@)
   my ($head, $fill, $eol, $max_len, @values) = @_;
 
   my $result = $head;
-  my $column = tab_length ($head);
+  my $column = _tab_length ($head);
 
-  my $fill_len = tab_length ($fill);
-  my $eol_len = tab_length ($eol);
+  my $fill_len = _tab_length ($fill);
+  my $eol_len = _tab_length ($eol);
 
   my $not_first_word = 0;
 
   foreach (@values)
     {
-      my $len = tab_length ($_);
+      my $len = _tab_length ($_);
 
       # See if the new variable fits on this line.
       # (The + 1 is for the space we add in front of the value.).
index 46483e6..4ba84ce 100644 (file)
@@ -68,18 +68,6 @@ methods C<close>, C<lock> (corresponding to C<flock>), C<new>,
 C<open>, C<seek>, and C<truncate>.  It also overrides the C<getline>
 and C<getlines> methods to translate C<\r\n> to C<\n>.
 
-=head1 SEE ALSO
-
-L<perlfunc>,
-L<perlop/"I/O Operators">,
-L<IO::File>
-L<IO::Handle>
-L<IO::Seekable>
-
-=head1 HISTORY
-
-Derived from IO::File.pm by Akim Demaille E<lt>F<akim@freefriends.org>E<gt>.
-
 =cut
 
 require 5.000;
@@ -110,12 +98,16 @@ eval {
   push (@EXPORT, @O);
 };
 
-# Used in croak error messages.
-my $me = basename ($0);
+=head2 Methods
+
+=over
+
+=item C<$fh = new Automake::XFile ([$expr, ...]>
 
-################################################
-## Constructor
-##
+Constructor a new XFile object.  Additional arguments
+are passed to C<open>, if any.
+
+=cut
 
 sub new
 {
@@ -129,9 +121,12 @@ sub new
   $fh;
 }
 
-################################################
-## Open
-##
+=item C<$fh-E<gt>open ([$file, ...])>
+
+Open a file, passing C<$file> and further arguments to C<IO::File::open>.
+Die if opening fails.  Store the name of the file.  Use binmode for writing.
+
+=cut
 
 sub open
 {
@@ -156,9 +151,11 @@ sub open
   binmode $fh if $file =~ /^\s*>/;
 }
 
-################################################
-## Close
-##
+=item C<$fh-E<gt>close>
+
+Close the file, handling errors.
+
+=cut
 
 sub close
 {
@@ -172,9 +169,12 @@ sub close
     }
 }
 
-################################################
-## Getline
-##
+=item C<$line = $fh-E<gt>getline>
+
+Read and return a line from the file.  Ensure C<\r\n> is translated to
+C<\n> on input files.
+
+=cut
 
 # Some Win32/perl installations fail to translate \r\n to \n on input
 # so we do that here.
@@ -187,9 +187,11 @@ sub getline
   return $_;
 }
 
-################################################
-## Getlines
-##
+=item C<@lines = $fh-E<gt>getlines>
+
+Slurp lines from the files.
+
+=cut
 
 sub getlines
 {
@@ -199,9 +201,11 @@ sub getlines
   return @res;
 }
 
-################################################
-## Name
-##
+=item C<$name = $fh-E<gt>name>
+
+Return the name of the file.
+
+=cut
 
 sub name
 {
@@ -209,9 +213,13 @@ sub name
   return ${*$fh}{'autom4te_xfile_file'};
 }
 
-################################################
-## Lock
-##
+=item C<$fh-E<gt>lock>
+
+Lock the file using C<flock>.  If locking fails for reasons other than
+C<flock> being unsupported, then error out if C<$ENV{'MAKEFLAGS'}> indicates
+that we are spawned from a parallel C<make>.
+
+=cut
 
 sub lock
 {
@@ -243,9 +251,11 @@ sub lock
     }
 }
 
-################################################
-## Seek
-##
+=item C<$fh-E<gt>seek ($position, [$whence])>
+
+Seek file to C<$position>.  Die if seeking fails.
+
+=cut
 
 sub seek
 {
@@ -254,13 +264,15 @@ sub seek
   if (!seek ($fh, $_[0], $_[1]))
     {
       my $file = $fh->name;
-      fatal "$me: cannot rewind $file with @_: $!";
+      fatal "cannot rewind $file with @_: $!";
     }
 }
 
-################################################
-## Truncate
-##
+=item C<$fh-E<gt>truncate ($len)>
+
+Truncate the file to length C<$len>.  Die on failure.
+
+=cut
 
 sub truncate
 {
@@ -272,6 +284,22 @@ sub truncate
     }
 }
 
+=back
+
+=head1 SEE ALSO
+
+L<perlfunc>,
+L<perlop/"I/O Operators">,
+L<IO::File>
+L<IO::Handle>
+L<IO::Seekable>
+
+=head1 HISTORY
+
+Derived from IO::File.pm by Akim Demaille E<lt>F<akim@freefriends.org>E<gt>.
+
+=cut
+
 1;
 
 ### Setup "GNU" style for perl-mode and cperl-mode.
diff --git a/lib/Automake/tests/Cond2.pl b/lib/Automake/tests/Cond2.pl
new file mode 100644 (file)
index 0000000..4ad0e1c
--- /dev/null
@@ -0,0 +1,6 @@
+# Catch common programming error:
+# A Condition passed as a string to 'new'.
+use Automake::Condition;
+
+my $cond = new Automake::Condition ('TRUE');
+new Automake::Condition ($cond);
diff --git a/lib/Automake/tests/Cond3.pl b/lib/Automake/tests/Cond3.pl
new file mode 100644 (file)
index 0000000..dc957af
--- /dev/null
@@ -0,0 +1,6 @@
+# Catch common programming error:
+# A Condition passed as a string to 'new'.
+use Automake::Condition;
+
+my $cond = new Automake::Condition ("COND1_TRUE");
+new Automake::Condition ("$cond");
index 06eb34e..99004ac 100644 (file)
@@ -1,4 +1,5 @@
-# Copyright (C) 2001, 2002, 2003, 2008  Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2003, 2008, 2009  Free Software Foundation,
+# Inc.
 #
 # This file is part of GNU Automake.
 #
@@ -18,7 +19,8 @@
 BEGIN {
   use Config;
   if (eval { require 5.007_002; }      # for CLONE support
-      && $Config{useithreads})
+      && $Config{useithreads}
+      && !$ENV{WANT_NO_THREADS})
     {
       require threads;
       import threads;
@@ -32,15 +34,15 @@ use Automake::Condition qw/TRUE FALSE/;
 
 sub test_basics ()
 {
-  my @tests = (# [[Conditions], is_true?, is_false?, string, subst-string]
-              [[], 1, 0, 'TRUE', ''],
-              [['TRUE'], 1, 0, 'TRUE', ''],
-              [['FALSE'], 0, 1, 'FALSE', '#'],
-              [['A_TRUE'], 0, 0, 'A_TRUE', '@A_TRUE@'],
+  my @tests = (# [[Conditions], is_true?, is_false?, string, subst-string, human]
+              [[], 1, 0, 'TRUE', '', 'TRUE'],
+              [['TRUE'], 1, 0, 'TRUE', '', 'TRUE'],
+              [['FALSE'], 0, 1, 'FALSE', '#', 'FALSE'],
+              [['A_TRUE'], 0, 0, 'A_TRUE', '@A_TRUE@', 'A'],
               [['A_TRUE', 'B_FALSE'],
-               0, 0, 'A_TRUE B_FALSE', '@A_TRUE@@B_FALSE@'],
-              [['B_TRUE', 'FALSE'], 0, 1, 'FALSE', '#'],
-              [['B_TRUE', 'B_FALSE'], 0, 1, 'FALSE', '#']);
+               0, 0, 'A_TRUE B_FALSE', '@A_TRUE@@B_FALSE@', 'A and !B'],
+              [['B_TRUE', 'FALSE'], 0, 1, 'FALSE', '#', 'FALSE'],
+              [['B_TRUE', 'B_FALSE'], 0, 1, 'FALSE', '#', 'FALSE']);
 
   for (@tests)
     {
@@ -53,6 +55,7 @@ sub test_basics ()
          return 1 if $_->[2] != ($a == FALSE);
          return 1 if $_->[3] ne $a->string;
          return 1 if $_->[4] ne $a->subst_string;
+         return 1 if $_->[5] ne $a->human;
        })->join;
     }
   return 0;
@@ -281,7 +284,33 @@ sub test_reduce_or ()
   return $failed;
 }
 
-exit (test_basics || test_true_when || test_reduce_and || test_reduce_or);
+sub test_merge ()
+{
+  my $cond = new Automake::Condition "COND1_TRUE", "COND2_FALSE";
+  return threads->new(sub {
+      my $other = new Automake::Condition "COND3_FALSE";
+      return threads->new(sub {
+       my $both = $cond->merge ($other);
+       return threads->new(sub {
+         my $both2 = $cond->merge_conds ("COND3_FALSE");
+         return threads->new(sub {
+           $cond = $both->strip ($other);
+           my @conds = $cond->conds;
+           return 1 if $both->string ne "COND1_TRUE COND2_FALSE COND3_FALSE";
+           return 1 if $cond->string ne "COND1_TRUE COND2_FALSE";
+           return 1 if $both != $both2;
+         })->join;
+       })->join;
+      })->join;
+    })->join;
+  return 0;
+}
+
+exit (test_basics
+      || test_true_when
+      || test_reduce_and
+      || test_reduce_or
+      || test_merge);
 
 ### Setup "GNU" style for perl-mode and cperl-mode.
 ## Local Variables:
index 86f1745..e330e53 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2001, 2002, 2003  Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2003, 2009  Free Software Foundation, Inc.
 #
 # This file is part of GNU Automake.
 #
@@ -19,15 +19,15 @@ use Automake::Condition qw/TRUE FALSE/;
 
 sub test_basics ()
 {
-  my @tests = (# [[Conditions], is_true?, is_false?, string, subst-string]
-              [[], 1, 0, 'TRUE', ''],
-              [['TRUE'], 1, 0, 'TRUE', ''],
-              [['FALSE'], 0, 1, 'FALSE', '#'],
-              [['A_TRUE'], 0, 0, 'A_TRUE', '@A_TRUE@'],
+  my @tests = (# [[Conditions], is_true?, is_false?, string, subst-string, human]
+              [[], 1, 0, 'TRUE', '', 'TRUE'],
+              [['TRUE'], 1, 0, 'TRUE', '', 'TRUE'],
+              [['FALSE'], 0, 1, 'FALSE', '#', 'FALSE'],
+              [['A_TRUE'], 0, 0, 'A_TRUE', '@A_TRUE@', 'A'],
               [['A_TRUE', 'B_FALSE'],
-               0, 0, 'A_TRUE B_FALSE', '@A_TRUE@@B_FALSE@'],
-              [['B_TRUE', 'FALSE'], 0, 1, 'FALSE', '#'],
-              [['B_TRUE', 'B_FALSE'], 0, 1, 'FALSE', '#']);
+               0, 0, 'A_TRUE B_FALSE', '@A_TRUE@@B_FALSE@', 'A and !B'],
+              [['B_TRUE', 'FALSE'], 0, 1, 'FALSE', '#', 'FALSE'],
+              [['B_TRUE', 'B_FALSE'], 0, 1, 'FALSE', '#', 'FALSE']);
 
   for (@tests)
     {
@@ -38,6 +38,7 @@ sub test_basics ()
       return 1 if $_->[2] != ($a == FALSE);
       return 1 if $_->[3] ne $a->string;
       return 1 if $_->[4] ne $a->subst_string;
+      return 1 if $_->[5] ne $a->human;
     }
   return 0;
 }
@@ -240,7 +241,25 @@ sub test_reduce_or ()
   return $failed;
 }
 
-exit (test_basics || test_true_when || test_reduce_and || test_reduce_or);
+sub test_merge ()
+{
+  my $cond = new Automake::Condition "COND1_TRUE", "COND2_FALSE";
+  my $other = new Automake::Condition "COND3_FALSE";
+  my $both = $cond->merge ($other);
+  my $both2 = $cond->merge_conds ("COND3_FALSE");
+  $cond = $both->strip ($other);
+  my @conds = $cond->conds;
+  return 1 if $both->string ne "COND1_TRUE COND2_FALSE COND3_FALSE";
+  return 1 if $cond->string ne "COND1_TRUE COND2_FALSE";
+  return 1 if $both != $both2;
+  return 0;
+}
+
+exit (test_basics
+      || test_true_when
+      || test_reduce_and
+      || test_reduce_or
+      || test_merge);
 
 ### Setup "GNU" style for perl-mode and cperl-mode.
 ## Local Variables:
diff --git a/lib/Automake/tests/DisjCon2.pl b/lib/Automake/tests/DisjCon2.pl
new file mode 100644 (file)
index 0000000..9edd8d5
--- /dev/null
@@ -0,0 +1,8 @@
+# Catch common programming error:
+# A non-Condition reference passed to new.
+use Automake::Condition;
+use Automake::DisjConditions;
+
+my $cond = new Automake::Condition ('TRUE');
+my $cond2 = new Automake::DisjConditions ($cond);
+new Automake::DisjConditions ($cond2);
diff --git a/lib/Automake/tests/DisjCon3.pl b/lib/Automake/tests/DisjCon3.pl
new file mode 100644 (file)
index 0000000..8e69e2b
--- /dev/null
@@ -0,0 +1,7 @@
+# Catch common programming error:
+# A non-reference passed to new.
+use Automake::Condition qw/TRUE FALSE/;
+use Automake::DisjConditions;
+
+my $cond = new Automake::Condition ("COND1_TRUE");
+new Automake::DisjConditions ("$cond");
index 2fe275b..4df5112 100644 (file)
@@ -1,4 +1,5 @@
-# Copyright (C) 2001, 2002, 2003, 2008  Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2003, 2008, 2009  Free Software Foundation,
+# Inc.
 #
 # This file is part of GNU Automake.
 #
@@ -18,7 +19,8 @@
 BEGIN {
   use Config;
   if (eval { require 5.007_002; }      # for CLONE support
-      && $Config{useithreads})
+      && $Config{useithreads}
+      && !$ENV{WANT_NO_THREADS})
     {
       require threads;
       import threads;
@@ -33,18 +35,44 @@ use Automake::DisjConditions;
 
 sub test_basics ()
 {
+  my $true = new Automake::DisjConditions TRUE;
+  my $false = new Automake::DisjConditions FALSE;
   my $cond = new Automake::Condition "COND1_TRUE", "COND2_FALSE";
   return threads->new (sub {
     my $other = new Automake::Condition "COND3_FALSE";
+    my $another = new Automake::Condition "COND3_TRUE", "COND4_FALSE";
     return threads->new (sub {
       my $set1 = new Automake::DisjConditions $cond, $other;
       return threads->new (sub {
        my $set2 = new Automake::DisjConditions $other, $cond;
+       my $set3 = new Automake::DisjConditions FALSE, $another;
        return 1 unless $set1 == $set2;
        return 1 if $set1->false;
        return 1 if $set1->true;
        return 1 unless (new Automake::DisjConditions)->false;
        return 1 if (new Automake::DisjConditions)->true;
+       return 1 unless $true->human eq 'TRUE';
+       return 1 unless $false->human eq 'FALSE';
+       return 1 unless $set1->human eq "(COND1 and !COND2) or (!COND3)";
+       return 1 unless $set2->human eq "(COND1 and !COND2) or (!COND3)";
+       my $one_cond_human = $set1->one_cond->human;
+       return 1 unless $one_cond_human eq "!COND3"
+                       || $one_cond_human eq "COND1 and !COND2";
+       return 1 unless $set1->string eq "COND1_TRUE COND2_FALSE | COND3_FALSE";
+
+       my $merged1 = $set1->merge ($set2);
+       my $merged2 = $set1->merge ($cond);
+       my $mult1 = $set1->multiply ($set3);
+       return threads->new (sub {
+         my $mult2 = $set1->multiply ($another);
+         return threads->new (sub {
+           return 1 unless $merged1->simplify->string eq "COND1_TRUE COND2_FALSE | COND3_FALSE";
+           return 1 unless $merged2->simplify->string eq "COND1_TRUE COND2_FALSE | COND3_FALSE";
+           return 1 unless $mult1->string eq "COND1_TRUE COND2_FALSE COND3_TRUE COND4_FALSE";
+           return 1 unless $mult1 == $mult2;
+           return 0;
+         })->join;
+       })->join;
       })->join;
     })->join;
   })->join;
index 47dea83..7ccac13 100644 (file)
@@ -1,4 +1,5 @@
-# Copyright (C) 2001, 2002, 2003, 2008  Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2003, 2008, 2009  Free Software Foundation,
+# Inc.
 #
 # This file is part of GNU Automake.
 #
@@ -20,15 +21,38 @@ use Automake::DisjConditions;
 
 sub test_basics ()
 {
+  my $true = new Automake::DisjConditions TRUE;
+  my $false = new Automake::DisjConditions FALSE;
   my $cond = new Automake::Condition "COND1_TRUE", "COND2_FALSE";
   my $other = new Automake::Condition "COND3_FALSE";
+  my $another = new Automake::Condition "COND3_TRUE", "COND4_FALSE";
   my $set1 = new Automake::DisjConditions $cond, $other;
   my $set2 = new Automake::DisjConditions $other, $cond;
+  my $set3 = new Automake::DisjConditions FALSE, $another;
   return 1 unless $set1 == $set2;
   return 1 if $set1->false;
   return 1 if $set1->true;
   return 1 unless (new Automake::DisjConditions)->false;
   return 1 if (new Automake::DisjConditions)->true;
+  return 1 unless $true->human eq 'TRUE';
+  return 1 unless $false->human eq 'FALSE';
+  return 1 unless $set1->human eq "(COND1 and !COND2) or (!COND3)";
+  return 1 unless $set2->human eq "(COND1 and !COND2) or (!COND3)";
+  my $one_cond_human = $set1->one_cond->human;
+  return 1 unless $one_cond_human eq "!COND3"
+                  || $one_cond_human eq "COND1 and !COND2";
+  return 1 unless $set1->string eq "COND1_TRUE COND2_FALSE | COND3_FALSE";
+
+  my $merged1 = $set1->merge ($set2);
+  my $merged2 = $set1->merge ($cond);
+  my $mult1 = $set1->multiply ($set3);
+  my $mult2 = $set1->multiply ($another);
+  return 1 unless $merged1->simplify->string eq "COND1_TRUE COND2_FALSE | COND3_FALSE";
+  return 1 unless $merged2->simplify->string eq "COND1_TRUE COND2_FALSE | COND3_FALSE";
+  return 1 unless $mult1->string eq "COND1_TRUE COND2_FALSE COND3_TRUE COND4_FALSE";
+  return 1 unless $mult1 == $mult2;
+
+  return 0;
 }
 
 sub build_set (@)
index c5e53d2..b4f09f1 100644 (file)
@@ -22,9 +22,23 @@ TEST_EXTENSIONS = .pl
 TESTS = \
 Condition.pl \
 Condition-t.pl \
+Cond2.pl \
+Cond3.pl \
 DisjConditions.pl \
 DisjConditions-t.pl \
+DisjCon2.pl \
+DisjCon3.pl \
 Version.pl \
+Version2.pl \
+Version3.pl \
 Wrap.pl
 
+XFAIL_TESTS = \
+Cond2.pl \
+Cond3.pl \
+DisjCon2.pl \
+DisjCon3.pl \
+Version2.pl \
+Version3.pl
+
 EXTRA_DIST = $(TESTS)
index 8167788..37bb426 100644 (file)
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11 from Makefile.am.
+# Makefile.in generated by automake 1.11a from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -55,14 +55,20 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/amversion.m4 \
        $(top_srcdir)/m4/install-sh.m4 $(top_srcdir)/m4/lead-dot.m4 \
        $(top_srcdir)/m4/missing.m4 $(top_srcdir)/m4/mkdirp.m4 \
        $(top_srcdir)/m4/options.m4 $(top_srcdir)/m4/runlog.m4 \
-       $(top_srcdir)/m4/sanity.m4 $(top_srcdir)/m4/strip.m4 \
-       $(top_srcdir)/m4/substnot.m4 $(top_srcdir)/m4/tar.m4 \
-       $(top_srcdir)/configure.ac
+       $(top_srcdir)/m4/sanity.m4 $(top_srcdir)/m4/silent.m4 \
+       $(top_srcdir)/m4/strip.m4 $(top_srcdir)/m4/substnot.m4 \
+       $(top_srcdir)/m4/tar.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
 mkinstalldirs = $(SHELL) $(top_srcdir)/lib/mkinstalldirs
 CONFIG_CLEAN_FILES =
 CONFIG_CLEAN_VPATH_FILES =
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo "  GEN     " $@;
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
 SOURCES =
 DIST_SOURCES =
 # If stdout is a non-dumb tty, use colors.  If test -t is not supported,
@@ -179,6 +185,7 @@ TEST_LOGS_TMP = $(TEST_LOGS:.log=.log-t)
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 APIVERSION = @APIVERSION@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
@@ -273,11 +280,25 @@ TEST_EXTENSIONS = .pl
 TESTS = \
 Condition.pl \
 Condition-t.pl \
+Cond2.pl \
+Cond3.pl \
 DisjConditions.pl \
 DisjConditions-t.pl \
+DisjCon2.pl \
+DisjCon3.pl \
 Version.pl \
+Version2.pl \
+Version3.pl \
 Wrap.pl
 
+XFAIL_TESTS = \
+Cond2.pl \
+Cond3.pl \
+DisjCon2.pl \
+DisjCon3.pl \
+Version2.pl \
+Version3.pl
+
 EXTRA_DIST = $(TESTS)
 all: all-am
 
@@ -319,6 +340,8 @@ TAGS:
 ctags: CTAGS
 CTAGS:
 
+cscope cscopelist:
+
 
 $(TEST_SUITE_LOG): $(TEST_LOGS)
        @$(am__sh_e_setup);                                             \
@@ -491,10 +514,15 @@ install-am: all-am
 
 installcheck: installcheck-am
 install-strip:
-       $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-         install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-         `test -z '$(STRIP)' || \
-           echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+       if test -z '$(STRIP)'; then \
+         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+             install; \
+       else \
+         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+           "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+       fi
 mostlyclean-generic:
        -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS)
        -test -z "$(TEST_LOGS_TMP)" || rm -f $(TEST_LOGS_TMP)
index e496435..bea91f0 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2002, 2003  Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003, 2009  Free Software Foundation, Inc.
 #
 # This file is part of GNU Automake.
 #
@@ -42,6 +42,29 @@ sub test_version_compare
     print "compare (\"$left\", \"$right\") = $res! (not $result?)\n";
     $failed = 1;
   }
+
+  my $check_expected = ($result == 0 || $result == 1) ? 0 : 1;
+  # Exception for 'foo' fork.
+  $check_expected = 1
+    if ($right =~ /foo/ && !($left =~ /foo/));
+
+  my $check = Automake::Version::check ($left, $right);
+  if ($check != $check_expected)
+  {
+    print "check (\"$left\", \"$right\") = $check! (not $check_expected?)\n";
+    $failed = 1;
+  }
+}
+
+sub test_bad_versions
+{
+  my ($ver) = @_;
+  my @version = Automake::Version::split ($ver);
+  if ($#version != -1)
+  {
+    print "shouldn't grok \"$ver\"\n";
+    $failed = 1;
+  }
 }
 
 my @tests = (
@@ -69,15 +92,24 @@ my @tests = (
   ['1.5a', '1.5.1f', 1],
   ['1.5', '1.5.1a', -1],
   ['1.5.1a', '1.5.1f', -1],
+  ['1.5.1f', '1.5.1a', 1],
+  ['1.5.1f', '1.5.1f', 0],
 # special exceptions
   ['1.6-p5a', '1.6.5a', 0],
   ['1.6', '1.6-p5a', -1],
   ['1.6-p4b', '1.6-p5a', -1],
   ['1.6-p4b', '1.6-foo', 1],
-  ['1.6-p4b', '1.6a-foo', -1]
+  ['1.6-p4b', '1.6a-foo', -1],
+  ['1.6-p5', '1.6.5', 0],
+  ['1.6a-foo', '1.6a-foo', 0],
+);
+
+my @bad_versions = (
+  '', 'a', '1', '1a', '1.2.3.4', '-1.2'
 );
 
 test_version_compare (@{$_}) foreach @tests;
+test_bad_versions ($_) foreach @bad_versions;
 
 exit $failed;
 
diff --git a/lib/Automake/tests/Version2.pl b/lib/Automake/tests/Version2.pl
new file mode 100644 (file)
index 0000000..038466d
--- /dev/null
@@ -0,0 +1,5 @@
+# prog_error due to invalid $VERSION.
+
+use Automake::Version;
+
+Automake::Version::check ('', '1.2.3');
diff --git a/lib/Automake/tests/Version3.pl b/lib/Automake/tests/Version3.pl
new file mode 100644 (file)
index 0000000..ebac23f
--- /dev/null
@@ -0,0 +1,5 @@
+# prog_error due to invalid $REQUIRED.
+
+use Automake::Version;
+
+Automake::Version::check ('1.2.3', '');
index 8d840fc..b415401 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2003  Free Software Foundation, Inc.
+# Copyright (C) 2003, 2009  Free Software Foundation, Inc.
 #
 # This file is part of GNU Automake.
 #
@@ -15,7 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-use Automake::Wrap 'wrap';
+use Automake::Wrap qw/wrap makefile_wrap/;
 
 my $failed = 0;
 
@@ -31,6 +31,18 @@ sub test_wrap
     }
 }
 
+sub test_makefile_wrap
+{
+  my ($in, $exp_out) = @_;
+
+  my $out = &makefile_wrap (@$in);
+  if ($out ne $exp_out)
+    {
+      print STDERR "For: @$in\nGot:\n$out\nInstead of:\n$exp_out\n---\n";
+      ++$failed;
+    }
+}
+
 my @tests = (
   [["HEAD:", "NEXT:", "CONT", 13, "v" ,"a", "l", "ue", "s", "values"],
 "HEAD:v aCONT
@@ -55,10 +67,32 @@ big continuation:diag3
 "big header: END
 cont: word1 END
 cont: word2
+"],
+  [["big header:", "", " END", 16, "w1", "w2 ", "w3"],
+"big header: END
+w1 w2 w3
 "]);
 
+my @makefile_tests = (
+  [["target:"],
+"target:
+"],
+  [["target:", "\t"],
+"target:
+"],
+  [["target:", "\t", "prereq1", "prereq2"],
+"target: prereq1 prereq2
+"],
+  [["target: ", "\t", "this is a long list of prerequisites ending in space",
+    "so that there is no need for another space before the backslash",
+    "unlike in the second line"],
+"target: this is a long list of prerequisites ending in space \\
+\tso that there is no need for another space before the backslash \\
+\tunlike in the second line
+"]);
 
 test_wrap (@{$_}) foreach @tests;
+test_makefile_wrap (@{$_}) foreach @makefile_tests;
 
 exit $failed;
 
index 627368d..5bdc02e 100644 (file)
@@ -2,7 +2,8 @@
 
 ## Makefile for Automake lib.
 
-# Copyright (C) 2001, 2003, 2004, 2009 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2003, 2004, 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
@@ -28,7 +29,7 @@ dist_pkgvdata_DATA = COPYING INSTALL texinfo.tex ansi2knr.c ansi2knr.1 \
 scriptdir = $(pkgvdatadir)
 dist_script_DATA = config.guess config.sub install-sh mdate-sh missing \
   mkinstalldirs elisp-comp ylwrap acinstall depcomp compile py-compile \
-  symlink-tree
+  symlink-tree ar-lib
 
 EXTRA_DIST = gnupload
 
index f90b085..464170b 100644 (file)
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11 from Makefile.am.
+# Makefile.in generated by automake 1.11a from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -15,7 +15,8 @@
 
 @SET_MAKE@
 
-# Copyright (C) 2001, 2003, 2004, 2009 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2003, 2004, 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
@@ -51,8 +52,8 @@ build_triplet = @build@
 subdir = lib
 DIST_COMMON = $(dist_pkgvdata_DATA) $(dist_script_DATA) \
        $(srcdir)/Makefile.am $(srcdir)/Makefile.in COPYING INSTALL \
-       ansi2knr.1 ansi2knr.c compile config.guess config.sub depcomp \
-       elisp-comp install-sh mdate-sh missing mkinstalldirs \
+       ansi2knr.1 ansi2knr.c ar-lib compile config.guess config.sub \
+       depcomp elisp-comp install-sh mdate-sh missing mkinstalldirs \
        py-compile texinfo.tex ylwrap
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/amversion.m4 \
@@ -60,14 +61,20 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/amversion.m4 \
        $(top_srcdir)/m4/install-sh.m4 $(top_srcdir)/m4/lead-dot.m4 \
        $(top_srcdir)/m4/missing.m4 $(top_srcdir)/m4/mkdirp.m4 \
        $(top_srcdir)/m4/options.m4 $(top_srcdir)/m4/runlog.m4 \
-       $(top_srcdir)/m4/sanity.m4 $(top_srcdir)/m4/strip.m4 \
-       $(top_srcdir)/m4/substnot.m4 $(top_srcdir)/m4/tar.m4 \
-       $(top_srcdir)/configure.ac
+       $(top_srcdir)/m4/sanity.m4 $(top_srcdir)/m4/silent.m4 \
+       $(top_srcdir)/m4/strip.m4 $(top_srcdir)/m4/substnot.m4 \
+       $(top_srcdir)/m4/tar.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
 mkinstalldirs = $(SHELL) $(top_srcdir)/lib/mkinstalldirs
 CONFIG_CLEAN_FILES =
 CONFIG_CLEAN_VPATH_FILES =
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo "  GEN     " $@;
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
 SOURCES =
 DIST_SOURCES =
 RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
@@ -136,6 +143,7 @@ am__relativize = \
   reldir="$$dir2"
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 APIVERSION = @APIVERSION@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
@@ -231,7 +239,7 @@ dist_pkgvdata_DATA = COPYING INSTALL texinfo.tex ansi2knr.c ansi2knr.1 \
 scriptdir = $(pkgvdatadir)
 dist_script_DATA = config.guess config.sub install-sh mdate-sh missing \
   mkinstalldirs elisp-comp ylwrap acinstall depcomp compile py-compile \
-  symlink-tree
+  symlink-tree ar-lib
 
 EXTRA_DIST = gnupload
 all: all-recursive
@@ -377,6 +385,10 @@ ctags-recursive:
        list='$(SUBDIRS)'; for subdir in $$list; do \
          test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
        done
+cscopelist-recursive:
+       list='$(SUBDIRS)'; for subdir in $$list; do \
+         test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \
+       done
 
 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
        list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
@@ -440,6 +452,20 @@ GTAGS:
          && $(am__cd) $(top_srcdir) \
          && gtags -i $(GTAGS_ARGS) "$$here"
 
+cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP)
+       list='$(SOURCES) $(HEADERS) $(LISP)'; \
+       case "$(srcdir)" in \
+         [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+         *) sdir=$(subdir)/$(srcdir) ;; \
+       esac; \
+       for i in $$list; do \
+         if test -f "$$i"; then \
+           echo "$(subdir)/$$i"; \
+         else \
+           echo "$$sdir/$$i"; \
+         fi; \
+       done >> $(top_builddir)/cscope.files
+
 distclean-tags:
        -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
@@ -519,10 +545,15 @@ install-am: all-am
 
 installcheck: installcheck-recursive
 install-strip:
-       $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-         install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-         `test -z '$(STRIP)' || \
-           echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+       if test -z '$(STRIP)'; then \
+         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+             install; \
+       else \
+         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+           "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+       fi
 mostlyclean-generic:
 
 clean-generic:
@@ -601,22 +632,24 @@ ps-am:
 
 uninstall-am: uninstall-dist_pkgvdataDATA uninstall-dist_scriptDATA
 
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
-       install-am install-data-am install-strip tags-recursive
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) \
+       cscopelist-recursive ctags-recursive install-am \
+       install-data-am install-strip tags-recursive
 
 .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
-       all all-am check check-am clean clean-generic ctags \
-       ctags-recursive distclean distclean-generic distclean-tags \
-       distdir dvi dvi-am html html-am info info-am install \
-       install-am install-data install-data-am install-data-hook \
-       install-dist_pkgvdataDATA install-dist_scriptDATA install-dvi \
-       install-dvi-am install-exec install-exec-am install-html \
-       install-html-am install-info install-info-am install-man \
-       install-pdf install-pdf-am install-ps install-ps-am \
-       install-strip installcheck installcheck-am installcheck-local \
-       installdirs installdirs-am maintainer-clean \
-       maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
-       pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \
+       all all-am check check-am clean clean-generic cscopelist \
+       cscopelist-recursive ctags ctags-recursive distclean \
+       distclean-generic distclean-tags distdir dvi dvi-am html \
+       html-am info info-am install install-am install-data \
+       install-data-am install-data-hook install-dist_pkgvdataDATA \
+       install-dist_scriptDATA install-dvi install-dvi-am \
+       install-exec install-exec-am install-html install-html-am \
+       install-info install-info-am install-man install-pdf \
+       install-pdf-am install-ps install-ps-am install-strip \
+       installcheck installcheck-am installcheck-local installdirs \
+       installdirs-am maintainer-clean maintainer-clean-generic \
+       mostlyclean mostlyclean-generic pdf pdf-am ps ps-am tags \
+       tags-recursive uninstall uninstall-am \
        uninstall-dist_pkgvdataDATA uninstall-dist_scriptDATA
 
 
index 8924d17..80f1242 100644 (file)
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11 from Makefile.am.
+# Makefile.in generated by automake 1.11a from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -58,14 +58,20 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/amversion.m4 \
        $(top_srcdir)/m4/install-sh.m4 $(top_srcdir)/m4/lead-dot.m4 \
        $(top_srcdir)/m4/missing.m4 $(top_srcdir)/m4/mkdirp.m4 \
        $(top_srcdir)/m4/options.m4 $(top_srcdir)/m4/runlog.m4 \
-       $(top_srcdir)/m4/sanity.m4 $(top_srcdir)/m4/strip.m4 \
-       $(top_srcdir)/m4/substnot.m4 $(top_srcdir)/m4/tar.m4 \
-       $(top_srcdir)/configure.ac
+       $(top_srcdir)/m4/sanity.m4 $(top_srcdir)/m4/silent.m4 \
+       $(top_srcdir)/m4/strip.m4 $(top_srcdir)/m4/substnot.m4 \
+       $(top_srcdir)/m4/tar.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
 mkinstalldirs = $(SHELL) $(top_srcdir)/lib/mkinstalldirs
 CONFIG_CLEAN_FILES =
 CONFIG_CLEAN_VPATH_FILES =
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo "  GEN     " $@;
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
 SOURCES =
 DIST_SOURCES =
 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
@@ -94,6 +100,7 @@ DATA = $(dist_am_DATA)
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 APIVERSION = @APIVERSION@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
@@ -285,6 +292,8 @@ TAGS:
 ctags: CTAGS
 CTAGS:
 
+cscope cscopelist:
+
 
 distdir: $(DISTFILES)
        @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
@@ -333,10 +342,15 @@ install-am: all-am
 
 installcheck: installcheck-am
 install-strip:
-       $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-         install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-         `test -z '$(STRIP)' || \
-           echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+       if test -z '$(STRIP)'; then \
+         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+             install; \
+       else \
+         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+           "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+       fi
 mostlyclean-generic:
 
 clean-generic:
index 08de45c..37f34ca 100644 (file)
@@ -1,5 +1,5 @@
 ## automake - create Makefile.in from Makefile.am
-## Copyright (C) 1994, 1995, 1996, 1997, 2000, 2001, 2003, 2006
+## Copyright (C) 1994, 1995, 1996, 1997, 2000, 2001, 2003, 2006, 2010
 ## Free Software Foundation, Inc.
 
 ## This program is free software; you can redistribute it and/or modify
@@ -73,7 +73,7 @@ check-DEJAGNU: site.exp
 ## the possibility of a corrupted site.exp if make is interrupted.
 ## Jim Meyering has some useful text on this topic.
 site.exp: Makefile
-       @echo 'Making a new site.exp file...'
+       @echo 'Making a new site.exp file ...'
        @echo '## these variables are automatically generated by make ##' >site.tmp
        @echo '# Do not edit here.  If you wish to override these values' >>site.tmp
        @echo '# edit the last section' >>site.tmp
index e0f3bce..185d34c 100644 (file)
@@ -26,7 +26,7 @@ am__remove_distdir = \
   { test ! -d "$(distdir)" \
     || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
          && rm -fr "$(distdir)"; }; }
-
+am__post_remove_distdir = $(am__remove_distdir)
 endif %?TOPDIR_P%
 
 if %?SUBDIRS%
@@ -328,6 +328,10 @@ endif %?TOPDIR_P%
 ## with tar 1.11.2).  We do not do anything specific w.r.t. this
 ## incompatibility since packages where empty directories need to be
 ## present in the archive are really unusual.
+##
+## We order DIST_TARGETS by expected duration of the compressors,
+## slowest first, for better parallelism in `make dist'.  Do not
+## reorder DIST_ARCHIVES, users may expect gzip to be first.
 
 if %?TOPDIR_P%
 
@@ -336,44 +340,59 @@ GZIP_ENV = --best
 .PHONY: dist-gzip
 dist-gzip: distdir
        tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
-       $(am__remove_distdir)
+       $(am__post_remove_distdir)
 
 ?BZIP2?DIST_ARCHIVES += $(distdir).tar.bz2
 .PHONY: dist-bzip2
 dist-bzip2: distdir
-       tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
-       $(am__remove_distdir)
+       tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
+       $(am__post_remove_distdir)
+
+?LZIP?DIST_ARCHIVES += $(distdir).tar.lz
+.PHONY: dist-lzip
+dist-lzip: distdir
+       tardir=$(distdir) && $(am__tar) | lzip -9 -c >$(distdir).tar.lz
+       $(am__post_remove_distdir)
 
 ?LZMA?DIST_ARCHIVES += $(distdir).tar.lzma
 .PHONY: dist-lzma
 dist-lzma: distdir
        tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
-       $(am__remove_distdir)
+       $(am__post_remove_distdir)
 
 ?XZ?DIST_ARCHIVES += $(distdir).tar.xz
 .PHONY: dist-xz
 dist-xz: distdir
-       tardir=$(distdir) && $(am__tar) | xz -9 -c >$(distdir).tar.xz
-       $(am__remove_distdir)
+       tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--9} xz -c >$(distdir).tar.xz
+       $(am__post_remove_distdir)
 
 ?COMPRESS?DIST_ARCHIVES += $(distdir).tar.Z
 .PHONY: dist-tarZ
 dist-tarZ: distdir
        tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
-       $(am__remove_distdir)
+       $(am__post_remove_distdir)
 
 ?SHAR?DIST_ARCHIVES += $(distdir).shar.gz
 .PHONY: dist-shar
 dist-shar: distdir
        shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
-       $(am__remove_distdir)
+       $(am__post_remove_distdir)
 
 ?ZIP?DIST_ARCHIVES += $(distdir).zip
 .PHONY: dist-zip
 dist-zip: distdir
        -rm -f $(distdir).zip
        zip -rq $(distdir).zip $(distdir)
-       $(am__remove_distdir)
+       $(am__post_remove_distdir)
+
+?LZMA?DIST_TARGETS += dist-lzma
+?LZIP?DIST_TARGETS += dist-lzip
+?XZ?DIST_TARGETS += dist-xz
+?SHAR?DIST_TARGETS += dist-shar
+?BZIP2?DIST_TARGETS += dist-bzip2
+?GZIP?DIST_TARGETS += dist-gzip
+?ZIP?DIST_TARGETS += dist-zip
+?COMPRESS?DIST_TARGETS += dist-tarZ
 
 endif %?TOPDIR_P%
 
@@ -393,16 +412,9 @@ if %?SUBDIRS%
 AM_RECURSIVE_TARGETS += dist dist-all
 endif %?SUBDIRS%
 
-dist dist-all: distdir
-?GZIP? tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
-?BZIP2?        tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
-?LZMA? tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
-?XZ?   tardir=$(distdir) && $(am__tar) | xz -9 -c >$(distdir).tar.xz
-?COMPRESS?     tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
-?SHAR? shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
-?ZIP?  -rm -f $(distdir).zip
-?ZIP?  zip -rq $(distdir).zip $(distdir)
-       $(am__remove_distdir)
+dist dist-all:
+       $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:'
+       $(am__post_remove_distdir)
 
 endif %?TOPDIR_P%
 
@@ -429,6 +441,8 @@ distcheck: dist
          bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
        *.tar.lzma*) \
          lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\
+       *.tar.lz*) \
+         lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
        *.tar.xz*) \
          xz -dc $(distdir).tar.xz | $(am__untar) ;;\
        *.tar.Z*) \
@@ -505,7 +519,7 @@ distcheck: dist
 ## Cater to parallel BSD make (see above).
          && cd "$$am__cwd" \
          || exit 1
-       $(am__remove_distdir)
+       $(am__post_remove_distdir)
        @(echo "$(distdir) archives ready for distribution: "; \
          list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
          sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
index d261070..01ae49a 100644 (file)
@@ -1,5 +1,5 @@
 ## automake - create Makefile.in from Makefile.am
-## Copyright (C) 2001, 2002, 2003, 2004, 2006, 2008, 2009  Free Software
+## Copyright (C) 2001, 2002, 2003, 2004, 2006, 2008, 2009, 2010 Free Software
 ## Foundation, Inc.
 
 ## This program is free software; you can redistribute it and/or modify
@@ -90,9 +90,17 @@ install-strip:
 ## It's OK to override both with INSTALL_STRIP_PROGRAM, because
 ## INSTALL_STRIP_PROGRAM uses install-sh (see m4/strip.m4 for a rationale).
 ##
-## Use double quotes here because we might need to interpolate some
-## backquotes at runtime.
-       $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-         install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-         `test -z '$(STRIP)' || \
-           echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+## Use double quotes for the *_PROGRAM settings because we might need to
+## interpolate some backquotes at runtime.
+##
+## The case for empty $(STRIP) is separate so that it is quoted correctly for
+## multiple words, but does not expand to an empty words if STRIP is empty.
+       if test -z '$(STRIP)'; then \
+         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+             install; \
+       else \
+         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+           "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+       fi
index ce94e5e..db096c7 100644 (file)
@@ -1,5 +1,5 @@
 ## automake - create Makefile.in from Makefile.am
-## Copyright (C) 1994, 1995, 1996, 1999, 2003, 2009 Free Software
+## Copyright (C) 1994, 1995, 1996, 1999, 2003, 2009, 2010 Free Software
 ## Foundation, Inc.
 
 ## This program is free software; you can redistribute it and/or modify
@@ -14,7 +14,7 @@
 
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
-%LIBRARY%: $(%XLIBRARY%_OBJECTS) $(%XLIBRARY%_DEPENDENCIES) %DIRSTAMP%
+%LIBRARY%: $(%XLIBRARY%_OBJECTS) $(%XLIBRARY%_DEPENDENCIES) $(EXTRA_%XLIBRARY%_DEPENDENCIES) %DIRSTAMP%
        %SILENT%-rm -f %LIBRARY%
        %VERBOSE%$(%XLIBRARY%_AR) %LIBRARY% $(%XLIBRARY%_OBJECTS) $(%XLIBRARY%_LIBADD)
        %SILENT%$(RANLIB) %LIBRARY%
index 29aa00c..55e53e1 100644 (file)
@@ -104,9 +104,11 @@ clean-%DIR%LTLIBRARIES:
 ## `so_locations' files are created by some linkers (IRIX, OSF) when
 ## building a shared object.  Libtool places these files in the
 ## directory where the shared object is created.
-       @list='$(%DIR%_LTLIBRARIES)'; for p in $$list; do \
-         dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-         test "$$dir" != "$$p" || dir=.; \
-         echo "rm -f \"$${dir}/so_locations\""; \
-         rm -f "$${dir}/so_locations"; \
-       done
+       @list='$(%DIR%_LTLIBRARIES)'; \
+       locs=`for p in $$list; do echo $$p; done | \
+             sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+             sort -u`; \
+       test -z "$$locs" || { \
+         echo rm -f $${locs}; \
+         rm -f $${locs}; \
+       }
index 9455234..3cd2941 100644 (file)
@@ -1,5 +1,5 @@
 ## automake - create Makefile.in from Makefile.am
-## Copyright (C) 1994, 1995, 1996, 2003, 2005, 2008, 2009 Free Software
+## Copyright (C) 1994, 1995, 1996, 2003, 2005, 2008, 2009, 2010 Free Software
 ## Foundation, Inc.
 
 ## This program is free software; you can redistribute it and/or modify
@@ -14,5 +14,5 @@
 
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
-%LTLIBRARY%: $(%XLTLIBRARY%_OBJECTS) $(%XLTLIBRARY%_DEPENDENCIES) %DIRSTAMP%
+%LTLIBRARY%: $(%XLTLIBRARY%_OBJECTS) $(%XLTLIBRARY%_DEPENDENCIES) $(EXTRA_%XLTLIBRARY%_DEPENDENCIES) %DIRSTAMP%
        %VERBOSE%$(%XLINK%) %RPATH% $(%XLTLIBRARY%_OBJECTS) $(%XLTLIBRARY%_LIBADD) $(LIBS)
index 7e568e7..c0e188f 100644 (file)
@@ -1,5 +1,5 @@
 ## automake - create Makefile.in from Makefile.am
-## Copyright (C) 1994, 1995, 1996, 1997, 2001, 2003, 2005, 2009
+## Copyright (C) 1994, 1995, 1996, 1997, 2001, 2003, 2005, 2009, 2010
 ## Free Software Foundation, Inc.
 
 ## This program is free software; you can redistribute it and/or modify
@@ -14,7 +14,7 @@
 
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
-%PROGRAM%%EXEEXT%: $(%XPROGRAM%_OBJECTS) $(%XPROGRAM%_DEPENDENCIES) %DIRSTAMP%
+%PROGRAM%%EXEEXT%: $(%XPROGRAM%_OBJECTS) $(%XPROGRAM%_DEPENDENCIES) $(EXTRA_%XPROGRAM%_DEPENDENCIES) %DIRSTAMP%
 ## Remove program before linking.  Otherwise the link will fail if the
 ## program is running somewhere.  FIXME: this could be a loss if
 ## you're using an incremental linker.  Maybe we should think twice?
index d39b23d..d26968a 100644 (file)
@@ -1,6 +1,6 @@
 ## automake - create Makefile.in from Makefile.am
 ## Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2003, 2004,
-## 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+## 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
@@ -42,7 +42,7 @@ install-%DIR%PROGRAMS: $(%DIR%_PROGRAMS)
            -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
        sed 'N;N;N;s,\n, ,g' | \
 ## The following awk script turns that into one line containing directories
-## and then lines of 'type target_name_or_directory sources...', with type
+## and then lines of 'type target_name_or_directory sources ...', with type
 ## 'd' designating directories, and 'f' files.
        $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
          { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
index 7463e2f..7fa75c9 100644 (file)
@@ -134,6 +134,43 @@ GTAGS:
          && gtags -i $(GTAGS_ARGS) "$$here"
 
 
+## ------- ##
+## cscope  ##
+## ------- ##
+
+if %?TOPDIR_P%
+
+CSCOPE = cscope
+.PHONY: cscope clean-cscope
+AM_RECURSIVE_TARGETS += cscope
+
+cscope: cscope.files
+       test ! -s cscope.files \
+         || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)
+
+clean-cscope:
+       -rm -f cscope.files
+
+cscope.files: clean-cscope %CSCOPEDIRS% cscopelist
+
+endif %?TOPDIR_P%
+
+.PHONY: cscopelist
+cscopelist: %CSCOPEDIRS% $(HEADERS) $(SOURCES) $(LISP)
+       list='$(SOURCES) $(HEADERS) $(LISP)'; \
+       case "$(srcdir)" in \
+         [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+         *) sdir=$(subdir)/$(srcdir) ;; \
+       esac; \
+       for i in $$list; do \
+         if test -f "$$i"; then \
+           echo "$(subdir)/$$i"; \
+         else \
+           echo "$$sdir/$$i"; \
+         fi; \
+       done >> $(top_builddir)/cscope.files
+
+
 ## ---------- ##
 ## Cleaning.  ##
 ## ---------- ##
@@ -142,3 +179,6 @@ GTAGS:
 
 distclean-tags:
        -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+if %?TOPDIR_P%
+       -rm -f cscope.out cscope.in.out cscope.po.out cscope.files
+endif %?TOPDIR_P%
index dca9ce1..4b1add7 100644 (file)
@@ -32,7 +32,7 @@
 ##    to fail, the info files are not removed.  (They are needed by the
 ##    developer while he writes documentation.)
 ## *.iNN files are used on DJGPP.  See the comments in install-info-am
-       restore=: && backupdir="$(am__leading_dot)am$$$$" && \
+       %AM_V_MAKEINFO%restore=: && backupdir="$(am__leading_dot)am$$$$" && \
 ?INSRC?        am__cwd=`pwd` && $(am__cd) $(srcdir) && \
        rm -rf $$backupdir && mkdir $$backupdir && \
 ## If makeinfo is not installed we must not backup the files so
@@ -62,23 +62,27 @@ INFO_DEPS += %DEST_INFO_PREFIX%%DEST_SUFFIX%
 
 ?GENERIC?%SOURCE_SUFFIX%.dvi:
 ?!GENERIC?%DEST_PREFIX%.dvi: %SOURCE% %DEPS% %DIRSTAMP%
-       TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
+       %AM_V_TEXI2DVI%TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
 ## Must set MAKEINFO like this so that version.texi will be found even
 ## if it is in srcdir (-I $(srcdir) is set in %MAKEINFOFLAGS%).
        MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) %MAKEINFOFLAGS%' \
 ## Do not use `-o' unless necessary: it is only supported since Texinfo 4.1.
-?GENERIC?      $(TEXI2DVI) %SOURCE%
-?!GENERIC?     $(TEXI2DVI) -o $@ `test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE%
+## texi2dvi doesn't silence everything with -q, redirect to /dev/null instead.
+## We still want -q (%TEXIQUIET%) because it turns on batch mode.
+?GENERIC?      $(TEXI2DVI) %TEXIQUIET% %SOURCE% %TEXIDEVNULL%
+?!GENERIC?     $(TEXI2DVI) %TEXIQUIET% -o $@ `test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE% %TEXIDEVNULL%
 
 ?GENERIC?%SOURCE_SUFFIX%.pdf:
 ?!GENERIC?%DEST_PREFIX%.pdf: %SOURCE% %DEPS% %DIRSTAMP%
-       TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
+       %AM_V_TEXI2PDF%TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
 ## Must set MAKEINFO like this so that version.texi will be found even
 ## if it is in srcdir (-I $(srcdir) is set in %MAKEINFOFLAGS%).
        MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) %MAKEINFOFLAGS%' \
 ## Do not use `-o' unless necessary: it is only supported since Texinfo 4.1.
-?GENERIC?      $(TEXI2PDF) %SOURCE%
-?!GENERIC?     $(TEXI2PDF) -o $@ `test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE%
+## texi2pdf doesn't silence everything with -q, redirect to /dev/null instead.
+## We still want -q (%TEXIQUIET%) because it turns on batch mode.
+?GENERIC?      $(TEXI2PDF) %TEXIQUIET% %SOURCE% %TEXIDEVNULL%
+?!GENERIC?     $(TEXI2PDF) %TEXIQUIET% -o $@ `test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE% %TEXIDEVNULL%
 
 ?GENERIC?%SOURCE_SUFFIX%.html:
 ?!GENERIC?%DEST_PREFIX%.html: %SOURCE% %DEPS% %DIRSTAMP%
@@ -88,8 +92,8 @@ INFO_DEPS += %DEST_INFO_PREFIX%%DEST_SUFFIX%
 ## in the manual change, it may leave unused pages.  Our fix
 ## is to build under a temporary name, and replace the target on
 ## success.
-       rm -rf $(@:.html=.htp)
-       if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) %MAKEINFOFLAGS% \
+       %AM_V_MAKEINFO%rm -rf $(@:.html=.htp)
+       %SILENT%if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) %MAKEINFOFLAGS% \
 ?GENERIC?       -o $(@:.html=.htp) %SOURCE%; \
 ?!GENERIC?      -o $(@:.html=.htp) `test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE%; \
        then \
index c9dcd9d..bfde665 100644 (file)
@@ -55,8 +55,8 @@ endif %?LOCAL-TEXIS%
 if %?LOCAL-TEXIS%
 DVIPS = dvips
 .dvi.ps:
-       TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
-       $(DVIPS) -o $@ $<
+       %AM_V_DVIPS%TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
+       $(DVIPS) %TEXIQUIET% -o $@ $<
 endif %?LOCAL-TEXIS%
 
 .PHONY: dvi dvi-am html html-am info info-am pdf pdf-am ps ps-am
diff --git a/lib/ar-lib b/lib/ar-lib
new file mode 100755 (executable)
index 0000000..4883fef
--- /dev/null
@@ -0,0 +1,265 @@
+#! /bin/sh
+# Wrapper for Microsoft lib.exe
+
+me=ar-lib
+scriptversion=2010-09-02.19; # UTC
+
+# Copyright (C) 2010 Free Software
+# Foundation, Inc.
+# Written by Peter Rosin <peda@lysator.liu.se>.
+#
+# 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/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# This file is maintained in Automake, please report
+# bugs to <bug-automake@gnu.org> or send patches to
+# <automake-patches@gnu.org>.
+
+
+# func_error message
+func_error ()
+{
+  echo "$me: $1" 1>&2
+  exit 1
+}
+
+file_conv=
+
+# func_file_conv build_file
+# Convert a $build file to $host form and store it in $file
+# Currently only supports Win32 hosts.
+func_file_conv ()
+{
+  file=$1
+  case $file in
+    / | /[!/]*) # absolute file, and not a UNC file
+      if test -z "$file_conv"; then
+       # lazily determine how to convert abs files
+       case `uname -s` in
+         MINGW*)
+           file_conv=mingw
+           ;;
+         CYGWIN*)
+           file_conv=cygwin
+           ;;
+         *)
+           file_conv=wine
+           ;;
+       esac
+      fi
+      case $file_conv in
+       mingw)
+         file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
+         ;;
+       cygwin)
+         file=`cygpath -m "$file" || echo "$file"`
+         ;;
+       wine)
+         file=`winepath -w "$file" || echo "$file"`
+         ;;
+      esac
+      ;;
+  esac
+}
+
+# func_at_file at_file operation archive
+# Iterate over all members in AT_FILE performing OPERATION on ARCHIVE
+# for each of them.
+# When interpreting the content of the @FILE, do NOT use func_file_conv,
+# since the user would need to supply preconverted file names to
+# binutils ar, at least for MinGW.
+func_at_file ()
+{
+  operation=$2
+  archive=$3
+  at_file_contents=`cat "$1"`
+  eval set x "$at_file_contents"
+  shift
+
+  for member
+  do
+    $AR -NOLOGO $operation:"$member" "$archive" || exit $?
+  done
+}
+
+case $1 in
+  '')
+     func_error "no command.  Try \`$0 --help' for more information."
+     ;;
+  -h | --h*)
+    cat <<EOF
+Usage: $me [--help] [--version] PROGRAM ACTION ARCHIVE [MEMBER...]
+
+Members may be specified in a file named with @FILE.
+EOF
+    exit $?
+    ;;
+  -v | --v*)
+    echo "$me, version $scriptversion"
+    exit $?
+    ;;
+esac
+
+if test $# -lt 3; then
+  func_error "you must specify a program, an action and an archive"
+fi
+
+AR=$1
+shift
+while :
+do
+  if test $# -lt 2; then
+    func_error "you must specify a program, an action and an archive"
+  fi
+  case $1 in
+    -lib | -LIB \
+    | -ltcg | -LTCG \
+    | -machine* | -MACHINE* \
+    | -subsystem* | -SUBSYSTEM* \
+    | -verbose | -VERBOSE \
+    | -wx* | -WX* )
+      AR="$AR $1"
+      shift
+      ;;
+    *)
+      action=$1
+      shift
+      break
+      ;;
+  esac
+done
+orig_archive=$1
+shift
+func_file_conv "$orig_archive"
+archive=$file
+
+# strip leading dash in $action
+action=${action#-}
+
+delete=
+extract=
+list=
+replace=
+create=
+
+while test -n "$action"
+do
+  case $action in
+    d*) delete=yes  ;;
+    x*) extract=yes ;;
+    t*) list=yes    ;;
+    r*) replace=yes ;;
+    c*) create=yes  ;;
+    u*)             ;; # TODO: don't ignore the update modifier
+    *)
+      func_error "unknown action specified"
+      ;;
+  esac
+  action=${action#?}
+done
+
+case $delete$extract$list$replace in
+  yes)
+    ;;
+  yesyes*)
+    func_error "more than one action specified"
+    ;;
+  *)
+    func_error "no action specified"
+    ;;
+esac
+
+if test -n "$delete"; then
+  if test ! -f "$orig_archive"; then
+    func_error "archive not found"
+  fi
+  for member
+  do
+    case $1 in
+      @*)
+        func_at_file "${1#@}" -REMOVE "$archive"
+        ;;
+      *)
+        func_file_conv "$1"
+        $AR -NOLOGO -REMOVE:"$file" "$archive" || exit $?
+        ;;
+    esac
+  done
+
+elif test -n "$extract"; then
+  if test ! -f "$orig_archive"; then
+    func_error "archive not found"
+  fi
+  if test $# -gt 0; then
+    for member
+    do
+      case $1 in
+        @*)
+          func_at_file "${1#@}" -EXTRACT "$archive"
+          ;;
+        *)
+          func_file_conv "$1"
+          $AR -NOLOGO -EXTRACT:"$file" "$archive" || exit $?
+          ;;
+      esac
+    done
+  else
+    $AR -NOLOGO -LIST "$archive" | sed -e 's/\\/\\\\/g' | while read member
+    do
+      $AR -NOLOGO -EXTRACT:"$member" "$archive" || exit $?
+    done
+  fi
+
+elif test -n "$replace"; then
+  if test ! -f "$orig_archive"; then
+    if test -z "$create"; then
+      echo "$me: creating $orig_archive"
+    fi
+    orig_archive=
+  else
+    orig_archive=$archive
+  fi
+
+  for member
+  do
+    case $1 in
+    @*)
+      func_file_conv "${1#@}"
+      set x "$@" "@$file"
+      ;;
+    *)
+      func_file_conv "$1"
+      set x "$@" "$file"
+      ;;
+    esac
+    shift
+    shift
+  done
+
+  if test -n "$orig_archive"; then
+    $AR -NOLOGO -OUT:"$archive" "$orig_archive" "$@" || exit $?
+  else
+    $AR -NOLOGO -OUT:"$archive" "$@" || exit $?
+  fi
+
+elif test -n "$list"; then
+  if test ! -f "$orig_archive"; then
+    func_error "archive not found"
+  fi
+  $AR -NOLOGO -LIST "$archive" || exit $?
+fi
index c0096a7..bac481c 100755 (executable)
@@ -1,9 +1,9 @@
 #! /bin/sh
 # Wrapper for compilers which do not understand `-c -o'.
 
-scriptversion=2009-10-06.20; # UTC
+scriptversion=2010-11-15.09; # UTC
 
-# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009  Free Software
+# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009, 2010 Free Software
 # Foundation, Inc.
 # Written by Tom Tromey <tromey@cygnus.com>.
 #
@@ -29,6 +29,171 @@ scriptversion=2009-10-06.20; # UTC
 # bugs to <bug-automake@gnu.org> or send patches to
 # <automake-patches@gnu.org>.
 
+nl='
+'
+
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent tools from complaining about whitespace usage.
+IFS=" ""       $nl"
+
+file_conv=
+
+# func_file_conv build_file lazy
+# Convert a $build file to $host form and store it in $file
+# Currently only supports Win32 hosts. If the determined conversion
+# type is listed in (the comma separated) LAZY, no conversion will
+# take place.
+func_file_conv ()
+{
+  file=$1
+  case $file in
+    / | /[!/]*) # absolute file, and not a UNC file
+      if test -z "$file_conv"; then
+       # lazily determine how to convert abs files
+       case `uname -s` in
+         MINGW*)
+           file_conv=mingw
+           ;;
+         CYGWIN*)
+           file_conv=cygwin
+           ;;
+         *)
+           file_conv=wine
+           ;;
+       esac
+      fi
+      case $file_conv/,$2, in
+       *,$file_conv,*)
+         ;;
+       mingw/*)
+         file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
+         ;;
+       cygwin/*)
+         file=`cygpath -m "$file" || echo "$file"`
+         ;;
+       wine/*)
+         file=`winepath -w "$file" || echo "$file"`
+         ;;
+      esac
+      ;;
+  esac
+}
+
+# func_cl_wrapper cl arg...
+# Adjust compile command to suit cl
+func_cl_wrapper ()
+{
+  # Assume a capable shell
+  lib_path=
+  shared=:
+  linker_opts=
+  for arg
+  do
+    if test -n "$eat"; then
+      eat=
+    else
+      case $1 in
+       -o)
+         # configure might choose to run compile as `compile cc -o foo foo.c'.
+         eat=1
+         case $2 in
+           *.o | *.[oO][bB][jJ])
+             func_file_conv "$2"
+             set x "$@" -Fo"$file"
+             shift
+             ;;
+           *)
+             func_file_conv "$2"
+             set x "$@" -Fe"$file"
+             shift
+             ;;
+         esac
+         ;;
+       -I*)
+         func_file_conv "${1#-I}" mingw
+         set x "$@" -I"$file"
+         shift
+         ;;
+       -l*)
+         lib=${1#-l}
+         found=no
+         save_IFS=$IFS
+         IFS=';'
+         for dir in $lib_path $LIB
+         do
+           IFS=$save_IFS
+           if $shared && test -f "$dir/$lib.dll.lib"; then
+             found=yes
+             set x "$@" "$dir/$lib.dll.lib"
+             break
+           fi
+           if test -f "$dir/$lib.lib"; then
+             found=yes
+             set x "$@" "$dir/$lib.lib"
+             break
+           fi
+         done
+         IFS=$save_IFS
+
+         test "$found" != yes && set x "$@" "$lib.lib"
+         shift
+         ;;
+       -L*)
+         func_file_conv "${1#-L}"
+         if test -z "$lib_path"; then
+           lib_path=$file
+         else
+           lib_path="$lib_path;$file"
+         fi
+         linker_opts="$linker_opts -LIBPATH:$file"
+         ;;
+       -static)
+         shared=false
+         ;;
+       -Wl,*)
+         arg=${1#-Wl,}
+         save_ifs="$IFS"; IFS=','
+         for flag in $arg; do
+           IFS="$save_ifs"
+           linker_opts="$linker_opts $flag"
+         done
+         IFS="$save_ifs"
+         ;;
+       -Xlinker)
+         eat=1
+         linker_opts="$linker_opts $2"
+         ;;
+       -*)
+         set x "$@" "$1"
+         shift
+         ;;
+       *.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
+         func_file_conv "$1"
+         set x "$@" -Tp"$file"
+         shift
+         ;;
+       *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
+         func_file_conv "$1" mingw
+         set x "$@" "$file"
+         shift
+         ;;
+       *)
+         set x "$@" "$1"
+         shift
+         ;;
+      esac
+    fi
+    shift
+  done
+  if test -n "$linker_opts"; then
+    linker_opts="-link$linker_opts"
+  fi
+  exec "$@" $linker_opts
+  exit 1
+}
+
+eat=
+
 case $1 in
   '')
      echo "$0: No command.  Try \`$0 --help' for more information." 1>&2
@@ -53,11 +218,13 @@ EOF
     echo "compile $scriptversion"
     exit $?
     ;;
+  cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
+    func_cl_wrapper "$@"      # Doesn't return...
+    ;;
 esac
 
 ofile=
 cfile=
-eat=
 
 for arg
 do
index f2497ad..2dd0d51 100644 (file)
@@ -2,7 +2,7 @@
 # wanting multilib support.
 #
 # Copyright (C) 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2007  Free Software Foundation, Inc.
+# 2005, 2006, 2007, 2008, 2010  Free Software Foundation, Inc.
 #
 # This file is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -517,6 +517,7 @@ multi-do:
                                prefix="$(prefix)" \
                                exec_prefix="$(exec_prefix)" \
                                GCJFLAGS="$(GCJFLAGS) $${flags}" \
+                               GOCFLAGS="$(GOCFLAGS) $${flags}" \
                                CXXFLAGS="$(CXXFLAGS) $${flags}" \
                                LIBCFLAGS="$(LIBCFLAGS) $${flags}" \
                                LIBCXXFLAGS="$(LIBCXXFLAGS) $${flags}" \
@@ -750,7 +751,7 @@ if [ -n "${multidirs}" ] && [ -z "${ml_norecursion}" ]; then
         break
       fi
     done
-    ml_config_env='CC="${CC_}$flags" CXX="${CXX_}$flags" F77="${F77_}$flags" GCJ="${GCJ_}$flags" GFORTRAN="${GFORTRAN_}$flags"'
+    ml_config_env='CC="${CC_}$flags" CXX="${CXX_}$flags" F77="${F77_}$flags" GCJ="${GCJ_}$flags" GFORTRAN="${GFORTRAN_}$flags" GOC="${GOC_}$flags"'
 
     if [ "${with_target_subdir}" = "." ]; then
        CC_=$CC' '
@@ -758,6 +759,7 @@ if [ -n "${multidirs}" ] && [ -z "${ml_norecursion}" ]; then
        F77_=$F77' '
        GCJ_=$GCJ' '
        GFORTRAN_=$GFORTRAN' '
+       GOC_=$GOC' '
     else
        # Create a regular expression that matches any string as long
        # as ML_POPDIR.
@@ -822,6 +824,18 @@ if [ -n "${multidirs}" ] && [ -z "${ml_norecursion}" ]; then
          esac
        done
 
+       GOC_=
+       for arg in ${GOC}; do
+         case $arg in
+         -[BIL]"${ML_POPDIR}"/*)
+           GOC_="${GOC_}"`echo "X${arg}" | sed -n "s/X\\(-[BIL]${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X-[BIL]${popdir_rx}\\(.*\\)/\\1/p"`' ' ;;
+         "${ML_POPDIR}"/*)
+           GOC_="${GOC_}"`echo "X${arg}" | sed -n "s/X\\(${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X${popdir_rx}\\(.*\\)/\\1/p"`' ' ;;
+         *)
+           GOC_="${GOC_}${arg} " ;;
+         esac
+       done
+
        if test "x${LD_LIBRARY_PATH+set}" = xset; then
          LD_LIBRARY_PATH_=
          for arg in `echo "$LD_LIBRARY_PATH" | tr ':' ' '`; do
index df8eea7..c3163be 100755 (executable)
@@ -1,10 +1,10 @@
 #! /bin/sh
 # depcomp - compile a program generating dependencies as side-effects
 
-scriptversion=2009-04-28.21; # UTC
+scriptversion=2010-10-07.20; # UTC
 
-# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free
-# Software Foundation, Inc.
+# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 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
@@ -90,10 +90,18 @@ if test "$depmode" = msvcmsys; then
    # This is just like msvisualcpp but w/o cygpath translation.
    # Just convert the backslash-escaped backslashes to single forward
    # slashes to satisfy depend.m4
-   cygpath_u="sed s,\\\\\\\\,/,g"
+   cygpath_u='sed s,\\\\,/,g'
    depmode=msvisualcpp
 fi
 
+if test "$depmode" = msvc7msys; then
+   # This is just like msvc7 but w/o cygpath translation.
+   # Just convert the backslash-escaped backslashes to single forward
+   # slashes to satisfy depend.m4
+   cygpath_u='sed s,\\\\,/,g'
+   depmode=msvc7
+fi
+
 case "$depmode" in
 gcc3)
 ## gcc 3 implements dependency tracking that does exactly what
@@ -405,6 +413,52 @@ tru64)
    rm -f "$tmpdepfile"
    ;;
 
+msvc7)
+  if test "$libtool" = yes; then
+    showIncludes=-Wc,-showIncludes
+  else
+    showIncludes=-showIncludes
+  fi
+  "$@" $showIncludes > "$tmpdepfile"
+  stat=$?
+  grep -v '^Note: including file: ' "$tmpdepfile"
+  if test "$stat" = 0; then :
+  else
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  # The first sed program below extracts the file names and escapes
+  # backslashes for cygpath.  The second sed program outputs the file
+  # name when reading, but also accumulates all include files in the
+  # hold buffer in order to output them again at the end.  This only
+  # works with sed implementations that can handle large buffers.
+  sed < "$tmpdepfile" -n '
+/^Note: including file:  *\(.*\)/ {
+  s//\1/
+  s/\\/\\\\/g
+  p
+}' | $cygpath_u | sort -u | sed -n '
+s/ /\\ /g
+s/\(.*\)/      \1 \\/p
+s/.\(.*\) \\/\1:/
+H
+$ {
+  s/.*/        /
+  G
+  p
+}' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+msvc7msys)
+  # This case exists only to let depend.m4 do its work.  It works by
+  # looking at the text of this script.  This case will never be run,
+  # since it is checked for above.
+  exit 1
+  ;;
+
 #nosideeffect)
   # This comment above is used by automake to tell side-effect
   # dependency tracking mechanisms from slower ones.
index 5036752..edb4b56 100755 (executable)
@@ -188,7 +188,7 @@ done
 
 dprint()
 {
-  echo "Running $*..."
+  echo "Running $* ..."
 }
 
 if $dry_run; then
@@ -252,7 +252,7 @@ echo
 if test $# -ne 0; then
   for file
   do
-    echo "Signing $file..."
+    echo "Signing $file ..."
     rm -f $file.sig
     echo "$passphrase" | $dbg $GPG --passphrase-fd 0 -ba -o $file.sig $file
   done
@@ -391,7 +391,7 @@ for dest in $to
 do
   for file
   do
-    echo "Uploading $file to $dest..."
+    echo "Uploading $file to $dest ..."
     stmt=
     files="$file $file.sig"
     destdir=`echo $dest | sed 's/[^:]*://'`
index 270ee91..e225dd4 100644 (file)
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11 from Makefile.am.
+# Makefile.in generated by automake 1.11a from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -58,14 +58,20 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/amversion.m4 \
        $(top_srcdir)/m4/install-sh.m4 $(top_srcdir)/m4/lead-dot.m4 \
        $(top_srcdir)/m4/missing.m4 $(top_srcdir)/m4/mkdirp.m4 \
        $(top_srcdir)/m4/options.m4 $(top_srcdir)/m4/runlog.m4 \
-       $(top_srcdir)/m4/sanity.m4 $(top_srcdir)/m4/strip.m4 \
-       $(top_srcdir)/m4/substnot.m4 $(top_srcdir)/m4/tar.m4 \
-       $(top_srcdir)/configure.ac
+       $(top_srcdir)/m4/sanity.m4 $(top_srcdir)/m4/silent.m4 \
+       $(top_srcdir)/m4/strip.m4 $(top_srcdir)/m4/substnot.m4 \
+       $(top_srcdir)/m4/tar.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
 mkinstalldirs = $(SHELL) $(top_srcdir)/lib/mkinstalldirs
 CONFIG_CLEAN_FILES =
 CONFIG_CLEAN_VPATH_FILES =
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo "  GEN     " $@;
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
 SOURCES =
 DIST_SOURCES =
 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
@@ -94,6 +100,7 @@ DATA = $(dist_m4data_DATA)
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 APIVERSION = @APIVERSION@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
@@ -282,6 +289,8 @@ TAGS:
 ctags: CTAGS
 CTAGS:
 
+cscope cscopelist:
+
 
 distdir: $(DISTFILES)
        @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
@@ -330,10 +339,15 @@ install-am: all-am
 
 installcheck: installcheck-am
 install-strip:
-       $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-         install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-         `test -z '$(STRIP)' || \
-           echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+       if test -z '$(STRIP)'; then \
+         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+             install; \
+       else \
+         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+           "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+       fi
 mostlyclean-generic:
 
 clean-generic:
index aae0c28..ff3a85e 100644 (file)
 # generated from the m4 files accompanying Automake X.Y.
 # (This private macro should not be called outside this file.)
 AC_DEFUN([AM_AUTOMAKE_VERSION],
-[am__api_version='1.11'
+[am__api_version='1.11a'
 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
 dnl require some minimum version.  Point them to the right macro.
-m4_if([$1], [1.11], [],
+m4_if([$1], [1.11a], [],
       [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
 ])
 
@@ -31,7 +31,7 @@ m4_define([_AM_AUTOCONF_VERSION], [])
 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.11])dnl
+[AM_AUTOMAKE_VERSION([1.11a])dnl
 m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
index 8304180..714bc9c 100644 (file)
@@ -6,7 +6,7 @@
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 11
+# serial 12
 
 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
 # written in clear, in which case automake, when reading aclocal.m4,
@@ -110,7 +110,7 @@ AC_CACHE_CHECK([dependency style of $depcc],
        break
       fi
       ;;
-    msvisualcpp | msvcmsys)
+    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
       # This compiler won't grok `-c -o', but also, the minuso test has
       # not run yet.  These depmodes are late enough in the game, and
       # so weak that their functioning should not be impacted.
@@ -169,9 +169,13 @@ AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
 # AM_DEP_TRACK
 # ------------
 AC_DEFUN([AM_DEP_TRACK],
-[AC_ARG_ENABLE(dependency-tracking,
-[  --disable-dependency-tracking  speeds up one-time build
-  --enable-dependency-tracking   do not reject slow dependency extractors])
+[AC_ARG_ENABLE([dependency-tracking], [dnl
+AS_HELP_STRING(
+  [--enable-dependency-tracking],
+  [do not reject slow dependency extractors])
+AS_HELP_STRING(
+  [--disable-dependency-tracking],
+  [speeds up one-time build])])
 if test "x$enable_dependency_tracking" != xno; then
   am_depcomp="$ac_aux_dir/depcomp"
   AMDEPBACKSLASH='\'
index aea5f9d..5d48a24 100644 (file)
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 4
+# serial 5
 
 AC_DEFUN([AM_WITH_DMALLOC],
 [AC_MSG_CHECKING([if malloc debugging is wanted])
-AC_ARG_WITH(dmalloc,
-[  --with-dmalloc          use dmalloc, as in http://www.dmalloc.com],
+AC_ARG_WITH([dmalloc],
+[AS_HELP_STRING([--with-dmalloc],
+                [use dmalloc, as in http://www.dmalloc.com])],
 [if test "$withval" = yes; then
   AC_MSG_RESULT(yes)
   AC_DEFINE(WITH_DMALLOC,1,
index 62c2daf..bc1c831 100644 (file)
@@ -10,7 +10,7 @@
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 10
+# serial 11
 
 # AM_PATH_LISPDIR
 # ---------------
@@ -23,7 +23,8 @@ AC_DEFUN([AM_PATH_LISPDIR],
  AC_ARG_VAR([EMACS], [the Emacs editor command])
  AC_ARG_VAR([EMACSLOADPATH], [the Emacs library search path])
  AC_ARG_WITH([lispdir],
- [  --with-lispdir          override the default lisp directory],
+ [AS_HELP_STRING([--with-lispdir],
+                 [override the default lisp directory])],
  [ lispdir="$withval"
    AC_MSG_CHECKING([where .elc files should go])
    AC_MSG_RESULT([$lispdir])],
index 0b54e67..0d0bf7f 100644 (file)
@@ -8,7 +8,7 @@
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 5
+# serial 6
 
 # AM_MAINTAINER_MODE([DEFAULT-MODE])
 # ----------------------------------
@@ -25,10 +25,11 @@ AC_DEFUN([AM_MAINTAINER_MODE],
 AC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
   dnl maintainer-mode's default is 'disable' unless 'enable' is passed
   AC_ARG_ENABLE([maintainer-mode],
-[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
-                         (and sometimes confusing) to the casual installer],
-      [USE_MAINTAINER_MODE=$enableval],
-      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
+    [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode],
+      am_maintainer_other[ make rules and dependencies not useful
+      (and sometimes confusing) to the casual installer])],
+    [USE_MAINTAINER_MODE=$enableval],
+    [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
   AC_MSG_RESULT([$USE_MAINTAINER_MODE])
   AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
   MAINT=$MAINTAINER_MODE_TRUE
index 9841767..dce3675 100644 (file)
@@ -6,15 +6,17 @@
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 6
+# serial 7
 
 # AM_ENABLE_MULTILIB([MAKEFILE], [REL-TO-TOP-SRCDIR])
 # ---------------------------------------------------
 # Add --enable-multilib to configure.
 AC_DEFUN([AM_ENABLE_MULTILIB],
 [# Default to --enable-multilib
-AC_ARG_ENABLE(multilib,
-[  --enable-multilib       build many library versions (default)],
+AC_ARG_ENABLE([multilib],
+[AS_HELP_STRING(
+   [--enable-multilib],
+   [build many library versions (default)])],
 [case "$enableval" in
   yes) multilib=yes ;;
   no)  multilib=no ;;
index c05bb38..a453930 100644 (file)
@@ -1,18 +1,21 @@
 ## --------------------------------- ##                     -*- Autoconf -*-
 ## Check if --with-regex was given.  ##
 ## --------------------------------- ##
-# Copyright (C) 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
-# Free Software Foundation, Inc.
+# Copyright (C) 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+# 2010 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 7
+# serial 8
 
 # AM_WITH_REGEX
 # -------------
 #
+# THIS MACRO IS OBSOLETE now, since rx doesn't seem to be maintained,
+# while regex is.  This macro should be removed on 2013-01-01.
+#
 # The idea is to distribute rx.[hc] and regex.[hc] together, for a
 # while.  The WITH_REGEX symbol is used to decide which of regex.h or
 # rx.h should be included in the application.  If `./configure
 # package will use the system's rx which, on Linux at least, will
 # result in a smaller executable file.
 #
-# FIXME: This macro seems quite obsolete now since rx doesn't seem to
-# be maintained, while regex is.
 AC_DEFUN([AM_WITH_REGEX],
 [AC_PREREQ(2.50)dnl
+m4_warn([obsolete], [$0 is obsolete, since `rx' is unmantained now])dnl
 AC_LIBSOURCES([rx.h, rx.c, regex.c, regex.h])dnl
 AC_MSG_CHECKING([which of GNU rx or gawk's regex is wanted])
 AC_ARG_WITH([regex],
index db87c8b..ba97076 100644 (file)
@@ -1,13 +1,13 @@
 # Check to make sure that the build environment is sane.    -*- Autoconf -*-
 
-# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008, 2009
+# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008, 2009, 2010
 # Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 6
+# serial 7
 
 # AM_SANITY_CHECK
 # ---------------
@@ -32,14 +32,14 @@ esac
 # (eg FreeBSD returns the mod time of the symlink's containing
 # directory).
 if (
+   am_has_slept=no
    for am_try in 1 2; do
-     echo timestamp > conftest.file
+     echo "timestamp, slept: $am_has_slept" > conftest.file
      set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
      if test "$[*]" = "X"; then
        # -L didn't work.
        set X `ls -t "$srcdir/configure" conftest.file`
      fi
-     rm -f conftest.file
      if test "$[*]" != "X $srcdir/configure conftest.file" \
        && test "$[*]" != "X conftest.file $srcdir/configure"; then
 
@@ -55,6 +55,7 @@ if (
      fi
      # Just in case.
      sleep 1
+     am_has_slept=yes
    done
    test "$[2]" = conftest.file
    )
@@ -65,4 +66,19 @@ else
    AC_MSG_ERROR([newly created file is older than distributed files!
 Check your system clock])
 fi
-AC_MSG_RESULT(yes)])
+AC_MSG_RESULT(yes)
+# If we didn't sleep, we still need to ensure time stamps of config.status and
+# generated files are strictly newer.
+am_sleep_pid=
+if grep 'slept: no' conftest.file >/dev/null 2>&1; then
+  ( sleep 1 ) &
+  am_sleep_pid=$!
+fi
+AC_CONFIG_COMMANDS_PRE(
+  [AC_MSG_CHECKING([that generated files are newer than configure])
+   if test -n "$am_sleep_pid"; then
+     wait $am_sleep_pid
+   fi
+   AC_MSG_RESULT([done])])
+rm -f conftest.file
+])
index 6d2a1a2..432dd45 100644 (file)
@@ -1,24 +1,29 @@
 ##                                                          -*- Autoconf -*-
-# Copyright (C) 2009  Free Software Foundation, Inc.
+# Copyright (C) 2009, 2010 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 1
+# serial 2
 
 # AM_SILENT_RULES([DEFAULT])
 # --------------------------
 # Enable less verbose build rules; with the default set to DEFAULT
 # (`yes' being less verbose, `no' or empty being verbose).
 AC_DEFUN([AM_SILENT_RULES],
-[AC_ARG_ENABLE([silent-rules],
-[  --enable-silent-rules          less verbose build output (undo: `make V=1')
-  --disable-silent-rules         verbose build output (undo: `make V=0')])
-case $enable_silent_rules in
-yes) AM_DEFAULT_VERBOSITY=0;;
-no)  AM_DEFAULT_VERBOSITY=1;;
-*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
+[AC_ARG_ENABLE([silent-rules], [dnl
+AS_HELP_STRING(
+  [--enable-silent-rules],
+  [less verbose build output (undo: `make V=1')])
+AS_HELP_STRING(
+  [--disable-silent-rules],
+  [verbose build output (undo: `make V=0')])dnl
+])
+case $enable_silent_rules in @%:@ (((
+  yes) AM_DEFAULT_VERBOSITY=0;;
+   no) AM_DEFAULT_VERBOSITY=1;;
+    *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
 esac
 AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
 AM_BACKSLASH='\'
index 3c1f990..026e261 100644 (file)
@@ -1,8 +1,12 @@
 aclocal-*
 automake-*
-defs
+defs-static
+instspc-tests.am
 parallel-tests.am
 *.dir
 *.log
 *.log-t
 *-p.test
+instspc-*-build.test
+instspc-*-install.test
+*.test-t
index da81c49..90b58fe 100644 (file)
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+MAINTAINERCLEANFILES =
+EXTRA_DIST = ChangeLog-old
+
 XFAIL_TESTS = \
 all.test \
 auxdir2.test \
 cond17.test \
 gcj6.test \
+override-conditional-2.test \
 txinfo5.test
 
+
 include $(srcdir)/parallel-tests.am
 
 $(srcdir)/parallel-tests.am: gen-parallel-tests Makefile.am
-       (cd $(srcdir) && $(SHELL) ./gen-parallel-tests) >$@
+       $(AM_V_GEN)($(am__cd) $(srcdir) && $(SHELL) ./gen-parallel-tests) >$@
+
+$(parallel_tests): Makefile.am
+       $(AM_V_at)rm -f $@ $@-t
+       $(AM_V_GEN)input=`echo $@ | sed 's,.*/,,; s,-p.test$$,.test,'`; \
+       { echo '#!/bin/sh'; \
+         echo '# DO NOT EDIT!  GENERATED AUTOMATICALLY!'; \
+         echo; \
+         echo '# Ensure proper definition of $$testsrcdir.'; \
+         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."; \
+         echo 'parallel_tests=yes'; \
+         echo "# In the spirit of VPATH, we prefer a test in the build tree"; \
+         echo "# over one in the source tree."; \
+         echo "if test -f \"./$$input\"; then"; \
+         echo "  . \"./$$input\""; \
+         echo 'else'; \
+         echo "  . \"\$$testsrcdir/$$input\""; \
+         echo 'fi'; \
+       } > $@-t
+       $(AM_V_at)chmod a+rx $@-t && mv -f $@-t $@
+
+MAINTAINERCLEANFILES += $(parallel_tests)
+EXTRA_DIST += gen-parallel-tests
+
 
-$(parallel_tests): $(parallel_tests:-p.test=.test) Makefile.am
-       input=`echo $@ | sed 's,.*/,,; s,-p.test$$,.test,'`; \
-       sed 's|^\. \./defs.*|parallel_tests=yes; &|' \
-         < $(srcdir)/$$input >$@
-       chmod a+rx $@
+include $(srcdir)/instspc-tests.am
+
+$(srcdir)/instspc-tests.am: instspc-tests.sh Makefile.am
+       $(AM_V_GEN)($(am__cd) $(srcdir) \
+         && $(SHELL) ./instspc-tests.sh --generate-makefile) >$@
+
+$(instspc_tests): Makefile.am
+       $(AM_V_at)rm -f $@ $@-t
+       $(AM_V_GEN) :; \
+         base=`expr 'x/$@' : 'x.*/instspc-\(.*\)\.test$$'`; \
+         name=`expr x"$$base" : x'\(.*\)-'`; \
+         action=`expr x"$$base" : x'.*-\(.*\)'`; \
+         { \
+           echo '#!/bin/sh'; \
+           echo '# DO NOT EDIT!  GENERATED AUTOMATICALLY!'; \
+           echo; \
+           echo '# Ensure proper definition of $$testsrcdir.'; \
+           echo '. ./defs-static || exit 99'; \
+           echo 'test -n "$$testsrcdir" || exit 99 # sanity check'; \
+           echo; \
+           echo "instspc_test_name='$$name'"; \
+           echo "instspc_action='test-$$action'"; \
+           echo ". \$$testsrcdir/instspc-tests.sh"; \
+         } > $@-t
+       $(AM_V_at)chmod a+rx $@-t && mv -f $@-t $@
+
+# All instspc*.test tests work by sourcing the instspc-tests.sh script.
+$(instspc_tests:.test=.log): instspc-tests.sh
+
+MAINTAINERCLEANFILES += $(instspc_tests)
+EXTRA_DIST += instspc-tests.sh
+XFAIL_TESTS += $(instspc_xfail_tests)
 
-MAINTAINERCLEANFILES = $(parallel_tests)
 
 TESTS = \
-aclibobj.test \
 aclocal.test \
 aclocal3.test \
 aclocal4.test \
@@ -59,6 +115,7 @@ acloca19.test \
 acloca20.test \
 acloca21.test \
 acloca22.test \
+acloca23.test \
 acoutnoq.test \
 acoutpt.test \
 acoutpt2.test \
@@ -89,6 +146,7 @@ ansi7.test \
 ansi8.test \
 ansi9.test \
 ansi10.test \
+ar-lib.test \
 ar.test \
 ar2.test \
 asm.test \
@@ -104,6 +162,17 @@ auxdir.test \
 auxdir2.test \
 auxdir3.test \
 auxdir4.test \
+auxdir5.test \
+auxdir6.test \
+auxdir7.test \
+auxdir8.test \
+auxdir9.test \
+backcompat.test \
+backcompat2.test \
+backcompat3.test \
+backcompat4.test \
+backcompat5.test \
+backcompat6.test \
 backsl.test \
 backsl2.test \
 backsl3.test \
@@ -113,11 +182,15 @@ badopt.test \
 badprog.test \
 block.test \
 bsource.test \
+candist.test \
 canon.test \
 canon2.test \
 canon3.test \
 canon4.test \
 canon5.test \
+canon6.test \
+canon7.test \
+canon8.test \
 canon-name.test \
 ccnoco.test \
 ccnoco2.test \
@@ -133,11 +206,13 @@ check8.test \
 check9.test \
 check10.test \
 check11.test \
+check12.test \
 checkall.test \
 clean.test \
 clean2.test \
 colneq.test \
 colneq2.test \
+colneq3.test \
 colon.test \
 colon2.test \
 colon3.test \
@@ -160,8 +235,13 @@ commen10.test \
 commen11.test \
 compile.test \
 compile2.test \
+compile3.test \
+compile4.test \
+compile5.test \
+compile6.test \
 compile_f90_c_cxx.test \
 compile_f_c_cxx.test \
+cond-basic.test \
 cond.test \
 cond2.test \
 cond3.test \
@@ -206,6 +286,7 @@ cond42.test \
 cond43.test \
 cond44.test \
 cond45.test \
+cond46.test \
 condd.test \
 condhook.test \
 condhook2.test \
@@ -234,7 +315,9 @@ confsub.test \
 confvar.test \
 confvar2.test \
 copy.test \
-ctarget1.test \
+cscope.test \
+cscope2.test \
+cscope3.test \
 cxx.test \
 cxx2.test \
 cxxansi.test \
@@ -306,6 +389,7 @@ exeext4.test \
 exsource.test \
 ext.test \
 ext2.test \
+ext3.test \
 extra.test \
 extra2.test \
 extra3.test \
@@ -314,9 +398,12 @@ extra5.test \
 extra6.test \
 extra7.test \
 extra8.test \
+extra9.test \
 extra10.test \
 extra11.test \
 extra12.test \
+extradep.test \
+extradep2.test \
 f90only.test \
 flavor.test \
 flibs.test \
@@ -398,7 +485,7 @@ instman2.test \
 instmany.test \
 instmany-mans.test \
 instmany-python.test \
-instspc.test \
+$(instspc_tests) \
 interp.test \
 interp2.test \
 java.test \
@@ -413,9 +500,12 @@ lex2.test \
 lex3.test \
 lex4.test \
 lex5.test \
+lexcpp.test \
+lexvpath.test \
 lflags.test \
 lflags2.test \
 libexec.test \
+libobj-basic.test \
 libobj2.test \
 libobj3.test \
 libobj4.test \
@@ -423,10 +513,20 @@ libobj5.test \
 libobj7.test \
 libobj8.test \
 libobj10.test \
-libobj11.test \
 libobj12.test \
 libobj13.test \
 libobj14.test \
+libobj15a.test \
+libobj15b.test \
+libobj15c.test \
+libobj16a.test \
+libobj16b.test \
+libobj17.test \
+libobj18.test \
+libobj19.test \
+libobj20a.test \
+libobj20b.test \
+libobj20c.test \
 library.test \
 library2.test \
 library3.test \
@@ -450,6 +550,7 @@ link_fc.test \
 link_fccxx.test \
 link_fcxx.test \
 link_f_only.test \
+link_override.test \
 lisp2.test \
 lisp3.test \
 lisp4.test \
@@ -470,6 +571,7 @@ ltinstloc.test \
 ltlibobjs.test \
 ltlibsrc.test \
 ltorder.test \
+lzip.test \
 lzma.test \
 maintclean.test \
 make.test \
@@ -504,6 +606,7 @@ mkinst3.test \
 mmode.test \
 mmodely.test \
 multlib.test \
+no-outdir-option.test \
 nobase.test \
 nobase-libtool.test \
 nobase-python.test \
@@ -526,8 +629,8 @@ number.test \
 objc.test \
 objc2.test \
 obsolete.test \
+oldvars.test \
 order.test \
-outdir.test \
 output.test \
 output2.test \
 output3.test \
@@ -542,7 +645,10 @@ output11.test \
 output12.test \
 output13.test \
 output-order.test \
-overrid.test \
+override-conditional-1.test \
+override-conditional-2.test \
+override-html.test \
+override-suggest-local.test \
 parallel-am.test \
 parallel-am2.test \
 parallel-am3.test \
@@ -571,6 +677,15 @@ pluseq8.test \
 pluseq9.test \
 pluseq10.test \
 pluseq11.test \
+posixsubst-data.test \
+posixsubst-extradist.test \
+posixsubst-ldadd.test \
+posixsubst-libraries.test \
+posixsubst-ltlibraries.test \
+posixsubst-programs.test \
+posixsubst-scripts.test \
+posixsubst-sources.test \
+posixsubst-tests.test \
 postproc.test \
 ppf77.test \
 pr2.test \
@@ -614,16 +729,31 @@ python12.test \
 recurs.test \
 recurs2.test \
 remake.test \
+remake1a.test \
 remake2.test \
 remake3.test \
+remake3a.test \
 remake4.test \
 remake5.test \
 remake6.test \
 remake7.test \
+remake8a.test \
+remake8b.test \
+remake9a.test \
+remake9b.test \
+remake9c.test \
+remake9d.test \
+remake10a.test \
+remake10b.test \
+remake10c.test \
+remake11.test \
+remake12.test \
 regex.test \
+regex-obsolete.test \
 req.test \
 reqd.test \
 reqd2.test \
+repeated-options.test \
 rulepat.test \
 sanity.test \
 scripts.test \
@@ -632,15 +762,19 @@ silent.test \
 silent2.test \
 silent3.test \
 silent4.test \
-silent5.test \
 silent6.test \
 silent7.test \
+silent8.test \
 silent9.test \
 silentcxx.test \
 silentf77.test \
 silentf90.test \
-silentlex.test \
-silentyacc.test \
+silent-many-gcc.test \
+silent-many-generic.test \
+silent-lex-gcc.test \
+silent-lex-generic.test \
+silent-yacc-gcc.test \
+silent-yacc-generic.test \
 sinclude.test \
 srcsub.test \
 srcsub2.test \
@@ -663,6 +797,8 @@ stamph2.test \
 stdlib.test \
 stdlib2.test \
 strip.test \
+strip2.test \
+strip3.test \
 subdir.test \
 subdir2.test \
 subdir3.test \
@@ -696,6 +832,7 @@ subst.test \
 subst2.test \
 subst3.test \
 subst4.test \
+subst5.test \
 substref.test \
 substre2.test \
 substtarg.test \
@@ -716,6 +853,7 @@ symlink.test \
 symlink2.test \
 syntax.test \
 tags.test \
+tags2.test \
 tagsub.test \
 tar.test \
 tar2.test \
@@ -766,6 +904,8 @@ vala5.test \
 vars.test \
 vars3.test \
 vartar.test \
+vartypos.test \
+vartypo2.test \
 version.test \
 version2.test \
 version3.test \
@@ -780,9 +920,11 @@ warnopts.test \
 werror.test \
 werror2.test \
 werror3.test \
+werror4.test \
 whoami.test \
 xsource.test \
 xz.test \
+yacc-basic.test \
 yacc.test \
 yacc2.test \
 yacc3.test \
@@ -798,10 +940,11 @@ yflags.test \
 yflags2.test \
 $(parallel_tests)
 
-EXTRA_DIST = ChangeLog-old gen-parallel-tests $(TESTS)
+EXTRA_DIST += $(TESTS)
+
 
 # Each test case depends on defs, aclocal, and automake.
-check_SCRIPTS = defs aclocal-$(APIVERSION) automake-$(APIVERSION)
+$(TEST_LOGS): defs aclocal-$(APIVERSION) automake-$(APIVERSION)
 
 clean-local: clean-local-check
 .PHONY: clean-local-check
index eb461a9..45a6401 100644 (file)
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11 from Makefile.am.
+# Makefile.in generated by automake 1.11a from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -49,7 +49,8 @@ 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)/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
@@ -58,14 +59,21 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/amversion.m4 \
        $(top_srcdir)/m4/install-sh.m4 $(top_srcdir)/m4/lead-dot.m4 \
        $(top_srcdir)/m4/missing.m4 $(top_srcdir)/m4/mkdirp.m4 \
        $(top_srcdir)/m4/options.m4 $(top_srcdir)/m4/runlog.m4 \
-       $(top_srcdir)/m4/sanity.m4 $(top_srcdir)/m4/strip.m4 \
-       $(top_srcdir)/m4/substnot.m4 $(top_srcdir)/m4/tar.m4 \
-       $(top_srcdir)/configure.ac
+       $(top_srcdir)/m4/sanity.m4 $(top_srcdir)/m4/silent.m4 \
+       $(top_srcdir)/m4/strip.m4 $(top_srcdir)/m4/substnot.m4 \
+       $(top_srcdir)/m4/tar.m4 $(top_srcdir)/configure.ac
 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     " $@;
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
 SOURCES =
 DIST_SOURCES =
 # If stdout is a non-dumb tty, use colors.  If test -t is not supported,
@@ -184,6 +192,7 @@ TEST_LOGS_TMP = $(TEST_LOGS:.log=.log-t)
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 APIVERSION = @APIVERSION@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
@@ -272,39 +281,82 @@ target_alias = @target_alias@
 top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-XFAIL_TESTS = \
-all.test \
-auxdir2.test \
-cond17.test \
-gcj6.test \
-txinfo5.test
-
-parallel_tests = \
-check-p.test \
-check10-p.test \
-check11-p.test \
-check2-p.test \
-check3-p.test \
-check4-p.test \
-check5-p.test \
-check6-p.test \
-check7-p.test \
-check8-p.test \
-check9-p.test \
-color-p.test \
-color2-p.test \
-comment9-p.test \
-dejagnu-p.test \
-exeext4-p.test \
-maken3-p.test \
-maken4-p.test \
-pr401-p.test \
-pr401b-p.test \
-pr401c-p.test
-
-MAINTAINERCLEANFILES = $(parallel_tests)
+MAINTAINERCLEANFILES = $(parallel_tests) $(instspc_tests)
+EXTRA_DIST = ChangeLog-old gen-parallel-tests instspc-tests.sh \
+       $(TESTS)
+XFAIL_TESTS = all.test auxdir2.test cond17.test gcj6.test \
+       override-conditional-2.test txinfo5.test \
+       $(instspc_xfail_tests)
+parallel_tests = backcompat5-p.test check-p.test check10-p.test \
+       check11-p.test check12-p.test check2-p.test check3-p.test \
+       check4-p.test check5-p.test check6-p.test check7-p.test \
+       check8-p.test check9-p.test color-p.test color2-p.test \
+       comment9-p.test dejagnu-p.test exeext4-p.test maken3-p.test \
+       maken4-p.test posixsubst-tests-p.test pr401-p.test \
+       pr401b-p.test pr401c-p.test
+instspc_tests = instspc-squote-build.test instspc-squote-install.test \
+       instspc-dquote-build.test instspc-dquote-install.test \
+       instspc-bquote-build.test instspc-bquote-install.test \
+       instspc-sharp-build.test instspc-sharp-install.test \
+       instspc-dollar-build.test instspc-dollar-install.test \
+       instspc-bang-build.test instspc-bang-install.test \
+       instspc-bslash-build.test instspc-bslash-install.test \
+       instspc-ampersand-build.test instspc-ampersand-install.test \
+       instspc-percent-build.test instspc-percent-install.test \
+       instspc-leftpar-build.test instspc-leftpar-install.test \
+       instspc-rightpar-build.test instspc-rightpar-install.test \
+       instspc-pipe-build.test instspc-pipe-install.test \
+       instspc-caret-build.test instspc-caret-install.test \
+       instspc-tilde-build.test instspc-tilde-install.test \
+       instspc-qmark-build.test instspc-qmark-install.test \
+       instspc-star-build.test instspc-star-install.test \
+       instspc-plus-build.test instspc-plus-install.test \
+       instspc-minus-build.test instspc-minus-install.test \
+       instspc-comma-build.test instspc-comma-install.test \
+       instspc-colon-build.test instspc-colon-install.test \
+       instspc-semicol-build.test instspc-semicol-install.test \
+       instspc-equal-build.test instspc-equal-install.test \
+       instspc-less-build.test instspc-less-install.test \
+       instspc-more-build.test instspc-more-install.test \
+       instspc-at-build.test instspc-at-install.test \
+       instspc-lqbrack-build.test instspc-lqbrack-install.test \
+       instspc-rqbrack-build.test instspc-rqbrack-install.test \
+       instspc-lcbrack-build.test instspc-lcbrack-install.test \
+       instspc-rcbrack-build.test instspc-rcbrack-install.test \
+       instspc-space-build.test instspc-space-install.test \
+       instspc-tab-build.test instspc-tab-install.test \
+       instspc-linefeed-build.test instspc-linefeed-install.test \
+       instspc-backspace-build.test instspc-backspace-install.test \
+       instspc-formfeed-build.test instspc-formfeed-install.test \
+       instspc-carriageret-build.test \
+       instspc-carriageret-install.test \
+       instspc-quadrigraph0-build.test \
+       instspc-quadrigraph0-install.test \
+       instspc-quadrigraph1-build.test \
+       instspc-quadrigraph1-install.test \
+       instspc-quadrigraph2-build.test \
+       instspc-quadrigraph2-install.test \
+       instspc-quadrigraph3-build.test \
+       instspc-quadrigraph3-install.test \
+       instspc-quadrigraph4-build.test \
+       instspc-quadrigraph4-install.test instspc-a_b-build.test \
+       instspc-a_b-install.test instspc-a__b-build.test \
+       instspc-a__b-install.test instspc-a_lf_b-build.test \
+       instspc-a_lf_b-install.test instspc-dotdotdot-build.test \
+       instspc-dotdotdot-install.test instspc-dosdrive-build.test \
+       instspc-dosdrive-install.test instspc-miscglob1-build.test \
+       instspc-miscglob1-install.test instspc-miscglob2-build.test \
+       instspc-miscglob2-install.test
+instspc_xfail_tests = instspc-squote-build.test \
+       instspc-dquote-build.test instspc-bquote-build.test \
+       instspc-sharp-build.test instspc-dollar-build.test \
+       instspc-bslash-build.test instspc-ampersand-build.test \
+       instspc-linefeed-build.test instspc-quadrigraph0-build.test \
+       instspc-a_lf_b-build.test instspc-squote-install.test \
+       instspc-dquote-install.test instspc-bquote-install.test \
+       instspc-sharp-install.test instspc-dollar-install.test \
+       instspc-linefeed-install.test instspc-a_lf_b-install.test
 TESTS = \
-aclibobj.test \
 aclocal.test \
 aclocal3.test \
 aclocal4.test \
@@ -326,6 +378,7 @@ acloca19.test \
 acloca20.test \
 acloca21.test \
 acloca22.test \
+acloca23.test \
 acoutnoq.test \
 acoutpt.test \
 acoutpt2.test \
@@ -356,6 +409,7 @@ ansi7.test \
 ansi8.test \
 ansi9.test \
 ansi10.test \
+ar-lib.test \
 ar.test \
 ar2.test \
 asm.test \
@@ -371,6 +425,17 @@ auxdir.test \
 auxdir2.test \
 auxdir3.test \
 auxdir4.test \
+auxdir5.test \
+auxdir6.test \
+auxdir7.test \
+auxdir8.test \
+auxdir9.test \
+backcompat.test \
+backcompat2.test \
+backcompat3.test \
+backcompat4.test \
+backcompat5.test \
+backcompat6.test \
 backsl.test \
 backsl2.test \
 backsl3.test \
@@ -380,11 +445,15 @@ badopt.test \
 badprog.test \
 block.test \
 bsource.test \
+candist.test \
 canon.test \
 canon2.test \
 canon3.test \
 canon4.test \
 canon5.test \
+canon6.test \
+canon7.test \
+canon8.test \
 canon-name.test \
 ccnoco.test \
 ccnoco2.test \
@@ -400,11 +469,13 @@ check8.test \
 check9.test \
 check10.test \
 check11.test \
+check12.test \
 checkall.test \
 clean.test \
 clean2.test \
 colneq.test \
 colneq2.test \
+colneq3.test \
 colon.test \
 colon2.test \
 colon3.test \
@@ -427,8 +498,13 @@ commen10.test \
 commen11.test \
 compile.test \
 compile2.test \
+compile3.test \
+compile4.test \
+compile5.test \
+compile6.test \
 compile_f90_c_cxx.test \
 compile_f_c_cxx.test \
+cond-basic.test \
 cond.test \
 cond2.test \
 cond3.test \
@@ -473,6 +549,7 @@ cond42.test \
 cond43.test \
 cond44.test \
 cond45.test \
+cond46.test \
 condd.test \
 condhook.test \
 condhook2.test \
@@ -501,7 +578,9 @@ confsub.test \
 confvar.test \
 confvar2.test \
 copy.test \
-ctarget1.test \
+cscope.test \
+cscope2.test \
+cscope3.test \
 cxx.test \
 cxx2.test \
 cxxansi.test \
@@ -573,6 +652,7 @@ exeext4.test \
 exsource.test \
 ext.test \
 ext2.test \
+ext3.test \
 extra.test \
 extra2.test \
 extra3.test \
@@ -581,9 +661,12 @@ extra5.test \
 extra6.test \
 extra7.test \
 extra8.test \
+extra9.test \
 extra10.test \
 extra11.test \
 extra12.test \
+extradep.test \
+extradep2.test \
 f90only.test \
 flavor.test \
 flibs.test \
@@ -665,7 +748,7 @@ instman2.test \
 instmany.test \
 instmany-mans.test \
 instmany-python.test \
-instspc.test \
+$(instspc_tests) \
 interp.test \
 interp2.test \
 java.test \
@@ -680,9 +763,12 @@ lex2.test \
 lex3.test \
 lex4.test \
 lex5.test \
+lexcpp.test \
+lexvpath.test \
 lflags.test \
 lflags2.test \
 libexec.test \
+libobj-basic.test \
 libobj2.test \
 libobj3.test \
 libobj4.test \
@@ -690,10 +776,20 @@ libobj5.test \
 libobj7.test \
 libobj8.test \
 libobj10.test \
-libobj11.test \
 libobj12.test \
 libobj13.test \
 libobj14.test \
+libobj15a.test \
+libobj15b.test \
+libobj15c.test \
+libobj16a.test \
+libobj16b.test \
+libobj17.test \
+libobj18.test \
+libobj19.test \
+libobj20a.test \
+libobj20b.test \
+libobj20c.test \
 library.test \
 library2.test \
 library3.test \
@@ -717,6 +813,7 @@ link_fc.test \
 link_fccxx.test \
 link_fcxx.test \
 link_f_only.test \
+link_override.test \
 lisp2.test \
 lisp3.test \
 lisp4.test \
@@ -737,6 +834,7 @@ ltinstloc.test \
 ltlibobjs.test \
 ltlibsrc.test \
 ltorder.test \
+lzip.test \
 lzma.test \
 maintclean.test \
 make.test \
@@ -771,6 +869,7 @@ mkinst3.test \
 mmode.test \
 mmodely.test \
 multlib.test \
+no-outdir-option.test \
 nobase.test \
 nobase-libtool.test \
 nobase-python.test \
@@ -793,8 +892,8 @@ number.test \
 objc.test \
 objc2.test \
 obsolete.test \
+oldvars.test \
 order.test \
-outdir.test \
 output.test \
 output2.test \
 output3.test \
@@ -809,7 +908,10 @@ output11.test \
 output12.test \
 output13.test \
 output-order.test \
-overrid.test \
+override-conditional-1.test \
+override-conditional-2.test \
+override-html.test \
+override-suggest-local.test \
 parallel-am.test \
 parallel-am2.test \
 parallel-am3.test \
@@ -838,6 +940,15 @@ pluseq8.test \
 pluseq9.test \
 pluseq10.test \
 pluseq11.test \
+posixsubst-data.test \
+posixsubst-extradist.test \
+posixsubst-ldadd.test \
+posixsubst-libraries.test \
+posixsubst-ltlibraries.test \
+posixsubst-programs.test \
+posixsubst-scripts.test \
+posixsubst-sources.test \
+posixsubst-tests.test \
 postproc.test \
 ppf77.test \
 pr2.test \
@@ -881,16 +992,31 @@ python12.test \
 recurs.test \
 recurs2.test \
 remake.test \
+remake1a.test \
 remake2.test \
 remake3.test \
+remake3a.test \
 remake4.test \
 remake5.test \
 remake6.test \
 remake7.test \
+remake8a.test \
+remake8b.test \
+remake9a.test \
+remake9b.test \
+remake9c.test \
+remake9d.test \
+remake10a.test \
+remake10b.test \
+remake10c.test \
+remake11.test \
+remake12.test \
 regex.test \
+regex-obsolete.test \
 req.test \
 reqd.test \
 reqd2.test \
+repeated-options.test \
 rulepat.test \
 sanity.test \
 scripts.test \
@@ -899,15 +1025,19 @@ silent.test \
 silent2.test \
 silent3.test \
 silent4.test \
-silent5.test \
 silent6.test \
 silent7.test \
+silent8.test \
 silent9.test \
 silentcxx.test \
 silentf77.test \
 silentf90.test \
-silentlex.test \
-silentyacc.test \
+silent-many-gcc.test \
+silent-many-generic.test \
+silent-lex-gcc.test \
+silent-lex-generic.test \
+silent-yacc-gcc.test \
+silent-yacc-generic.test \
 sinclude.test \
 srcsub.test \
 srcsub2.test \
@@ -930,6 +1060,8 @@ stamph2.test \
 stdlib.test \
 stdlib2.test \
 strip.test \
+strip2.test \
+strip3.test \
 subdir.test \
 subdir2.test \
 subdir3.test \
@@ -963,6 +1095,7 @@ subst.test \
 subst2.test \
 subst3.test \
 subst4.test \
+subst5.test \
 substref.test \
 substre2.test \
 substtarg.test \
@@ -983,6 +1116,7 @@ symlink.test \
 symlink2.test \
 syntax.test \
 tags.test \
+tags2.test \
 tagsub.test \
 tar.test \
 tar2.test \
@@ -1033,6 +1167,8 @@ vala5.test \
 vars.test \
 vars3.test \
 vartar.test \
+vartypos.test \
+vartypo2.test \
 version.test \
 version2.test \
 version3.test \
@@ -1047,9 +1183,11 @@ warnopts.test \
 werror.test \
 werror2.test \
 werror3.test \
+werror4.test \
 whoami.test \
 xsource.test \
 xz.test \
+yacc-basic.test \
 yacc.test \
 yacc2.test \
 yacc3.test \
@@ -1065,15 +1203,11 @@ yflags.test \
 yflags2.test \
 $(parallel_tests)
 
-EXTRA_DIST = ChangeLog-old gen-parallel-tests $(TESTS)
-
-# Each test case depends on defs, aclocal, and automake.
-check_SCRIPTS = defs aclocal-$(APIVERSION) automake-$(APIVERSION)
 all: all-am
 
 .SUFFIXES:
 .SUFFIXES: .html .log .test
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am $(srcdir)/parallel-tests.am $(am__configure_deps)
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am $(srcdir)/parallel-tests.am $(srcdir)/instspc-tests.am $(am__configure_deps)
        @for dep in $?; do \
          case '$(am__configure_deps)' in \
            *$$dep*) \
@@ -1103,7 +1237,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)/$@
@@ -1115,6 +1249,8 @@ TAGS:
 ctags: CTAGS
 CTAGS:
 
+cscope cscopelist:
+
 
 $(TEST_SUITE_LOG): $(TEST_LOGS)
        @$(am__sh_e_setup);                                             \
@@ -1273,7 +1409,6 @@ distdir: $(DISTFILES)
          fi; \
        done
 check-am: all-am
-       $(MAKE) $(AM_MAKEFLAGS) $(check_SCRIPTS)
        $(MAKE) $(AM_MAKEFLAGS) check-TESTS
 check: check-am
 all-am: Makefile
@@ -1288,10 +1423,15 @@ install-am: all-am
 
 installcheck: installcheck-am
 install-strip:
-       $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-         install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-         `test -z '$(STRIP)' || \
-           echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+       if test -z '$(STRIP)'; then \
+         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+             install; \
+       else \
+         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+           "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+       fi
 mostlyclean-generic:
        -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS)
        -test -z "$(TEST_LOGS_TMP)" || rm -f $(TEST_LOGS_TMP)
@@ -1388,15 +1528,85 @@ uninstall-am:
        maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
        pdf-am ps ps-am recheck recheck-html uninstall uninstall-am
 
+backcompat5-p.log: backcompat5.test
+check-p.log: check.test
+check10-p.log: check10.test
+check11-p.log: check11.test
+check12-p.log: check12.test
+check2-p.log: check2.test
+check3-p.log: check3.test
+check4-p.log: check4.test
+check5-p.log: check5.test
+check6-p.log: check6.test
+check7-p.log: check7.test
+check8-p.log: check8.test
+check9-p.log: check9.test
+color-p.log: color.test
+color2-p.log: color2.test
+comment9-p.log: comment9.test
+dejagnu-p.log: dejagnu.test
+exeext4-p.log: exeext4.test
+maken3-p.log: maken3.test
+maken4-p.log: maken4.test
+posixsubst-tests-p.log: posixsubst-tests.test
+pr401-p.log: pr401.test
+pr401b-p.log: pr401b.test
+pr401c-p.log: pr401c.test
 
 $(srcdir)/parallel-tests.am: gen-parallel-tests Makefile.am
-       (cd $(srcdir) && $(SHELL) ./gen-parallel-tests) >$@
+       $(AM_V_GEN)($(am__cd) $(srcdir) && $(SHELL) ./gen-parallel-tests) >$@
+
+$(parallel_tests): Makefile.am
+       $(AM_V_at)rm -f $@ $@-t
+       $(AM_V_GEN)input=`echo $@ | sed 's,.*/,,; s,-p.test$$,.test,'`; \
+       { echo '#!/bin/sh'; \
+         echo '# DO NOT EDIT!  GENERATED AUTOMATICALLY!'; \
+         echo; \
+         echo '# Ensure proper definition of $$testsrcdir.'; \
+         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."; \
+         echo 'parallel_tests=yes'; \
+         echo "# In the spirit of VPATH, we prefer a test in the build tree"; \
+         echo "# over one in the source tree."; \
+         echo "if test -f \"./$$input\"; then"; \
+         echo "  . \"./$$input\""; \
+         echo 'else'; \
+         echo "  . \"\$$testsrcdir/$$input\""; \
+         echo 'fi'; \
+       } > $@-t
+       $(AM_V_at)chmod a+rx $@-t && mv -f $@-t $@
+
+$(srcdir)/instspc-tests.am: instspc-tests.sh Makefile.am
+       $(AM_V_GEN)($(am__cd) $(srcdir) \
+         && $(SHELL) ./instspc-tests.sh --generate-makefile) >$@
 
-$(parallel_tests): $(parallel_tests:-p.test=.test) Makefile.am
-       input=`echo $@ | sed 's,.*/,,; s,-p.test$$,.test,'`; \
-       sed 's|^\. \./defs.*|parallel_tests=yes; &|' \
-         < $(srcdir)/$$input >$@
-       chmod a+rx $@
+$(instspc_tests): Makefile.am
+       $(AM_V_at)rm -f $@ $@-t
+       $(AM_V_GEN) :; \
+         base=`expr 'x/$@' : 'x.*/instspc-\(.*\)\.test$$'`; \
+         name=`expr x"$$base" : x'\(.*\)-'`; \
+         action=`expr x"$$base" : x'.*-\(.*\)'`; \
+         { \
+           echo '#!/bin/sh'; \
+           echo '# DO NOT EDIT!  GENERATED AUTOMATICALLY!'; \
+           echo; \
+           echo '# Ensure proper definition of $$testsrcdir.'; \
+           echo '. ./defs-static || exit 99'; \
+           echo 'test -n "$$testsrcdir" || exit 99 # sanity check'; \
+           echo; \
+           echo "instspc_test_name='$$name'"; \
+           echo "instspc_action='test-$$action'"; \
+           echo ". \$$testsrcdir/instspc-tests.sh"; \
+         } > $@-t
+       $(AM_V_at)chmod a+rx $@-t && mv -f $@-t $@
+
+# All instspc*.test tests work by sourcing the instspc-tests.sh script.
+$(instspc_tests:.test=.log): instspc-tests.sh
+
+# Each test case depends on defs, aclocal, and automake.
+$(TEST_LOGS): defs aclocal-$(APIVERSION) automake-$(APIVERSION)
 
 clean-local: clean-local-check
 .PHONY: clean-local-check
index 93f9cbf..88da783 100644 (file)
@@ -5,15 +5,33 @@ User interface
 ==============
 
 
-Running all tests
+Running the tests
 -----------------
 
-  make check
+  To run all tests:
+
+    make -k check
 
   You can use `-jN' for faster completion (it even helps on a
   uniprocessor system, due to unavoidable sleep delays, as
   noted below).
 
+  To rerun only failed tests:
+
+    make -k recheck
+
+  To run only tests that are newer than their last results:
+
+    make -k check RECHECK_LOGS=
+
+  To run only selected tests:
+
+    make -k check TESTS="foo.test bar.test"
+
+  For non-GNU make, you might have to use this instead:
+
+    env TESTS="foo.test bar.test" make -e -k check
+
 
 Interpretation
 --------------
index 7716f2a..c89e80c 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
+# Copyright (C) 2003, 2005, 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
@@ -55,6 +55,7 @@ grep MACRO3 aclocal.m4
 test ! -f m4_1/macro.m4
 test ! -f m4_2/macro.m4
 
+$sleep
 $ACLOCAL -I m4_2 -I m4_1
 $AUTOCONF
 ./configure
@@ -65,6 +66,7 @@ grep MACRO3 aclocal.m4
 test ! -f m4_1/macro.m4
 test ! -f m4_2/macro.m4
 
+$sleep
 ACLOCAL_TESTSUITE_FLAGS='-I m4_1 -I m4_2'
 $ACLOCAL --install
 $AUTOCONF
@@ -77,6 +79,7 @@ test -f m4_1/macro.m4
 test ! -f m4_2/macro.m4
 cp aclocal.m4 copy.m4
 
+$sleep
 echo '#GREPME' >>dirlist-test/macro.m4
 $ACLOCAL --install
 $AUTOCONF
index 9826892..6756fb3 100755 (executable)
@@ -25,7 +25,7 @@ AM_MACRO1
 AM_MACRO2
 END
 
-mkdir 1 2 3 4
+mkdir 1 2 3 4 5 6
 
 cat >1/m1.m4 <<EOF
 #serial 1.8.1230.9
@@ -53,6 +53,17 @@ cat >4/mumble.m4 <<EOF
 AC_DEFUN([AM_MACRO1], [echo macro14 >> foo])
 EOF
 
+cat >5/ill-formed.m4 <<EOF
+#serial bla
+#serial .2
+#serial
+AC_DEFUN([AM_MACRO1], [echo macro15 >> foo])
+EOF
+
+cat >6/after-def.m4 <<EOF
+AC_DEFUN([AM_MACRO1], [echo macro16 >> foo])
+#serial 1
+EOF
 
 ACLOCAL_TESTSUITE_FLAGS='-I 1 -I 2 -I 3 -I 4'
 
@@ -62,6 +73,7 @@ $AUTOCONF
 grep macro11 foo
 grep macro21 foo
 
+$sleep
 rm -f foo
 $ACLOCAL --install
 $AUTOCONF
@@ -69,6 +81,7 @@ $AUTOCONF
 grep macro12 foo
 grep macro23 foo
 
+$sleep
 ACLOCAL_TESTSUITE_FLAGS='-I 4 -I 1 -I 2 -I 3'
 rm -f foo
 $ACLOCAL --install --dry-run
@@ -77,6 +90,7 @@ $AUTOCONF
 grep macro12 foo
 grep macro23 foo
 
+$sleep
 rm -f foo
 $ACLOCAL --install
 $AUTOCONF
@@ -84,12 +98,14 @@ $AUTOCONF
 grep macro14 foo
 grep macro23 foo
 
+$sleep
 ACLOCAL_TESTSUITE_FLAGS='-I 4 -I 1 -I 2'
 rm -f foo
 $ACLOCAL --install 2>stderr && { cat stderr >&2; Exit 1; }
 cat stderr >&2
 grep 'macro.*AM_MACRO2.*not found' stderr
 
+$sleep
 ACLOCAL_TESTSUITE_FLAGS='-I 4 -I 1'
 rm -f foo
 $ACLOCAL --install
@@ -99,6 +115,7 @@ grep macro14 foo
 grep macro21 foo
 
 
+$sleep
 mkdir dirlist-test
 cat >dirlist-test/m1.m4 <<EOF
 #serial 456
@@ -117,4 +134,12 @@ grep '#serial 456' stdout
 test ! -f 4/m1.m4
 grep 'installing.*4/m1\.m4' stderr
 
+$ACLOCAL -I 5 2>stderr && { cat stderr >&2; Exit 1; }
+cat stderr >&2
+test `grep -c 'ill-formed serial' stderr` -eq 3
+
+$ACLOCAL -I 6 2>stderr && { cat stderr >&2; Exit 1; }
+cat stderr >&2
+grep 'serial.*before any macro definition' stderr
+
 :
diff --git a/tests/acloca23.test b/tests/acloca23.test
new file mode 100755 (executable)
index 0000000..1741e70
--- /dev/null
@@ -0,0 +1,37 @@
+#! /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 we diagnose underquoted AC_DEFUN's.
+
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+FOO
+END
+
+mkdir m4
+cat >m4/foo.m4 <<EOF
+AC_DEFUN(FOO, [echo foo])
+EOF
+
+$ACLOCAL -I m4 2>stderr && { cat stderr >&2; Exit 1; }
+cat stderr >&2
+grep 'underquoted definition.*FOO' stderr
+grep 'warning.*warning' stderr && Exit 1
+
+:
index da80d08..3e78df9 100755 (executable)
@@ -41,6 +41,6 @@ grep '[Tt]ry.*--help.*for more information' stderr
 
 $ACLOCAL --versi
 
-test "`$ACLOCAL --print-ac-dir`" = "$testaclocaldir"
+test x"`$ACLOCAL --print-ac-dir`" = x"$top_testsrcdir/m4"
 
 :
index 325f6ae..a9657fc 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2003  Free Software Foundation, Inc.
+# Copyright (C) 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
@@ -42,6 +42,8 @@ $AUTOCONF
 grep macro11 foo
 grep macro21 foo
 
+$sleep
+
 $ACLOCAL -I m4_2 -I m4_1
 $AUTOCONF
 ./configure
index c0778c6..7795f48 100755 (executable)
@@ -42,13 +42,11 @@ END
 : > ansi2knr.1
 
 $ACLOCAL
+$AUTOCONF
 $AUTOMAKE
 
-$FGREP -v @SET_MAKE@ Makefile.in > Makefile.sed
-$MAKE -f Makefile.sed SHELL=$SHELL test1
-
-$AUTOCONF
 ./configure
+
 $MAKE test1
 $MAKE test2
 
diff --git a/tests/ar-lib.test b/tests/ar-lib.test
new file mode 100755 (executable)
index 0000000..652aaf1
--- /dev/null
@@ -0,0 +1,88 @@
+#! /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 `ar-lib' wraps the Microsoft Library Manager (lib) correctly
+
+required=xsi-shell
+. ./defs || Exit 1
+
+set -e
+
+cp "$top_testsrcdir/lib/ar-lib" .
+
+# Use a dummy lib, since lib isn't readily available on all systems.
+cat >lib <<'END'
+#! /bin/sh
+if test x"$2" = x-LIST && test x"$3" = xfake.lib; then
+  echo fake.obj
+elif test x"$2" = x-LIST && test x"$3" = xfake2.lib; then
+  printf "%s\n" "dir\\fake2.obj"
+else
+  printf "%s\n" "lib $*"
+fi
+END
+
+chmod +x ./lib
+
+# Check if ar-lib can create an archive with "cr"
+opts=`./ar-lib ./lib cr foo.lib foo.obj`
+test x"$opts" = x"lib -NOLOGO -OUT:foo.lib foo.obj"
+
+# Check if ar-lib can update an existing archive with "r"
+touch foo.lib
+opts=`./ar-lib ./lib r foo.lib foo.obj`
+test x"$opts" = x"lib -NOLOGO -OUT:foo.lib foo.lib foo.obj"
+
+# Check if ar-lib passes on @FILE with "r"
+opts=`./ar-lib ./lib r foo.lib @list`
+test x"$opts" = x"lib -NOLOGO -OUT:foo.lib foo.lib @list"
+
+# Check if ar-lib can delete a member from an archive with "d"
+opts=`./ar-lib ./lib d foo.lib foo.obj`
+test x"$opts" = x"lib -NOLOGO -REMOVE:foo.obj foo.lib"
+
+# Check if ar-lib can delete members in an @FILE
+echo foo.obj > foolist
+opts=`./ar-lib ./lib d foo.lib @foolist`
+test x"$opts" = x"lib -NOLOGO -REMOVE:foo.obj foo.lib"
+
+# Check if ar-lib can list archive members with "t"
+opts=`./ar-lib ./lib t foo.lib`
+test x"$opts" = x"lib -NOLOGO -LIST foo.lib"
+
+# Check if ar-lib can extract archive members with "x"
+touch fake.lib
+opts=`./ar-lib ./lib x fake.lib`
+test x"$opts" = x"lib -NOLOGO -EXTRACT:fake.obj fake.lib"
+
+# Check if ar-lib can extract specified archive members with "x"
+opts=`./ar-lib ./lib x foo.lib foo.obj`
+test x"$opts" = x"lib -NOLOGO -EXTRACT:foo.obj foo.lib"
+
+# Check if ar-lib can extract members in an @FILE
+opts=`./ar-lib ./lib x foo.lib @foolist`
+test x"$opts" = x"lib -NOLOGO -EXTRACT:foo.obj foo.lib"
+
+# Check if ar-lib passes -lib and -LTCG through to the wrappee
+opts=`./ar-lib ./lib -lib -LTCG x foo.lib foo.obj`
+test x"$opts" = x"lib -lib -LTCG -NOLOGO -EXTRACT:foo.obj foo.lib"
+
+# Check if ar-lib can extract backslashed members
+touch fake2.lib
+opts=`./ar-lib ./lib x fake2.lib`
+test x"$opts" = x"lib -NOLOGO -EXTRACT:dir\\fake2.obj fake2.lib"
+
+:
index 014d2b7..9293bd1 100755 (executable)
@@ -16,7 +16,7 @@
 
 # Check that autoheaders works, despite our AC_CONFIG_HEADERS hack.
 
-. ./defs
+. ./defs || Exit 1
 
 set -e
 
index 2ddce32..e2a71cf 100755 (executable)
@@ -16,7 +16,7 @@
 
 # Check that autoheaders works, despite our AC_CONFIG_HEADERS hack.
 
-. ./defs
+. ./defs || Exit 1
 
 set -e
 
index 8e9f079..f559295 100755 (executable)
@@ -17,7 +17,7 @@
 # Check rebuild rules for autoheader.
 
 required=GNUmake
-. ./defs
+. ./defs || Exit 1
 
 set -e
 
index 187429f..24c57fb 100755 (executable)
@@ -18,7 +18,7 @@
 # (This should also work without GNU Make.)
 
 required=gcc
-. ./defs
+. ./defs || Exit 1
 
 set -e
 
index 95a7a20..f795450 100755 (executable)
@@ -1,5 +1,6 @@
 #! /bin/sh
-# Copyright (C) 1996, 2001, 2002, 2003, 2004, 2007  Free Software Foundation, Inc.
+# Copyright (C) 1996, 2001, 2002, 2003, 2004, 2007, 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
 
 . ./defs || Exit 1
 
+set -e
+
 # The "./." is here so we don't have to mess with subdirs.
-cat > configure.in << 'END'
-AC_INIT([auxdir], [1.0])
-AC_CONFIG_AUX_DIR(./.)
+cat > configure.in <<END
+AC_INIT([$me], [1.0])
+AC_CONFIG_AUX_DIR([./.])
 AM_INIT_AUTOMAKE
 AC_CONFIG_FILES([Makefile])
 END
@@ -30,11 +33,13 @@ cat > Makefile.am << 'END'
 pkgdata_DATA =
 END
 
-cp "$testsrcdir/../lib/mkinstalldirs" .
+cp "$top_testsrcdir/lib/mkinstalldirs" .
 
 # The "././" prefix confuses Automake into thinking it is doing a
 # subdir build.  Yes, this is hacky.
-$ACLOCAL || Exit 1
-$AUTOMAKE ././Makefile || Exit 1
+$ACLOCAL
+$AUTOMAKE ././Makefile
 
 grep '/\./\./mkinstalldirs' Makefile.in
+
+:
index 590a5df..430abad 100755 (executable)
 
 . ./defs || Exit 1
 
-# The "./." is here so we don't have to mess with subdirs.
-cat > configure.in << 'END'
-AC_INIT([auxdir2], [1.0])
-AC_CONFIG_AUX_DIR($foo)
+set -e
+
+cat > configure.in <<END
+AC_INIT([$me], [1.0])
+AC_CONFIG_AUX_DIR([\$foo)
 AM_INIT_AUTOMAKE
 AC_CONFIG_FILES([Makefile])
 END
 
 : > Makefile.am
 
-$ACLOCAL || Exit 1
+$ACLOCAL
+# Both these two invocations are meant.
+# They exercise both code paths concerning auxiliary files.
+$AUTOMAKE -a
 $AUTOMAKE
+
+:
index c828051..64fbd6a 100755 (executable)
@@ -21,7 +21,7 @@
 set -e
 
 cat >> configure.in << 'END'
-AC_CONFIG_AUX_DIR(.)
+AC_CONFIG_AUX_DIR([.]) dnl this will appear after AM_INIT_AUTOMAKE
 END
 
 : > Makefile.am
@@ -29,3 +29,5 @@ END
 $ACLOCAL
 AUTOMAKE_fails
 grep 'AC_CONFIG_AUX_DIR.*AM_INIT_AUTOMAKE' stderr
+
+:
index 0447809..38bf28f 100755 (executable)
 # 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 we diagnose dangerous AC_CONFIG_AUX_DIR names.
+# Make sure we diagnose unportable AC_CONFIG_AUX_DIR names.
 
 . ./defs || Exit 1
 
 set -e
 
-cat >configure.in <<'END'
-AC_INIT([auxdir4], [1.0])
+cat >configure.in <<END
+AC_INIT([$me], [1.0])
 AC_CONFIG_AUX_DIR([aux])
 AM_INIT_AUTOMAKE
 AC_CONFIG_FILES([Makefile])
@@ -31,5 +31,11 @@ END
 
 $ACLOCAL
 AUTOMAKE_fails
-grep 'configure.in:2:.*aux.*does not exist' stderr
-grep 'configure.in:2:.*aux.*W32' stderr
+grep '^configure\.in:2:.*aux.*W32' stderr
+
+if mkdir aux; then
+  AUTOMAKE_fails
+  grep '^configure\.in:2:.*aux.*W32' stderr
+fi
+
+:
diff --git a/tests/auxdir5.test b/tests/auxdir5.test
new file mode 100755 (executable)
index 0000000..e44b8fb
--- /dev/null
@@ -0,0 +1,36 @@
+#! /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 we diagnose non-existent AC_CONFIG_AUX_DIR names.
+
+. ./defs || Exit 1
+
+set -e
+
+cat > configure.in <<END
+AC_INIT([$me], [1.0])
+AC_CONFIG_AUX_DIR([nonesuch])
+AM_INIT_AUTOMAKE
+AC_CONFIG_FILES([Makefile])
+END
+
+: > Makefile.am
+
+$ACLOCAL
+AUTOMAKE_fails
+grep '^configure\.in:2:.*nonesuch.* not exist' stderr
+
+:
diff --git a/tests/auxdir6.test b/tests/auxdir6.test
new file mode 100755 (executable)
index 0000000..4b3565a
--- /dev/null
@@ -0,0 +1,52 @@
+#! /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/>.
+
+# Test to make sure AC_CONFIG_AUX_DIR works correctly.
+# This test calls AC_CONFIG_AUX_DIR with an explicit literal argument,
+# thus explicitly making the directory named by that argument the
+# config auxdir.
+# Keep this in sync with sister tests auxdir7.test and auxdir8.test.
+
+. ./defs || Exit 1
+
+set -e
+
+cat > configure.in <<END
+AC_INIT([$me], [1.0])
+AC_CONFIG_AUX_DIR([auxdir])
+AM_INIT_AUTOMAKE
+AC_CONFIG_FILES([Makefile subdir/Makefile])
+END
+
+mkdir subdir auxdir
+
+cat > Makefile.am << 'END'
+pkgdata_DATA =
+END
+
+cp Makefile.am subdir/Makefile.am
+
+: > auxdir/mkinstalldirs
+: > auxdir/install-sh
+: > auxdir/missing
+
+$ACLOCAL
+$AUTOMAKE
+
+$FGREP '$(top_srcdir)/auxdir/mkinstalldirs' Makefile.in
+$FGREP '$(top_srcdir)/auxdir/mkinstalldirs' subdir/Makefile.in
+
+:
diff --git a/tests/auxdir7.test b/tests/auxdir7.test
new file mode 100755 (executable)
index 0000000..05fbb4d
--- /dev/null
@@ -0,0 +1,49 @@
+#! /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/>.
+
+# Test to make sure AC_CONFIG_AUX_DIR works correctly.
+# This test calls AC_CONFIG_AUX_DIR with a `.' argument, thus explicitly
+# making the top-level directory the config auxdir.
+# Keep this in sync with sister tests auxdir6.test and auxdir8.test.
+
+. ./defs || Exit 1
+
+set -e
+
+cat > configure.in <<END
+AC_INIT([$me], [1.0])
+AC_CONFIG_AUX_DIR([.])
+AM_INIT_AUTOMAKE
+AC_CONFIG_FILES([Makefile subdir/Makefile])
+END
+
+mkdir subdir
+
+cat > Makefile.am << 'END'
+pkgdata_DATA =
+END
+
+cp Makefile.am subdir/Makefile.am
+
+: > mkinstalldirs
+
+$ACLOCAL
+$AUTOMAKE
+
+$FGREP '$(top_srcdir)/mkinstalldirs' Makefile.in
+$FGREP '$(top_srcdir)/mkinstalldirs' subdir/Makefile.in
+
+:
diff --git a/tests/auxdir8.test b/tests/auxdir8.test
new file mode 100755 (executable)
index 0000000..c3e57de
--- /dev/null
@@ -0,0 +1,48 @@
+#! /bin/sh
+# Copyright (C) 1996, 2001, 2002, 2003, 2004, 2007  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/>.
+
+# Test to make sure AC_CONFIG_AUX_DIR works correctly.
+# This test tries without an explicit call to AC_CONFIG_AUX_DIR;
+# the config auxdir should be implicitly defined to `.' since
+# the install-sh, mkinstalldirs, etc., scripts are in the top-level
+# directory.
+# Keep this in sync with sister tests auxdir6.test and auxdir7.test.
+
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_CONFIG_FILES([subdir/Makefile])
+END
+
+mkdir subdir
+
+cat > Makefile.am << 'END'
+pkgdata_DATA =
+END
+
+cp Makefile.am subdir/Makefile.am
+
+: > mkinstalldirs
+
+$ACLOCAL
+$AUTOMAKE
+
+$FGREP '$(top_srcdir)/mkinstalldirs' Makefile.in
+$FGREP '$(top_srcdir)/mkinstalldirs' subdir/Makefile.in
+
+:
diff --git a/tests/auxdir9.test b/tests/auxdir9.test
new file mode 100755 (executable)
index 0000000..db85ac1
--- /dev/null
@@ -0,0 +1,132 @@
+#! /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, if AC_CONFIG_AUX_DIR is not specified, Automake tries
+# to use `.', `..' and `../..', in precisely that order.
+
+. ./defs || Exit 1
+
+set -e
+
+nil=__no_such_program
+
+unset NONESUCH || :
+
+cat >>configure.in << END
+AM_MISSING_PROG([NONESUCH],[$nil])
+AC_OUTPUT
+END
+
+mkdir d3
+mkdir d3/d2
+mkdir d3/d2/d1
+mkdir d3/d2/d1/d0
+
+echo 'echo %%d3%% $*' > d3/missing
+chmod +x d3/missing
+echo 'echo %%d2%% $*' > d3/d2/missing
+chmod +x d3/d2/missing
+echo 'echo %%d1%% $*' > d3/d2/d1/missing
+chmod +x d3/d2/d1/missing
+echo 'echo %%d0%% $*' > d3/d2/d1/d0/missing
+chmod +x d3/d2/d1/d0/missing
+
+mv configure.in d3/d2/d1/d0/
+
+cd d3/d2/d1/d0
+
+cat > Makefile.am << 'EOF'
+.PHONY: test
+test:
+       $(NONESUCH) >$(out)
+EOF
+
+$ACLOCAL
+$AUTOCONF
+
+# ------------------------------------------- #
+:  We must end up with AC_CONFIG_AUX_DIR = .  #
+# ------------------------------------------- #
+
+: > install-sh
+$AUTOMAKE
+./configure
+out=out0 $MAKE test
+cat out0
+grep "%%d0%%.*$nil" out0
+grep '%%d[123]' out0 && Exit 1
+
+rm -f missing install-sh
+
+# -------------------------------------------- #
+:  We must end up with AC_CONFIG_AUX_DIR = ..  #
+# -------------------------------------------- #
+
+# Automake finds `install-sh' in `.', so it assumes that auxdir is `.';
+# but it won't find `missing' in `.', so it will fail.
+: > install-sh
+AUTOMAKE_fails
+grep 'required file.*[^.]\./missing.*not found' stderr
+rm -f install-sh
+
+# Now things should work.
+: > ../install-sh
+$AUTOMAKE
+./configure
+out=out1 $MAKE test
+cat out1
+grep "%%d1%%.*$nil" out1
+grep '%%d[023]' out1 && Exit 1
+
+rm -f ../missing ../install-sh
+
+# ----------------------------------------------- #
+:  We must end up with AC_CONFIG_AUX_DIR = ../..  #
+# ----------------------------------------------- #
+
+# Automake finds `install-sh' in `.', so it assumes that auxdir is `.';
+# but it won't find `missing' in `.', so it will fail.
+: > install-sh
+AUTOMAKE_fails
+grep 'required file.*[^.]\./missing.*not found' stderr
+rm -f install-sh
+
+# Automake finds `install-sh' in `..', so it assumes that auxdir is `..';
+# but it won't find `missing' in `.', so it will fail.
+: > ../install-sh
+AUTOMAKE_fails
+grep 'required file.*[^.]\.\./missing.*not found' stderr
+rm -f ../install-sh
+
+# Now things should work.
+: > ../../install-sh
+$AUTOMAKE
+./configure
+out=out2 $MAKE test
+cat out2
+grep "%%d2%%.*$nil" out2
+grep '%%d[013]' out2 && Exit 1
+
+rm -f ../../missing ../../install-sh
+
+# --------------------------------------------------------- #
+:  AC_CONFIG_AUX_DIR will not be found: automake must fail  #
+# --------------------------------------------------------- #
+
+AUTOMAKE_fails
+grep 'required file.*missing.*not found' stderr
+
+:
diff --git a/tests/backcompat.test b/tests/backcompat.test
new file mode 100755 (executable)
index 0000000..3367db2
--- /dev/null
@@ -0,0 +1,66 @@
+#! /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/>.
+
+# Test usage of AM_INIT_AUTOMAKE with two ot three arguments, for
+# backward-compatibility.
+
+. ./defs || Exit 1
+
+set -e
+
+cat > Makefile.am <<'END'
+.PHONY: test display
+
+## Might be useful for debugging.
+display:
+       ## The following should be substituted by AM_INIT_AUTOMAKE.
+       @echo PACKAGE = $(PACKAGE)
+       @echo VERSION = $(VERSION)
+       ## The following should not be substituted, as we used the
+       ## old form of AC_INIT.
+       @echo PACKAGE_NAME = $(PACKAGE_NAME)
+       @echo PACKAGE_VERSION = $(PACKAGE_VERSION)
+       @echo PACKAGE_TARNAME = $(PACKAGE_TARNAME)
+       @echo PACKAGE_STRING = $(PACKAGE_STRING)
+
+test: display
+       test x'$(PACKAGE)' = x'FooBar'
+       test x'$(VERSION)' = x'0.7.1'
+       test x'$(PACKAGE_NAME)' = x
+       test x'$(PACKAGE_VERSION)' = x
+       test x'$(PACKAGE_TARNAME)' = x
+       test x'$(PACKAGE_STRING)' = x
+END
+
+for ac_init in 'AC_INIT' 'AC_INIT([Makefile.am])'; do
+  for am_extra_args in '' ', []' ', [:]' ', [false]'; do
+    rm -rf autom4te*.cache config* Makefile.in Makefile
+    cat > configure.in <<END
+$ac_init
+AM_INIT_AUTOMAKE([FooBar], [0.7.1]$am_extra_args)
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
+END
+    cat configure.in # might be useful for debugging
+    $ACLOCAL
+    $AUTOCONF
+    $AUTOMAKE
+    ./configure
+    $MAKE test
+  done
+done
+
+:
diff --git a/tests/backcompat2.test b/tests/backcompat2.test
new file mode 100755 (executable)
index 0000000..0967720
--- /dev/null
@@ -0,0 +1,67 @@
+#! /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/>.
+
+# Backward-compatibility test: check that AM_INIT_AUTOMAKE with two or
+# three arguments does AC_DEFINE the symbols PACKAGE and VERSION iff the
+# third argument is empty or non-existent.
+
+. ./defs || Exit 1
+
+set -e
+
+# A trick to make the test run muuuch faster, by avoiding repeated
+# runs of aclocal (one order of magnitude improvement in speed!).
+echo 'AC_INIT(x,0) AM_INIT_AUTOMAKE' > configure.in
+$ACLOCAL
+rm -rf configure.in autom4te.*
+
+cat > config.h.in <<'END'
+#undef PACKAGE
+#undef VERSION
+END
+
+for am_arg3 in ':' 'false' '#' ' '; do
+  cat > configure.in <<END
+AC_INIT
+AC_CONFIG_HEADERS([config.h])
+AM_INIT_AUTOMAKE([pkgname], [pkgversion], [$am_arg3])
+AC_OUTPUT
+END
+  cat configure.in # might be useful for debugging
+  $AUTOCONF
+  ./configure
+  cat config.h # might be useful for debugging
+  # The non-empty third argument should prevent PACKAGE and VERSION
+  # from being AC_DEFINE'd.
+  $EGREP 'pkg(name|version)' config.h && Exit 1
+done
+
+for am_extra_args in '' ',' ', []'; do
+  cat > configure.in <<END
+AC_INIT
+AC_CONFIG_HEADERS([config.h])
+AM_INIT_AUTOMAKE([pkgname], [pkgversion]$am_extra_args)
+AC_OUTPUT
+END
+  cat configure.in # might be useful for debugging
+  $AUTOCONF
+  ./configure
+  cat config.h # might be useful for debugging
+  grep '^ *# *define  *PACKAGE  *"pkgname" *$' config.h
+  grep '^ *# *define  *VERSION  *"pkgversion" *$' config.h
+done
+
+:
diff --git a/tests/backcompat3.test b/tests/backcompat3.test
new file mode 100755 (executable)
index 0000000..f07eaff
--- /dev/null
@@ -0,0 +1,153 @@
+#! /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/>.
+
+# Backward-compatibility test: check what happens when AC_INIT and
+# AM_INIT_AUTOMAKE are both given two or more arguments.
+
+. ./defs || Exit 1
+
+set -e
+
+empty=''
+
+cat > Makefile.am <<'END'
+## Leading `:;' here required to work around bugs of (at least) bash 3.2
+got: Makefile
+       @:; { \
+         echo 'PACKAGE = $(PACKAGE)'; \
+         echo 'VERSION = $(VERSION)'; \
+         echo 'PACKAGE_NAME = $(PACKAGE_NAME)'; \
+         echo 'PACKAGE_VERSION = $(PACKAGE_VERSION)'; \
+         echo 'PACKAGE_STRING = $(PACKAGE_STRING)'; \
+         echo 'PACKAGE_TARNAME = $(PACKAGE_TARNAME)'; \
+         echo 'PACKAGE_BUGREPORT = $(PACKAGE_BUGREPORT)'; \
+         echo 'PACKAGE_URL = $(PACKAGE_URL)'; \
+       } >$@
+END
+
+
+### Run 1 ###
+
+cat > configure.in <<END
+AC_INIT([ac_name], [ac_version])
+AM_INIT_AUTOMAKE([am_name], [am_version])
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
+END
+
+cat configure.in
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+./configure
+
+cat >exp <<END
+PACKAGE = am_name
+VERSION = am_version
+PACKAGE_NAME = ac_name
+PACKAGE_VERSION = ac_version
+PACKAGE_STRING = ac_name ac_version
+PACKAGE_TARNAME = ac_name
+PACKAGE_BUGREPORT = $empty
+PACKAGE_URL = $empty
+END
+
+$MAKE got
+
+diff exp got
+
+
+### Run 2 ###
+
+cat > configure.in <<'END'
+dnl#  `AC_INIT' in Autoconf <= 2.63 doesn't have an URL argument.
+dnl#  Luckily, `AC_AUTOCONF_VERSION' and `m4_version_prereq' are
+dnl#  both present in autoconf 2.62, which we require; so that we
+dnl#  can at least use the following workaround.
+m4_version_prereq([2.64],
+    [AC_INIT([ac_name], [ac_version], [ac_bugreport], [ac_tarname],
+             [ac_url])],
+    [AC_INIT([ac_name], [ac_version], [ac_bugreport], [ac_tarname])
+     AC_SUBST([PACKAGE_URL], [ac_url])])
+AM_INIT_AUTOMAKE([am_name], [am_version])
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
+END
+
+cat configure.in
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+./configure
+
+cat >exp <<END
+PACKAGE = am_name
+VERSION = am_version
+PACKAGE_NAME = ac_name
+PACKAGE_VERSION = ac_version
+PACKAGE_STRING = ac_name ac_version
+PACKAGE_TARNAME = ac_tarname
+PACKAGE_BUGREPORT = ac_bugreport
+PACKAGE_URL = ac_url
+END
+
+$MAKE got
+
+diff exp got
+
+
+### Run 3 ###
+
+cat > configure.in <<END
+AC_INIT([ac_name], [ac_version])
+AM_INIT_AUTOMAKE([am_name], [am_version], [am_foo_quux])
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
+END
+
+cat configure.in
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+./configure
+
+cat >exp <<END
+PACKAGE = am_name
+VERSION = am_version
+PACKAGE_NAME = ac_name
+PACKAGE_VERSION = ac_version
+PACKAGE_STRING = ac_name ac_version
+PACKAGE_TARNAME = ac_name
+PACKAGE_BUGREPORT = $empty
+PACKAGE_URL = $empty
+END
+
+$MAKE got
+
+diff exp got
+
+$FGREP am_foo_quux Makefile.in Makefile configure config.status && Exit 1
+
+
+### Done ###
+
+:
diff --git a/tests/backcompat4.test b/tests/backcompat4.test
new file mode 100755 (executable)
index 0000000..f0625ea
--- /dev/null
@@ -0,0 +1,68 @@
+#! /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/>.
+
+# Backward-compatibility: AC_OUTPUT with arguments.
+
+. ./defs || Exit 1
+
+set -e
+
+mkdir sub
+: > Makefile.am
+: > zardoz
+: > foo.in
+: > foo1.in
+: > foo2.in
+: > foo3.in
+: > sub/bar.in
+
+ls -l # might be useful for debugging
+
+for args in \
+  'foo' \
+  'foo:foo1.in' \
+  'foo:zardoz' \
+  'foo:sub/bar.in' \
+  'foo:foo1.in:foo2.in' \
+  'foo:zardoz:zardoz' \
+  'foo:foo1.in:foo2.in:foo3.in' \
+  'foo:foo1.in:foo2.in:sub/bar.in:foo3.in' \
+; do
+  rm -rf autom4te*.cache aclocal.m4
+  cat >configure.in <<END
+AC_INIT([$me], [1.0])
+AM_INIT_AUTOMAKE
+AC_CONFIG_FILES([$args])
+AC_OUTPUT
+END
+  cat configure.in # for debugging
+  $ACLOCAL
+  $AUTOMAKE Makefile
+  mv -f Makefile.in Makefile.acf
+  rm -rf autom4te*.cache aclocal.m4
+  cat >configure.in <<END
+AC_INIT([$me], [1.0])
+AM_INIT_AUTOMAKE
+AC_OUTPUT([$args])
+END
+  cat configure.in # for debugging
+  $ACLOCAL
+  $AUTOMAKE Makefile
+  mv -f Makefile.in Makefile.aco
+  diff Makefile.acf Makefile.aco
+done
+
+:
diff --git a/tests/backcompat5.test b/tests/backcompat5.test
new file mode 100755 (executable)
index 0000000..50538cc
--- /dev/null
@@ -0,0 +1,119 @@
+#! /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/>.
+
+# Backward-compatibility test: try to build and distribute a package
+# using obsoleted forms of AC_INIT, AM_INIT_AUTOMAKE and AC_OUTPUT.
+# This script can also serve as mild stress-testing for Automke.
+# See also the similar test `backcompat6.test'.
+
+. ./defs || Exit 1
+
+set -e
+
+# Yuck!
+cat > configure.in <<'END'
+dnl. Everything here is *deliberately* underquoted!
+AC_INIT(src/foo.input)
+AM_INIT_AUTOMAKE(foo, 1.0)
+AC_CONFIG_FILES(Makefile:mkfile.in)
+AC_OUTPUT(hacky/Makefile src/Makefile data/Makefile tests/Makefile)
+END
+
+distdir=foo-1.0
+
+cat > mkfile.am <<'END'
+SUBDIRS = src data tests hacky
+installcheck-local:
+       grep DataDataData $(DESTDIR)$(prefix)/data/$(PACKAGE)-$(VERSION)/bar
+END
+
+mkdir hacky src tests data
+
+echo 'This is a dummy package' > README
+
+cat > src/foo.input <<'END'
+#!sh
+echo Zardoz
+END
+
+cat > tests/a.test <<'END'
+#!/bin/sh
+"$srcdir/../src/foo" | grep Zardoz
+END
+chmod a+x tests/a.test
+
+cat > data/bar <<'END'
+line1
+line2
+line3
+END
+
+cat >hacky/Makefile.am <<'END'
+dist-hook:
+       find $(top_distdir) -print
+       chmod a+rx $(top_distdir)/tests/*.test
+END
+
+cat > src/Makefile.am <<'END'
+dist_bin_SCRIPTS = foo
+foo: foo.input
+       sed '1s,^#!.*$$,#!/bin/sh,' $(srcdir)/foo.input >$@
+       chmod a+x $@
+EXTRA_DIST = foo.input
+DISTCLEANFILES = foo
+END
+
+cat > data/Makefile.am <<'END'
+nodist_data_DATA = bar
+datadir = $(prefix)/data/$(PACKAGE)-$(VERSION)
+bar:
+       echo DataDataData >$@
+distclean-local:
+       rm -f bar
+END
+
+cat > tests/Makefile.am <<'END'
+TESTS = a.test
+EXTRA_DIST = $(TESTS)
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+./configure
+ls -l . hacky src data tests # useful for debugging
+test ! -f mkfile
+$MAKE
+$MAKE distdir
+test ! -f $distdir/Makefile.in
+test ! -f $distdir/data/bar
+test -f $distdir/src/foo
+diff README $distdir/README
+diff mkfile.in $distdir/mkfile.in
+diff tests/a.test $distdir/tests/a.test
+diff src/foo.input $distdir/src/foo.input
+
+$MAKE check
+$MAKE distcheck
+
+test -f $distdir.tar.gz
+
+chmod a-x tests/a.test
+# dist-hook should take care of making test files executables
+$MAKE distcheck
+
+:
diff --git a/tests/backcompat6.test b/tests/backcompat6.test
new file mode 100755 (executable)
index 0000000..0d63bcc
--- /dev/null
@@ -0,0 +1,101 @@
+#! /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/>.
+
+# Backward-compatibility test: try to build and distribute a package
+# using obsoleted forms of AC_INIT, AM_INIT_AUTOMAKE and AC_OUTPUT.
+# This script can also serve as mild stress-testing for Automke.
+# See also the similar test `backcompat5.test'.
+
+. ./defs || Exit 1
+
+set -e
+
+# Anyone doing something like this in a real-life package probably
+# deserves to be killed.
+cat > configure.in <<'END'
+dnl. Everything here is *deliberately* underquoted!
+AC_INIT(quux.c)
+PACKAGE=nonesuch-zardoz
+VERSION=nonesuch-0.1
+AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
+AC_SUBST(one,1)
+two=2
+AC_SUBST(two, $two)
+three=3
+AC_SUBST(three)
+AC_PROG_CC
+AC_CONFIG_HEADERS(config.h:config.hin)
+AC_OUTPUT(Makefile foo.got:foo1.in:foo2.in:foo3.in)
+END
+
+echo @one@ > foo1.in
+echo @two@ > foo2.in
+echo @three@ > foo3.in
+
+cat >config.hin <<'END'
+#undef PACKAGE
+#undef VERSION
+END
+
+cat >> Makefile.am <<'END'
+bin_PROGRAMS = foo
+foo_SOURCES = quux.c
+check-local:
+       test x'$(PACKAGE)' = x'nonesuch-zardoz'
+       test x'$(VERSION)' = x'nonesuch-0.1'
+       ./foo # for debugging
+       ## Do not anchor the regexps w.r.t. the end of line, because on
+       ## MinGW/MSYS, grep may assume LF line endings only, while our
+       ## `foo' program may generate CRLF line endings.
+       ./foo | grep '^PACKAGE = nonesuch-zardoz!'
+       ./foo | echo '^VERSION = nonesuch-0\.1!'
+END
+
+cat > quux.c <<'END'
+#include <config.h>
+#include <stdio.h>
+int main (void)
+{
+  printf("PACKAGE = %s!\nVERSION = %s!\n", PACKAGE, VERSION);
+  return 0;
+}
+END
+
+$ACLOCAL
+$AUTOMAKE
+$AUTOCONF
+
+./configure
+
+cat >foo.exp <<'END'
+1
+2
+3
+END
+
+diff foo.exp foo.got
+
+$MAKE
+$MAKE check
+
+distdir=nonesuch-zardoz-nonesuch-0.1
+$MAKE distdir
+test -f $distdir/quux.c
+test ! -f $distdir/foo.got
+
+$MAKE distcheck
+
+:
diff --git a/tests/candist.test b/tests/candist.test
new file mode 100755 (executable)
index 0000000..0a859dd
--- /dev/null
@@ -0,0 +1,34 @@
+#! /bin/sh
+# Copyright (C) 2009  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 3 of the License, 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/>.
+
+# Test to make sure things that cannot be dist_'ed are diagnosed.
+
+. ./defs || Exit 1
+
+set -e
+
+echo AC_OUTPUT >>configure.in
+
+cat > Makefile.am << 'END'
+dist_bin_PROGRAMS = foo
+dist_lib_LIBRARIES = libfoo.a
+END
+
+$ACLOCAL
+AUTOMAKE_fails
+test 2 -eq `grep -c 'dist.*forbidden' stderr`
+
+Exit 0
index aecda17..b8e5331 100755 (executable)
@@ -21,8 +21,8 @@
 
 set -e
 
-cat > configure.in << 'END'
-AC_INIT([canon-name], [1.0])
+cat > configure.in <<END
+AC_INIT([$me], [1.0])
 AM_INIT_AUTOMAKE
 AC_CONFIG_FILES([./gmakefile ./sub/gmakefile])
 AC_OUTPUT
@@ -36,3 +36,5 @@ $ACLOCAL
 AUTOMAKE_fails
 grep 'leading.*\./.*\./gmakefile' stderr
 grep 'leading.*\./.*\./sub/gmakefile' stderr
+
+:
index 2b035d0..fc524fd 100755 (executable)
@@ -1,5 +1,6 @@
 #! /bin/sh
-# Copyright (C) 1996, 1997, 2001, 2002, 2003  Free Software Foundation, Inc.
+# Copyright (C) 1996, 1997, 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
@@ -20,7 +21,9 @@
 
 set -e
 
-echo AC_PROG_CC >> configure.in
+cat >> configure.in << 'END'
+AC_PROG_CC
+END
 
 cat > Makefile.am << 'END'
 bin_PROGRAMS = sniff-glue
@@ -29,4 +32,7 @@ END
 
 $ACLOCAL
 AUTOMAKE_fails
-grep 'Makefile.am:2:.*sniff_glue_SOURCES' stderr
+grep 'Makefile\.am:2:.* bad .*variable.*sniff-glue_SOURCES' stderr
+grep 'Makefile\.am:2:.* use .*sniff_glue_SOURCES' stderr
+
+:
index 9d5a172..ce5876a 100755 (executable)
@@ -34,4 +34,5 @@ $ACLOCAL
 $AUTOMAKE
 
 $FGREP 'perm_number.c' Makefile.in && Exit 1
-Exit 0
+
+:
index 52e968d..454b4ef 100755 (executable)
@@ -14,7 +14,8 @@
 # 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 to make sure name canonicalization happens for libraries.
+# Test to make sure name canonicalization happens for static libraries.
+# Keep this in sync with sister test `canon6.test'.
 
 . ./defs || Exit 1
 
@@ -33,5 +34,6 @@ END
 $ACLOCAL
 $AUTOMAKE
 
-grep '^libx-y.*=' Makefile.in && Exit 1
-Exit 0
+grep '^ *libx-y.*=' Makefile.in && Exit 1
+
+:
index 53cdeb2..3bd99ab 100755 (executable)
@@ -22,7 +22,9 @@
 
 set -e
 
-echo AC_PROG_CC >> configure.in
+cat >> configure.in << 'END'
+AC_PROG_CC
+END
 
 $ACLOCAL
 
@@ -46,7 +48,8 @@ bin_PROGRAMS = ,foo
 END
 
 AUTOMAKE_fails
-grep 'Makefile.am:2:.*_foo_SOURCES' stderr
+grep 'Makefile\.am:2:.* bad .*variable.*,foo_SOURCES' stderr
+grep 'Makefile\.am:2:.* use .*_foo_SOURCES' stderr
 
 cat > Makefile.am << 'END'
 bin_PROGRAMS = ,foo
@@ -54,3 +57,5 @@ _foo_SOURCES = foo.c
 END
 
 $AUTOMAKE -Wno-portability
+
+:
diff --git a/tests/canon6.test b/tests/canon6.test
new file mode 100755 (executable)
index 0000000..d103996
--- /dev/null
@@ -0,0 +1,42 @@
+#! /bin/sh
+# Copyright (C) 1996, 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
+# 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/>.
+
+# Test to make sure name canonicalization happens for libtool libraries.
+# Keep this in sync with sister test `canon4.test'.
+
+required='libtoolize'
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_PROG_CC
+AC_PROG_LIBTOOL
+END
+
+cat > Makefile.am << 'END'
+noinst_LTLIBRARIES = libx-y.la
+libx_y_la_SOURCES = xy.c
+END
+
+: > ltmain.sh
+
+$ACLOCAL
+$AUTOMAKE -a
+
+grep '^ *libx-y.*=' Makefile.in && Exit 1
+
+:
diff --git a/tests/canon7.test b/tests/canon7.test
new file mode 100755 (executable)
index 0000000..b85a835
--- /dev/null
@@ -0,0 +1,92 @@
+#! /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/>.
+
+# Stress test on canonicalization.
+
+required='libtool libtoolize'
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_PROG_CC
+AC_PROG_RANLIB  dnl: for static libraries
+AC_PROG_LIBTOOL dnl: for libtool libraries
+AC_OUTPUT
+END
+
+touch ,foo-bar libb.az+baz lib~zardoz,, || Exit 77
+rm -f ,foo-bar libb.az+baz lib~zardoz,,
+
+cat > Makefile.am << 'END'
+noinst_PROGRAMS = dummy_static dummy_dynamic ,foo-bar
+noinst_LIBRARIES = libb.az+baz.a
+noinst_LTLIBRARIES = lib~zardoz,,.la
+
+dummy_static_SOURCES = dummy.c lib.h
+dummy_dynamic_SOURCES = $(dummy_static_SOURCES)
+
+dummy_static_LDADD = $(noinst_LIBRARIES)
+dummy_dynamic_LDADD = $(noinst_LTLIBRARIES)
+
+_foo_bar_SOURCES = foobar.c
+libb_az_baz_a_SOURCES = libs.c
+lib_zardoz___la_SOURCES = libd.c
+
+check-local:
+       ls -l
+       ./,foo-bar
+       ./dummy_static
+       ./dummy_dynamic
+       ./,foo-bar | grep 'Hello, FooBar!'
+       ./dummy_static | grep 'Hello from Static!'
+       ./dummy_dynamic | grep 'Hello from Dynamic!'
+END
+
+cat > foobar.c << 'END'
+#include <stdio.h>
+int main(void)
+{
+  printf("Hello, FooBar!\n");
+  return 0;
+}
+END
+
+cat > dummy.c << 'END'
+#include <stdio.h>
+#include "lib.h"
+int main(void)
+{
+  printf("Hello from %s!\n", dummy_func());
+  return 0;
+}
+END
+
+echo 'const char *dummy_func(void);' > lib.h
+echo 'const char *dummy_func(void) { return "Dynamic"; }' > libd.c
+echo 'const char *dummy_func(void) { return "Static"; }' > libs.c
+
+libtoolize
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
+
+./configure
+
+$MAKE check
+$MAKE distcheck
+
+:
diff --git a/tests/canon8.test b/tests/canon8.test
new file mode 100755 (executable)
index 0000000..2ae47dd
--- /dev/null
@@ -0,0 +1,40 @@
+#! /bin/sh
+# Copyright (C) 1996, 1997, 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
+# 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 canonicalization does not transliterate the `@' charactrer.
+
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_PROG_CC
+END
+
+cat > Makefile.am << 'END'
+bin_PROGRAMS = foob@rquux
+END
+
+$ACLOCAL
+$AUTOMAKE
+
+# The first grep is here mostly for debugging.
+grep foob.rquux Makefile.in
+grep foob@rquux Makefile.in
+grep 'foob[^@]rquux' Makefile.in && Exit 1
+
+:
diff --git a/tests/check12.test b/tests/check12.test
new file mode 100755 (executable)
index 0000000..34c8409
--- /dev/null
@@ -0,0 +1,206 @@
+#! /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/>.
+
+# Test to make sure dejagnu tests, automake-style tests, and check-local
+# target can coexist.
+
+required=runtest
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+AUTOMAKE_OPTIONS =
+EXTRA_DIST =
+CLEANFILES =
+END
+
+## Simple tests.
+
+cat > a.test << 'END'
+#!/bin/sh
+exit ${A_EXIT_STATUS-0}
+END
+cat > b.test << 'END'
+#!/bin/sh
+exit ${B_EXIT_STATUS-0}
+END
+chmod +x a.test b.test
+
+cat >> Makefile.am << 'END'
+TESTS = a.test b.test
+EXTRA_DIST += $(TESTS)
+END
+
+A_EXIT_STATUS=0; export A_EXIT_STATUS
+B_EXIT_STATUS=0; export B_EXIT_STATUS
+
+## DejaGnu tests.
+
+cat >> Makefile.am << 'END'
+AUTOMAKE_OPTIONS += dejagnu
+DEJATOOL = hammer spanner
+AM_RUNTESTFLAGS = HAMMER=$(srcdir)/hammer SPANNER=$(srcdir)/spanner
+EXTRA_DIST += hammer.test/hammer.exp
+EXTRA_DIST += spanner.test/spanner.exp
+END
+
+cat > hammer << 'END'
+#! /bin/sh
+echo "Everything looks like a ${NAIL-nail} to me!"
+END
+
+NAIL=nail; export NAIL
+
+cat > spanner << 'END'
+#! /bin/sh
+echo "I'm a right spanner!"
+END
+chmod +x hammer spanner
+
+mkdir hammer.test spanner.test
+
+cat > hammer.test/hammer.exp << 'END'
+set test test_hammer
+spawn $HAMMER
+expect {
+    "Everything looks like a nail to me!" { pass "$test" }
+    default { fail "$test" }
+}
+END
+
+cat > spanner.test/spanner.exp << 'END'
+set test test_spanner
+spawn $SPANNER
+expect {
+    "I'm a right spanner!" { pass "$test" }
+    default { fail "$test" }
+}
+END
+
+## User-defined extra tests.
+
+cat >> Makefile.am <<'END'
+check-local:
+       case $$CHECKLOCAL_EXIT_STATUS in \
+         0) echo 'check-local succeded :-)';; \
+         *) echo 'check-local failed :-(';; \
+       esac >local.log
+       exit $$CHECKLOCAL_EXIT_STATUS
+CLEANFILES += local.log
+END
+CHECKLOCAL_EXIT_STATUS=0; export CHECKLOCAL_EXIT_STATUS
+
+## Go with the testcase execution.
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE --add-missing
+
+for vpath in : false; do
+
+  if $vpath; then
+    srcdir=..
+    mkdir build_
+    cd build_
+  else
+    srcdir=.
+  fi
+
+  if test -f config.status; then
+    $MAKE distclean
+  fi
+
+  $srcdir/configure
+
+  $MAKE check
+  test -f hammer.log
+  test -f hammer.sum
+  test -f spanner.log
+  test -f spanner.sum
+  # This checks will be run only by the autogenerated `check12-p.test'.
+  if test x"$parallel_tests" = x"yes"; then
+    cat test-suite.log
+    grep '^PASS: a\.test (exit: 0)' a.log
+    grep '^PASS: b\.test (exit: 0)' b.log
+  else
+    :
+  fi
+  grep 'check-local succeded :-)' local.log
+
+  cp -f config.status config-status.sav
+
+  $MAKE distclean
+  test ! -r hammer.log
+  test ! -r hammer.sum
+  test ! -r spanner.log
+  test ! -r spanner.sum
+  test ! -r test-suite.log
+  test ! -r a.log
+  test ! -r b.log
+  test ! -r local.log
+
+  mv -f config-status.sav config.status
+  ./config.status
+
+  NAIL=screw $MAKE check && Exit 1
+  test -f hammer.log
+  test -f hammer.sum
+  test -f spanner.log
+  test -f spanner.sum
+  grep 'FAIL: test_hammer' hammer.sum
+  grep 'FAIL:' spanner.sum && Exit 1
+
+  B_EXIT_STATUS=1 $MAKE check && Exit 1
+  # This checks will be run only by the autogenerated `check12-p.test'.
+  if test x"$parallel_tests" = x"yes"; then
+    cat test-suite.log
+    grep '^PASS: a\.test (exit: 0)' a.log
+    grep '^FAIL: b\.test (exit: 1)' b.log
+    grep '^FAIL: b\.test (exit: 1)' test-suite.log
+  else :; fi
+
+  CHECKLOCAL_EXIT_STATUS=1 $MAKE check && Exit 1
+  grep 'check-local failed :-(' local.log
+
+  # Do not trust the exit status of `make -k'.
+  NAIL=screw B_EXIT_STATUS=23 CHECKLOCAL_EXIT_STATUS=1 $MAKE -k check || :
+  test -f hammer.log
+  test -f hammer.sum
+  test -f spanner.log
+  test -f spanner.sum
+  grep 'FAIL: test_hammer' hammer.sum
+  grep 'FAIL:' spanner.sum && Exit 1
+  # This checks will be run only by the autogenerated `check12-p.test'.
+  if test x"$parallel_tests" = x"yes"; then
+    cat test-suite.log
+    grep '^PASS: a\.test (exit: 0)' a.log
+    grep '^FAIL: b\.test (exit: 23)' b.log
+    grep '^FAIL: b\.test (exit: 23)' test-suite.log
+  else :; fi
+  grep 'check-local failed :-(' local.log
+
+  cd $srcdir
+
+done
+
+$MAKE distcheck
+
+:
index 59d2414..ab789b3 100755 (executable)
@@ -1,5 +1,6 @@
 #! /bin/sh
-# Copyright (C) 1996, 2001, 2002, 2003  Free Software Foundation, Inc.
+# Copyright (C) 1996, 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
@@ -22,13 +23,13 @@ set -e
 
 cat > Makefile.am << 'END'
 ICONS := $(wildcard *.xbm)
-data_DATA = $(ICONS)
 END
 
 $ACLOCAL
 AUTOMAKE_fails
 grep ':=.*not portable' stderr
 
-echo 'AUTOMAKE_OPTIONS = -Wno-portability' >> Makefile.am
-$AUTOMAKE
-grep 'ICONS :=' Makefile.in
+$AUTOMAKE -Wno-portability
+grep '^ICONS *:= *\$(wildcard \*\.xbm) *$' Makefile.in
+
+:
index e454c46..37be360 100755 (executable)
 
 set -e
 
+cat >> configure.in << 'END'
+AC_OUTPUT
+END
+
 cat > Makefile.am << 'END'
 t = a b c
 EXTRA_DIST = $(t:=.test)
+.PHONY: test
+test:
+       test x'$(EXTRA_DIST)' = x'a.test b.test c.test'
 END
 
-: > a.test
-: > b.test
-: > c.test
-
 $ACLOCAL
+$AUTOCONF
 $AUTOMAKE
+
+./configure
+$MAKE test
+
+:
diff --git a/tests/colneq3.test b/tests/colneq3.test
new file mode 100755 (executable)
index 0000000..0ff8bce
--- /dev/null
@@ -0,0 +1,46 @@
+#! /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/>.
+
+# Test that := definitions work as expected at make time.
+
+required=GNUmake
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+BAR := $(FOO)
+BAZ = $(FOO)
+FOO := foo
+.PHONY: test
+test:
+       test x'$(FOO)' = x'foo'
+       test x'$(BAZ)' = x'foo'
+       test x'$(BAR)' = x
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -Wno-portability
+
+./configure
+$MAKE test
+
+:
index 22b5ed3..f1eec9a 100755 (executable)
@@ -27,10 +27,23 @@ AC_CONFIG_FILES([foo.h:foo.hin])
 AC_OUTPUT
 END
 
-: > Makefile.am
 : > foo.hin
 
+cat > Makefile.am <<'END'
+.PHONY: test
+test: distdir
+       ls -l . $(distdir)
+       test -f foo.h
+       test -f $(distdir)/foo.hin
+END
+
 $ACLOCAL
 $AUTOMAKE
+$AUTOCONF
+
+./configure
+
+$MAKE test
+$MAKE distcheck
 
 :
index a52dfa8..503f6db 100755 (executable)
@@ -16,6 +16,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # Make sure ":" works with files automake generates.
+# See also sister test `colon3.test'.
 
 . ./defs || Exit 1
 
@@ -28,14 +29,54 @@ AC_CONFIG_FILES([Makefile:zardoz.in])
 AC_OUTPUT
 END
 
-echo 'dummy:' > zardoz.am
+cat > zardoz.am <<END
+.PHONY: dummy
+dummy:
+END
 
 $ACLOCAL
 $AUTOMAKE
 
-# We actually check several things here.
+# Automake should have created zardoz.in.
 test -f zardoz.in
-grep '^zardoz:' zardoz.in && Exit 1
-grep '^dummy:' zardoz.in
+
+# The generated file should refer to zardoz.in and zardoz.am, but
+# never just "zardoz".
+$FGREP 'zardoz.am' zardoz.in
+$FGREP 'zardoz.in' zardoz.in
+sed -e 's|zardoz\.am|zrdz.am|g' \
+    -e 's|zardoz\.in|zrdz.in|g' \
+  <zardoz.in | $FGREP 'zardoz' && Exit 1
+
+# The configure-generated Makefile should depend on zardoz.in, two.in and
+# three.in.  The automake-generated zardoz.in should depend on zardoz.am.
+# Let's do this check the right way by running configure and make.
+
+str='%% ZaR DoZ %%'
+
+$AUTOCONF
+./configure
+test -f Makefile # sanity check
+
+$MAKE dummy
+# Again, make sure that the generated Makefile do not unduly
+# refer to `zardoz' .
+$MAKE -n zardoz && Exit 1
+
+$sleep
+cat >> zardoz.am <<END
+check-local: testam testin testmk
+.PHONY: testam testin testmk
+testam:
+       grep '$str' \$(srcdir)/zardoz.am
+testin:
+       grep '$str' \$(srcdir)/zardoz.in
+testmk:
+       grep '$str' Makefile
+END
+$MAKE Makefile # for non-GNU make
+$MAKE testam testin testmk
+
+$MAKE distcheck
 
 :
index 151d015..e261b72 100755 (executable)
@@ -17,6 +17,7 @@
 
 # Make sure ":" works with files automake generates.
 # This test is for multiple ":"s.
+# See also sister test `colon2.test'.
 
 . ./defs || Exit 1
 
@@ -29,7 +30,11 @@ AC_CONFIG_FILES([Makefile:zardoz.in:two.in:three.in])
 AC_OUTPUT
 END
 
-: > zardoz.am
+cat > zardoz.am <<END
+.PHONY: dummy
+dummy:
+END
+
 : > two.in
 : > three.in
 
@@ -41,21 +46,49 @@ test -f zardoz.in
 
 # The generated file should refer to zardoz.in and zardoz.am, but
 # never just "zardoz".
+$FGREP 'zardoz.am' zardoz.in
+$FGREP 'zardoz.in' zardoz.in
 sed -e 's|zardoz\.am|zrdz.am|g' \
     -e 's|zardoz\.in|zrdz.in|g' \
   <zardoz.in | $FGREP 'zardoz' && Exit 1
 
-# FIXME: Do something like this after planned enahncements to tests/defs.
-# FIXME: Or even do proper functional testing.
-## Also, Makefile should depend on two.in and three.in.
-# extract_makefile_deps Makefile zardoz.in > deps
-#$FGREP ' $(srcdir)/two.in ' deps
-#$FGREP ' $(srcdir)/three.in ' deps
-#
-# FIXME: for the moment, we content ourselves with these inferior tests.
-# Makefile should depend on two.in.
-grep '^Makefile:.* \$(srcdir)/two.in' zardoz.in
-# Likewise three.in.
-grep '^Makefile:.* \$(srcdir)/three.in' zardoz.in
+# The configure-generated Makefile should depend on zardoz.in, two.in and
+# three.in.  The automake-generated zardoz.in should depend on zardoz.am.
+# Let's do this check the right way by running configure and make.
+
+str='%% ZaR DoZ %%'
+str2='// 2_TwO_2 //'
+str3='== @thr33@ =='
+
+$AUTOCONF
+./configure
+test -f Makefile # sanity check
+
+$MAKE dummy
+# Again, make sure that the generated Makefile do not unduly
+# refer to `zardoz' .
+$MAKE -n zardoz && Exit 1
+
+$sleep
+cat >> zardoz.am <<END
+check-local: testam testin testmk test2 test3
+.PHONY: testam testin test2 testmk test3
+testam:
+       grep '$str' \$(srcdir)/zardoz.am
+testin:
+       grep '$str' \$(srcdir)/zardoz.in
+testmk:
+       grep '$str' Makefile
+test2:
+       grep '$str2' \$(srcdir)/two.in
+test3:
+       grep '$str3' \$(srcdir)/three.in
+END
+echo "# $str2" >> two.in
+echo "# $str3" >> three.in
+$MAKE Makefile # for non-GNU make
+$MAKE testam testin testmk test2 test3
+
+$MAKE distcheck
 
 :
index c53910e..2db2484 100755 (executable)
@@ -31,21 +31,44 @@ END
 : > Makefile.dep
 
 cat > Makefile.am <<'END'
-.PHONY: test
-test:
-       case ' $(DIST_COMMON) ' in \
-         *' $(srcdir)/Makefile.dep '*|*' Makefile.dep '*) exit 0;; \
-         *) exit 1;; \
-       esac
+.PHONY: test-fs-layout test-grep test-distcommon test-distdir
+check-local: test-fs-layout test-grep test-distcommon test-distdir
+test-fs-layout:
+       test x'$(srcdir)' = '.' || test ! -r Makefile.dep
+test-grep:
+## The use of $(empty) prevents spurious matches.
+       grep '=GrEp$(empty)Me_am=' $(srcdir)/Makefile.in
+       grep '=GrEp$(empty)Me_dep=' $(srcdir)/Makefile.dep
+       grep '=GrEp$(empty)Me_am=' Makefile
+       grep '=GrEp$(empty)Me_dep=' Makefile
+test-distcommon:
+       echo ' ' $(DIST_COMMON) ' ' | grep '[ /]Makefile.dep '
+test-distdir: distdir
+       test -f $(distdir)/Makefile.dep
 END
 
 $ACLOCAL
+$AUTOCONF
 $AUTOMAKE
 
-grep 'Makefile:Makefile\.in' Makefile.in
-grep '^Makefile:.* \$(srcdir)/Makefile\.dep' Makefile.in
+./configure
 
-sed '/@SET_MAKE@/d' <Makefile.in >Makefile.sed
-$MAKE -f Makefile.sed SHELL=$SHELL test
+grep '=GrEpMe_am=' Makefile && Exit 1   # sanity check
+grep '=GrEpMe_dep=' Makefile && Exit 1  # likewise
+
+$MAKE test-distcommon
+$MAKE test-distdir
+
+$sleep
+
+echo '# =GrEpMe_am=' >> Makefile.am
+echo '# =GrEpMe_dep=' >> Makefile.dep
+
+$MAKE Makefile # for non-GNU make
+$MAKE test-grep
+$MAKE test-distcommon
+$MAKE test-distdir
+
+$MAKE distcheck
 
 :
index 4fb738e..71ee4bd 100755 (executable)
@@ -24,30 +24,77 @@ set -e
 cat > configure.in <<END
 AC_INIT([$me], [1.0])
 AM_INIT_AUTOMAKE
+# With this, version.good should depend from version.gin, while
+# Makefile should not depend from either of them.
 AC_CONFIG_FILES([demo/Makefile demo/version.good:demo/version.gin])
 AC_OUTPUT
 END
 
 mkdir demo
-
 : > demo/version.gin
-
-cat > demo/Makefile.am <<'END'
-.PHONY: test
-test:
-       case ' $(DIST_COMMON) ' in \
-         *' $(srcdir)/version.gin '*) exit 0;; \
-         *) exit 1;; \
-       esac
-END
+: > demo/Makefile.am
 
 $ACLOCAL
 $AUTOMAKE
 
+# These are older "grepping check", kept mostly for backward-copmatibility.
+# They might (unlikely, but possibly) require updating when automake
+# internals are changed.  Just relax or remove if they become too fragile.
 $EGREP 'Makefile:.*(demo|version)' demo/Makefile.in && Exit 1
 grep 'version\.good:.*version\.gin' demo/Makefile.in
 
-sed '/@SET_MAKE@/d' <demo/Makefile.in >Makefile.sed
-$MAKE -f Makefile.sed SHELL=$SHELL test
+$AUTOCONF
+
+for vpath in : false; do
+
+  if $vpath; then
+    srcdir=..
+    mkdir build
+    cd build
+  else
+    srcdir=.
+  fi
+
+  $srcdir/configure
+
+  test -f demo/version.good    # sanity check
+  test ! -s demo/version.good  # likewise
+
+  cd demo
+
+  # version.good should depend from version.gin
+  $sleep
+  echo "Rebuilt (srcdir=$srcdir)" > ../$srcdir/demo/version.gin
+  $MAKE version.good
+  $FGREP "Rebuilt (srcdir=$srcdir)" version.good
+
+  # Makefile should not depend from version.good.
+  rm -f version.good
+  $MAKE Makefile
+  test ! -r version.good
+
+  # version.good should be rebuilt from version.gin
+  $MAKE version.good
+  test -f version.good
+
+  # Makefile should not depend from version.gin.
+  rm -f ../$srcdir/demo/version.gin
+  $MAKE Makefile
+  test ! -r ../$srcdir/demo/version.gin # sanity check
+
+  # version.good should depend from version.gin
+  rm -f version.good
+  $MAKE version.good >output 2>&1 && { cat output; Exit 1; }
+  cat output
+  # Try to verify that we errored out for the right reason.
+  $FGREP version.gin output
+
+  cd .. # back in top builddir
+  cd $srcdir
+
+  # Re-create it for the next pass (if any).
+  : > demo/version.gin
+
+done
 
 :
index 4195188..40bd0a6 100755 (executable)
@@ -15,8 +15,8 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Another test for a failing ":" in AC_OUTPUT.  Report from Maciej
-# Stachowiak.
+# Another test for a failing ":" in AC_OUTPUT.
+# Report from Maciej Stachowiak.
 
 . ./defs || Exit 1
 
@@ -32,19 +32,26 @@ AC_OUTPUT(subdir/bar:subdir/foo \
 )
 END
 
-: > Makefile.am
-
 mkdir subdir
-: > subdir/Makefile.am
+: > Makefile.am
 : > subdir/foo
+cat > subdir/Makefile.am << 'END'
+.PHONY: test
+test:
+       ## DIST_COMMON should contain `foo', not `subdir/foo'.
+       case '$(DIST_COMMON)' in *subdir/foo*) exit 1;; *) exit 0;; esac
+       echo ' ' $(DIST_COMMON) ' ' | grep '[ /]foo '
+END
 
 $ACLOCAL
 $AUTOMAKE
 
-# shouldn't have any bar.in
-grep 'bar.in' subdir/Makefile.in && Exit 1
+# Should nowhere refer to `bar.in'.
+$FGREP 'bar.in' Makefile.in subdir/Makefile.in && Exit 1
 
-# DIST_COMMON should have foo, not subdir/foo
-grep 'DIST_COMMON.*subdir/foo' subdir/Makefile.in && Exit 1
+$AUTOCONF
+./configure
+cd subdir
+$MAKE test
 
 :
index 9d86785..c1032fd 100755 (executable)
@@ -34,7 +34,7 @@ std='\e[m'
 # BSD 'grep' works from a pipe, but not a seekable file.
 # GNU or BSD 'grep -a' works on files, but is not portable.
 case `echo "$std" | grep .` in
-  $std) ;;
+  "$std") ;;
   *) echo "$me: grep can't parse nonprinting characters" >&2; Exit 77;;
 esac
 
index eedd37d..306aa04 100755 (executable)
@@ -34,7 +34,7 @@ std='\e[m'
 # BSD 'grep' works from a pipe, but not a seekable file.
 # GNU or BSD 'grep -a' works on files, but is not portable.
 case `echo "$std" | grep .` in
-  $std) ;;
+  "$std") ;;
   *) echo "$me: grep can't parse nonprinting characters" >&2; Exit 77;;
 esac
 
index 21b5e87..6c66b53 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2002, 2003  Free Software Foundation, Inc.
+# Copyright (C) 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,7 +37,7 @@ EOF
 
 $ACLOCAL
 AUTOMAKE_fails
-grep '^Makefile.am:5: blank line following trailing backslash' stderr
+grep '^Makefile.am:5: error: blank line following trailing backslash' stderr
 
 
 ## Here is a second test because head comments are
@@ -54,7 +54,7 @@ var = foo
 EOF
 
 AUTOMAKE_fails
-grep '^Makefile.am:2: blank line following trailing backslash' stderr
+grep '^Makefile.am:2: error: blank line following trailing backslash' stderr
 
 
 ## Make sure we print an 'included' stack on errors.
@@ -66,8 +66,9 @@ cat > Makefile.inc << 'EOF'
 EOF
 
 AUTOMAKE_fails
-grep '^Makefile.inc:2: blank line following trailing backslash' stderr
+grep '^Makefile.inc:2: error: blank line following trailing backslash' stderr
 grep '^Makefile.am:1: .*included from here' stderr
+grep -v '^Makefile.am:1: .*error:' stderr
 
 
 ## Make sure backslashes are still allowed within a comment.
index ef27afe..2bec657 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2004, 2007  Free Software Foundation, Inc.
+# Copyright (C) 2004, 2007, 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,7 @@
 
 set -e
 
-cp "$testsrcdir/../lib/compile" .
+cp "$top_testsrcdir/lib/compile" .
 
 # -o 'a  c' should not be stripped because 'a  c' is not an object
 # (it does not matter whether touch creates ./-- or not)
@@ -42,3 +42,5 @@ test -f a.c
 ./compile touch a.obj -- -o ac.obj a.c
 test ! -f a.obj
 test ac.obj
+
+:
index 334f154..2f812c5 100755 (executable)
@@ -20,7 +20,7 @@
 
 set -e
 
-cp "$testsrcdir/../lib/compile" .
+cp "$top_testsrcdir/lib/compile" .
 
 cat >mycc <<'END'
 source_seen=no
diff --git a/tests/compile3.test b/tests/compile3.test
new file mode 100755 (executable)
index 0000000..53db926
--- /dev/null
@@ -0,0 +1,54 @@
+#! /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 `compile' wraps the Microsoft C/C++ compiler (cl) correctly
+
+required=xsi-shell
+. ./defs || Exit 1
+
+set -e
+
+cp "$top_testsrcdir/lib/compile" .
+
+# Use a dummy cl, since cl isn't readily available on all systems
+cat >cl <<'END'
+#! /bin/sh
+echo "$@"
+END
+
+chmod +x ./cl
+
+# Check if compile handles "-o foo", -I, -l, -L, -Xlinker -Wl,
+opts=`LIB= ./compile ./cl foo.c -o foo -lbar -Lgazonk -Ibaz -Xlinker foobar -Wl,-foo,bar`
+test x"$opts" = x"foo.c -Fefoo bar.lib -Ibaz -link -LIBPATH:gazonk foobar -foo bar"
+
+# Check if compile handles "-o foo.obj"
+opts=`./compile ./cl -c foo.c -o foo.obj -Ibaz`
+test x"$opts" = x"-c foo.c -Fofoo.obj -Ibaz"
+
+# Check if compile handles "-o foo.o"
+opts=`./compile ./cl -c foo.c -o foo.o -Ibaz`
+test x"$opts" = x"-c foo.c -Fofoo.o -Ibaz"
+
+# Check if compile handles "foo.cc" as C++.
+opts=`./compile ./cl -c foo.cc -o foo.o -Ibaz`
+test x"$opts" = x"-c -Tpfoo.cc -Fofoo.o -Ibaz"
+
+# Check if compile clears the "eat" variable properly.
+opts=`eat=1 ./compile ./cl -c foo.c -o foo.obj -Ibaz`
+test x"$opts" = x"-c foo.c -Fofoo.obj -Ibaz"
+
+:
diff --git a/tests/compile4.test b/tests/compile4.test
new file mode 100755 (executable)
index 0000000..5a0bdf3
--- /dev/null
@@ -0,0 +1,85 @@
+#! /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 `compile' wraps the Microsoft C/C++ compiler (cl) correctly
+# with respect to absolute paths.
+
+required='cl'
+. ./defs || Exit 1
+
+set -e
+
+mkdir sub
+
+cat >sub/foo.c <<'EOF'
+int
+foo ()
+{
+  return 0;
+}
+EOF
+
+cat >main.c <<'EOF'
+extern int foo ();
+int
+main ()
+{
+  return foo ();
+}
+EOF
+
+absfoodir=`pwd`/sub
+absmainc=`pwd`/main.c
+absmainobj=`pwd`/main.obj
+
+cat >> configure.in << 'END'
+AC_PROG_CC
+AM_PROG_CC_C_O
+AC_PROG_RANLIB
+AC_CONFIG_FILES([sub/Makefile])
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+SUBDIRS = sub
+END
+
+cat > sub/Makefile.am << 'END'
+lib_LIBRARIES = libfoo.a
+libfoo_a_SOURCES = foo.c
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
+./configure
+$MAKE
+
+./compile cl $CPPFLAGS $CFLAGS -c -o "$absmainobj" "$absmainc"
+
+# cl expects archives to be named foo.lib, not libfoo.a so
+# make a simple copy here if needed. This is a severe case
+# of badness, but ignore that since this is not what is
+# being tested here...
+if test -f sub/libfoo.a; then
+  cp sub/libfoo.a sub/foo.lib
+fi
+
+./compile cl $CFLAGS $LDFLAGS -L"$absfoodir" "$absmainobj" -o main -lfoo
+
+./main
+
+:
diff --git a/tests/compile5.test b/tests/compile5.test
new file mode 100755 (executable)
index 0000000..5fc1b30
--- /dev/null
@@ -0,0 +1,81 @@
+#! /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 the file name translation in the `compile' script works
+# correctly
+
+. ./defs || Exit 1
+
+set -e
+
+cp "$top_testsrcdir/lib/compile" .
+
+# Use a dummy cl, since cl isn't readily available on all systems
+cat >cl <<'END'
+#! /bin/sh
+echo "$@"
+END
+
+chmod +x ./cl
+
+cat >>configure.in << 'END'
+AC_CANONICAL_HOST
+AC_CONFIG_FILES([check_host], [chmod +x check_host])
+AC_OUTPUT
+END
+
+: >Makefile.am
+
+cat >check_host.in << 'END'
+#! /bin/sh
+case @host_os@ in
+  mingw*)
+    ;;
+  *)
+    exit 77
+    ;;
+esac
+case @build_os@ in
+  mingw* | cygwin*)
+    ;;
+  *)
+    winepath -w / || exit 77
+    ;;
+esac
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
+./configure
+./check_host
+
+pwd=`pwd`
+
+# Check if "compile cl" transforms absolute file names to
+# host format (e.g /somewhere -> c:/msys/1.0/somewhere).
+
+res=`./compile ./cl -L"$pwd" | sed -e 's/-link -LIBPATH://'`
+
+case $res in
+  ?:[\\/]*)
+    ;;
+  *)
+    Exit 1
+    ;;
+esac
+
+:
diff --git a/tests/compile6.test b/tests/compile6.test
new file mode 100755 (executable)
index 0000000..1f012cf
--- /dev/null
@@ -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/>.
+
+# Make sure `compile' searches libraries correctly
+
+required=xsi-shell
+. ./defs || Exit 1
+
+set -e
+
+cp "$top_testsrcdir/lib/compile" .
+
+# Use a dummy cl, since cl isn't readily available on all systems
+cat >cl <<'END'
+#! /bin/sh
+echo "$@"
+END
+
+chmod +x ./cl
+
+mkdir syslib
+:> syslib/foo.lib
+
+syslib=`pwd`/syslib
+LIB=$syslib
+export LIB
+
+mkdir lib
+:> lib/bar.lib
+:> lib/bar.dll.lib
+
+# Check if compile library search correctly
+opts=`./compile ./cl foo.c -o foo -Llib -lbar -lfoo`
+test x"$opts" = x"foo.c -Fefoo lib/bar.dll.lib $syslib/foo.lib -link -LIBPATH:lib"
+
+# Check if -static makes compile avoid bar.dll.lib
+opts=`./compile ./cl foo.c -o foo -Llib -static -lbar -lfoo`
+test x"$opts" = x"foo.c -Fefoo lib/bar.lib $syslib/foo.lib -link -LIBPATH:lib"
+
+:> syslib/bar.lib
+:> syslib/bar.dll.lib
+
+# Check if compile finds bar.dll.lib in syslib
+opts=`./compile ./cl foo.c -o foo -lbar -lfoo`
+test x"$opts" = x"foo.c -Fefoo $syslib/bar.dll.lib $syslib/foo.lib"
+
+# Check if compile prefers -L over $LIB
+opts=`./compile ./cl foo.c -o foo -Llib -lbar -lfoo`
+test x"$opts" = x"foo.c -Fefoo lib/bar.dll.lib $syslib/foo.lib -link -LIBPATH:lib"
+
+mkdir lib2
+:> lib2/bar.dll.lib
+
+# Check if compile avoids bar.dll.lib in lib2 when -static
+opts=`./compile ./cl foo.c -o foo -Llib2 -static -lbar -lfoo`
+test x"$opts" = x"foo.c -Fefoo $syslib/bar.lib $syslib/foo.lib -link -LIBPATH:lib2"
+
+# Check if compile gets two different bar libraries when -static
+# is added in the middle
+opts=`./compile ./cl foo.c -o foo -Llib2 -Llib -lbar -static -lbar`
+test x"$opts" = x"foo.c -Fefoo lib2/bar.dll.lib lib/bar.lib -link -LIBPATH:lib2 -LIBPATH:lib"
+
+# Check if compile gets the correct bar.dll.lib
+opts=`./compile ./cl foo.c -o foo -Llib -Llib2 -lbar -lfoo`
+test x"$opts" = x"foo.c -Fefoo lib/bar.dll.lib $syslib/foo.lib -link -LIBPATH:lib -LIBPATH:lib2"
+
+# Check if compile gets the correct bar.dll.lib
+opts=`./compile ./cl foo.c -o foo -Llib2 -Llib -lbar -lfoo`
+test x"$opts" = x"foo.c -Fefoo lib2/bar.dll.lib $syslib/foo.lib -link -LIBPATH:lib2 -LIBPATH:lib"
+
+mkdir "sys  lib2"
+:> "sys  lib2/foo.dll.lib"
+
+syslib2="`pwd`/sys  lib2"
+LIB="$syslib2;$LIB"
+
+# Check if compile handles spaces in $LIB and that it prefers the order
+# in a multi-component $LIB.
+opts=`./compile ./cl foo.c -o foo -lfoo`
+test x"$opts" = x"foo.c -Fefoo $syslib2/foo.dll.lib"
+
+# Check if compile handles the 2nd directory in a multi-component $LIB.
+opts=`./compile ./cl foo.c -o foo -static -lfoo`
+test x"$opts" = x"foo.c -Fefoo $syslib/foo.lib"
+
+:
index 21ed65d..bb46390 100755 (executable)
@@ -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
+:
index a995527..2ab5349 100755 (executable)
@@ -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
+:
similarity index 81%
rename from tests/ctarget1.test
rename to tests/cond-basic.test
index d2191f6..0609ec1 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2001, 2002  Free Software Foundation, Inc.
+# Copyright (C) 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
 
 . ./defs || Exit 1
 
-cat > configure.in << 'END'
-AC_INIT
-AM_INIT_AUTOMAKE(nonesuch, nonesuch)
-AM_CONDITIONAL(TEST, true)
-AC_OUTPUT(Makefile)
+set -e
+
+cat >> configure.in << 'END'
+AM_CONDITIONAL([TEST], [true])
+AC_OUTPUT
 END
 
 cat > Makefile.am << 'END'
@@ -34,11 +34,11 @@ target: false
 endif
 END
 
-set -e
-
-$ACLOCAL || Exit 1
+$ACLOCAL
 $AUTOMAKE
+
 grep '^@TEST_TRUE@target: true' Makefile.in
 grep '^@TEST_TRUE@     action' Makefile.in
 grep '^@TEST_FALSE@target: false' Makefile.in
-Exit 0
+
+:
index 4ec596d..e2b133c 100755 (executable)
@@ -17,7 +17,7 @@
 # Check that conditional redefinitions of AC_SUBST'ed variables are detected.
 # Report from Patrik Weiskircher
 
-. ./defs
+. ./defs || Exit 1
 
 set -e
 
index 6f76e4d..e548211 100755 (executable)
@@ -17,7 +17,7 @@
 # Check that conditional redefinitions of AC_SUBST'ed variables are detected.
 # Report from Patrik Weiskircher
 
-. ./defs
+. ./defs || Exit 1
 
 set -e
 
index 332fda5..02614f9 100755 (executable)
@@ -17,7 +17,7 @@
 # Check that conditional primaries can use non-conditional directories.
 # From Pavel Roskin.
 
-. ./defs
+. ./defs || Exit 1
 
 set -e
 
index a9baa55..1d93cc0 100755 (executable)
@@ -17,7 +17,7 @@
 # Check that non-conditional primaries can use conditional directories.
 # Reported by Juergen Keil.
 
-. ./defs
+. ./defs || Exit 1
 
 set -e
 
index 3082902..250b1ef 100755 (executable)
@@ -17,7 +17,7 @@
 # Check that non-conditional primaries cannot use directories defined
 # in some conditions (but not others).
 
-. ./defs
+. ./defs || Exit 1
 
 set -e
 
index ccdcf9e..006ef57 100755 (executable)
@@ -17,7 +17,7 @@
 # Check that conditional primaries can use directories defined
 # in the same conditions (but not others).
 
-. ./defs
+. ./defs || Exit 1
 
 set -e
 
index 12badcb..8310eab 100755 (executable)
@@ -24,7 +24,7 @@
 # or cpu time it can found.  Although this test won't print `FAIL' if
 # it fails, it will take long enough so it can't go unnoticed.
 
-. ./defs
+. ./defs || Exit 1
 
 set -e
 
index e092c45..d1935f7 100755 (executable)
@@ -16,7 +16,7 @@
 
 # For PR/352: make sure we support bin_PROGRAMS being defined conditionally.
 
-. ./defs
+. ./defs || Exit 1
 
 set -e
 
index 4975ef4..224d32c 100755 (executable)
@@ -16,7 +16,7 @@
 
 # Make sure we define conditional _DEPENDENCIES correctly.
 
-. ./defs
+. ./defs || Exit 1
 
 set -e
 
index ae5c8c6..6ec5a20 100755 (executable)
@@ -16,7 +16,7 @@
 
 # Make sure the user can override a conditional _DEPENDENCIES.
 
-. ./defs
+. ./defs || Exit 1
 
 set -e
 
index 0aff11a..f327cb7 100755 (executable)
@@ -17,7 +17,7 @@
 # Check for conditional library with a conditional directory.
 # Report from Ralf Corsepius
 
-. ./defs
+. ./defs || Exit 1
 
 set -e
 
index 9e42eea..ecb1616 100755 (executable)
@@ -17,7 +17,7 @@
 # Check for _DEPDENDENCIES definition with conditional _LDADD.
 # Report from Elena A. Vengerova
 
-. ./defs
+. ./defs || Exit 1
 
 set -e
 
index 6b3a4d4..0f3b8cf 100755 (executable)
@@ -18,7 +18,7 @@
 # Report from Roman Fietze.
 
 required='flex bison gcc'
-. ./defs
+. ./defs || Exit 1
 
 set -e
 
index 58eb529..f6c97db 100755 (executable)
@@ -17,7 +17,7 @@
 # Check rules output for parser defined conditionally.
 
 required='flex bison gcc'
-. ./defs
+. ./defs || Exit 1
 
 set -e
 
index 144c2ac..a4ae078 100755 (executable)
@@ -17,7 +17,7 @@
 # Check conditional local rules.
 # Report from Simon Josefsson.
 
-. ./defs
+. ./defs || Exit 1
 
 set -e
 
index 0051e1f..b1c3036 100755 (executable)
@@ -17,7 +17,7 @@
 # Check conditional variable ordering.
 # Report from Ed Hartnett.
 
-. ./defs
+. ./defs || Exit 1
 
 set -e
 
index 8d96595..c75c7b5 100755 (executable)
@@ -20,7 +20,7 @@
 
 # Build either as CONFIG_FILE or as PROGRAM.
 
-. ./defs
+. ./defs || Exit 1
 set -e
 
 mkdir sub
index c0bde5c..8552cef 100755 (executable)
@@ -20,7 +20,7 @@
 
 # Test AM_COND_IF.
 
-. ./defs
+. ./defs || Exit 1
 set -e
 
 cat >>configure.in <<'END'
index b32bff3..dd9ffda 100755 (executable)
@@ -20,7 +20,7 @@
 
 # AM_COND_IF with an undefined condition should fail.
 
-. ./defs
+. ./defs || Exit 1
 set -e
 
 cat >>configure.in <<'END'
index 00ca114..428c02b 100755 (executable)
@@ -22,7 +22,7 @@
 # This shouldn't happen with user input, as _AM_COND_* are not documented,
 # but better to be safe.
 
-. ./defs
+. ./defs || Exit 1
 set -e
 
 cat >>configure.in <<'END'
index 1b468a7..1fa413d 100755 (executable)
@@ -20,7 +20,7 @@
 
 # Ensure an error with underquoted usage of AM_COND_IF in configure.ac.
 
-. ./defs
+. ./defs || Exit 1
 set -e
 
 cat >>configure.in <<'END'
index ac907f1..4b5adc2 100755 (executable)
@@ -17,7 +17,7 @@
 # Check that redefinitions of AC_SUBST'ed AM_SUBST_NOTMAKE'd variables
 # are not diagnosed.  See cond23.test.
 
-. ./defs
+. ./defs || Exit 1
 
 set -e
 
index 57dd339..c70fecb 100755 (executable)
@@ -17,7 +17,7 @@
 # Check that redefinitions of AC_SUBST'ed AM_SUBST_NOTMAKE'd variables
 # are not diagnosed.  See cond24.test.
 
-. ./defs
+. ./defs || Exit 1
 
 set -e
 
diff --git a/tests/cond46.test b/tests/cond46.test
new file mode 100755 (executable)
index 0000000..0b8696c
--- /dev/null
@@ -0,0 +1,110 @@
+#! /bin/sh
+# 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
+# the Free Software Foundation; either version 3 of the License, 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 the right condition is listed after `else' and `endif'.
+
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AM_CONDITIONAL([USE_A],[test x = y])
+AM_CONDITIONAL([USE_B],[test x = z])
+AC_OUTPUT
+END
+
+$ACLOCAL
+
+cat > Makefile.am << 'END'
+if USE_A
+endif !USE_A
+END
+
+AUTOMAKE_fails
+grep 'endif.*incompatible with current conditional' stderr
+
+cat > Makefile.am << 'END'
+if USE_A
+endif USE_B
+END
+
+AUTOMAKE_fails
+grep 'endif.*incompatible with current conditional' stderr
+
+cat > Makefile.am << 'END'
+if USE_A
+else
+endif USE_A
+END
+
+AUTOMAKE_fails
+grep 'endif.*incompatible with current conditional' stderr
+
+cat > Makefile.am << 'END'
+if USE_A
+else
+endif !USE_A
+END
+
+$AUTOMAKE
+
+cat > Makefile.am << 'END'
+if USE_A
+if USE_B
+else
+endif !USE_A
+endif
+END
+
+AUTOMAKE_fails
+grep 'endif.*incompatible with current conditional' stderr
+
+cat > Makefile.am << 'END'
+if USE_A
+else USE_A
+endif
+END
+
+AUTOMAKE_fails
+grep 'else.*incompatible with current conditional' stderr
+
+cat > Makefile.am << 'END'
+if USE_A
+else USE_B
+endif
+END
+
+AUTOMAKE_fails
+grep 'else.*incompatible with current conditional' stderr
+
+cat > Makefile.am << 'END'
+if USE_A
+if USE_B
+else USE_A
+endif
+endif
+END
+
+AUTOMAKE_fails
+grep 'else.*incompatible with current conditional' stderr
+
+cat > Makefile.am << 'END'
+if USE_A
+else !USE_A
+endif
+END
+
+$AUTOMAKE
index 9001028..7210a5b 100755 (executable)
@@ -1,5 +1,6 @@
 #! /bin/sh
-# Copyright (C) 1999, 2001, 2002, 2003  Free Software Foundation, Inc.
+# Copyright (C) 1999, 2001, 2002, 2003, 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
@@ -38,6 +39,24 @@ END
 
 $ACLOCAL
 AUTOMAKE_fails
-grep 'adjunct:3: too many conditionals closed' stderr
+grep 'adjunct:3: error: too many conditionals closed' stderr
+
+cat > adjunct << 'END'
+if TOBE
+target: dependency
+       rule
+END
+
+AUTOMAKE_fails
+grep 'unterminated conditionals' stderr
+
+cat > adjunct << 'END'
+if TOBE
+target: dependency
+       rule
+endif
+END
+
+$AUTOMAKE
 
 :
index b09f816..679e801 100755 (executable)
@@ -24,11 +24,11 @@ echo "FOO = foo" > Makefile.am
 
 $ACLOCAL
 
-echo "$me: Generated by aclocal..."
+echo "$me: Generated by aclocal ..."
 $AUTOMAKE
 grep '^\$(ACLOCAL_M4):' Makefile.in
 
-echo "$me: Not generated by aclocal..."
+echo "$me: Not generated by aclocal ..."
 # Pretend it is not from aclocal (remove the signature),
 # but keep it correct, i.e., with AM_INIT_AUTOMAKE etc.
 sed -n '3,$p' aclocal.m4 >aclocal.m4t
index 34674cc..93badef 100755 (executable)
@@ -30,10 +30,10 @@ END
 cat > Makefile.am << 'END'
 .PHONY: test1 test2
 test1:
-       @echo DIST_COMMON = $(DIST_COMMON) ## for debugging
+       @echo DIST_COMMON = $(DIST_COMMON)
        echo ' ' $(DIST_COMMON) ' ' | grep '[ /]acconfig\.h '
 test2: distdir
-       ls -l $(distdir)/* ## for debugging
+       ls -l $(distdir)/*
        test -f $(distdir)/acconfig.h
 check-local: test1 test2
 END
index df985ec..146d2f0 100755 (executable)
@@ -29,7 +29,7 @@ END
 cat > Makefile.am << 'END'
 .PHONY: test0 test1 test2
 test0:
-       @echo DIST_COMMON = $(DIST_COMMON) ## for debugging
+       @echo DIST_COMMON = $(DIST_COMMON)
        echo ' ' $(DIST_COMMON) ' ' | grep '[ /]one\.h\.in '
        echo ' ' $(DIST_COMMON) ' ' | grep '[ /]two\.h\.in '
        : Processed header files should not be distributed.
@@ -42,7 +42,7 @@ test1: all
        test -f one.h
        test -f two.h
 test2: distdir
-       ls -l $(distdir)/* ## for debugging
+       ls -l $(distdir)/*
        test -f $(distdir)/one.h.in
        test -f $(distdir)/two.h.in
        : Processed header files should not be distributed.
index 770ae51..e4199a1 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 1999, 2001, 2002  Free Software Foundation, Inc.
+# Copyright (C) 1999, 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
 
 . ./defs || Exit 1
 
+set -e
+
 : > Makefile.am
 rm -f install-sh
 
-$ACLOCAL || Exit 1
+$ACLOCAL
 $AUTOMAKE -c -a
+
+test -f install-sh
+test ! -h install-sh
+
+:
diff --git a/tests/cscope.test b/tests/cscope.test
new file mode 100755 (executable)
index 0000000..e79520f
--- /dev/null
@@ -0,0 +1,109 @@
+#! /bin/sh
+# 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
+# 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/>.
+
+# Test cscope functionality.
+
+required=
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_CONFIG_FILES([sub/Makefile])
+AC_PROG_CC
+AC_PROG_CXX
+AC_PROG_FC
+AM_PROG_GCJ
+AM_PATH_LISPDIR
+AC_OUTPUT
+END
+
+mkdir sub sub/subsub
+
+cat >Makefile.am <<'END'
+SUBDIRS = sub
+bin_PROGRAMS = foo
+foo_SOURCES = foo.c bar.cpp baz.f90
+lisp_LISP = foo.el
+EXTRA_DIST = foo.el
+END
+
+cat >sub/Makefile.am <<'END'
+bin_PROGRAMS = bar
+bar_SOURCES = subsub/dist.c
+nodist_bar_SOURCES = subsub/gen.c
+subsub/gen.c:
+       $(MKDIR_P) subsub
+       echo 'int generated_subsub () { return 0; }' > $@
+CLEANFILES = subsub/gen.c
+END
+
+echo 'int foo_func () { return 0; }' > foo.c
+echo 'int main () { return 0; }' > bar.cpp
+cat > baz.f90 <<'END'
+      subroutine baz
+      end
+END
+: >foo.el
+echo 'int main () { return 0; }' > sub/subsub/dist.c
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE --add-missing
+
+mkdir build
+cd build
+../configure || Exit 77
+
+$MAKE -n cscope
+
+: ${CSCOPE=cscope}
+( $CSCOPE --version ) >/dev/null 2>&1 || Exit 77
+
+$MAKE cscope 2>stderr || { cat stderr >&2; Exit 1; }
+cat stderr >&2
+grep 'cannot find file' stderr && Exit 1
+
+test -f cscope.files
+$FGREP foo.c cscope.files
+$FGREP bar.cpp cscope.files
+$FGREP sub/subsub/dist.c cscope.files
+$FGREP sub/subsub/gen.c cscope.files
+
+cp cscope.files cscope.files1
+$MAKE cscope
+diff cscope.files cscope.files1
+
+$MAKE distclean
+test ! -f cscope.files
+test ! -f cscope.out
+test ! -f cscope.in.out
+test ! -f cscope.po.out
+
+
+`pwd`/../configure || Exit 77
+
+$MAKE cscope 2>stderr || { cat stderr >&2; Exit 1; }
+cat stderr >&2
+grep 'cannot find file' stderr && Exit 1
+$MAKE || Exit 77
+$MAKE distclean
+
+cd ..
+./configure
+$MAKE distcheck
+
+:
similarity index 67%
rename from tests/outdir.test
rename to tests/cscope2.test
index 4bafb4e..106b801 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 1996, 2001, 2002  Free Software Foundation, Inc.
+# Copyright (C) 2009  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
 # 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 to ensure that --output-dir works.  Bug report from Joshua
-# Cowan.
+# The `cscope' target should not fail if there are no sources.
 
+required=
 . ./defs || Exit 1
 
-cat > Makefile.am <<'END'
-pkgdata_DATA =
+set -e
+
+cat >> configure.in << 'END'
+AC_OUTPUT
 END
+: >Makefile.am
 
-mkdir zardir
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
 
-$ACLOCAL || Exit 1
-$AUTOMAKE -Wno-obsolete --output-dir=zardir || Exit 1
+./configure
+$MAKE cscope
 
-test -f Makefile.in && Exit 1
-test -f zardir/Makefile.in
+:
diff --git a/tests/cscope3.test b/tests/cscope3.test
new file mode 100755 (executable)
index 0000000..03e1d47
--- /dev/null
@@ -0,0 +1,41 @@
+#! /bin/sh
+# Copyright (C) 2009  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/>.
+
+# The `cscope' target should not fail if there are no sources in a subdir.
+# In practice this means `cscope' should not be invoked if cscope.files
+# is empty.
+
+required=cscope
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_CONFIG_FILES([sub/Makefile])
+AC_OUTPUT
+END
+mkdir sub
+echo 'SUBDIRS = sub' >Makefile.am
+: >sub/Makefile.am
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+./configure
+$MAKE cscope
+
+:
similarity index 55%
rename from tests/defs.in
rename to tests/defs
index ee19dbe..134dc78 100644 (file)
@@ -1,8 +1,7 @@
 # -*- shell-script -*-
-# @configure_input@
 #
 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
+# 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
 # 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 <tromey@cygnus.com>
-
-# 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
 }
 
-if test -z "$srcdir"; then
-   # compute $srcdir.
-   srcdir=`echo "$0" | sed -e 's,/[^\\/]*$,,'`
-   test "$srcdir" = $0 && srcdir=.
-else :; fi
+# 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$//'`
+
 
-# Ensure $srcdir is set correctly.
-test -f "$srcdir/defs.in" || {
-   echo "$srcdir/defs.in not found, check \$srcdir" 1>&2
+## ---------------------------------------- ##
+##  Sanity checks and environment cleanup.  ##
+## ---------------------------------------- ##
+
+# Ensure $testsrcdir is set correctly.
+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+"$@"}
+}
+
+
+## ----------------------------------------------------------- ##
+##  Checks for required tools, and additional setups (if any)  ##
+##  required by them.                                          ##
+## ----------------------------------------------------------- ##
 
-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=`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="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"
+# 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.
@@ -98,12 +149,18 @@ do
       YACC='bison -y'
       export YACC
       echo "$me: running bison --version"
-      ( bison --version ) || exit 77
+      bison --version || exit 77
       ;;
     bzip2)
       # Do not use --version, bzip2 still tries to compress stdin.
       echo "$me: running bzip2 --help"
-      ( bzip2 --help ) || exit 77
+      bzip2 --help || exit 77
+      ;;
+    cl)
+      CC=cl
+      export CC
+      echo "$me: running $CC -?"
+      $CC -? || exit 77
       ;;
     etags)
       # Exuberant Ctags will create a TAGS file even
@@ -111,7 +168,7 @@ do
       # does not have such problem.)  Use -o /dev/null
       # to make sure we do not pollute the tests/ directory.
       echo "$me: running etags --version -o /dev/null"
-      ( etags --version -o /dev/null ) || exit 77
+      etags --version -o /dev/null || exit 77
       ;;
     GNUmake)
       # Use --version AND -v, because SGI Make doesn't fail on --version.
@@ -128,20 +185,25 @@ do
       CC=gcc
       export CC
       echo "$me: running $CC --version"
-      ( $CC --version ) || exit 77
+      $CC --version || exit 77
+      echo "$me: running $CC -v"
+      $CC -v || exit 77
       ;;
     gcj)
       GCJ=gcj
       export GCJ
       echo "$me: running $GCJ --version"
-      ( $GCJ --version ) || exit 77
-      ( $GCJ -v ) || exit 77
+      $GCJ --version || exit 77
+      echo "$me: running $GCJ -v"
+      $GCJ -v || exit 77
       ;;
     g++)
       CXX=g++
       export CXX
       echo "$me: running $CXX --version"
-      ( $CXX --version ) || exit 77
+      $CXX --version || exit 77
+      echo "$me: running $CXX -v"
+      $CXX -v || exit 77
       ;;
     icc)
       CC=icc
@@ -151,16 +213,16 @@ do
       # it will try link *nothing* and complain it cannot find
       # main(); funny).  Use -help so it does not try linking anything.
       echo "$me: running $CC -V -help"
-      ( $CC -V -help ) || exit 77
+      $CC -V -help || exit 77
       ;;
     makedepend)
       echo "$me: running makedepend -f-"
-      ( makedepend -f- ) || exit 77
+      makedepend -f- || exit 77
       ;;
     makeinfo-html)
       # Make sure makeinfo understands --html.
       echo "$me: running makeinfo --html --version"
-      ( makeinfo --html --version ) || exit 77
+      makeinfo --html --version || exit 77
       ;;
     non-root)
       # Skip this test case if the user is root.
@@ -171,12 +233,21 @@ 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)
+      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
       echo "$me: running python -V"
-      ( python -V ) || exit 77
+      python -V || exit 77
       ;;
     ro-dir)
       # Skip this test case if read-only directories aren't supported
@@ -187,104 +258,188 @@ 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.
       while :; do
-       for r2h in $RST2HTML rst2html rst2html.py; do
-         echo "$me: running $r2h --version"
-         $r2h --version && break 2
-       done
-       exit 77
+        for r2h in $RST2HTML rst2html rst2html.py; do
+          echo "$me: running $r2h --version"
+          $r2h --version && break 2
+        done
+        echo "$me: no proper rst2html program found" >&2
+        exit 77
       done
       ;;
     runtest)
       # 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"
-      (runtest SOMEPROGRAM=someprogram --version) || exit 77
+      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.
       echo "$me: running texi2dvi -o /dev/null --version"
-      ( texi2dvi -o /dev/null --version ) || exit 77
+      texi2dvi -o /dev/null --version || exit 77
+      ;;
+    xsi-shell)
+      # Try some XSI features.
+      # Keep this in sync with libtool.m4:_LT_CHECK_SHELL_FEATURES.
+      echo "$me: trying some XSI constructs"
+      ( _am_dummy="a/b/c"
+       test "${_am_dummy##*/},${_am_dummy%/*},${_am_dummy#??}"${_am_dummy%"$_am_dummy"}, \
+               = c,a/b,b/c, \
+       && eval 'test $(( 1 + 1 )) -eq 2 \
+       && test "${#_am_dummy}" -eq 5' ) || exit 77
       ;;
-    # Generic case: the tool must support --version.
     *)
+      # Generic case: the tool must support --version.
       echo "$me: running $tool --version"
+      # It is not likely but possible that $tool is a special builtin,
+      # in which case the shell is allowed to exit after an error.
+      # So, please leave the subshell here.
       ( $tool --version ) || exit 77
       ;;
   esac
 done
 
-
-# Always use an absolute srcdir.  Otherwise symlinks made in subdirs
-# of the test dir just won't work.
-case "$srcdir" in
- [\\/]* | ?:[\\/]*)
+# 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
     ;;
+esac
 
- *)
-    srcdir=`CDPATH=: && cd "$srcdir" && pwd`
+# 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.
+# Use `-I $top_testsrcdir/m4' in addition to `--acdir=$top_testsrcdir/m4',
+# because the other `-I' directories added for libtool and gettext might
+# contain files from an old version of Automake that we don't want to use.
+# Use `-Wno-syntax' because we do not want our test suite to fail because
+# some third-party .m4 file is underquoted.
+case " $required " in
+  *' libtool '* | *' libtoolize '* | *' gettext '* )
+    aclocaldir=$testprefix/share/aclocal
+    extra_includes=""
+    if test -f $aclocaldir/dirlist; then
+       extra_includes=`
+       <$aclocaldir/dirlist \
+       sed  's/#.*//;s/[        ][      ]*$//g' \
+       | while read dir; do test ! -d "$dir" || echo "-I $dir"; done`
+    else :; fi
+
+    libtool_found=no
+    gettext_found=no
+    for d in $extra_includes $aclocaldir ; do
+      test "x$d" != x-I || continue
+      if test -f "$d/libtool.m4"; then
+        libtool_found=yes
+      fi
+      if test -f "$d/gettext.m4"; then
+        gettext_found=yes
+      fi
+    done
+    case " $required " in
+      *' 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
 
-# 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`
+## ---------------------------------------------------------------- ##
+##  Create and set up of the temporary directory used by the test.  ##
+##  Set up of the exit trap for cleanup of said directory.          ##
+## ---------------------------------------------------------------- ##
+
+# 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
+
 test ! -d $testSubDir || {
   find $testSubDir -type d ! -perm -200 -exec chmod u+w {} ";"
   rm -rf $testSubDir
 }
 mkdir $testSubDir
 
-sh_errexit_works=@sh_errexit_works@
+cd ./$testSubDir
+
 if test "$sh_errexit_works" = yes; then
   trap 'exit_status=$?
     set +e
-    cd "$curdir"
+    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"
+    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
-signal=0
 
 # Copy in some files we need.
 for file in install-sh missing depcomp; do
-   cp "$srcdir/../lib/$file" "$testSubDir/$file" || Exit 1
+   cp "$top_testsrcdir/lib/$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
@@ -300,132 +455,10 @@ cd ./$testSubDir
   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
-# 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
-
-echo "=== Running test $0"
 
-# We might need extra macros, e.g., from Libtool or Gettext.
-# Find them on the system.
-# Use `-I $srcdir/../m4' in addition to `--acdir=$srcdir/../m4', because the
-# other `-I' directories added for libtool and gettext might contain
-# files from an old version of Automake that we don't want to use.
-# Use `-Wno-syntax' because we do not want our test suite to fail because
-# some third-party .m4 file is underquoted.
-case $required in
-  *libtool* | *gettext* )
-    aclocaldir='@prefix@/share/aclocal'
-    extra_includes=""
-    if test -f $aclocaldir/dirlist; then
-       extra_includes=`
-       <$aclocaldir/dirlist \
-       sed  's/#.*//;s/[        ][      ]*$//g' \
-       | while read dir; do test ! -d "$dir" || echo "-I $dir"; done`
-    else :; fi
-
-    libtool_found=no
-    gettext_found=no
-    for d in $extra_includes $aclocaldir ; do
-       test "x$d" != x-I || continue
-       if test -f "$d/libtool.m4"; then
-         libtool_found=yes
-       fi
-       if test -f "$d/gettext.m4"; then
-         gettext_found=yes
-       fi
-    done
-    case $required in
-      *libtool* ) 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 $srcdir,`pwd` in
-      *\ * | *\        *) Exit 77 ;;
-    esac
-    ACLOCAL="$ACLOCAL -Wno-syntax -I $srcdir/../m4 $extra_includes -I $aclocaldir"
-    ;;
-esac
-
-testaclocaldir='@abs_top_srcdir@/m4'
-
-# 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@'
-
-# The tests call `make -e' but we do not want $srcdir from the environment
-# to override the definition from the Makefile.
-testsrcdir=$srcdir
-unset srcdir
-
-# 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
-
-# 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+"$@"}
-}
+## ---------------- ##
+##  Ready to go...  ##
+## ---------------- ##
 
 # Turn on shell traces.
 set -x
diff --git a/tests/defs-static.in b/tests/defs-static.in
new file mode 100644 (file)
index 0000000..2ca4b57
--- /dev/null
@@ -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
index 5ffb9a1..6041918 100755 (executable)
 set -e
 
 cat > acinclude.m4 << 'END'
-AC_DEFUN([AM_FUNC_TWO])
+AC_DEFUN([AM_FUNC_THREE])
+AC_DEFUN([AM_FUNC_TWO], [@!GrepThisString!@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 '^@!GrepThisString!@$' configure
+
+:
index 6c10a8f..1e2677d 100755 (executable)
@@ -38,3 +38,5 @@ END
 
 $ACLOCAL
 $AUTOMAKE
+
+:
index a273770..b3e58e7 100755 (executable)
@@ -14,7 +14,8 @@
 # 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 to make sure dejagnu tests and automake-style tests can coexist.
+# Superficial test to check that dejagnu tests and automake-style
+# tests can coexist.  See also related deeper test `check12.test'.
 
 . ./defs || Exit 1
 
@@ -25,10 +26,10 @@ AUTOMAKE_OPTIONS = dejagnu
 TESTS = frob.test
 END
 
-: > frob.test
-
 $ACLOCAL
 $AUTOMAKE
 
 grep '^check-TESTS' Makefile.in
 grep '^check-DEJAGNU' Makefile.in
+
+:
index 531f744..121f6d8 100755 (executable)
@@ -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
 
 set -e
 
-echo 'AC_OUTPUT' >> configure.in
+cat >> configure.in <<'END'
+AC_OUTPUT
+END
 
 cat > Makefile.am << 'END'
 AUTOMAKE_OPTIONS = dejagnu
 
 site.exp:
-       @echo foo
+       echo :GREP:ME: > $@
 END
 
 $ACLOCAL
 $AUTOCONF
 $AUTOMAKE -Wno-override
 
-grep site.exp Makefile.in
-test `grep '^site\.exp:' Makefile.in | wc -l` -eq 1
+grep 'site\.exp' Makefile.in
+test `grep -c '^site\.exp:' Makefile.in` -eq 1
 
 ./configure
-$MAKE site.exp >stdout
-cat stdout
-grep foo stdout
+$MAKE site.exp
+grep ':GREP:ME:' site.exp
 
 AUTOMAKE_fails
-grep 'Makefile.am:3:.*site.exp' stderr
+grep '^Makefile\.am:3:.*site\.exp' stderr
+
+:
index d812ac4..2c5d375 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2003  Free Software Foundation, Inc.
+# Copyright (C) 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
@@ -28,15 +28,14 @@ END
 
 chmod +x hammer
 
-echo AC_OUTPUT >> configure.in
+cat >> configure.in << 'END'
+AC_OUTPUT
+END
 
 cat > Makefile.am << 'END'
 AUTOMAKE_OPTIONS = dejagnu
-
 DEJATOOL = hammer
-
 AM_RUNTESTFLAGS = HAMMER=$(srcdir)/hammer
-
 EXTRA_DIST = hammer hammer.test/hammer.exp
 END
 
@@ -65,5 +64,9 @@ $MAKE distcheck
 
 # Ensure that the envvar RUNTESTFLAGS is used.
 # Report from Mark Mitchell.
-RUNTESTFLAGS=--unknown-option $MAKE check && Exit 1
-Exit 0
+RUNTESTFLAGS=--unknown-runtest-option $MAKE check >output 2>&1 \
+  && { cat output; Exit 1; }
+cat output
+$FGREP 'unknown-runtest-option' output
+
+:
index 5fdda10..fa64a31 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2003, 2006  Free Software Foundation, Inc.
+# Copyright (C) 2003, 2006, 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
@@ -26,17 +26,17 @@ cat > hammer << 'END'
 #! /bin/sh
 echo "Everything looks like a nail to me!"
 END
-
 chmod +x hammer
 
 cat > spanner << 'END'
 #! /bin/sh
 echo "I'm a right spanner!"
 END
-
 chmod +x spanner
 
-echo AC_OUTPUT >> configure.in
+cat >> configure.in << 'END'
+AC_OUTPUT
+END
 
 cat > Makefile.am << 'END'
 AUTOMAKE_OPTIONS = dejagnu
@@ -49,8 +49,7 @@ EXTRA_DIST  = hammer  hammer.test/hammer.exp
 EXTRA_DIST += spanner spanner.test/spanner.exp
 END
 
-mkdir hammer.test
-mkdir spanner.test
+mkdir hammer.test spanner.test
 
 cat > hammer.test/hammer.exp << 'END'
 set test test
@@ -86,8 +85,14 @@ $MAKE distcheck
 
 # Test for PR 488.
 sed 's/E\(verything\)/Not e\1/' hammer > thammer
-mv thammer hammer
+mv -f thammer hammer
 chmod +x hammer
 
+rm -f hammer.log hammer.sum spanner.log spanner.sum
 $MAKE check && Exit 1
+test -f hammer.log
+test -f hammer.sum
+test -f spanner.log
+test -f spanner.sum
+
 :
index 0095958..0237a08 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2003  Free Software Foundation, Inc.
+# Copyright (C) 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
@@ -22,30 +22,27 @@ required=runtest
 
 set -e
 
-# Get the package name from configure.in.
-package=`$FGREP AC_INIT configure.in | sed -e 's:^[^[]*\[\([^]]*\)\].*$:\1:'`
+package=$me
 
 cat > $package << 'END'
 #! /bin/sh
 echo "Ah, we have been expecting you, Mr. Blond."
 END
-
 chmod +x $package
 
-echo AC_OUTPUT >> configure.in
+cat >> configure.in << 'END'
+AC_OUTPUT
+END
 
 cat > Makefile.am << END
 AUTOMAKE_OPTIONS = dejagnu
-
 EXTRA_DIST = $package $package.test/$package.exp
+AM_RUNTESTFLAGS = PACKAGE=\$(srcdir)/$package
 END
 
-echo "AM_RUNTESTFLAGS = PACKAGE=\$(srcdir)/$package" >> Makefile.am
-
 mkdir $package.test
-
 cat > $package.test/$package.exp << 'END'
-set test "test"
+set test "a_dejagnu_test"
 spawn $PACKAGE
 expect {
     "Ah, we have been expecting you, Mr. Blond." { pass "$test" }
@@ -64,3 +61,5 @@ test -f $package.log
 test -f $package.sum
 
 $MAKE distcheck
+
+:
index 25a1f1f..662ca28 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2003  Free Software Foundation, Inc.
+# Copyright (C) 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
@@ -25,23 +25,21 @@ cat > faildeja << 'END'
 #! /bin/sh
 echo whatever
 END
-
 chmod +x faildeja
 
-echo AC_OUTPUT >> configure.in
+cat >> configure.in << 'END'
+AC_OUTPUT
+END
 
 cat > Makefile.am << 'END'
 AUTOMAKE_OPTIONS = dejagnu
-
 DEJATOOL = faildeja
-
 AM_RUNTESTFLAGS = FAILDEJA=$(srcdir)/faildeja
 END
 
 mkdir faildeja.test
-
 cat > faildeja.test/faildeja.exp << 'END'
-set test test
+set test failing_deja_test
 spawn $FAILDEJA
 expect {
     default { fail "$test" }
@@ -57,4 +55,6 @@ $AUTOMAKE --add-missing
 $MAKE check && Exit 1
 test -f faildeja.log
 test -f faildeja.sum
-$FGREP 'FAIL: test' faildeja.sum
+$FGREP 'FAIL: failing_deja_test' faildeja.sum
+
+:
index 552c2ca..0be4d1f 100755 (executable)
@@ -29,21 +29,19 @@ cat > failtcl << 'END'
 #! /bin/sh
 echo whatever
 END
-
 chmod +x failtcl
 
-echo AC_OUTPUT >> configure.in
+cat >> configure.in << 'END'
+AC_OUTPUT
+END
 
 cat > Makefile.am << 'END'
 AUTOMAKE_OPTIONS = dejagnu
-
 DEJATOOL = failtcl
-
 AM_RUNTESTFLAGS = --status FAILTCL=$(srcdir)/failtcl
 END
 
 mkdir failtcl.test
-
 cat > failtcl.test/failtcl.exp << 'END'
 set test test
 spawn $FAILTCL
@@ -62,3 +60,5 @@ $MAKE check && Exit 1
 test -f failtcl.log
 test -f failtcl.sum
 $FGREP 'missing close-brace' failtcl.sum
+
+:
index f36eb47..f61ddf0 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2001, 2002  Free Software Foundation, Inc.
+# Copyright (C) 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
 
 . ./defs || Exit 1
 
+set -e
+
 rm -f configure.in
 
 mkdir config
 for i in *; do
-   if test $i != "config"; then
-      mv $i config
+   if test "$i" != "config"; then
+      mv -f "$i" config
    fi
 done
 
-cat > configure.in << 'END'
-AC_INIT(subdir/foo.c)
-AC_CONFIG_AUX_DIR(config)
-AM_INIT_AUTOMAKE(nonesuch, nonesuch)
+cat > configure.in << END
+AC_INIT([$me], [1.0])
+AC_CONFIG_AUX_DIR([config])
+AM_INIT_AUTOMAKE
 AC_PROG_CC
-AC_OUTPUT(subdir/Makefile Makefile)
+AC_CONFIG_FILES([subdir/Makefile Makefile])
+AC_OUTPUT
 END
 
 cat > Makefile.am << 'END'
 SUBDIRS = subdir
+check-local: test1 test2
+.PHONY: test1 test2
+test1:
+       echo ' ' $(DIST_COMMON) ' ' | grep '[ /]config/depcomp '
+test2: distdir
+       ls -l $(distdir)/*
+       test -f $(distdir)/config/depcomp
 END
 
 mkdir subdir
-: > subdir/foo.c
+cat > subdir/foo.c << 'END'
+int main(void)
+{
+  return 0;
+}
+END
 
 cat > subdir/Makefile.am << 'END'
 bin_PROGRAMS = foo
 foo_SOURCES = foo.c
 END
 
-set -e
-
 $ACLOCAL
-$AUTOMAKE --add-missing
 $AUTOCONF
-grep config/depcomp Makefile.in
+$AUTOMAKE --add-missing
+
+./configure
+
+$MAKE check
+$MAKE distcheck
+
+:
index 0e4faa3..f319604 100755 (executable)
@@ -19,6 +19,8 @@
 
 . ./defs || Exit 1
 
+set -e
+
 cat >> configure.in << 'END'
 AC_PROG_RANLIB
 AC_PROG_CC
@@ -39,4 +41,4 @@ AUTOMAKE_fails
 
 grep 'automatically discovered.*fsusage\.c.*explicitly mentioned' stderr
 
-Exit 0
+:
index 3ea5096..c14d94c 100755 (executable)
@@ -42,6 +42,6 @@ END
 
 $ACLOCAL
 AUTOMAKE_fails --add-missing subdir/Makefile
-grep 'full run' stderr
+grep 'without.*Makefile.*arguments' stderr
 
 :
index bdc73ab..7105cb0 100755 (executable)
@@ -22,7 +22,7 @@
 # containing a `$' on the left hand side of an assignment are not
 # portable in practice, even though POSIX allows them.  :-/
 
-. ./defs
+. ./defs || Exit 1
 
 set -e
 
index 0d12afd..6fc2737 100755 (executable)
@@ -17,7 +17,7 @@
 # Test to make sure that -Wportability turns on portability-recursive,
 # likewise for -Wno-...
 
-. ./defs
+. ./defs || Exit 1
 
 set -e
 
diff --git a/tests/ext3.test b/tests/ext3.test
new file mode 100755 (executable)
index 0000000..0a691c5
--- /dev/null
@@ -0,0 +1,41 @@
+#! /bin/sh
+# Copyright (C) 2009 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 3 of the License, 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/>.
+
+# Cover corner cases of derive_suffix wrt. file extensions:
+# - extension declared with SUFFIXES but with no suffix rule for it
+# - extension with a suffix rule but none that leads us to $(OBJEXT)
+# In both cases, we don't try to create a rule; but we shouldn't
+# fail either, because magic might be happening behind our back.
+
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+END
+
+cat > Makefile.am << 'END'
+bin_PROGRAMS = foo bar
+foo_SOURCES = foo.goo
+SUFFIXES = .goo
+bar_SOURCES = bar.woo
+.woo.zoo: ; making a zoo $@ from a woo $<
+END
+
+$ACLOCAL
+$AUTOMAKE
+
+Exit 0
diff --git a/tests/extra9.test b/tests/extra9.test
new file mode 100755 (executable)
index 0000000..fefd385
--- /dev/null
@@ -0,0 +1,46 @@
+#!/bin/sh
+# Copyright (C) 2009  Free Software Foundation, Inc.
+#
+# This file is part of GNU Automake.
+#
+# GNU Automake 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 3 of the License, or
+# (at your option) any later version.
+#
+# GNU Automake 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 Automake; see the file COPYING.  If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+# Boston, MA 02110-1301, USA.
+
+# Ensure we warn about substitutions in bin_PROGRAMS if EXTRA_PROGRAMS
+# are missing; but only if the former is not AC_SUBSTed itself
+# (lib_LIBRARIES is in the same boat here).
+
+. ./defs || Exit 1
+
+set -e
+
+cat >>configure.in <<'END'
+AC_PROG_CC
+AC_PROG_RANLIB
+AC_SUBST([lib_LIBRARIES])
+AC_SUBST([bins])
+AC_OUTPUT
+END
+
+cat >Makefile.am <<'END'
+bin_PROGRAMS = @bins@
+END
+
+$ACLOCAL
+AUTOMAKE_fails
+grep 'bin_PROGRAMS.*contains configure substitution' stderr
+grep 'lib_LIBRARIES.*contains configure substitution' stderr && Exit 1
+
+Exit 0
diff --git a/tests/extradep.test b/tests/extradep.test
new file mode 100755 (executable)
index 0000000..d84182d
--- /dev/null
@@ -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/>.
+
+# Test EXTRA_*_DEPENDENCIES.  See extradep2 for libtool variant.
+
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_PROG_CC
+AC_PROG_RANLIB
+AC_SUBST([deps], [bardep])
+AM_CONDITIONAL([COND], [test -n "$cond"])
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+noinst_LIBRARIES = libfoo.a
+EXTRA_libfoo_a_DEPENDENCIES = libfoodep
+libfoodep:
+       @echo making $@
+       @: > $@
+CLEANFILES = libfoodep
+
+bin_PROGRAMS = foo bar
+EXTRA_foo_DEPENDENCIES = foodep
+if COND
+EXTRA_foo_DEPENDENCIES += foodep2
+endif
+bar_LDADD = libfoo.a
+EXTRA_bar_DEPENDENCIES = $(deps)
+
+EXTRA_DIST = foodep bardep
+
+bar-is-newer-than-libfoo.a:
+       test `ls -1t bar$(EXEEXT) libfoo.a | sed q` = bar$(EXEEXT)
+END
+
+cat >libfoo.c <<'END'
+int libfoo () { return 0; }
+END
+
+cat >foo.c <<'END'
+int main () { return 0; }
+END
+
+cat >bar.c <<'END'
+extern int libfoo ();
+int main () { return libfoo (); }
+END
+
+$ACLOCAL
+$AUTOMAKE --add-missing
+$AUTOCONF
+
+./configure cond=yes
+
+# hypotheses:
+# EXTRA_*_DEPENDENCIES are honored.
+# conditionals and substitutions are honored.
+# *_DEPENDENCIES are not overwritten by their EXTRA_* counterparts.
+
+: >foodep
+: >foodep2
+: >bardep
+$MAKE >stdout || { cat stdout; Exit 1; }
+cat stdout
+grep 'making libfoodep' stdout
+
+rm -f foodep
+$MAKE && Exit 1
+: >foodep
+
+rm -f foodep2
+$MAKE && Exit 1
+: >foodep2
+
+rm -f bardep
+$MAKE && Exit 1
+: >bardep
+
+$MAKE
+$sleep
+touch libfoo.a
+$MAKE
+$MAKE bar-is-newer-than-libfoo.a
+
+$MAKE distcheck
+
+:
diff --git a/tests/extradep2.test b/tests/extradep2.test
new file mode 100755 (executable)
index 0000000..7d72e82
--- /dev/null
@@ -0,0 +1,86 @@
+#! /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/>.
+
+# Test EXTRA_*_DEPENDENCIES, libtool version; see extradep.test.
+
+required=libtoolize
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_PROG_CC
+AC_PROG_LIBTOOL
+AC_SUBST([deps], [bardep])
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+noinst_LTLIBRARIES = libfoo.la
+EXTRA_libfoo_la_DEPENDENCIES = libfoodep
+libfoodep:
+       @echo making $@
+       @: > $@
+CLEANFILES = libfoodep
+
+bin_PROGRAMS = bar
+bar_LDADD = libfoo.la
+EXTRA_bar_DEPENDENCIES = $(deps)
+
+EXTRA_DIST = bardep
+
+bar-is-newer-than-libfoo.la:
+       test `ls -1t bar$(EXEEXT) libfoo.la | sed q` = bar$(EXEEXT)
+END
+
+cat >libfoo.c <<'END'
+int libfoo () { return 0; }
+END
+
+cat >bar.c <<'END'
+extern int libfoo ();
+int main () { return libfoo (); }
+END
+
+libtoolize
+$ACLOCAL
+$AUTOMAKE --add-missing
+$AUTOCONF
+
+./configure
+
+# hypothesis: EXTRA_*_DEPENDENCIES are honored.
+
+: >foodep
+: >foodep2
+: >bardep
+$MAKE >stdout || { cat stdout; Exit 1; }
+cat stdout
+grep 'making libfoodep' stdout
+
+rm -f bardep
+$MAKE && Exit 1
+: >bardep
+
+$MAKE
+$sleep
+touch libfoo.la
+$MAKE
+$MAKE bar-is-newer-than-libfoo.la
+
+$MAKE distcheck
+
+:
index c32a1b2..b9819dd 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 1999, 2001, 2002  Free Software Foundation, Inc.
+# Copyright (C) 1999, 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
 
 . ./defs || Exit 1
 
+set -e
+
 cat >> configure.in << 'END'
-_AM_DEPENDENCIES(GCJ)
-AC_SUBST(GCJ)
+_AM_DEPENDENCIES([GCJ])
+AC_SUBST([GCJ])
 END
 
 cat > Makefile.am << 'END'
@@ -28,7 +30,9 @@ bin_PROGRAMS = convert
 convert_SOURCES = x/y/convert.java
 END
 
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
 
 grep '^x/y/convert' Makefile.in
+
+:
index 7d8a981..5652124 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2001, 2002  Free Software Foundation, Inc.
+# Copyright (C) 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
 
 . ./defs || Exit 1
 
+set -e
+
 cat >> configure.in << 'END'
-_AM_DEPENDENCIES(GCJ)
-AC_SUBST(GCJ)
+_AM_DEPENDENCIES([GCJ])
+AC_SUBST([GCJ])
 END
 
 cat > Makefile.am << 'END'
@@ -28,8 +30,10 @@ bin_PROGRAMS = convert
 convert_SOURCES = x/y/convert.java
 END
 
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
 
 num=`grep depcomp Makefile.in | wc -l`
 test $num -gt 1
+
+:
index 39f5d1e..d2a5c13 100755 (executable)
@@ -35,8 +35,18 @@ while read tst; do
      || grep "parallel_tests=['\"]yes" $tst >/dev/null
   then :; else echo $tst; fi;
 done |
+sed -e 's/\.test$//' |
 {
   echo "## Generated by gen-parallel-tests.  Edit Makefile.am instead of this."
-  echo "parallel_tests = \\"
-  sed 's,\.test$,-p.test,; $!s,$, \\,'
+  echo "parallel_tests ="
+  # Since `foo-p.test' sources `foo.test', `foo-p.log' also depends on
+  # `foo.test'.
+  sed -e '
+    h
+    s/^/parallel_tests += /
+    s/$/-p.test/
+    p
+    x
+    s/.*/&-p.log: &.test/
+  '
 }
index 2ad2735..bd06b16 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2000, 2001, 2002  Free Software Foundation, Inc.
+# Copyright (C) 2000, 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
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # Test for PR 68.
+#
+# == Report ==
+#  If an autoconf substitution variable of the form "*_HEADERS" --
+#  for example "MY_HEADERS" -- is used in an "include_" variable
+#  in conjunction with EXTRA_HEADERS, $(MY_HEADERS) gets included
+#  in the HEADERS variable for *all* generated Makefile.ins in the
+#  project.
 
 . ./defs || Exit 1
 
+set -e
+
 cat >> configure.in << 'END'
-AC_SUBST(MY_HEADERS)
+AC_SUBST([MY_HEADERS])
 AC_PROG_CC
 END
 
@@ -31,8 +40,8 @@ END
 : > joe.c
 : > qq.h
 
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
 
 grep '[^@]MY_HEADERS' Makefile.in && Exit 1
 Exit 0
index ed9447e..e676e5e 100755 (executable)
@@ -33,9 +33,9 @@ $AUTOCONF
 ./configure --help >stdout || { cat stdout; Exit 1; }
 cat stdout
 
-$FGREP ' --enable-dependency-tracking ' stdout
-$FGREP ' --disable-dependency-tracking ' stdout
-$FGREP ' one-time build' stdout
+$EGREP '^  *--enable-dependency-tracking( |$)' stdout
+$EGREP '^  *--disable-dependency-tracking( |$)' stdout
+$FGREP ' speeds up one-time build' stdout
 $FGREP ' slow dependency extract' stdout
 
 :
index b4133b4..6bad661 100755 (executable)
@@ -34,9 +34,9 @@ $AUTOCONF
 ./configure --help >stdout || { cat stdout; Exit 1; }
 cat stdout
 
-$FGREP ' --enable-dependency-tracking ' stdout
-$FGREP ' --disable-dependency-tracking ' stdout
-$FGREP ' one-time build' stdout
+$EGREP '^  *--enable-dependency-tracking( |$)' stdout
+$EGREP '^  *--disable-dependency-tracking( |$)' stdout
+$FGREP ' speeds up one-time build' stdout
 $FGREP ' slow dependency extract' stdout
 
 :
index c20288d..51b3ba4 100755 (executable)
@@ -32,7 +32,7 @@ $AUTOCONF
 ./configure --help >stdout || { cat stdout; Exit 1; }
 cat stdout
 
-$FGREP ' --with-dmalloc ' stdout
+$EGREP '^   *--with-dmalloc( |$) ' stdout
 $FGREP ' use dmalloc' stdout
 $FGREP 'www.dmalloc.com' stdout
 
index a3af271..fdd9fa0 100755 (executable)
@@ -32,8 +32,8 @@ $AUTOCONF
 ./configure --help >stdout || { cat stdout; Exit 1; }
 cat stdout
 
-grep ' --program-prefix[= ]' stdout
-grep ' --program-suffix[= ]' stdout
-grep ' --program-transform-name[= ]' stdout
+grep '^  *--program-prefix[= ]' stdout
+grep '^  *--program-suffix[= ]' stdout
+grep '^  *--program-transform-name[= ]' stdout
 
 :
index 3d82074..5eb7ab9 100755 (executable)
@@ -32,9 +32,11 @@ $AUTOCONF
 ./configure --help >stdout || { cat stdout; Exit 1; }
 cat stdout
 
-grep ' --with-lispdir .*override.*lisp directory' stdout
-grep ' EMACS .*[eE]macs editor' stdout
-grep ' EMACSLOADPATH' stdout
+$EGREP '^  *--with-lispdir( |$)' stdout
+grep ' override.*lisp directory' stdout
+$EGREP '^  *EMACS( |$)' stdout
+grep ' .*[eE]macs editor' stdout
+$EGREP '^  *EMACSLOADPATH( |$)' stdout
 grep ' .*[eE]macs library search path' stdout
 
 :
index 72fc98a..6933d0c 100755 (executable)
@@ -31,7 +31,8 @@ $ACLOCAL
 $AUTOCONF --force
 ./configure --help >stdout || { cat stdout; Exit 1; }
 cat stdout
-grep ' --enable-maintainer-mode.*enable make rules' stdout
+$EGREP '^  *--enable-maintainer-mode( |$)' stdout
+$FGREP ' enable make rules' stdout
 
 rm -rf autom4te*.cache # just to be sure
 sed 's/\(AM_MAINTAINER_MODE\).*/\1([disable])/' configure.in >t
@@ -42,7 +43,8 @@ $ACLOCAL
 $AUTOCONF --force
 ./configure --help >stdout || { cat stdout; Exit 1; }
 cat stdout
-grep ' --enable-maintainer-mode.*enable make rules' stdout
+$EGREP '^  *--enable-maintainer-mode( |$)' stdout
+$FGREP ' enable make rules' stdout
 
 rm -rf autom4te*.cache # just to be sure
 sed 's/\(AM_MAINTAINER_MODE\).*/\1([enable])/' configure.in >t
@@ -53,6 +55,7 @@ $ACLOCAL
 $AUTOCONF --force
 ./configure --help >stdout || { cat stdout; Exit 1; }
 cat stdout
-grep ' --disable-maintainer-mode.*disable make rules' stdout
+$EGREP '^  *--disable-maintainer-mode( |$)' stdout
+$FGREP ' disable make rules' stdout
 
 :
index 0016c76..1657c34 100755 (executable)
@@ -32,7 +32,7 @@ $AUTOCONF
 ./configure --help >stdout || { cat stdout; Exit 1; }
 cat stdout
 
-$FGREP ' --enable-multilib ' stdout
+$EGREP '^  *--enable-multilib( |$)' stdout
 $FGREP ' many library versions (default)' stdout
 
 :
index b338907..e59f2f1 100755 (executable)
@@ -36,8 +36,10 @@ for args in '' '([])' '([yes])' '([no])'; do
   $AUTOCONF --force
   ./configure --help >stdout || { cat stdout; Exit 1; }
   cat stdout
-  grep ' --enable-silent-rules  *less verbose build.*undo.*make V=1' stdout
-  grep ' --disable-silent-rules  *verbose build.*undo.*make V=0' stdout
+  $EGREP '^  *--enable-silent-rules( |$)' stdout
+  grep ' less verbose build.*undo.*make V=1' stdout
+  $EGREP '^  *--disable-silent-rules ( |$)' stdout
+  grep ' verbose build.*undo.*make V=0' stdout
 done
 
 :
index 586299b..8f5ff5f 100755 (executable)
@@ -32,7 +32,7 @@ $AUTOCONF
 ./configure --help >stdout || { cat stdout; Exit 1; }
 cat stdout
 
-grep ' UPCFLAGS .*Unified Parallel C compiler flags' stdout
-grep ' UPC .*Unified Parallel C compiler command' stdout
+grep '^  *UPCFLAGS .*Unified Parallel C compiler flags' stdout
+grep '^  *UPC .*Unified Parallel C compiler command' stdout
 
 :
index 5212092..b74f30a 100755 (executable)
@@ -15,7 +15,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # Make sure --help and --version work, even when the current directory
-# contains a broken configure.in.
+# contains a broken configure.in and a broken acinclude.m4.
 . ./defs || Exit 1
 
 set -e
@@ -29,9 +29,19 @@ ACLOCAL=`echo " $ACLOCAL " | sed 's/ -W[^ ]*/ /g'`
 AUTOMAKE=`echo " $AUTOMAKE " | sed 's/ -W[^ ]*/ /g'`
 
 echo '[' > configure.in
+echo '[' > acinclude.m4
 
 $AUTOMAKE --version
 $AUTOMAKE --help
+$ACLOCAL --version
+$ACLOCAL --help
+
+# Sanity check: aclocal cannot work with broken acinclude.m4.
+$ACLOCAL 2>stderr && { cat stderr >&2; Exit 1; }
+cat stderr >&2
+$FGREP acinclude.m4 stderr
+
+rm -f acinclude.m4
 
 # Sanity checks: aclocal and automake cannot work with broken configure.in.
 $ACLOCAL 2>stderr && { cat stderr >&2; Exit 1; }
index c5eb31e..1b7de41 100755 (executable)
@@ -14,8 +14,8 @@
 # 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 --help and --version work, even when no configure.ac
-# is in the current directory.
+# Check that the first among --help and --version to be specified on
+# the command line takes precedence over the following one.
 
 . ./defs || Exit 1
 
index 8022729..8f0c5cc 100755 (executable)
@@ -20,7 +20,7 @@
 # Darwin).
 # Report from Peter O'Gorman.
 
-. ./defs
+. ./defs || Exit 1
 set -e
 
 echo AC_OUTPUT >>configure.in
index 210b2dc..c1c3479 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 1996, 2001, 2002  Free Software Foundation, Inc.
+# Copyright (C) 1996, 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
@@ -19,6 +19,8 @@
 
 . ./defs || Exit 1
 
+set -e
+
 cat >> configure.in << 'END'
 AC_PROG_CC
 END
@@ -27,7 +29,9 @@ cat > Makefile.am << 'END'
 noinst_PROGRAMS = libapp_1
 END
 
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
 
 grep '^libapp_1_OBJECTS' Makefile.in | $FGREP '.$(OBJEXT)'
+
+:
index 350f8fc..180b025 100755 (executable)
@@ -1,5 +1,6 @@
 #! /bin/sh
-# Copyright (C) 1999, 2001, 2002, 2005, 2006  Free Software Foundation, Inc.
+# Copyright (C) 1999, 2001, 2002, 2005, 2006, 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
 
 . ./defs || Exit 1
 
-echo AC_OUTPUT >> configure.in
+set -e
+
+cat >> configure.in <<END
+AC_OUTPUT
+END
 
 cat > Makefile.am << 'END'
-include foo
+include Will_Be_Included_In_Makefile
 END
 
-: > foo
+: > Will_Be_Included_In_Makefile
 
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
-len="`grep '^srcdir' Makefile.in | wc -l`"
-echo "len = $len"
-test $len -eq 1 || Exit 1
+$ACLOCAL
+$AUTOMAKE
+len=`grep '^srcdir' Makefile.in | wc -l`
+test $len -eq 1
 
 # Also make sure include file is distributed.
-(sed -n -e '/^DIST_COMMON =.*\\$/ {
+sed -n -e '/^DIST_COMMON =.*\\$/ {
    :loop
    p
    n
@@ -44,4 +48,6 @@ test $len -eq 1 || Exit 1
    t loop
    p
    n
-   }' -e '/^DIST_COMMON =/ p' Makefile.in | grep foo)
+   }' -e '/^DIST_COMMON =/ p' Makefile.in | grep Will_Be_Included_In_Makefile
+
+:
index 2cde524..e99a187 100755 (executable)
@@ -1,5 +1,6 @@
 #! /bin/sh
-# Copyright (C) 1996, 1997, 2001, 2002  Free Software Foundation, Inc.
+# Copyright (C) 1996, 1997, 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
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # Test to make sure info files are distributed correctly.
+# FIXME: This test is probably obsoleted, or wrong.  The generated
+#        Makefile.in seems not to define any `INFOS' variable!
 
 . ./defs || Exit 1
 
+set -e
+
 cat > Makefile.am << 'END'
 info_TEXINFOS = foo.texi
-
-magic:
-       @echo $(INFOS)
 END
 
 echo '@setfilename foo.info' > foo.texi
 : > texinfo.tex
 
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
 
 for i in `grep '^INFOS =' Makefile.in | sed -e 's/^INFOS = //'`; do
    echo $i
@@ -41,3 +43,5 @@ for i in `grep '^INFOS =' Makefile.in | sed -e 's/^INFOS = //'`; do
        ;;
    esac
 done
+
+:
index 38ec681..895bad6 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
+# Copyright (C) 2006, 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
 # 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 we give a sensible error message when neither AC_INIT nor
-# AM_INIT_AUTOMAKE are given arguments.
+# Make sure we give a sensible error message when AC_INIT and
+# AM_INIT_AUTOMAKE are both given less than two arguments.
 
 . ./defs || Exit 1
 
 set -e
 
-cat >configure.in <<END
-AC_INIT
-AM_INIT_AUTOMAKE
+for ac_init_args in '' '([x])'; do
+  for am_init_args in '' '([1.10])'; do
+    rm -rf aclocal.m4 autom4te*.cache
+    cat >configure.in <<END
+AC_INIT$ac_init_args
+AM_INIT_AUTOMAKE$am_init_args
 END
+    cat configure.in # might be useful for debugging
+    # The error message should mention AC_INIT, not AC_PACKAGE_VERSION.
+    ($ACLOCAL && $AUTOCONF) 2>stderr && { cat stderr >&2; Exit 1; }
+    cat stderr >&2
+    $FGREP AC_PACKAGE_VERSION stderr && Exit 1
+    grep 'configure\.in:.* AC_INIT .*arguments' stderr
+  done
+done
 
-# The error message should mension AC_INIT, not AC_PACKAGE_VERSION.
-($ACLOCAL && $AUTOCONF) 2>stderr && { cat stderr >&2; Exit 1; }
-cat stderr >&2
-grep AC_PACKAGE_VERSION stderr && Exit 1
-grep AC_INIT stderr
+:
index c64f1f7..c3da9a9 100755 (executable)
@@ -1,6 +1,6 @@
 #! /bin/sh
-# Copyright (C) 1996, 1997, 1998, 2000, 2001, 2002, 2003
-# Free Software Foundation, Inc.
+# Copyright (C) 1996, 1997, 1998, 2000, 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
 
 . ./defs || Exit 1
 
+set -e
+
 cat > Makefile.am << 'END'
 pkgdata_DATA =
 magic:
        @echo $(DISTFILES)
 END
 
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
 
 $FGREP -v @SET_MAKE@ Makefile.in > Makefile.sed
 $MAKE -s -f Makefile.sed SHELL=$SHELL magic | grep install-sh
+
+:
index a6ec01a..d5b4d07 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 1998, 2001, 2002  Free Software Foundation, Inc.
+# Copyright (C) 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
 
 . ./defs || Exit 1
 
-echo 'AC_SUBST(INSTALL_DATA)' >> configure.in
+set -e
+
+cat >> configure.in <<END
+AC_SUBST([INSTALL_DATA])
+END
 
 : > Makefile.am
 
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
 
-(grep '^DATA =' Makefile.in | grep INSTALL_DATA) && Exit 1
+grep '^DATA =' Makefile.in | grep 'INSTALL_DATA' && Exit 1
 Exit 0
index 77844fa..c519214 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2000, 2001, 2002  Free Software Foundation, Inc.
+# Copyright (C) 2000, 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
 
 . ./defs || Exit 1
 
+set -e
+
 cat > Makefile.am << 'EOF'
 man8_MANS = frob.8
 EOF
 
 : > frob.8
 
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
 
 grep '^install-man' Makefile.in
+
+:
diff --git a/tests/instspc-tests.sh b/tests/instspc-tests.sh
new file mode 100755 (executable)
index 0000000..90087eb
--- /dev/null
@@ -0,0 +1,301 @@
+#! /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/>.
+
+#
+# Driver script to generate and run tests checking that building from,
+# or installing to, directories with shell metacharacters succeed.
+#
+# Original report from James Amundson about file names with spaces.
+# Other characters added by Paul Eggert.
+#
+# This script fulfills a double role:
+#   1. It generates a Makefile.am snippet, containing the definition
+#      of proper lists of tests.
+#   2. It is sourced by said generated tests with proper parameters
+#      pre-set, to run the "meat" of the checks.
+# This setup might seem tricky and over-engineered abuse, but past
+# (painful) experiences showed that it is indeed required, because
+# the test generation code and test execution code tend to be
+# inextricably coupled and intertwined.
+#
+
+# Be more Bourne compatible (snippet copied from `tests/defs.in').
+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
+
+set -e
+
+# Sanity and usage checks.
+if test x"$instspc_action" = x; then
+  if test "$#,$1" = "1,--generate-makefile"; then
+    instspc_action=generate-makefile
+  else
+    echo "$0: empty action and no proper command line" >&2
+    exit 99
+  fi
+elif test $# -gt 0; then
+  echo "$0: action specified and command line arguments used" >&2
+  exit 99
+elif test x"$instspc_action" = x"generate-makefile"; then
+  :
+else
+  case $instspc_action in
+    test-build|test-install)
+      if test x"$instspc_test_name" = x; then
+        echo "$0: test name undefined for action '$instspc_action'" >&2
+        exit 99
+      fi;;
+    *)
+      echo "$0: invalid action: '$instspc_action'"
+      exit 99;;
+  esac
+fi
+
+# Helper subroutine for test data definition.
+# Usage: define_problematic_string NAME STRING
+define_problematic_string ()
+{
+  tst=$1
+  shift
+  eval "instspc__$tst=\$1" || exit 99
+  shift
+  instspc_names_list="$instspc_names_list $tst"
+  # Some of the "problematic" characters cannot be used in the name of
+  # a build or install directory on a POSIX host.  These lists should
+  # be empty, but are not due to limitations in Autoconf, Automake, Make,
+  # M4, or the shell.
+  case " $* " in *' fail-build '*|*' build-fail '*)
+    instspc_xfail_builds_list="$instspc_xfail_builds_list $tst";;
+  esac
+  case " $* " in *' fail-install '*|*' install-fail '*)
+    instspc_xfail_installs_list="$instspc_xfail_installs_list $tst";;
+  esac
+}
+
+# Be sure to avoid interferences from the environment.
+instspc_names_list=''
+instspc_xfail_builds_list=''
+instspc_xfail_installs_list=''
+
+
+# ================= #
+#  Test data begin  #
+# ----------------- #
+
+# Some control characters that are white space.
+bs='\b'   # back space
+cr='\r'   # carriage return
+ff='\f'   # form feed
+ht='   ' # horizontal tab
+lf='
+'         # line feed (aka newline)
+
+# Hack to save typing and make code visually clearer.
+def=define_problematic_string
+
+$def    squote          \'          fail-build  fail-install
+$def    dquote          '"'         fail-build  fail-install
+$def    bquote          '`'         fail-build  fail-install
+$def    sharp           '#'         fail-build  fail-install
+$def    dollar          '$'         fail-build  fail-install
+$def    bang            '!'
+$def    bslash          '\'         fail-build
+$def    ampersand       '&'         fail-build
+$def    percent         '%'
+$def    leftpar         '('
+$def    rightpar        ')'
+$def    pipe            '|'
+$def    caret           '^'
+$def    tilde           '~'
+$def    qmark           '?'
+$def    star            '*'
+$def    plus            '+'
+$def    minus           '-'
+$def    comma           ','
+$def    colon           ':'
+$def    semicol         ';'
+$def    equal           '='
+$def    less            '<'
+$def    more            '>'
+$def    at              '@'
+$def    lqbrack         '['
+$def    rqbrack         ']'
+$def    lcbrack         '{'
+$def    rcbrack         '}'
+$def    space           ' '
+$def    tab             "$ht"
+$def    linefeed        "$lf"       fail-build  fail-install
+$def    backspace       "$bs"
+$def    formfeed        "$ff"
+$def    carriageret     "$cr"
+$def    quadrigraph0    '@&t@'      fail-build
+$def    quadrigraph1    '@<:@'
+$def    quadrigraph2    '@:>@'
+$def    quadrigraph3    '@S|@'
+$def    quadrigraph4    '@%:@'
+$def    a_b             'a b'
+$def    a__b            'a  b'
+$def    a_lf_b          "a${lf}b"   fail-build  fail-install
+$def    dotdotdot       '...'
+$def    dosdrive        'a:'
+$def    miscglob1       '?[a-z]*'
+$def    miscglob2       '.*?[0-9]'
+
+unset def
+
+# --------------- #
+#  Test data end  #
+# =============== #
+
+
+if test x"$instspc_action" = x"generate-makefile"; then
+  # We must generate a makefile fragment on stdout.  It must refer
+  # to all tests at once, hence the loop below.
+  echo '## Generated by instspc-tests.sh.  DO NOT EDIT!'
+  echo 'instspc_tests ='
+  echo 'instspc_xfail_tests ='
+  for test_name in $instspc_names_list; do
+    echo "instspc_tests += instspc-$test_name-build.test"
+    echo "instspc_tests += instspc-$test_name-install.test"
+  done
+  for test_name in $instspc_xfail_builds_list; do
+    echo "instspc_xfail_tests += instspc-$test_name-build.test"
+  done
+  for test_name in $instspc_xfail_installs_list; do
+    echo "instspc_xfail_tests += instspc-$test_name-install.test"
+  done
+  exit 0
+fi
+
+###  If we are still here, we have to run a test ...
+
+# We'll need the full setup provided by `tests/defs'.  Temporarly disable
+# the errexit flag, since the setup code might not be prepared to deal
+# with it.
+set +e
+. ./defs || Exit 99
+set -e
+
+eval "instspc_test_string=\${instspc__$instspc_test_name}" || Exit 99
+if test x"$instspc_test_string" = x; then
+  echo "$me: invalid test name: '$instspc_test_name'" >&2
+  Exit 99
+fi
+
+# Skip if this system doesn't support these characters in file names.
+mkdir "./$instspc_test_string" || Exit 77
+
+mkdir sub sub1
+
+cat >> configure.in << 'EOF'
+AC_PROG_CC
+AC_PROG_RANLIB
+AC_OUTPUT
+EOF
+
+: > sub/base.h
+: > sub/nobase.h
+: > sub/base.dat
+: > sub/nobase.dat
+: > sub/base.sh
+: > sub/nobase.sh
+
+cat > source.c << 'EOF'
+int
+main (int argc, char **argv)
+{
+  return 0;
+}
+EOF
+cp source.c source2.c
+
+cat > Makefile.am << 'EOF'
+foodir = $(prefix)/foo
+fooexecdir = $(prefix)/foo
+
+foo_HEADERS = sub/base.h
+nobase_foo_HEADERS = sub/nobase.h
+
+dist_foo_DATA = sub/base.dat
+nobase_dist_foo_DATA = sub/nobase.dat
+
+dist_fooexec_SCRIPTS = sub/base.sh
+nobase_dist_fooexec_SCRIPTS = sub/nobase.sh
+
+fooexec_PROGRAMS = sub/base
+nobase_fooexec_PROGRAMS = sub/nobase
+sub_base_SOURCES = source.c
+sub_nobase_SOURCES = source.c
+
+fooexec_LIBRARIES = sub/libbase.a
+nobase_fooexec_LIBRARIES = sub/libnobase.a
+sub_libbase_a_SOURCES = source.c
+sub_libnobase_a_SOURCES = source.c
+
+.PHONY: test-install-sep
+test-install-sep: install
+       test   -f '$(DESTDIR)/$(file)-prefix/foo/sub/nobase.h'
+       test ! -f '$(DESTDIR)/$(file)-prefix/foo/nobase.h'
+       test   -f '$(DESTDIR)/$(file)-prefix/foo/base.h'
+       test   -f '$(DESTDIR)/$(file)-prefix/foo/sub/nobase.dat'
+       test ! -f '$(DESTDIR)/$(file)-prefix/foo/nobase.dat'
+       test   -f '$(DESTDIR)/$(file)-prefix/foo/base.dat'
+       test   -f '$(DESTDIR)/$(file)-prefix/foo/sub/nobase.sh'
+       test ! -f '$(DESTDIR)/$(file)-prefix/foo/nobase.sh'
+       test   -f '$(DESTDIR)/$(file)-prefix/foo/base.sh'
+       test   -f '$(DESTDIR)/$(file)-prefix/foo/sub/nobase$(EXEEXT)'
+       test ! -f '$(DESTDIR)/$(file)-prefix/foo/nobase$(EXEEXT)'
+       test   -f '$(DESTDIR)/$(file)-prefix/foo/base$(EXEEXT)'
+       test   -f '$(DESTDIR)/$(file)-prefix/foo/sub/libnobase.a'
+       test ! -f '$(DESTDIR)/$(file)-prefix/foo/libnobase.a'
+       test   -f '$(DESTDIR)/$(file)-prefix/foo/libbase.a'
+EOF
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
+
+case $instspc_action in
+  test-build)
+    build=$instspc_test_string
+    dest=`pwd`/sub1
+    ;;
+  test-install)
+    build=sub1
+    dest=`pwd`/$instspc_test_string
+    ;;
+  *)
+    echo "$me: internal error: invalid action '$instspc_action'"
+    Exit 99
+    ;;
+esac
+
+cd "./$build"
+
+../configure --prefix "/$instspc_test_string-prefix"
+$MAKE
+DESTDIR="$dest" file="$instspc_test_string" $MAKE -e test-install-sep
+
+:
diff --git a/tests/instspc.test b/tests/instspc.test
deleted file mode 100755 (executable)
index 414b3e5..0000000
+++ /dev/null
@@ -1,187 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2004, 2005  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 installation to directory with shell metacharacters succeed.
-# Original report from James Amundson about file names with spaces.
-# Other characters added by Paul Eggert.
-
-# This is mostly the same input as nobase.test, but we do not use
-# libtool libraries, because Libtool does not preserve space in
-# file names (Issue observed with ltmain.sh (GNU libtool) 1.5a (1.1323
-# 2003/11/10 21:06:47))
-
-
-required='gcc'
-. ./defs || Exit 1
-
-set -e
-
-# Set up files that won't change each time through the loop.
-
-cat >> configure.in <<'EOF'
-AC_PROG_CC
-AC_PROG_RANLIB
-AC_OUTPUT
-EOF
-
-mkdir sub
-
-: > sub/base.h
-: > sub/nobase.h
-: > sub/base.dat
-: > sub/nobase.dat
-: > sub/base.sh
-: > sub/nobase.sh
-
-cat >source.c <<'EOF'
-int
-main (int argc, char **argv)
-{
-  return 0;
-}
-EOF
-cp source.c source2.c
-
-cat > Makefile.am << 'EOF'
-foodir = $(prefix)/foo
-fooexecdir = $(prefix)/foo
-
-foo_HEADERS = sub/base.h
-nobase_foo_HEADERS = sub/nobase.h
-
-dist_foo_DATA = sub/base.dat
-nobase_dist_foo_DATA = sub/nobase.dat
-
-dist_fooexec_SCRIPTS = sub/base.sh
-nobase_dist_fooexec_SCRIPTS = sub/nobase.sh
-
-fooexec_PROGRAMS = sub/base
-nobase_fooexec_PROGRAMS = sub/nobase
-sub_base_SOURCES = source.c
-sub_nobase_SOURCES = source.c
-
-fooexec_LIBRARIES = sub/libbase.a
-nobase_fooexec_LIBRARIES = sub/libnobase.a
-sub_libbase_a_SOURCES = source.c
-sub_libnobase_a_SOURCES = source.c
-
-test-install-sep: install
-       test   -f '$(DESTDIR)/$(file)-prefix/foo/sub/nobase.h'
-       test ! -f '$(DESTDIR)/$(file)-prefix/foo/nobase.h'
-       test   -f '$(DESTDIR)/$(file)-prefix/foo/base.h'
-       test   -f '$(DESTDIR)/$(file)-prefix/foo/sub/nobase.dat'
-       test ! -f '$(DESTDIR)/$(file)-prefix/foo/nobase.dat'
-       test   -f '$(DESTDIR)/$(file)-prefix/foo/base.dat'
-       test   -f '$(DESTDIR)/$(file)-prefix/foo/sub/nobase.sh'
-       test ! -f '$(DESTDIR)/$(file)-prefix/foo/nobase.sh'
-       test   -f '$(DESTDIR)/$(file)-prefix/foo/base.sh'
-       test   -f '$(DESTDIR)/$(file)-prefix/foo/sub/nobase$(EXEEXT)'
-       test ! -f '$(DESTDIR)/$(file)-prefix/foo/nobase$(EXEEXT)'
-       test   -f '$(DESTDIR)/$(file)-prefix/foo/base$(EXEEXT)'
-       test   -f '$(DESTDIR)/$(file)-prefix/foo/sub/libnobase.a'
-       test ! -f '$(DESTDIR)/$(file)-prefix/foo/libnobase.a'
-       test   -f '$(DESTDIR)/$(file)-prefix/foo/libbase.a'
-EOF
-
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE -a
-
-# Some control characters that are white space:
-# back space, carriage return, form feed, horizontal tab, line feed, space
-bs='\b'
-cr='\r'
-ff='\f'
-ht='   '
-lf='
-'
-sp=' '
-
-build_failures=
-install_failures=
-
-for file in \
-  '!' '"' '#' '$' '%' '&' \' '(' ')' '*' '+' ',' '-' ':' ';' \
-  '<' '=' '>' '?' '@' '[' '\' ']' '^' '`' '{' '|' '}' '~' \
-  "$bs" "$cr" "$ff" "$ht" "$lf" "$sp" \
-  '@<:@' '@:>@' '@S|@' '@%:@' '@&t@' \
-  "a${sp}b" "a${sp}${sp}b" "a${lf}b" ... a:
-do
-  for test in build install; do
-    case $test in
-    build)
-      build=$file
-      dest=`pwd`/sub1;;
-    install)
-      build=sub1
-      dest=`pwd`/$file;;
-    esac
-
-    # Make sure this system supports this character in file names.
-    mkdir sub1 "./$file" || Exit 77
-
-    cd "$build"
-
-    ../configure --prefix "/$file-prefix" &&
-    $MAKE &&
-    DESTDIR=$dest file=$file $MAKE -e test-install-sep ||
-      eval "${test}_failures=\"\$${test}_failures$lf\$file\""
-
-    cd ..
-
-    rm -fr sub1 "./$file"
-  done
-done
-
-# The list of the above file names that cannot be used as a build directory
-# on a POSIX host.  This list should be empty, but is not due to limitations
-# in Autoconf, Automake, Make, M4, or the shell.
-expected_build_failures='
-"
-#
-$
-&
-'\''
-\
-`
-'"$lf"'
-@&t@
-a'"${lf}"'b'
-
-# Similarly, the list of file names that cannot be used as an install directory
-# on a POSIX host.  This list should also be empty.
-expected_install_failures='
-"
-#
-$
-'\''
-`
-'"$lf"'
-a'"${lf}"'b'
-
-fail=0
-for test in build install; do
-  eval failures=\$${test}_failures
-  case $failures in
-  ?*)
-    cat >&2 <<EOF
-$0: $test test failed for the following file names:$failures
-EOF
-    eval test \"\$failures\" = \"\$expected_${test}_failures\" || fail=1
-  esac
-done
-
-Exit $fail
index af82e33..82938f9 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 1996, 2001, 2002  Free Software Foundation, Inc.
+# Copyright (C) 1996, 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 +18,8 @@
 
 . ./defs || Exit 1
 
+set -e
+
 cat >> configure.in << 'END'
 AC_PROG_CC
 END
@@ -28,7 +30,9 @@ s1 = z.c
 qqq_SOURCES = $(s1)
 END
 
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
 
 $FGREP 'z.$(OBJEXT)' Makefile.in
+
+:
index cff8d1d..a25d531 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 1996, 2001, 2002  Free Software Foundation, Inc.
+# Copyright (C) 1996, 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
@@ -19,6 +19,8 @@
 
 . ./defs || Exit 1
 
+set -e
+
 cat >> configure.in << 'END'
 AC_PROG_CC
 AC_PATH_X
@@ -31,5 +33,7 @@ x_SOURCES = x.c
 x_LDADD = $(X_EXTRA_LIBS)
 END
 
-$ACLOCAL || Exit 1
+$ACLOCAL
 $AUTOMAKE
+
+:
index aa1506b..988024d 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 1998, 2001, 2002  Free Software Foundation, Inc.
+# Copyright (C) 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
 
 . ./defs || Exit 1
 
-echo 'AC_SUBST(JAVA)' >> configure.in
+set -e
+
+cat >> configure.in << 'END'
+AC_SUBST([JAVA])
+END
 
 cat > Makefile.am << 'END'
 javadir = $(datadir)/java
 java_JAVA = a.java b.java c.java
 END
 
-$ACLOCAL || Exit 1
+$ACLOCAL
 $AUTOMAKE
+
+:
index d018645..ae6bb78 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 1998, 2001, 2002  Free Software Foundation, Inc.
+# Copyright (C) 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
 
 . ./defs || Exit 1
 
-echo 'AC_SUBST(JAVAC)' >> configure.in
+set -e
+
+cat >> configure.in << 'END'
+AC_SUBST([JAVAC])
+END
 
 cat > Makefile.am << 'END'
 javadir = $(datadir)/java
 java_JAVA = a.java b.java c.java
 END
 
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
 
 grep 'JAVAC.*@JAVAC@' Makefile.in
+
+:
index 39ca274..d078eaa 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2000, 2001, 2002  Free Software Foundation, Inc.
+# Copyright (C) 2000, 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
 
 # Check for LDFLAGS in conditional.
 # PR 77.
+
 required=libtool
 . ./defs || Exit 1
 
+set -e
+
 cat >> configure.in << 'END'
 AC_PROG_CC
 AC_PROG_LIBTOOL
 AC_SUBST([LTLIBOBJS], [q.o])
-AM_CONDITIONAL(USE_SWIG, :)
+AM_CONDITIONAL([USE_SWIG], [:])
 AC_OUTPUT
 END
 
@@ -41,5 +44,7 @@ END
 : > config.sub
 : > q.c
 
-$ACLOCAL || Exit 1
+$ACLOCAL
 $AUTOMAKE
+
+:
index c59c4e3..c671bde 100755 (executable)
@@ -29,19 +29,14 @@ zot_SOURCES = joe.l
 LDADD = @LEXLIB@
 END
 
-: > joe.l
-
 $ACLOCAL
 $AUTOMAKE -a
 
-
 # Test to make sure that lex source generates correct target.
-
 $FGREP '$(LEX)' Makefile.in
 
 # Test to make sure that lex source generates correct clean rule.
 # From Ralf Corsepius.
-
 $FGREP joel Makefile.in && Exit 1
 
 :
index d588edf..d7499e1 100755 (executable)
@@ -29,8 +29,9 @@ bin_PROGRAMS = zot
 zot_SOURCES = joe.l
 END
 
-: > joe.l
-
 $ACLOCAL
-AUTOMAKE_fails
-grep AM_PROG_LEX stderr
+AUTOMAKE_fails -a
+grep 'LEX.* undefined' stderr
+grep 'add .*AM_PROG_LEX' stderr
+
+:
index c4120cf..e2b01d8 100755 (executable)
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+# Basic semantic checks on Lex support.
 # Test associated with PR 19.
 # From Matthew D. Langston.
 
 required='gcc flex GNUmake'
 . ./defs || Exit 1
 
+set -e
+
 # Ignore user CFLAGS.
 CFLAGS=
 export CFLAGS
 
-cat > configure.in << 'END'
-AC_INIT
-dnl Prevent automake from looking in .. and ../..
-AC_CONFIG_AUX_DIR(.)
-AM_INIT_AUTOMAKE(am_lex_bug, 0.1.1)
+distdir=$me-1.0
 
-dnl Checks for programs.
+cat >> configure.in << 'END'
 AC_PROG_CC
 AM_PROG_LEX
-AC_PROG_YACC
-AC_OUTPUT(Makefile)
+AC_OUTPUT
 END
 
 cat > Makefile.am << 'END'
@@ -46,38 +44,46 @@ END
 
 cat > foo.l << 'END'
 %%
-"END"   return EOF;
+"GOOD"   return EOF;
 .
 %%
 int
 main ()
 {
-  while (yylex () != EOF)
-    ;
-
-  return 0;
+  /* We don't use a 'while' loop here (like a real lexer would do)
+     to avoid possible hangs. */
+  if (yylex () == EOF)
+    return 0;
+  else
+    return 1;
 }
 END
 
-set -e
-
 $ACLOCAL
 $AUTOCONF
 $AUTOMAKE -a
+
 ./configure
+
+# Program should build and run.
 $MAKE
-echo 'This is the END' | ./foo
-$MAKE distcheck
+echo GOOD | ./foo
+echo BAD | ./foo && Exit 1
+
+# The generated file `foo.c' must be shipped.
+$MAKE distdir
+test -f $distdir/foo.c
 
-# foo.c must be shipped.
-gunzip am_lex_bug-0.1.1.tar.gz
-tar tf am_lex_bug-0.1.1.tar | $FGREP foo.c
+# Sanity check on distribution.
+$MAKE distcheck
 
 # While we are at it, make sure that foo.c is erased by
 # maintainer-clean, and not by distclean.
 test -f foo.c
 $MAKE distclean
 test -f foo.c
-./configure
+./configure # we must re-create `Makefile'
 $MAKE maintainer-clean
 test ! -f foo.c
+
+:
index fee140d..b171160 100755 (executable)
@@ -1,5 +1,6 @@
 #! /bin/sh
-# Copyright (C) 1999, 2001, 2002, 2006  Free Software Foundation, Inc.
+# Copyright (C) 1999, 2001, 2002, 2006, 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
@@ -32,9 +33,9 @@ bin_PROGRAMS = zoo
 zoo_SOURCES = joe.ll
 END
 
-: > joe.ll
-
 $ACLOCAL
 $AUTOMAKE -a
 
 $FGREP joe.Po Makefile.in
+
+:
index 88924b2..5c688d7 100755 (executable)
@@ -21,11 +21,7 @@ required='gcc GNUmake flex'
 
 set -e
 
-cat > configure.in << 'END'
-AC_INIT([lex5], [1.0])
-AC_CONFIG_AUX_DIR([.])
-AM_INIT_AUTOMAKE
-AC_CONFIG_FILES([Makefile])
+cat >> configure.in << 'END'
 AC_PROG_CC
 AM_PROG_CC_C_O
 AM_PROG_LEX
@@ -57,8 +53,6 @@ main ()
 }
 END
 
-set -e
-
 $ACLOCAL
 $AUTOCONF
 $AUTOMAKE -a
@@ -96,4 +90,4 @@ $MAKE foo/foo2.o
 test -f foo/foo2.c
 test -f foo/foo2.o
 
-Exit 0
+:
diff --git a/tests/lexcpp.test b/tests/lexcpp.test
new file mode 100755 (executable)
index 0000000..b95b5f1
--- /dev/null
@@ -0,0 +1,46 @@
+#! /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/>.
+
+# Test to make sure Lex + C++ is supported.
+# Please keep this is sync with sister test yaccpp.test.
+
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_PROG_CXX
+AC_PROG_LEX
+END
+
+cat > Makefile.am << 'END'
+bin_PROGRAMS = foo bar baz qux
+foo_SOURCES = foo.l++
+bar_SOURCES = bar.lpp
+baz_SOURCES = baz.ll
+qux_SOURCES = qux.lxx
+END
+
+$ACLOCAL
+$AUTOMAKE -a
+
+sed -e 's/^/ /' -e 's/$/ /' Makefile.in >mk
+$FGREP ' foo.c++ ' mk
+$FGREP ' bar.cpp ' mk
+$FGREP ' baz.cc '  mk
+$FGREP ' qux.cxx ' mk
+
+:
diff --git a/tests/lexvpath.test b/tests/lexvpath.test
new file mode 100755 (executable)
index 0000000..378795e
--- /dev/null
@@ -0,0 +1,115 @@
+#! /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/>.
+
+# This test checks that dependent files are updated before including
+# in the distribution.  `lexer.c' depends on `lexer.l'.  The latter is
+# updated so that `lexer.c' should be rebuild.  Then we are running
+# `make' and `make distdir' and check whether the version of `lexer.c'
+# to be distributed is up to date.
+
+# Please keep this in sync with sister test `yaccvapth.test'.
+
+required='gcc flex'
+. ./defs || Exit 1
+
+set -e
+
+distdir=$me-1.0
+
+cat > lexoutroot.in << 'END'
+LEX_OUTPUT_ROOT='@LEX_OUTPUT_ROOT@'
+END
+
+cat >> configure.in << 'END'
+AC_CONFIG_FILES([lexoutroot])
+AC_PROG_CC
+AC_PROG_LEX
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+bin_PROGRAMS = foo
+foo_SOURCES = lexer.l foo.c
+LDADD = $(LEXLIB)
+END
+
+# Original lexer, with a "foobar" comment
+cat > lexer.l << 'END'
+%%
+"END" return EOF;
+.
+%%
+/*foobar*/
+END
+
+cat > foo.c << 'END'
+int main () { return 0; }
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
+
+mkdir sub
+
+# We must run configure early, to find out whay $LEX_OUTPUT_ROOT is.
+cd sub
+../configure
+. ./lexoutroot
+test -n "$LEX_OUTPUT_ROOT" # sanity check
+cd ..
+
+flex lexer.l
+mv "$LEX_OUTPUT_ROOT".c lexer.c
+
+cd sub
+
+# Ensure that lexer.l will be newer than lexer.c.
+$sleep
+
+# New lexer, with `fubar' comment.
+cat > ../lexer.l << 'END'
+%%
+"END" return EOF;
+.
+%%
+/*fubar*/
+END
+
+$MAKE
+$MAKE distdir
+$FGREP '/*fubar*/' $distdir/lexer.c
+
+#
+# Now check to make sure that `make dist' will rebuilt the parser.
+#
+
+# Ensure that lexer.l will be newer than lexer.c.
+$sleep
+
+# New lexer, with `maude' comment.
+cat > ../lexer.l << 'END'
+%%
+"END" return EOF;
+.
+%%
+/*maude*/
+END
+
+$MAKE distdir
+$FGREP '/*maude*/' $distdir/lexer.c
+
+:
diff --git a/tests/libobj-basic.test b/tests/libobj-basic.test
new file mode 100755 (executable)
index 0000000..64b9c2b
--- /dev/null
@@ -0,0 +1,110 @@
+#! /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 AC_LIBSOURCE and AC_LIBSOURCES work.
+
+. ./defs || Exit 1
+
+set -e
+
+mv configure.in configure.proto
+cat >> configure.proto << 'END'
+AC_PROG_CC
+AC_PROG_RANLIB
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+noinst_LIBRARIES = libtu.a
+libtu_a_SOURCES = foo.c
+libtu_a_LIBADD = $(LIBOBJS)
+
+include extra-checks.am
+.PHONY: $(extra_checks) pre-test
+
+pre-test: distdir
+       ls -l $(srcdir) $(builddir) $(distdir)
+       $(AR) tv libtu.a
+$(extra_checks): pre-test
+check-local: $(extra_checks)
+
+maude-src:
+       grep dummy_maude $(srcdir)/maude.c
+maude-dist:
+       grep dummy_maude $(distdir)/maude.c
+liver-src:
+       grep dummy_liver $(srcdir)/liver.c
+liver-dist:
+       grep dummy_liver $(distdir)/liver.c
+liver-not-dist:
+       test -d $(distdir)
+       test ! -r $(distdir)/liver.c
+maude-not-dist:
+       test -d $(distdir)
+       test ! -r $(distdir)/maude.c
+END
+
+cat > foo.c << 'END'
+extern int dummy_foo;
+END
+
+cat > maude.c << 'END'
+extern int dummy_maude;
+END
+
+cat > liver.c << 'END'
+extern int dummy_liver;
+END
+
+# AC_LIBSOURCE should work also if called after AC_OUTPUT.
+cat configure.proto - > configure.in <<END
+AC_LIBSOURCE([maude.c])
+END
+
+cat > extra-checks.am << 'END'
+extra_checks = maude-src maude-dist liver-not-dist
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+./configure
+
+$MAKE check
+$MAKE distcheck
+
+$MAKE distclean
+# Avoid timestamp-related differences.
+rm -rf autom4te*.cache
+
+cat > extra-checks.am << 'END'
+extra_checks = maude-src maude-dist liver-src liver-dist
+END
+
+# AC_LIBSOURCES should work also if called after AC_OUTPUT.
+cat configure.proto - > configure.in <<END
+AC_LIBSOURCES([maude.c, liver.c])
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+./configure
+
+$MAKE check
+$MAKE distcheck
+
+:
index 0d24741..7897351 100755 (executable)
@@ -1,5 +1,6 @@
 #! /bin/sh
-# Copyright (C) 1999, 2000, 2001, 2002, 2003  Free Software Foundation, Inc.
+# Copyright (C) 1999, 2000, 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
@@ -30,13 +31,22 @@ END
 
 cat > Makefile.am << 'END'
 noinst_LIBRARIES = libfoo.a
-libfoo_a_LIBADD = @LIBOBJS@
+libfoo_a_SOURCES =
+libfoo_a_LIBADD = $(LIBOBJS)
+BUILT_SOURCES = foo.c
+CLEANFILES = foo.c
+foo.c:
+       echo 'extern int dummy;' > $@
 END
 
 $ACLOCAL
-AUTOMAKE_fails
-grep 'Makefile.am:2:.*foo\.c' stderr
+$AUTOCONF
+$AUTOMAKE
 
-echo 'BUILT_SOURCES = foo.c' >> Makefile.am
+./configure
 
-$AUTOMAKE
+$MAKE
+ar t libfoo.a # for debugging
+$MAKE distcheck
+
+:
index 5f1d029..747d7a0 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2002, 2003  Free Software Foundation, Inc.
+# Copyright (C) 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
 # 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 if a file can be mentioned in LIBOBJS and explicitly.
 # (See libobj13.test for the LTLIBRARIES check.)
 
 . ./defs || Exit 1
+
 set -e
 
 cat >> configure.in << 'END'
@@ -48,22 +48,30 @@ END
 : > bar.c
 
 $ACLOCAL
-$AUTOMAKE
 
 # This however should be diagnosed, since foo.c and bar.c are in @LIBOBJS@.
-echo 'libfoo_a_SOURCES += foo.c' >> Makefile.am
-echo 'p1_SOURCES += bar.c' >> Makefile.am
+cat >> Makefile.am << 'END'
+libfoo_a_SOURCES += foo.c
+p1_SOURCES += bar.c
+END
+
 AUTOMAKE_fails
-$FGREP foo.c stderr
-$FGREP bar.c stderr
+grep 'foo\.c.*explicitly mentioned' stderr
+grep 'bar\.c.*explicitly mentioned' stderr
 
 # Global `LDADD' can also come into play.
 cat > Makefile.am << 'END'
 noinst_PROGRAMS = a b
 LDADD = @LIBOBJS@
 END
+
 $AUTOMAKE
 grep 'a_DEPENDENCIES.*LIBOBJS' Makefile.in
-echo 'a_SOURCES = foo.c' >> Makefile.am
+
+cat >> Makefile.am << 'END'
+a_SOURCES = foo.c
+END
 AUTOMAKE_fails
-$FGREP foo.c stderr
+grep 'foo\.c.*explicitly mentioned' stderr
+
+:
index 6ca68c9..6d1e68d 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2002, 2003  Free Software Foundation, Inc.
+# Copyright (C) 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
 # 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 if a file can be mentioned in LTLIBOBJS and explicitly.
 # (Like libobj12.test, but for Libtool libraries.)
 
 required='libtoolize'
 . ./defs || Exit 1
+
 set -e
 
 cat >> configure.in << 'END'
@@ -47,4 +47,6 @@ $AUTOMAKE --add-missing
 # This however should be diagnosed, since foo.c is in @LIBOBJS@.
 echo 'libfoo_la_SOURCES += foo.c' >> Makefile.am
 AUTOMAKE_fails
-$FGREP foo.c stderr
+grep 'foo\.c.*explicitly mentioned' stderr
+
+:
index ed20703..08841c3 100755 (executable)
 # Report from Bill Davidson
 
 required=gcc
-. ./defs
+. ./defs || Exit 1
 
 set -e
 
 cat >>configure.in <<'EOF'
 AC_PROG_CC
 AC_LIBSOURCE([bar.c])
-AM_CONDITIONAL([CASE], :)
+AM_CONDITIONAL([CASE], [:])
 AC_OUTPUT
 EOF
 
@@ -43,3 +43,5 @@ EOF
 
 $ACLOCAL
 $AUTOMAKE
+
+:
similarity index 71%
rename from tests/libobj11.test
rename to tests/libobj15a.test
index 204ff8b..51da834 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2002, 2008  Free Software Foundation, Inc.
+# 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
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# AC_LIBOBJ must allow [] around its argument.
+# Nonexistent sources for AC_LIBOBJ should cause an Automake failure.
 
 . ./defs || Exit 1
 
-cat > configure.in << 'END'
-AC_INIT
-AM_INIT_AUTOMAKE(nonesuch, nonesuch)
+set -e
+
+cat >> configure.in << 'END'
 AC_PROG_CC
 AC_PROG_RANLIB
-AC_LIBOBJ([mountlist])
-AC_OUTPUT(Makefile)
+AC_LIBOBJ([foobar])
 END
 
 cat > Makefile.am << 'END'
 noinst_LIBRARIES = libtu.a
 libtu_a_SOURCES =
-libtu_a_LIBADD = @LIBOBJS@
+libtu_a_LIBADD = $(LIBOBJS)
 END
 
-: > mountlist.c
+$ACLOCAL
+AUTOMAKE_fails
+grep 'configure\.in:.*required file.*foobar\.c.*' stderr
 
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+:
similarity index 68%
rename from tests/aclibobj.test
rename to tests/libobj15b.test
index 6ef6f6b..3816602 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2001, 2002, 2003, 2008  Free Software Foundation, Inc.
+# 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
 # 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 AC_LIBOBJ and friends work.
+# Nonexistent source for AC_LIBSOURCE should cause Automake to fail.
 
 . ./defs || Exit 1
 
+set -e
+
 cat >> configure.in << 'END'
 AC_PROG_CC
 AC_PROG_RANLIB
+AC_LIBSOURCE([foobar.c])
+# NOTE: this call to AC_OUTPUT is really needed; see Automake bug #7635
+#       <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=7635>
 AC_OUTPUT
 END
 
 cat > Makefile.am << 'END'
 noinst_LIBRARIES = libtu.a
 libtu_a_SOURCES =
-libtu_a_LIBADD = @LIBOBJS@
+libtu_a_LIBADD = $(LIBOBJS)
 END
 
-: > maude.c
-: > liver.c
-
 $ACLOCAL
+AUTOMAKE_fails
+grep 'configure\.in:.*required file.*foobar\.c.*' stderr
 
-set -e
-
-cp configure.in X
-echo 'AC_LIBSOURCE(maude.c)' >> configure.in
-$AUTOMAKE
-
-# Avoid timestamp-related differences.
-rm -rf autom4te.cache
-
-cp X configure.in
-echo 'AC_LIBSOURCES([maude.c, liver.c])' >> configure.in
-$AUTOMAKE
+:
diff --git a/tests/libobj15c.test b/tests/libobj15c.test
new file mode 100755 (executable)
index 0000000..29e0aa7
--- /dev/null
@@ -0,0 +1,49 @@
+#! /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/>.
+
+# Nonexistent sources for AC_LIBSOURCES should cause Automake to fail.
+
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_PROG_CC
+AC_PROG_RANLIB
+AC_LIBSOURCES([foobar.c, bazquux.c])
+# NOTE: this call to AC_OUTPUT is really needed; see Automake bug #7635
+#       <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=7635>
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+noinst_LIBRARIES = libtu.a
+libtu_a_SOURCES =
+libtu_a_LIBADD = $(LIBOBJS)
+END
+
+$ACLOCAL
+
+AUTOMAKE_fails
+grep 'configure\.in:.*required file.*foobar\.c.*' stderr
+grep 'configure\.in:.*required file.*bazquux\.c.*' stderr
+
+: > foobar.c
+AUTOMAKE_fails
+grep 'configure\.in:.*required file.*bazquux\.c.*' stderr
+grep 'foobar\.c' stderr && Exit 1
+
+:
diff --git a/tests/libobj16a.test b/tests/libobj16a.test
new file mode 100755 (executable)
index 0000000..a673819
--- /dev/null
@@ -0,0 +1,139 @@
+#! /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 AC_LIBOBJ and friends work.
+# Please keep this in sync with sister test `libobj16b.test'.
+
+. ./defs || Exit 1
+
+set -e
+
+mv configure.in configure.proto
+cat >> configure.proto << 'END'
+AC_PROG_CC
+AC_PROG_RANLIB
+%LIBOBJ-STUFF% # will be activated later
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+noinst_LIBRARIES = libtu.a
+libtu_a_SOURCES =
+libtu_a_LIBADD = $(LIBOBJS)
+
+include extra-checks.am
+.PHONY: $(extra_checks) pre-test
+
+pre-test: distdir
+       ls -l $(srcdir) $(builddir) $(distdir)
+       $(AR) tv libtu.a
+$(extra_checks): pre-test
+check-local: $(extra_checks)
+
+maude-src:
+       grep dummy_maude $(srcdir)/maude.c
+maude-dist:
+       grep dummy_maude $(distdir)/maude.c
+liver-src:
+       grep dummy_liver $(srcdir)/liver.c
+liver-dist:
+       grep dummy_liver $(distdir)/liver.c
+liver-not-dist: distdir
+       test ! -r $(distdir)/liver.c
+maude-not-dist: distdir
+       test ! -r $(distdir)/maude.c
+maude-lib:
+       $(AR) t libtu.a | grep maude
+maude-not-lib:
+       $(AR) t libtu.a | grep maude && exit 1; exit 0
+liver-lib:
+       $(AR) t libtu.a | grep liver
+liver-not-lib:
+       $(AR) t libtu.a | grep liver && exit 1; exit 0
+END
+
+cat > maude.c << 'END'
+extern int dummy_maude;
+END
+
+cat > liver.c << 'END'
+extern int dummy_liver;
+END
+
+sed '/%LIBOBJ-STUFF%/{
+s/.*//
+i\
+AC_LIBOBJ([maude])
+}' configure.proto > configure.in
+cat configure.in # for debugging
+
+cat > extra-checks.am << 'END'
+extra_checks = maude-src maude-dist maude-lib liver-not-dist
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+./configure
+
+$MAKE
+$MAKE check
+$MAKE distcheck
+$MAKE distclean
+
+# Avoid timestamp-related differences.
+rm -rf autom4te*.cache
+
+cat > extra-checks.am << 'END'
+extra_checks = maude-src maude-dist liver-src liver-dist
+if MAUDE_COND
+extra_checks += maude-lib liver-not-lib
+else
+extra_checks += maude-not-lib liver-lib
+endif
+END
+
+sed '/%LIBOBJ-STUFF%/{
+s/.*//
+i\
+AM_CONDITIONAL([MAUDE_COND], [test x"$MAUDE" = x"yes"])\
+if test x"$MAUDE" = x"yes"; then\
+  AC_LIBOBJ([maude])\
+else\
+  AC_LIBOBJ([liver])\
+fi\
+AC_LIBSOURCES([maude.c, liver.c])
+}' configure.proto > configure.in
+cat configure.in # for debugging
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+./configure MAUDE=yes
+$MAKE
+$MAKE check
+$MAKE distcheck
+$MAKE distclean
+
+./configure MAUDE=no
+$MAKE
+$MAKE check
+$MAKE distcheck
+$MAKE distclean
+
+:
diff --git a/tests/libobj16b.test b/tests/libobj16b.test
new file mode 100755 (executable)
index 0000000..f2ac76d
--- /dev/null
@@ -0,0 +1,140 @@
+#! /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 AC_LIBOBJ and friends work.
+# Please keep this in sync with sister test `libobj16b.test'.
+
+. ./defs || Exit 1
+
+set -e
+
+mv configure.in configure.proto
+cat >> configure.proto << 'END'
+AC_PROG_CC
+AC_PROG_RANLIB
+%LIBOBJ-STUFF% # will be activated later
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+noinst_LIBRARIES = libtu.a
+libtu_a_SOURCES =
+libtu_a_LIBADD = @LIBOBJS@
+
+include extra-checks.am
+.PHONY: $(extra_checks) pre-test
+
+pre-test: distdir
+       ls -l $(srcdir) $(builddir) $(distdir)
+       $(AR) tv libtu.a
+$(extra_checks): pre-test
+check-local: $(extra_checks)
+
+maude-src:
+       grep dummy_maude $(srcdir)/maude.c
+maude-dist:
+       grep dummy_maude $(distdir)/maude.c
+liver-src:
+       grep dummy_liver $(srcdir)/liver.c
+liver-dist:
+       grep dummy_liver $(distdir)/liver.c
+liver-not-dist: distdir
+       test ! -r $(distdir)/liver.c
+maude-not-dist: distdir
+       test ! -r $(distdir)/maude.c
+maude-lib:
+       $(AR) t libtu.a | grep maude
+maude-not-lib:
+       $(AR) t libtu.a | grep maude && exit 1; exit 0
+liver-lib:
+       $(AR) t libtu.a | grep liver
+liver-not-lib:
+       $(AR) t libtu.a | grep liver && exit 1; exit 0
+END
+
+cat > maude.c << 'END'
+extern int dummy_maude;
+END
+
+cat > liver.c << 'END'
+extern int dummy_liver;
+END
+
+sed '/%LIBOBJ-STUFF%/{
+s/.*//
+i\
+AC_LIBOBJ(maude) dnl: do not quote this!
+}' configure.proto > configure.in
+cat configure.in # for debugging
+
+cat > extra-checks.am << 'END'
+extra_checks = maude-src maude-dist maude-lib liver-not-dist
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+./configure
+
+$MAKE
+$MAKE check
+$MAKE distcheck
+$MAKE distclean
+
+# Avoid timestamp-related differences.
+rm -rf autom4te*.cache
+
+cat > extra-checks.am << 'END'
+extra_checks = maude-src maude-dist liver-src liver-dist
+if MAUDE_COND
+extra_checks += maude-lib liver-not-lib
+else
+extra_checks += maude-not-lib liver-lib
+endif
+END
+
+sed '/%LIBOBJ-STUFF%/{
+s/.*//
+i\
+AM_CONDITIONAL([MAUDE_COND], [test x"$MAUDE" = x"yes"])\
+if test x"$MAUDE" = x"yes"; then\
+  AC_LIBOBJ(maude) dnl: do not quote this!\
+else\
+  AC_LIBOBJ(liver) dnl: do not quote this!\
+fi\
+AC_LIBSOURCE(maude.c) dnl: do not quote this!\
+AC_LIBSOURCE(liver.c) dnl: do not quote this!
+}' configure.proto > configure.in
+cat configure.in # for debugging
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+./configure MAUDE=yes
+$MAKE
+$MAKE check
+$MAKE distcheck
+$MAKE distclean
+
+./configure MAUDE=no
+$MAKE
+$MAKE check
+$MAKE distcheck
+$MAKE distclean
+
+:
diff --git a/tests/libobj17.test b/tests/libobj17.test
new file mode 100755 (executable)
index 0000000..daf4039
--- /dev/null
@@ -0,0 +1,67 @@
+#! /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 AC_LIBOBJ accept non-literal arguments.
+
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_PROG_CC
+AC_PROG_RANLIB
+foo=${FOO-oops}
+AC_LIBSOURCES([quux.c, zardoz.c])
+AC_LIBOBJ([$foo])
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+noinst_LIBRARIES = libtu.a
+libtu_a_SOURCES =
+libtu_a_LIBADD = $(LIBOBJS)
+END
+
+cat > quux.c <<'END'
+extern int dummy;
+END
+
+cat > zardoz.c <<'END'
+extern int dummy;
+END
+
+# These might print warnings, but should not error out.
+$ACLOCAL
+$AUTOMAKE
+$AUTOCONF
+
+./configure FOO=quux
+$MAKE
+ls -l # for debugging
+test -f libtu.a
+ar t libtu.a | $FGREP quux
+ar t libtu.a | $FGREP zardoz && Exit 1
+
+$MAKE distclean
+
+./configure FOO=zardoz
+$MAKE
+ls -l # for debugging
+test -f libtu.a 
+ar t libtu.a | $FGREP zardoz
+ar t libtu.a | $FGREP quux && Exit 1
+
+:
diff --git a/tests/libobj18.test b/tests/libobj18.test
new file mode 100755 (executable)
index 0000000..e03493e
--- /dev/null
@@ -0,0 +1,46 @@
+#! /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 AC_LIBSOURCE and AC_LIBSOURCES use arguments literally.
+
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_PROG_CC
+AC_PROG_RANLIB
+foo=dummy bar=dummy baz=dummy
+AC_LIBSOURCE([$foo.c])
+AC_LIBSOURCES([$bar.c, $baz.c])
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+noinst_LIBRARIES = libtu.a
+libtu_a_SOURCES =
+libtu_a_LIBADD = $(LIBOBJS)
+END
+
+: > dummy.c
+
+$ACLOCAL
+AUTOMAKE_fails
+grep 'configure\.in:.*required file.*\$foo\.c.*not found' stderr
+grep 'configure\.in:.*required file.*\$bar\.c.*not found' stderr
+grep 'configure\.in:.*required file.*\$baz\.c.*not found' stderr
+
+:
diff --git a/tests/libobj19.test b/tests/libobj19.test
new file mode 100755 (executable)
index 0000000..e19a759
--- /dev/null
@@ -0,0 +1,62 @@
+#! /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/>.
+
+# Test support for AC_CONFIG_LIBOBJ_DIR.
+
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_CONFIG_LIBOBJ_DIR([libobj-dir])
+AC_PROG_CC
+AC_PROG_RANLIB
+AC_LIBOBJ([foobar])
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+AUTOMAKE_OPTIONS = subdir-objects
+noinst_LIBRARIES = libtu.a
+libtu_a_SOURCES =
+libtu_a_LIBADD = $(LIBOBJS)
+check-local: distdir
+       ls -l $(srcdir)/* $(builddir)/* $(distdir)/*
+       test -f libtu.a
+       test ! -r $(srcdir)/foobar.c
+       test -f $(srcdir)/libobj-dir/foobar.c
+       test ! -r $(distdir)/foobar.c
+       test -f $(distdir)/libobj-dir/foobar.c
+       $(AR) t libtu.a
+       $(AR) t libtu.a | grep foobar
+END
+
+mkdir libobj-dir
+cat > libobj-dir/foobar.c << 'END'
+extern int dummy;
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+./configure
+
+$MAKE
+$MAKE check
+$MAKE distcheck
+
+:
index 81b0e72..913fef9 100755 (executable)
@@ -1,6 +1,6 @@
 #! /bin/sh
-# Copyright (C) 1996, 1997, 1999, 2000, 2001, 2002
-# Free Software Foundation, Inc.
+# Copyright (C) 1996, 1997, 1999, 2000, 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
 
 . ./defs || Exit 1
 
-cat > configure.in << 'END'
-AC_INIT
-AM_INIT_AUTOMAKE(nonesuch, nonesuch)
+set -e
+
+cat >> configure.in << 'END'
+AC_CONFIG_FILES([subdir/Makefile])
 AC_PROG_CC
 AC_PROG_RANLIB
 AC_LIBOBJ([fsusage])
-AC_OUTPUT(subdir/Makefile)
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+SUBDIRS = subdir
+check-local: distdir
+       ls -l $(srcdir) $(srcdir)/subdir
+       ls -l $(distdir) $(distdir)/subdir
+       ls -l $(builddir) $(builddir)/subdir
+       test -f $(srcdir)/subdir/fsusage.c
+       test -f $(distdir)/subdir/fsusage.c
+       $(AR) tv $(builddir)/subdir/libtu.a
 END
 
 mkdir subdir
@@ -37,9 +49,20 @@ libtu_a_SOURCES =
 libtu_a_LIBADD = @LIBOBJS@
 END
 
-: > subdir/fsusage.c
+cat > subdir/fsusage.c << 'END'
+extern int dummy;
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+# Older grepping check, kept "just to be sure".
+$FGREP 'fsusage.c' subdir/Makefile.in
+
+./configure
 
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$MAKE check
+$MAKE distcheck
 
-grep 'fsusage\.c' subdir/Makefile.in
+:
diff --git a/tests/libobj20a.test b/tests/libobj20a.test
new file mode 100755 (executable)
index 0000000..25c3cf3
--- /dev/null
@@ -0,0 +1,45 @@
+#! /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/>.
+
+# Test error reporting for AC_CONFIG_LIBOBJ_DIR.
+# See also sister tests `libobj20b.test' and `libobj20c.test' .
+
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_CONFIG_LIBOBJ_DIR([libobj-dir])
+AC_PROG_CC
+AC_PROG_RANLIB
+AC_LIBOBJ([foo])
+END
+
+cat > Makefile.am << 'END'
+noinst_LIBRARIES = libtu.a
+libtu_a_SOURCES =
+libtu_a_LIBADD = $(LIBOBJS)
+END
+
+mkdir libobj-dir
+: > libobj-dir/foo.c
+
+$ACLOCAL
+AUTOMAKE_fails
+grep 'LIBOBJS.*used outside.*libobj-dir' stderr
+grep 'subdir-objects.*not set' stderr
+
+:
diff --git a/tests/libobj20b.test b/tests/libobj20b.test
new file mode 100755 (executable)
index 0000000..f57a78b
--- /dev/null
@@ -0,0 +1,56 @@
+#! /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/>.
+
+# Test error reporting for AC_CONFIG_LIBOBJ_DIR.
+# See also sister tests `libobj20a.test' and `libobj20c.test' .
+
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_CONFIG_LIBOBJ_DIR([libobj-dir])
+AC_PROG_CC
+AC_PROG_RANLIB
+AC_LIBSOURCE([foobar.c])
+# NOTE: this call to AC_OUTPUT is really needed; see Automake bug #7635
+#       <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=7635>
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+AUTOMAKE_OPTIONS = subdir-objects
+noinst_LIBRARIES = libtu.a
+libtu_a_SOURCES =
+libtu_a_LIBADD = $(LIBOBJS)
+END
+
+$ACLOCAL
+
+AUTOMAKE_fails
+grep 'configure\.in:.*required directory.*libobj-dir' stderr
+
+mkdir libobj-dir
+: > foobar.c # oops, it should be in libobj-dir...
+AUTOMAKE_fails
+grep 'configure\.in:.*required file.*libobj-dir/foobar.c.*' stderr
+
+rm -f foobar.c
+
+: > libobj-dir/foobar.c
+$AUTOMAKE # now we should succeed
+
+:
diff --git a/tests/libobj20c.test b/tests/libobj20c.test
new file mode 100755 (executable)
index 0000000..4635183
--- /dev/null
@@ -0,0 +1,53 @@
+#! /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/>.
+
+# Test error reporting for AC_CONFIG_LIBOBJ_DIR.
+# See also sister tests `libobj20a.test' and `libobj20b.test' .
+
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_CONFIG_LIBOBJ_DIR([libobj-dir])
+AC_PROG_CC
+AC_PROG_RANLIB
+AC_LIBOBJ([foobar])
+END
+
+cat > Makefile.am << 'END'
+AUTOMAKE_OPTIONS = subdir-objects
+noinst_LIBRARIES = libtu.a
+libtu_a_SOURCES =
+libtu_a_LIBADD = $(LIBOBJS)
+END
+
+$ACLOCAL
+
+AUTOMAKE_fails
+grep 'configure\.in:.*required directory.*\./libobj-dir' stderr
+
+mkdir libobj-dir
+: > foobar.c # oops, it should be in libobj-dir!
+AUTOMAKE_fails
+grep 'configure\.in:.*required file.*libobj-dir/foobar.c.*' stderr
+
+rm -f foobar.c
+
+: > libobj-dir/foobar.c
+$AUTOMAKE # now we should succeed
+
+:
index 0aeced9..29aa6d5 100755 (executable)
@@ -1,5 +1,6 @@
 #! /bin/sh
-# Copyright (C) 1996, 1997, 2001, 2002, 2003  Free Software Foundation, Inc.
+# Copyright (C) 1996, 1997, 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
@@ -14,7 +15,8 @@
 # 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 we complain if @LIBOBJS@ is used without being set in configure.in
+# Make sure we complain if @LIBOBJS@ is used without being set in
+# configure.in.
 
 . ./defs || Exit 1
 
@@ -32,4 +34,6 @@ END
 
 $ACLOCAL
 AUTOMAKE_fails
-grep 'Makefile.am:3:.*LIBOBJS' stderr
+grep 'Makefile\.am:3:.*LIBOBJS' stderr
+
+:
index d6639be..d31e5ff 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 1996, 2001, 2002  Free Software Foundation, Inc.
+# Copyright (C) 1996, 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
 
 . ./defs || Exit 1
 
+set -e
+
 cat > Makefile.am << 'END'
 bin_PROGRAMS = foo
 END
 
 cat >> configure.in << 'END'
 AC_PROG_CC
-AC_REPLACE_FUNCS(foo)
+AC_REPLACE_FUNCS([foo])
 END
 
-$ACLOCAL || Exit 1
+$ACLOCAL
 $AUTOMAKE
+
+:
index 6add9e3..7aa218a 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 1996, 2001, 2002  Free Software Foundation, Inc.
+# Copyright (C) 1996, 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
@@ -19,6 +19,8 @@
 
 . ./defs || Exit 1
 
+set -e
+
 cat > Makefile.am << 'END'
 bin_PROGRAMS = joe
 LDADD = @LIBOBJS@
@@ -27,11 +29,13 @@ END
 cat >> configure.in << 'END'
 AC_PROG_CC
 AC_REPLACE_FUNCS(\
-   foo)
+   foo_bar_quux)
 END
 
-: > foo.c
+: > foo_bar_quux.c
+
+$ACLOCAL
+$AUTOMAKE
+$FGREP foo_bar_quux.c Makefile.in
 
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
-$FGREP foo.c Makefile.in
+:
index 73a8ab0..be51db7 100755 (executable)
@@ -1,5 +1,6 @@
 #! /bin/sh
-# Copyright (C) 1997, 1998, 2000, 2001, 2002  Free Software Foundation, Inc.
+# Copyright (C) 1997, 1998, 2000, 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
 
 . ./defs || Exit 1
 
-cat > configure.in << 'END'
-AC_INIT
-AM_INIT_AUTOMAKE(nonesuch, nonesuch)
+set -e
+
+cat >> configure.in << 'END'
 AC_PROG_CC
 AC_PROG_RANLIB
-AC_REPLACE_FUNCS(basename dirname strsignal)
-AC_OUTPUT(Makefile)
+# `am__dummy_function' is there to ensure that at least one function is
+# replaced, to avoid creating an empty archive which can cause problems
+# with e.g. Solaris ar.
+AC_REPLACE_FUNCS([basename dirname am__dummy_function])
+AC_OUTPUT
 END
 
 cat > Makefile.am << 'END'
 noinst_LIBRARIES = libtu.a
 libtu_a_SOURCES =
 libtu_a_LIBADD = @LIBOBJS@
+check-local: test1 test2 test3
+.PHONY: test1 test2 test3
+test1: all
+       $(AR) tv libtu.a
+test2:
+       @echo DIST_COMMON = $(DIST_COMMON)
+       echo ' ' $(DIST_COMMON) ' ' | grep '[ /]basename\.c '
+       echo ' ' $(DIST_COMMON) ' ' | grep '[ /]dirname\.c '
+       echo ' ' $(DIST_COMMON) ' ' | grep '[ /]am__dummy_function\.c '
+test3: distdir
+       test -f $(distdir)/basename.c
+       test -f $(distdir)/dirname.c
+       test -f $(distdir)/am__dummy_function.c
+END
+
+cat > basename.c <<'END'
+extern int dummy1;
+END
+cat > dirname.c <<'END'
+extern int dummy2;
 END
+cat > am__dummy_function.c <<'END'
+extern int dummy3;
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+./configure
+
+$MAKE
+$MAKE check
+$MAKE distcheck
 
-: > basename.c
-: > dirname.c
-: > strsignal.c
-
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
-
-sed -n -e ': again
-  /^DIST_COMMON.*[^\]$/ p
-  /^DIST_COMMON/ {
-     s/^DIST_COMMON//p
-     n
-     s/^/DIST_COMMON/
-     b again
-  }' < Makefile.in | $FGREP dirname.c
+:
index c06746b..95f21ed 100755 (executable)
@@ -1,5 +1,6 @@
 #! /bin/sh
-# Copyright (C) 1998, 2000, 2001, 2002, 2006  Free Software Foundation, Inc.
+# Copyright (C) 1998, 2000, 2001, 2002, 2006, 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
 
 . ./defs || Exit 1
 
-cat > configure.in << 'END'
-AC_INIT
-AM_INIT_AUTOMAKE(nonesuch, nonesuch)
+set -e
+
+cat >> configure.in << 'END'
 AC_PROG_CC
 AC_PROG_CC_STDC
 AC_PROG_RANLIB
 AC_REPLACE_FUNCS(basename dirname strsignal)
 AM_C_PROTOTYPES
-AC_OUTPUT(Makefile)
+AC_OUTPUT
 END
 
 cat > Makefile.am << 'END'
@@ -44,7 +45,9 @@ END
 : > ansi2knr.1
 : > ansi2knr.c
 
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
+
+$FGREP 'strsignal_.c:' Makefile.in
 
-grep 'strsignal_.c:' Makefile.in
+:
index 1e2b58b..b35e883 100755 (executable)
@@ -1,5 +1,6 @@
 #! /bin/sh
-# Copyright (C) 1998, 2001, 2002, 2008  Free Software Foundation, Inc.
+# Copyright (C) 1998, 2001, 2002, 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
@@ -18,6 +19,8 @@
 
 . ./defs || Exit 1
 
+set -e
+
 cat >> configure.in << 'END'
 AC_PROG_RANLIB
 AM_MAINTAINER_MODE
@@ -30,5 +33,7 @@ lib_LIBRARIES = libfoo.a
 libfoo_a_DEPENDENCIES = libzot.a
 END
 
-$ACLOCAL || Exit 1
+$ACLOCAL
 $AUTOMAKE
+
+:
index dd2a939..a75eada 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2001, 2002  Free Software Foundation, Inc.
+# Copyright (C) 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
 
 # Make sure libtool is removed.
 # Report from Kevin Dalley
+
 required=libtool
 . ./defs || Exit 1
 
+set -e
+
 cat >> configure.in << 'END'
 AC_LIBTOOL_DLOPEN
 AC_DISABLE_SHARED
 AC_PROG_LIBTOOL
-AC_SUBST(LIBTOOL_DEPS)
+AC_SUBST([LIBTOOL_DEPS])
 END
 
 : > Makefile.am
@@ -32,7 +35,9 @@ END
 : > config.guess
 : > config.sub
 
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
 
 grep 'rm -f libtool' Makefile.in
+
+:
index a50f6a4..e4ea89e 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2001, 2002  Free Software Foundation, Inc.
+# Copyright (C) 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
 
 # Make sure libtool clean targets exist.
 # Report from Eric Magnien.
+
 required=libtoolize
 . ./defs || Exit 1
 
-cat > configure.in << 'END'
-AC_INIT
-AM_INIT_AUTOMAKE(mypackage,0.1)
+set -e
 
+cat >> configure.in << 'END'
 AC_PROG_CC
 AC_PROG_LIBTOOL
-
-AC_CONFIG_FILES([
-  sub/Makefile
-  Makefile
-])
+AC_CONFIG_FILES([sub/Makefile])
 AC_OUTPUT
 END
 
@@ -45,8 +41,10 @@ lib_LTLIBRARIES = libfoo.la
 libfoo_la_SOURCES = foo.c
 END
 
-$ACLOCAL || Exit 1
+$ACLOCAL
 : > ltmain.sh
-$AUTOMAKE -a || Exit 1
+$AUTOMAKE -a
 
 grep 'rm -f .*\.lo' sub/Makefile.in
+
+:
diff --git a/tests/link_override.test b/tests/link_override.test
new file mode 100755 (executable)
index 0000000..41788a1
--- /dev/null
@@ -0,0 +1,46 @@
+#! /bin/sh
+# Copyright (C) 2009 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 3 of the License, 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/>.
+
+# Test to make sure _LINK variables are detected and used as documented.
+
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_PROG_CC
+END
+
+cat > Makefile.am << 'END'
+bin_PROGRAMS = foo bar baz boo
+foo_LINK = $(LINK)
+bar_LINK = $(LINK)
+bar_LDFLAGS = $(AM_LDFLAGS)
+END
+
+$ACLOCAL
+$AUTOMAKE -a
+
+# We should use foo_LINK not LINK.
+grep '.\$(foo_LINK)' Makefile.in
+grep '.\$(LINK).*foo' Makefile.in && Exit 1
+
+# We should not override the user definition of bar_LINK.
+# IOW, bar_LDFLAGS is useless unless bar_LINK refers to it.
+grep '^ *bar_LINK *=.*bar_LDFLAGS' Makefile.in && Exit 1
+grep '.\$(bar_LINK).*bar' Makefile.in
+
+Exit 0
index 5ff75db..5a71a05 100755 (executable)
@@ -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
 
 # Test to make sure variable is expanded properly.
 # From Adam J. Richter.
+
 required=libtool
 . ./defs || Exit 1
 
+set -e
+
 cat >> configure.in << 'END'
-AC_SUBST(LTLIBOBJS)
+AC_SUBST([LTLIBOBJS])
 AC_PROG_LIBTOOL
 END
 
@@ -37,5 +40,7 @@ END
 : > config.guess
 : > config.sub
 
-$ACLOCAL || Exit 1
+$ACLOCAL
 $AUTOMAKE
+
+:
index 13a2183..bdd00c4 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2002, 2003  Free Software Foundation, Inc.
+# Copyright (C) 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
@@ -45,29 +45,35 @@ VAR = 1 \
 END
 
 $ACLOCAL
-AUTOMAKE_fails
+AUTOMAKE_fails -Wno-error
 
 # Smash the useless difference of lib file locations.
 sed 's,^.*lib/am/\([a-z]*\.am\),\1,' stderr >observed
 cat >expected <<\EOF
-Makefile.am:12: VAR multiply defined in condition TRUE ...
+Makefile.am:12: warning: VAR multiply defined in condition TRUE ...
 Makefile.am:8: ... `VAR' previously defined here
-automake: libfoo_a_OBJECTS should not be defined
+automake: error: libfoo_a_OBJECTS should not be defined
 Makefile.am:3:   while processing library `libfoo.a'
-automake: use `libfoo_a_LDADD', not `libfoo_a_LIBADD'
+automake: error: use `libfoo_a_LDADD', not `libfoo_a_LIBADD'
 Makefile.am:3:   while processing library `libfoo.a'
-library.am: deprecated feature: target `libfoo.a' overrides `libfoo.a$(EXEEXT)'
+library.am: warning: deprecated feature: target `libfoo.a' overrides `libfoo.a$(EXEEXT)'
 library.am: change your target to read `libfoo.a$(EXEEXT)'
 Makefile.am:3:   while processing library `libfoo.a'
 program.am: target `libfoo.a$(EXEEXT)' was defined here
 Makefile.am:1:   while processing program `libfoo.a'
-program.am: redefinition of `libfoo.a$(EXEEXT)'...
+program.am: warning: redefinition of `libfoo.a$(EXEEXT)' ...
 Makefile.am:1:   while processing program `libfoo.a'
 library.am: ... `libfoo.a' previously defined here
 Makefile.am:3:   while processing library `libfoo.a'
-tags.am: redefinition of `ctags'...
+tags.am: warning: redefinition of `ctags' ...
 program.am: ... `ctags$(EXEEXT)' previously defined here
 Makefile.am:6:   while processing program `ctags'
 EOF
 
 diff expected observed || Exit 1
+
+AUTOMAKE_fails -Werror
+sed 's,^.*lib/am/\([a-z]*\.am\),\1,' stderr >observed
+( echo 'automake: warnings are treated as errors'; cat expected ) \
+  | diff - observed || Exit 1
+:
index bb3203a..18d306d 100755 (executable)
@@ -1,5 +1,5 @@
 #!/bin/sh
-# Copyright (C) 2008, 2009  Free Software Foundation, Inc.
+# Copyright (C) 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
@@ -49,13 +49,13 @@ AUTOMAKE_fails --add-missing
 # whether automake installs config.guess and config.sub.
 
 cat >expected <<'END'
-Makefile.am:5: sub/liba2.la multiply defined in condition COND
+Makefile.am:5: error: sub/liba2.la multiply defined in condition COND
 Makefile.am:5: `sub/liba2.la' should be installed below `lib' in condition COND ...
 Makefile.am:2: ... and should also be installed in `lib' in condition COND.
-Makefile.am:4: liba1.la multiply defined in condition COND
+Makefile.am:4: error: liba1.la multiply defined in condition COND
 Makefile.am:4: `liba1.la' should be installed in `pkglib' in condition COND ...
 Makefile.am:2: ... and should also be installed in `lib' in condition COND.
-Makefile.am:2: Libtool libraries can be built for only one destination.
+Makefile.am:2: Libtool libraries can be built for only one destination
 END
 
 grep '^Makefile.am' stderr | diff - expected
index fd66473..e34e667 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 1999, 2001, 2002  Free Software Foundation, Inc.
+# Copyright (C) 1999, 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
 required=libtool
 . ./defs || Exit 1
 
+set -e
+
 cat >> configure.in << 'END'
-AC_SUBST(LTLIBOBJS)
+AC_SUBST([LTLIBOBJS])
 AC_PROG_LIBTOOL
 END
 
@@ -35,5 +37,7 @@ END
 : > config.guess
 : > config.sub
 
-$ACLOCAL || Exit 1
+$ACLOCAL
 $AUTOMAKE
+
+:
diff --git a/tests/lzip.test b/tests/lzip.test
new file mode 100755 (executable)
index 0000000..fecbc83
--- /dev/null
@@ -0,0 +1,41 @@
+#! /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 support for no-dist-gzip with lzip
+
+required=lzip
+. ./defs || Exit 1
+
+set -e
+
+cat > configure.in << 'END'
+AC_INIT([lzip], [1.0])
+AM_INIT_AUTOMAKE([no-dist-gzip dist-lzip])
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+test: distcheck
+       test $(DIST_ARCHIVES) = lzip-1.0.tar.lz
+       test -f $(DIST_ARCHIVES)
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+./configure
+$MAKE test
index a66464b..e4f09fd 100755 (executable)
@@ -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
@@ -21,7 +21,7 @@
 set -e
 
 cat >> configure.in << 'END'
-AC_CONFIG_FILES(bar)
+AC_CONFIG_FILES([bar])
 AC_OUTPUT
 END
 
@@ -74,3 +74,5 @@ test ! -f foo.c
 test ! -f Makefile
 test ! -f config.status
 test ! -d autom4te.cache
+
+:
index 1e3184d..f866b31 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2001, 2002  Free Software Foundation, Inc.
+# Copyright (C) 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
 required=GNUmake
 . ./defs || Exit 1
 
-cat > configure.in << 'END'
-AC_INIT(Makefile.am)
-AM_INIT_AUTOMAKE(foo,0,no)
+set -e
+
+cat >> configure.in << 'END'
 AM_MAKE_INCLUDE
-AC_OUTPUT(Makefile)
+AC_OUTPUT
 END
 
 : > Makefile.am
 
-set -e
-
 $ACLOCAL
 $AUTOCONF
 $AUTOMAKE
@@ -45,14 +43,11 @@ export AUTOMAKE
 save="$MAKE"
 for flag in '' -w; do
    MAKE="$save $flag" ./configure
-
    $FGREP 'am__include = include' Makefile
-
+   $sleep
    touch configure.in
    $MAKE $flag
-
    $FGREP 'am__include = include' Makefile
-
    rm -f config.cache
 done
 
index e5d55a1..d85be0f 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2003  Free Software Foundation, Inc.
+# Copyright (C) 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
@@ -26,9 +26,9 @@ required=GNUmake
 
 set -e
 
-cat >configure.in <<'END'
+cat >configure.in <<END
 m4_include([version.m4])
-AC_INIT([version7], [THE_VERSION])
+AC_INIT([$me], [THE_VERSION])
 AM_INIT_AUTOMAKE
 AC_CONFIG_HEADER([config.h])
 AC_CONFIG_FILES([Makefile])
@@ -51,3 +51,5 @@ $sleep
 echo 'm4_define([THE_VERSION], [3.141])' > version.m4
 $MAKE -j
 ./configure --version | grep '3\.141'
+
+:
index f4a80aa..31fdd56 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2001, 2002  Free Software Foundation, Inc.
+# Copyright (C) 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
 
 . ./defs || Exit 1
 
+set -e
+
 # Find the macros wanted by Automake.
-$ACLOCAL || Exit 1
+$ACLOCAL
 
 # Create some dummy Makefile.in.
 : > Makefile.am
 
-$AUTOMAKE || Exit 1
+$AUTOMAKE
 
 # We are definitely not needing a compiler or preprocessor.
-$EGREP '^(CC|CPP|CXX|CXXCPP) =' Makefile.in && Exit 1
+$EGREP '^ *(CC|CPP|CXX|CXXCPP) *=' Makefile.in && Exit 1
 
-Exit 0
+:
index dcbe818..331b3d7 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 1999, 2001, 2002  Free Software Foundation, Inc.
+# Copyright (C) 1999, 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
 
 . ./defs || Exit 1
 
+set -e
+
 cat > Makefile.am << 'END'
 MAINTAINERCLEANFILES = foo
 END
 
 : > FOO
 
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
 
 grep 'rm -f .*MAINTAINERCLEANFILES' Makefile.in
+
+:
index 11b6d5d..ae2524c 100755 (executable)
@@ -1,5 +1,6 @@
 #! /bin/sh
-# Copyright (C) 1996, 1997, 2001, 2002  Free Software Foundation, Inc.
+# Copyright (C) 1996, 1997, 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'
 info_TEXINFOS = textutils.texi
 END
@@ -32,7 +35,9 @@ END
 echo '@setfilename textutils' > textutils.texi
 
 # Use "././" to confuse Automake into thinking this is a subdir build.
-$ACLOCAL || Exit 1
-$AUTOMAKE ././Makefile || Exit 1
+$ACLOCAL
+$AUTOMAKE ././Makefile
 
 grep 'mdate-sh' Makefile.in | grep -v SHELL
+
+:
index 75105f9..b487359 100755 (executable)
@@ -1,5 +1,6 @@
 #! /bin/sh
-# Copyright (C) 1999, 2001, 2002, 2004  Free Software Foundation, Inc.
+# Copyright (C) 1999, 2001, 2002, 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
 
 . ./defs || Exit 1
 
-cat > configure.in << 'END'
-AC_INIT([mdate3], [1.0])
+set -e
+
+cat > configure.in << END
+AC_INIT([$me], [1.0])
 AC_CONFIG_AUX_DIR([foo])
 AM_INIT_AUTOMAKE
 AC_CONFIG_FILES([Makefile])
@@ -41,11 +44,9 @@ mkdir foo
 : > foo/mdate-sh
 mv install-sh foo
 mv missing foo
-mv mkinstalldirs foo
-mv depcomp foo
 
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
 
 grep '[^/]mdate-sh' Makefile.in && Exit 1
 Exit 0
index ca24f56..c9ef899 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2001, 2002  Free Software Foundation, Inc.
+# Copyright (C) 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
 
 . ./defs || Exit 1
 
-cat > configure.in << 'END'
-AC_INIT
-AM_INIT_AUTOMAKE(nonesuch, nonesuch)
-AC_OUTPUT(Makefile sub/Makefile)
+set -e
+
+cat >> configure.in << 'END'
+AC_CONFIG_FILES([sub/Makefile])
 END
 
 cat > Makefile.am << 'END'
@@ -40,6 +40,9 @@ cat > sub/textutils.texi << 'END'
 @setfilename textutils.info
 END
 
-$ACLOCAL || Exit 1
-$AUTOMAKE -a || Exit 1
+$ACLOCAL
+$AUTOMAKE -a
+ls -l sub
 test -f sub/mdate-sh
+
+:
index e7f7d69..cb2456c 100755 (executable)
@@ -24,7 +24,7 @@ a=
 file='file  name $a'
 ( : > "$file" ) || Exit 77
 
-cp "$testsrcdir"/../lib/mdate-sh .
+cp "$top_testsrcdir/lib/mdate-sh" .
 $SHELL ./mdate-sh "$file" >stdout 2>stderr ||
   { cat stdout; cat stderr >&2; Exit 1; }
 cat stdout
index 20b9b04..da999d3 100755 (executable)
@@ -25,7 +25,7 @@ mkdir '~a b' || Exit 77
 mkdir '~a b/-x  y' || Exit 77
 rm -rf '~a b'
 
-cp "$testsrcdir/../lib/mkinstalldirs" .
+cp "$top_testsrcdir/lib/mkinstalldirs" .
 
 # Test mkinstalldirs with the installed mkdir.
 
index 4a65307..8b426e8 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 1996, 2001, 2002  Free Software Foundation, Inc.
+# Copyright (C) 1996, 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
 
 . ./defs || Exit 1
 
+set -e
+
 cat > Makefile.am << 'END'
 pkgdata_DATA =
 END
 
 # The "././" prefix confuses Automake into thinking it is doing a
 # subdir build.  Yes, this is hacky.
-$ACLOCAL || Exit 1
-$AUTOMAKE ././Makefile || Exit 1
+$ACLOCAL
+$AUTOMAKE ././Makefile
 
 grep ' /mkinstalldirs' Makefile.in && Exit 1
 Exit 0
index 3f88be3..c4b0024 100755 (executable)
@@ -107,8 +107,8 @@ mkdir libbar/sub
 
 : > libbar/bar.c
 
-cp "$testsrcdir/../lib/config-ml.in" .
-cp "$testsrcdir/../lib/symlink-tree" .
+cp "$top_testsrcdir/lib/config-ml.in" .
+cp "$top_testsrcdir/lib/symlink-tree" .
 
 $ACLOCAL
 $AUTOCONF
diff --git a/tests/no-outdir-option.test b/tests/no-outdir-option.test
new file mode 100755 (executable)
index 0000000..827e318
--- /dev/null
@@ -0,0 +1,29 @@
+#! /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 the `-o' aka `--output-dir' option is not recognized anymore.
+
+. ./defs || Exit 1
+
+set -e
+
+AUTOMAKE_fails -Wno-error --output-dir=foo
+$EGREP '(invalid|unrecognized) option.*--output-dir' stderr
+
+AUTOMAKE_fails -Wno-error -o foo
+$EGREP '(invalid|unrecognized) option.*-o' stderr
+
+:
index 7239338..d2c2caf 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 1999, 2001, 2002  Free Software Foundation, Inc.
+# Copyright (C) 1999, 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
 
 . ./defs || Exit 1
 
-echo AC_PROG_CC >> configure.in
+set -e
+
+cat >> configure.in << 'END'
+AC_PROG_CC
+END
 
 cat > Makefile.am << 'END'
 bin_PROGRAMS = eyeball
@@ -28,15 +32,11 @@ nodist_eyeball_SOURCES = b.c
 dist_eyeball_SOURCES = c.c
 END
 
-: > a.c
-: > b.c
-: > c.c
-
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
 
-grep '^am_eyeball_OBJECTS' Makefile.in || Exit 1
-grep '^DIST_SOURCES =' Makefile.in || Exit 1
+grep '^am_eyeball_OBJECTS' Makefile.in
+grep '^DIST_SOURCES =' Makefile.in
 grep '^DIST_SOURCES =.*nodist' Makefile.in && Exit 1
 
-Exit 0
+:
index 21cfec3..c5470e7 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2003, 2004  Free Software Foundation, Inc.
+# Copyright (C) 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
@@ -18,7 +18,9 @@
 
 . ./defs || Exit 1
 
-echo AC_PROG_CC >> configure.in
+cat >> configure.in << 'END'
+AC_PROG_CC
+END
 
 cat > Makefile.am << 'END'
 AUTOMAKE_OPTIONS = no-dist
@@ -26,12 +28,10 @@ bin_PROGRAMS = eyeball
 eyeball_SOURCES = a.c
 END
 
-: > a.c
-
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
 
 grep '^dist:' Makefile.in && Exit 1
 grep '^DIST_SOURCES =' Makefile.in && Exit 1
 
-Exit 0
+:
index dd97481..075e05e 100755 (executable)
@@ -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
 
 . ./defs || Exit 1
 
+set -e
+
 cat > Makefile.am << 'END'
 all-local:
        exit 1
 END
 
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
 
 grep '^install[-a-z]*:.* all' Makefile.in
+
+:
index 3f33c32..b91ac32 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2001, 2002  Free Software Foundation, Inc.
+# Copyright (C) 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
@@ -19,6 +19,8 @@
 
 . ./defs || Exit 1
 
+set -e
+
 cat > Makefile.am << 'END'
 noinst_SCRIPTS = foo.sh
 noinst_DATA = foo.xpm
@@ -37,9 +39,10 @@ AC_PROG_CC
 AC_PROG_RANLIB
 END
 
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
 
 grep 'noinstdir' Makefile.in && Exit 1
 grep 'checkdir' Makefile.in && Exit 1
-Exit 0
+
+:
index a43ff2f..b764519 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 1996, 2001, 2002  Free Software Foundation, Inc.
+# Copyright (C) 1996, 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
@@ -19,6 +19,8 @@
 
 . ./defs || Exit 1
 
+set -e
+
 cat >> configure.in << 'END'
 AC_PROG_CC
 END
@@ -27,8 +29,11 @@ cat > Makefile.am << 'END'
 bin_PROGRAMS = zardoz
 END
 
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
 
+grep '^zardoz_OBJECTS' Makefile.in
 count=`grep -c '^zardoz_OBJECTS' Makefile.in`
 test $count -eq 1
+
+:
index facc4d4..0c55f7a 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2001, 2002, 2006  Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2006, 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
@@ -19,6 +19,8 @@
 
 . ./defs || Exit 1
 
+set -e
+
 cat >> configure.in << 'END'
 AC_PROG_OBJC
 END
@@ -28,7 +30,9 @@ bin_PROGRAMS = hello
 hello_SOURCES = hello.m
 END
 
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
 
 grep '^\.SUFFIXES:.*\.m' Makefile.in
+
+:
index 337e4db..2c43e7a 100755 (executable)
@@ -23,29 +23,38 @@ set x ${AUTOUPDATE-autoupdate}
 required=$2
 . ./defs || Exit 1
 
+set -e
+
 cat > configure.in << 'END'
 AC_INIT
 END
 
 $PERL -ne '/AU_DEFUN\(\[(\w+)\]/ && print "$1\n"' \
-    "$testsrcdir/../m4/obsolete.m4" >> obs
+    "$top_testsrcdir/m4/obsolete.m4" >> obs
 cat obs >> configure.in
-$PERL -ne 'chomp; print "grep $_ stderr || Exit 1\n"; ' obs > obs.1
+$PERL -ne 'chomp; print "grep $_ output || Exit 1\n"; ' obs > obs.1
 $PERL -ne 'chomp; print "grep $_ configure.in && Exit 1\n"; ' obs > obs.2
+echo : >> obs.1 # since it will be sourced, it must and with a success
+echo : >> obs.2 # ditto
+
+cat configure.in # for debugging
+cat obs.1        # ditto
+cat obs.2        # ditto
 
 # Sanity check.  Make sure we have added something to configure.in.
-test `cat configure.in | wc -l` -gt 1 || Exit 1
+test `wc -l <configure.in` -gt 1
 
-$ACLOCAL || Exit 1
+$ACLOCAL
 
 # Expect Autoconf to complain about each of the macros in obs.
-$AUTOCONF -Wobsolete >stderr 2>&1
+$AUTOCONF -Wobsolete >output 2>&1 || { cat output; Exit 1; }
+cat output
 . ./obs.1
 # Make sure Autoupdate remove each of these macros.
-$AUTOUPDATE || Exit 1
+$AUTOUPDATE
 . ./obs.2
 
 # Autoconf should be able to grok the updated configure.in.
-$AUTOCONF || Exit 1
+$AUTOCONF
 
-Exit 0
+:
diff --git a/tests/oldvars.test b/tests/oldvars.test
new file mode 100755 (executable)
index 0000000..7a2bb71
--- /dev/null
@@ -0,0 +1,37 @@
+#! /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/>.
+
+# Use of these variables is deprecated:
+# LISP, HEADERS, DATA, SCRIPTS, LTLIBRARIES, LIBRARIES, PROGRAMS, MANS.
+
+. ./defs || Exit 1
+
+set -e
+
+cat >Makefile.am <<\EOF
+DATA =
+HEADERS =
+LIBRARIES =
+LISP =
+LTLIBRARIES =
+MANS =
+PROGRAMS =
+SCRIPTS =
+EOF
+
+$ACLOCAL
+AUTOMAKE_fails
+test `grep -c anachronism stderr` -eq 8
index 4f6a7cd..3931fc5 100755 (executable)
@@ -1,5 +1,6 @@
 #! /bin/sh
-# Copyright (C) 1996, 2000, 2001, 2002  Free Software Foundation, Inc.
+# Copyright (C) 1996, 2000, 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
 
 . ./defs || Exit 1
 
-cat > configure.in << 'END'
-AC_INIT
-AM_INIT_AUTOMAKE(nonesuch, nonesuch)
-AC_OUTPUT(Makefile frob/zardoz)
+cat > configure.in <<END
+AC_INIT([$me], [1.0])
+AM_INIT_AUTOMAKE
+AC_OUTPUT([Makefile frob/zardoz])
 END
 
 : > Makefile.am
@@ -29,5 +30,7 @@ END
 mkdir frob
 : > frob/zardoz.in
 
-$ACLOCAL || Exit 1
+$ACLOCAL
 $AUTOMAKE
+
+:
index c9bdbc3..df1c4c3 100755 (executable)
@@ -1,5 +1,6 @@
 #! /bin/sh
-# Copyright (C) 1996, 2000, 2001, 2002  Free Software Foundation, Inc.
+# Copyright (C) 1996, 2000, 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
 
 . ./defs || Exit 1
 
-cat > configure.in << 'END'
-AC_INIT
-AM_INIT_AUTOMAKE(nonesuch, nonesuch)
-AC_OUTPUT(Makefile intl/intlh.inst po/Makefile.in misc/gettextize)
+set -e
+
+cat > configure.in <<END
+AC_INIT([$me], [1.0])
+AM_INIT_AUTOMAKE
+AC_OUTPUT([Makefile intl/intlh.inst po/Makefile.in misc/gettextize])
 END
 
 : > Makefile.am
@@ -31,8 +34,8 @@ mkdir intl po misc
 : > po/Makefile.in.am
 : > misc/gettextize.in
 
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
 
 grep '^gettextize' Makefile.in && Exit 1
 Exit 0
index 02d7e6f..3c8e79b 100755 (executable)
@@ -1,5 +1,6 @@
 #! /bin/sh
-# Copyright (C) 1996, 2000, 2001, 2002  Free Software Foundation, Inc.
+# Copyright (C) 1996, 2000, 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
 
 . ./defs || Exit 1
 
-cat > configure.in << 'END'
-AC_INIT
-AM_INIT_AUTOMAKE(nonesuch, nonesuch)
+set -e
+
+cat > configure.in <<END
+AC_INIT([$me], [1.0])
+AM_INIT_AUTOMAKE
 AC_OUTPUT([Makefile
 tests/Makefile tests/defs],
 [blah])
@@ -32,5 +35,7 @@ mkdir tests
 : > tests/Makefile.am
 : > tests/defs.in
 
-$ACLOCAL || Exit 1
+$ACLOCAL
 $AUTOMAKE
+
+:
index fc5a022..4ea75b5 100755 (executable)
@@ -1,5 +1,6 @@
 #! /bin/sh
-# Copyright (C) 1996, 2000, 2001, 2002  Free Software Foundation, Inc.
+# Copyright (C) 1996, 2000, 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
 
 . ./defs || Exit 1
 
-cat > configure.in << 'END'
-AC_INIT
-AM_INIT_AUTOMAKE(nonesuch, nonesuch)
-AC_OUTPUT(tests/Makefile tests/defs)
+set -e
+
+cat > configure.in <<END
+AC_INIT([$me], [1.0])
+AM_INIT_AUTOMAKE
+AC_OUTPUT([tests/Makefile tests/defs])
 END
 
 mkdir tests
 : > tests/defs.in
 : > tests/Makefile.am
 
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
 
 grep tests/defs.in tests/Makefile.in && Exit 1
 Exit 0
diff --git a/tests/override-conditional-1.test b/tests/override-conditional-1.test
new file mode 100755 (executable)
index 0000000..fe0bbba
--- /dev/null
@@ -0,0 +1,56 @@
+
+#! /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/>.
+
+# Test for conditionally-defined overrides.
+
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AM_CONDITIONAL([COND], [test x"$cond" = x"yes"])
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+foobar:
+       : > $@
+if COND
+ps: foobar
+       :
+endif
+END
+
+$ACLOCAL
+$AUTOMAKE -Wno-override
+
+# "ps:" should be output in two conditions
+test `grep '[^-]ps:' Makefile.in | wc -l` = 2
+grep '@COND_TRUE@ps: *foobar' Makefile.in
+grep '@COND_FALSE@ps: *ps-am' Makefile.in
+
+$AUTOCONF
+
+./configure cond=no
+$MAKE ps
+test ! -r foobar
+
+./configure cond=yes
+$MAKE ps
+test -f foobar
+
+:
diff --git a/tests/override-conditional-2.test b/tests/override-conditional-2.test
new file mode 100755 (executable)
index 0000000..132b841
--- /dev/null
@@ -0,0 +1,41 @@
+#! /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/>.
+
+# Test that conditional overrides are diagnosed.
+# This test is still xfailing; see the FIXME in Automake::Rule::define.
+# Once that is fixed, the test should succeed.
+
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AM_CONDITIONAL([COND], [:])
+END
+
+cat > Makefile.am << 'END'
+if COND
+all:
+       :
+endif
+END
+
+$ACLOCAL
+
+AUTOMAKE_fails
+grep ':.*overrides.*all' stderr
+
+:
diff --git a/tests/override-html.test b/tests/override-html.test
new file mode 100755 (executable)
index 0000000..baece42
--- /dev/null
@@ -0,0 +1,35 @@
+#! /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/>.
+
+# Test that overriding `html' target causes only one "html:" rule to
+# be output.
+
+. ./defs || Exit 1
+
+set -e
+
+cat > Makefile.am << 'END'
+html:
+       :
+END
+
+$ACLOCAL
+$AUTOMAKE -Wno-override
+
+# Overriding `html' should cause only one "html:" rule to be output.
+test `grep '^html:' Makefile.in | wc -l` = 1
+
+:
similarity index 59%
rename from tests/overrid.test
rename to tests/override-suggest-local.test
index df453ca..851393a 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2003, 2004, 2006  Free Software Foundation, Inc.
+# 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
 
 set -e
 
-cat >> configure.in << 'END'
-AM_CONDITIONAL([COND], [:])
-END
-
 cat > Makefile.am << 'END'
 install:
        :
@@ -34,11 +30,6 @@ html:
        :
 clean-am:
        :
-
-if COND
-ps: mine
-       :
-endif
 END
 
 $ACLOCAL
@@ -51,17 +42,4 @@ grep ':.*html-local' stderr
 grep ':.*clean-am-local' stderr && Exit 1
 grep ':.*clean-local' stderr
 
-# Conditional overrides ought to be diagnosed, but it can't be done yet.
-# See the FIXME in Automake::Rule::define.  Once this is fixed, the grep below
-# will fail.  If you see the failure, it means you fixed Automake.  Well done!
-# Just strip out the next '&& Exit 1' and this comment.
-grep ':.*overrides.*ps' stderr && Exit 1
-
-# Test for another issue.  Overriding html: should cause only one
-# html: rule to be output.
-test `grep '^html:' Makefile.in | wc -l` = 1
-
-# ps: should be output in two conditions
-test `grep '[^-]ps:' Makefile.in | wc -l` = 2
-grep '@COND_TRUE@ps: mine' Makefile.in
-grep '@COND_FALSE@ps: ps-am' Makefile.in
+:
index 4aef628..c46377b 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2008  Free Software Foundation, Inc.
+# Copyright (C) 2008, 2009  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
@@ -35,6 +35,7 @@
 #
 # This test checks (0), (1), and (2).  See sister tests for further coverage.
 
+required=perl-threads
 . ./defs || Exit 1
 
 set -e
index 20225a0..d929740 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2008  Free Software Foundation, Inc.
+# Copyright (C) 2008, 2009  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,6 +20,7 @@
 # 4) warning and normal error output should be identical, in that duplicate
 #    warnings should be omitted in the same way as without threads,
 
+required=perl-threads
 . ./defs || Exit 1
 
 set -e
index 5db9c67..104376a 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2008  Free Software Foundation, Inc.
+# Copyright (C) 2008, 2009  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,6 +21,7 @@
 #    with --add-missing, even with concurrent file requirements, and the
 #    installation of aux files should be race-free,
 
+required=perl-threads
 . ./defs || Exit 1
 
 set -e
index e7dcbe5..6ae93a2 100755 (executable)
@@ -1,5 +1,6 @@
 #! /bin/sh
-# Copyright (C) 1998, 2000, 2001, 2002  Free Software Foundation, Inc.
+# Copyright (C) 1998, 2000, 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
 
 . ./defs || Exit 1
 
-cat > configure.in << 'END'
-AC_INIT
-AM_INIT_AUTOMAKE(nonesuch, nonesuch)
+set -e
+
+cat >> configure.in << 'END'
 AC_PROG_CC
-AC_PROG_RANLIB
-AC_OUTPUT(Makefile)
 END
 
 cat > Makefile.am << 'END'
@@ -33,8 +32,8 @@ zar.c\
 doz.c
 END
 
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
 
 $FGREP zar.cdoz Makefile.in && Exit 1
 Exit 0
index 40f9a43..dfb48ae 100755 (executable)
@@ -17,7 +17,7 @@
 # Test to make sure that -Wportability understands %-style pattern
 # rules.
 
-. ./defs
+. ./defs || Exit 1
 
 set -e
 
index f7c7f14..09e4f84 100755 (executable)
@@ -19,7 +19,7 @@
 # `${ARCH}/%.$(OBJEXT):'.
 # Report from Ralf Corsepius.
 
-. ./defs
+. ./defs || Exit 1
 
 set -e
 
index 0f57915..9c9f3d3 100755 (executable)
@@ -17,7 +17,7 @@
 # Make sure .PHONY can be given dependencies several times.
 # From Ralf Corsepius.
 
-. ./defs
+. ./defs || Exit 1
 
 set -e
 
index 66eec8f..5cfa873 100755 (executable)
@@ -18,6 +18,8 @@
 
 . ./defs || Exit 1
 
+set -e
+
 cat > Makefile.am << 'END'
 data_DATA = zar
 data_DATA += doz
index 4e03d37..88b2cb7 100755 (executable)
@@ -37,10 +37,10 @@ AUTOMAKE_fails
 
 # We expect the following diagnostic:
 #
-# Makefile.am:4: Cannot apply `+=' because `INCLUDES' is not defined in
+# Makefile.am:4: cannot apply `+=' because `INCLUDES' is not defined in
 # Makefile.am:4: the following conditions:
 # Makefile.am:4:   !CHECK
-# Makefile.am:4: Either define `INCLUDES' in these conditions, or use
+# Makefile.am:4: either define `INCLUDES' in these conditions, or use
 # Makefile.am:4: `+=' in the same conditions as the definitions.
 
 # Is !CHECK mentioned?
index fb30a1d..7d65bea 100755 (executable)
@@ -55,10 +55,10 @@ AUTOMAKE_fails
 
 # We expect the following diagnostic:
 #
-# Makefile.am:19: Cannot apply `+=' because `B' is not defined in
+# Makefile.am:19: cannot apply `+=' because `B' is not defined in
 # Makefile.am:19: the following conditions:
 # Makefile.am:19:   !COND1 and !COND3
-# Makefile.am:19: Either define `B' in these conditions, or use
+# Makefile.am:19: either define `B' in these conditions, or use
 # Makefile.am:19: `+=' in the same conditions as the definitions.
 #
 # It would be nice if Automake could print only COND3_FALSE and
diff --git a/tests/posixsubst-data.test b/tests/posixsubst-data.test
new file mode 100755 (executable)
index 0000000..210279f
--- /dev/null
@@ -0,0 +1,76 @@
+#! /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/>.
+
+# Test that POSIX variable expansion `$(var:str=rpl)' works
+# in when used with the DATA primary.
+
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+foodir = $(prefix)
+
+t1 = foo1 foo2
+t2 = barx
+t3 = baz.y
+
+bar.data bazzardoz:
+       : > $@
+CLEANFILES = bar.data bazzardoz
+
+# Also try an empty match suffix, to ensure that the `:=' in there is
+# not confused by the parser with an unportable assignment operator.
+dist_foo_DATA = $(t1:=.txt)
+foo_DATA = $(t2:x=.data)
+nodist_foo_DATA = $(t3:.y=zardoz)
+
+check-local: test
+.PHONY: test
+test: distdir
+       ls -l $(distdir)
+       test ! -r $(distdir)/foo.data
+       test ! -r $(distdir)/bazzardoz
+
+installcheck-local:
+       ls -l $(prefix)
+       test -f $(prefix)/foo1.txt
+       test -f $(prefix)/foo2.txt
+       test -f $(prefix)/bar.data
+       test -f $(prefix)/bazzardoz
+END
+
+: > foo1.txt
+: > foo2.txt
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+cwd=`pwd` || Exit 1
+./configure --prefix="$cwd/_inst"
+$MAKE install
+test -f bar.data
+test -f bazzardoz
+$MAKE test
+$MAKE installcheck
+$MAKE distcheck
+
+:
diff --git a/tests/posixsubst-extradist.test b/tests/posixsubst-extradist.test
new file mode 100755 (executable)
index 0000000..c9a20bf
--- /dev/null
@@ -0,0 +1,56 @@
+#! /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/>.
+
+# Test that POSIX variable expansion `$(var:str=rpl)' works when used
+# in EXTRA_DIST.
+
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+t1 = foo1 foo2
+t2 = bar.x
+t3 = baz-y
+# Also try an empty match suffix, to ensure that the `:=' in there is
+# not confused by the parser with an unportable assignment operator.
+EXTRA_DIST = $(t1:=.c) $(t2:.x=.f) $(t3:-y=ar)
+bazar bar.f:
+       : > $@
+.PHONY: test
+test: distdir
+       ls -l $(distdir)
+       test -f $(distdir)/foo1.c
+       test -f $(distdir)/foo2.c
+       test -f $(distdir)/bar.f
+       test -f $(distdir)/bazar
+END
+
+: > foo1.c
+: > foo2.c
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+./configure
+$MAKE test
+
+:
diff --git a/tests/posixsubst-ldadd.test b/tests/posixsubst-ldadd.test
new file mode 100755 (executable)
index 0000000..6eb29f9
--- /dev/null
@@ -0,0 +1,78 @@
+#! /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/>.
+
+# Test that POSIX variable expansion `$(var:str=rpl)' works
+# in when used in LDADD.
+
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_PROG_CC
+AC_PROG_RANLIB
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+u = libquux1.lib libquux2.lib
+v = libquux1
+w = none
+
+zardozdir = $(prefix)/zardoz
+zardoz_PROGRAMS = foo bar
+
+noinst_LIBRARIES = libquux1.a libquux2.a libquux3.a
+
+# Also try an empty match suffix, to ensure that the `:=' in there is
+# not confused by the parser with an unportable assignment operator.
+LDADD = $(u:.lib=.a)
+bar_LDADD = $(v:=.a) libquux2.a $(w:none=libquux3.a)
+
+libquux1.c:
+       echo 'int quux1(void) { return 0; }' > $@
+CLEANFILES = libquux1.c # for FreeBSD make
+END
+
+cat > foo.c <<'END'
+int main(void)
+{
+  int quux1(void), quux2(void);
+  return quux1() + quux2();
+}
+END
+
+cat > bar.c <<'END'
+int main(void)
+{
+  int quux1(void), quux2(void), quux3(void);
+  return quux1() + quux2() + quux3();
+}
+END
+
+echo 'int quux2(void) { return 0; }' > libquux2.c
+echo 'int quux3(void) { return 0; }' > libquux3.c
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+./configure
+$MAKE
+test -f libquux1.c
+$MAKE distcheck
+
+:
diff --git a/tests/posixsubst-libraries.test b/tests/posixsubst-libraries.test
new file mode 100755 (executable)
index 0000000..90cc2e5
--- /dev/null
@@ -0,0 +1,65 @@
+#! /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/>.
+
+# Test that POSIX variable expansion `$(var:str=rpl)' works when used
+# with the LIBRARIES primary in a "simple" way.
+# Keep this in sync with sister test `posixsubst-ltlibraries.test'.
+
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_PROG_CC
+AC_PROG_RANLIB
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+foolibs = libfoo1 libfoo2
+barlibs = libbaz
+
+# Also try an empty match suffix, to ensure that the `:=' in there is
+# not confused by the parser with an unportable assignment operator.
+lib_LIBRARIES = $(foolibs:=.a) $(barlibs:z=r.a)
+
+libbar.c:
+       echo 'int bar(void) { return 0; }' > $@
+CLEANFILES = libbar.c # for FreeBSD make
+
+installcheck-local:
+       ls -l $(prefix)/lib
+       test -f $(prefix)/lib/libfoo1.a
+       test -f $(prefix)/lib/libfoo2.a
+       test -f $(prefix)/lib/libbar.a
+END
+
+echo 'int bar1(void) { return 0; }' > libfoo1.c
+echo 'int bar2(void) { return 0; }' > libfoo2.c
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+cwd=`pwd` || Exit 1
+./configure --prefix="$cwd/_inst"
+$MAKE
+test -f libfoo2.c
+$MAKE install
+$MAKE installcheck
+$MAKE distcheck
+
+:
diff --git a/tests/posixsubst-ltlibraries.test b/tests/posixsubst-ltlibraries.test
new file mode 100755 (executable)
index 0000000..93a1d57
--- /dev/null
@@ -0,0 +1,67 @@
+#! /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/>.
+
+# Test that POSIX variable expansion `$(var:str=rpl)' works when used
+# with the LTLIBRARIES primary in a "simple" way.
+# Keep this in sync with sister test `posixsubst-libraries.test'.
+
+required='libtool libtoolize'
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_PROG_CC
+AC_PROG_LIBTOOL
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+foolibs = libfoo1 libfoo2
+barlibs = libbaz
+
+# Also try an empty match suffix, to ensure that the `:=' in there is
+# not confused by the parser with an unportable assignment operator.
+lib_LTLIBRARIES = $(foolibs:=.la) $(barlibs:z=r.la)
+
+libbar.c:
+       echo 'int bar(void) { return 0; }' > $@
+CLEANFILES = libbar.c # for FreeBSD make
+
+installcheck-local:
+       ls -l $(prefix)/lib
+       test -f $(prefix)/lib/libfoo1.la
+       test -f $(prefix)/lib/libfoo2.la
+       test -f $(prefix)/lib/libbar.la
+END
+
+echo 'int bar1(void) { return 0; }' > libfoo1.c
+echo 'int bar2(void) { return 0; }' > libfoo2.c
+
+libtoolize
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
+
+cwd=`pwd` || Exit 1
+./configure --prefix="$cwd/_inst"
+$MAKE
+test -f libfoo2.c
+$MAKE install
+$MAKE installcheck
+$MAKE distcheck
+
+:
diff --git a/tests/posixsubst-programs.test b/tests/posixsubst-programs.test
new file mode 100755 (executable)
index 0000000..69252dd
--- /dev/null
@@ -0,0 +1,64 @@
+#! /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/>.
+
+# Test that POSIX variable expansion `$(var:str=rpl)' works when used
+# with the PROGRAMS primary.
+
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_PROG_CC
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+t1 = foo1 foo2
+t2 = barx bar2
+
+# Also try an empty match suffix, to ensure that the `:=' in there is
+# not confused by the parser with an unportable assignment operator.
+bin_PROGRAMS = $(t1:=-p) $(t2:2=y)
+
+installcheck-local:
+       ls -l $(prefix)/bin
+       test -f $(prefix)/bin/foo1-p$(EXEEXT)
+       test -x $(prefix)/bin/foo1-p$(EXEEXT)
+       test -f $(prefix)/bin/foo2-p$(EXEEXT)
+       test -x $(prefix)/bin/foo2-p$(EXEEXT)
+       test -f $(prefix)/bin/barx$(EXEEXT)
+       test -x $(prefix)/bin/barx$(EXEEXT)
+       test -f $(prefix)/bin/bary$(EXEEXT)
+       test -x $(prefix)/bin/bary$(EXEEXT)
+END
+
+for f in foo1-p.c foo2-p.c barx.c bary.c; do
+  echo 'int main(void) { return 0; }' > $f
+done
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+cwd=`pwd` || Exit 1
+./configure --prefix="$cwd/_inst"
+$MAKE
+$MAKE install
+$MAKE installcheck
+$MAKE distcheck
+
+:
diff --git a/tests/posixsubst-scripts.test b/tests/posixsubst-scripts.test
new file mode 100755 (executable)
index 0000000..918bced
--- /dev/null
@@ -0,0 +1,101 @@
+#! /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/>.
+
+# Test that POSIX variable expansion `$(var:str=rpl)' works when used
+# with the SCRIPTS primary.
+
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_OUTPUT
+END
+
+# We have to be careful with 'test -x' commands on MinGW/MSYS, because
+# the file system does not actually have execute permission information.
+# Instead, that is emulated by looking at the file content, and returning
+# 0 if the file starts with, e.g., a COFF header or with '#!'.
+# So we need to create actual scripts in the make rules and in the file
+# creation below.
+
+cat > Makefile.am << 'END'
+t1 = foo1 foo2
+t2 = bar1x bar2
+t3 = quu-baz
+
+bar1 bar2:
+       (echo '#!/bin/sh' && echo 'exit 0') > $@
+quux.pl:
+       (echo '#!/bin/perl' && echo '1;') > $@
+CLEANFILES = bar1 bar2 quux.pl
+
+# Also try an empty match suffix, to ensure that the `:=' in there is
+# not confused by the parser with an unportable assignment operator.
+dist_sbin_SCRIPTS = $(t1:=.sh)
+libexec_SCRIPTS = $(t2:x=)
+nodist_bin_SCRIPTS = $(t3:-baz=x.pl)
+
+check-local: test1 test2
+.PHONY: test1 test2
+test1:
+       ls -l
+       test -f bar1
+       test -f bar2
+       test -f quux.pl
+test2: distdir
+       ls -l $(distdir)
+       ## the scripts foo1.sh and foo2.sh should be distributed
+       test -f $(distdir)/foo1.sh
+       test -f $(distdir)/foo2.sh
+       ## the scripts bar1, bar2 and quux.pl shouldn't be distributed
+       test ! -r $(distdir)/bar1
+       test ! -r $(distdir)/bar2
+       test ! -r $(distdir)/quux.pl
+
+installcheck-local:
+       ls -l $(prefix)/libexec $(prefix)/bin $(prefix)/sbin
+       test -f $(prefix)/sbin/foo1.sh
+       test -x $(prefix)/sbin/foo1.sh
+       test -f $(prefix)/sbin/foo2.sh
+       test -x $(prefix)/sbin/foo2.sh
+       test -f $(prefix)/libexec/bar1
+       test -x $(prefix)/libexec/bar1
+       test -f $(prefix)/libexec/bar2
+       test -x $(prefix)/libexec/bar2
+       test -f $(prefix)/bin/quux.pl
+       test -x $(prefix)/bin/quux.pl
+END
+
+cat > foo1.sh <<'END'
+#!/bin/sh
+exit 0
+END
+cp foo1.sh foo2.sh
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+cwd=`pwd` || Exit 1
+./configure --prefix="$cwd/_inst"
+$MAKE
+$MAKE test1 test2
+$MAKE install
+$MAKE installcheck
+$MAKE distcheck
+
+:
diff --git a/tests/posixsubst-sources.test b/tests/posixsubst-sources.test
new file mode 100755 (executable)
index 0000000..14d438d
--- /dev/null
@@ -0,0 +1,82 @@
+#! /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/>.
+
+# Test that POSIX variable expansion `$(var:str=rpl)' works when used
+# with the SOURCES primary.
+
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_PROG_CC
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+bin_PROGRAMS = foo
+
+FOO = foo.cxx
+BAR = bar__
+BAZ = baz.
+
+# Also try an empty match suffix, to ensure that the `:=' in there is
+# not confused by the parser with an unportable assignment operator.
+foo_SOURCES = main.c $(FOO:.cxx=.c)
+dist_foo_SOURCES = $(BAR:__=.c)
+nodist_foo_SOURCES = $(BAZ:=c)
+
+bar.c baz.c:
+       echo 'int $@ (void) { return 0; }' | sed 's/\.c //' > $@
+CLEANFILES = baz.c
+CLEANFILES += bar.c # for FreeBSD make
+
+.PHONY: test test2
+check-local: test1 test2
+test1:
+       ls -l . $(srcdir)
+       test -f $(srcdir)/bar.c
+       test -f baz.c
+test2: distdir
+       ls -l $(distdir)
+       ## these sources should be distributed ...
+       test -f $(distdir)/bar.c
+       test -f $(distdir)/foo.c
+       test -f $(distdir)/main.c
+       ## ... and this shouldn't
+       test ! -r $(distdir)/baz.c
+END
+
+cat > main.c <<'END'
+int main(void)
+{
+  int foo(void), bar(void), baz(void);
+  return foo() + bar() + baz();
+}
+END
+
+echo 'int foo(void) { return 0; }' > foo.c
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+./configure
+$MAKE
+$MAKE test1 test2
+$MAKE distcheck
+
+:
diff --git a/tests/posixsubst-tests.test b/tests/posixsubst-tests.test
new file mode 100755 (executable)
index 0000000..3fca8f4
--- /dev/null
@@ -0,0 +1,70 @@
+#! /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/>.
+
+# Test that POSIX variable expansion `$(var:str=rpl)' works when used
+# with the TESTS special variable.
+
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+t1 = foo1 foo2
+t2 = barx
+t3 = bar2
+
+foo2.test barz:
+       (echo '#!/bin/sh' && echo 'exit 0') > $@ && chmod a+x $@
+CLEANFILES = foo2.test barz # for FreeBSD make
+
+# Also try an empty match suffix, to ensure that the `:=' in there is
+# not confused by the parser with an unportable assignment operator.
+TESTS = $(t1:=.test) $(t2:x=y) $(t3:2=z)
+
+EXTRA_DIST = $(TESTS)
+MOSTLYCLEANFILES = *.out
+END
+
+cat > foo1.test <<'END'
+#!/bin/sh
+touch foo1.out
+test x"${TESTSUITE_OK-no}" = x"yes"
+END
+sed 's/foo1/bary/g' foo1.test > bary
+chmod +x foo1.test bary
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+./configure
+$MAKE check >out 2>&1 && { cat out; Exit 1; }
+cat out
+ls -l
+grep '^FAIL: foo1\.test *$' out
+grep '^PASS: foo2\.test *$' out
+grep '^FAIL: bary *$' out
+grep '^PASS: barz *$' out
+test -f foo1.out
+test -f bary.out
+
+TESTSUITE_OK=yes $MAKE distcheck
+
+:
index 6c61a2e..aaeedcb 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 1999, 2001, 2002  Free Software Foundation, Inc.
+# Copyright (C) 1999, 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
@@ -19,6 +19,8 @@
 
 . ./defs || Exit 1
 
+set -e
+
 cat >> configure.in << 'END'
 AC_PROG_F77
 END
@@ -28,8 +30,7 @@ bin_PROGRAMS = ppf
 ppf_SOURCES = foo.F q.r
 END
 
-: > foo.F
-: > q.r
-
-$ACLOCAL || Exit 1
+$ACLOCAL
 $AUTOMAKE
+
+:
index 0f15f37..9163aac 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2004, 2006, 2008  Free Software Foundation, Inc.
+# Copyright (C) 2004, 2006, 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
@@ -44,8 +44,8 @@ grep 'no suitable Python interpreter found' stderr
 
 sed 's/AM_PATH_PYTHON/AM_PATH_PYTHON(,,:)/' configure.in >configure.int
 mv -f configure.int configure.in
-$ACLOCAL
-$AUTOCONF
+$ACLOCAL --force
+$AUTOCONF --force
 # This one should define PYTHON as : and exit succesfully
 ./configure
 
diff --git a/tests/regex-obsolete.test b/tests/regex-obsolete.test
new file mode 100755 (executable)
index 0000000..c283025
--- /dev/null
@@ -0,0 +1,32 @@
+#! /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 tha the AM_WITH_REGEX macro is reported as obsolete.
+
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AM_WITH_REGEX
+END
+
+$ACLOCAL
+$AUTOCONF -Werror -Wobsolete 2>stderr && { cat stderr >&2; Exit 1; }
+cat stderr >&2
+grep '^configure\.in:.*AM_WITH_REGEX.*obsolete' stderr
+
+:
index 9c86b1b..4d3036b 100755 (executable)
@@ -1,5 +1,6 @@
 #! /bin/sh
-# Copyright (C) 1996, 2000, 2001, 2002  Free Software Foundation, Inc.
+# Copyright (C) 1996, 2000, 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
 # 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 remaking rules in subdir are correctly generated.
+# Weak "grepping" test trying to ensure that remaking rules in a subdir
+# are correctly generated.
+# See also sister functional test `remake1a.test'.
 
 . ./defs || Exit 1
 
-cat > configure.in << 'END'
-AC_INIT
-AM_INIT_AUTOMAKE(nonesuch, nonesuch)
-AC_OUTPUT(sub/Makefile)
+set -e
+
+cat > configure.in <<END
+AC_INIT([$me], [1.0])
+AM_INIT_AUTOMAKE
+AC_CONFIG_FILES([sub/Makefile])
+AC_OUTPUT
 END
 
 mkdir sub
 : > sub/Makefile.am
 
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
 
 grep '^Makefile' sub/Makefile.in
+
+:
diff --git a/tests/remake10a.test b/tests/remake10a.test
new file mode 100755 (executable)
index 0000000..cda72b0
--- /dev/null
@@ -0,0 +1,108 @@
+#! /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/>.
+
+# Test remake rules for m4 files included (also recursively) by
+# configure.ac.
+# Keep in sync with sister tests `remake10b.test' and `remake10c.test'.
+
+required=GNUmake
+. ./defs || Exit 1
+
+set -e
+
+magic1=::MagicStringOne::
+magic2=__MagicStringTwo__
+magic3=%%MagicStringThree%%
+
+cat >> configure.in <<END
+m4_include([foo.m4])
+AC_SUBST([FINGERPRINT], [my_fingerprint])
+AC_OUTPUT
+END
+
+cat > Makefile.am <<'END'
+.PHONY: nil
+nil:
+## Used by "make distcheck" later.
+check-local:
+       test -f $(top_srcdir)/foo.m4
+       test ! -r $(top_srcdir)/bar.m4
+       test x'$(FINGERPRINT)' = x'DummyValue'
+END
+
+echo 'm4_define([my_fingerprint], [BadBadBad])' > foo.m4
+
+$sleep # so that generated autotools files will be newer than prerequisites
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+for vpath in : false; do
+
+  if $vpath; then
+    mkdir build
+    cd build
+    top_srcdir=..
+  else
+    top_srcdir=.
+  fi
+
+  $top_srcdir/configure
+  $MAKE # should be no-op
+
+  $sleep
+  echo "m4_define([my_fingerprint], [$magic1])" > $top_srcdir/foo.m4
+  $MAKE nil
+  $FGREP FINGERPRINT Makefile # for debugging
+  $FGREP $magic1 Makefile
+
+  $sleep
+  echo "m4_define([my_fingerprint], [$magic2])" > $top_srcdir/foo.m4
+  $MAKE nil
+  $FGREP FINGERPRINT Makefile # for debugging
+  $FGREP $magic1 Makefile && Exit 1
+  $FGREP $magic2 Makefile
+
+  $sleep
+  echo "m4_include([bar.m4])" > $top_srcdir/foo.m4
+  echo "m4_define([my_fingerprint], [$magic3])" > $top_srcdir/bar.m4
+  $MAKE nil
+  $FGREP FINGERPRINT Makefile # for debugging
+  $FGREP $magic1 Makefile && Exit 1
+  $FGREP $magic2 Makefile && Exit 1
+  $FGREP $magic3 Makefile
+
+  $sleep
+  echo "m4_define([my_fingerprint], [$magic1])" > $top_srcdir/bar.m4
+  $MAKE nil
+  $FGREP $magic2 Makefile && Exit 1
+  $FGREP $magic3 Makefile && Exit 1
+  $FGREP $magic1 Makefile
+
+  $sleep
+  echo "m4_define([my_fingerprint], [DummyValue])" > $top_srcdir/foo.m4
+  $MAKE distcheck
+  $FGREP $magic1 Makefile && Exit 1 # sanity check
+  $FGREP $magic2 Makefile && Exit 1 # likewise
+  $FGREP $magic3 Makefile && Exit 1 # likewise
+
+  $MAKE distclean
+
+  cd $top_srcdir
+
+done
+
+:
diff --git a/tests/remake10b.test b/tests/remake10b.test
new file mode 100755 (executable)
index 0000000..53a7d13
--- /dev/null
@@ -0,0 +1,107 @@
+#! /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/>.
+
+# Test remake rules for am files included (also recursively) by
+# Makefile.am.
+# Keep in sync with sister tests `remake10a.test' and `remake10c.test'.
+
+required=GNUmake
+. ./defs || Exit 1
+
+set -e
+
+magic1=::MagicStringOne::
+magic2=__MagicStringTwo__
+magic3=%%MagicStringThree%%
+
+cat >> configure.in <<'END'
+AC_OUTPUT
+END
+
+cat > Makefile.am <<'END'
+.PHONY: nil
+nil:
+include foo.am
+## Used by "make distcheck" later.
+check-local:
+       test -f $(top_srcdir)/foo.am
+       test ! -r $(top_srcdir)/bar.am
+       test x'$(FINGERPRINT)' = x'DummyValue'
+END
+
+echo 'FINGERPRINT = BadBadBad' > foo.am
+
+$sleep # so that generated autotools files will be newer than prerequisites
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+for vpath in : false; do
+
+  if $vpath; then
+    mkdir build
+    cd build
+    top_srcdir=..
+  else
+    top_srcdir=.
+  fi
+
+  $top_srcdir/configure
+  $MAKE # should be no-op
+
+  $sleep
+  echo "FINGERPRINT = $magic1" > $top_srcdir/foo.am
+  $MAKE nil
+  $FGREP FINGERPRINT Makefile # for debugging
+  $FGREP $magic1 Makefile
+
+  $sleep
+  echo "FINGERPRINT = $magic2" > $top_srcdir/foo.am
+  $MAKE nil
+  $FGREP FINGERPRINT Makefile # for debugging
+  $FGREP $magic1 Makefile && Exit 1
+  $FGREP $magic2 Makefile
+
+  $sleep
+  echo 'include $(top_srcdir)/bar.am' > $top_srcdir/foo.am
+  echo "FINGERPRINT = $magic3" > $top_srcdir/bar.am
+  $MAKE nil
+  $FGREP FINGERPRINT Makefile # for debugging
+  $FGREP $magic1 Makefile && Exit 1
+  $FGREP $magic2 Makefile && Exit 1
+  $FGREP $magic3 Makefile
+
+  $sleep
+  echo "FINGERPRINT = $magic1" > $top_srcdir/bar.am
+  $MAKE nil
+  $FGREP $magic2 Makefile && Exit 1
+  $FGREP $magic3 Makefile && Exit 1
+  $FGREP $magic1 Makefile
+
+  $sleep
+  echo "FINGERPRINT = DummyValue" > $top_srcdir/foo.am
+  $MAKE distcheck
+  $FGREP $magic1 Makefile && Exit 1 # sanity check
+  $FGREP $magic2 Makefile && Exit 1 # likewise
+  $FGREP $magic3 Makefile && Exit 1 # likewise
+
+  $MAKE distclean
+
+  cd $top_srcdir
+
+done
+
+:
diff --git a/tests/remake10c.test b/tests/remake10c.test
new file mode 100755 (executable)
index 0000000..96e2c0d
--- /dev/null
@@ -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/>.
+
+# Test remake rules for m4 files included (also recursively) by
+# aclocal.m4.
+# Keep in sync with sister tests `remake10a.test' and `remake10b.test'.
+
+required=GNUmake
+. ./defs || Exit 1
+
+set -e
+
+magic1=::MagicStringOne::
+magic2=__MagicStringTwo__
+magic3=%%MagicStringThree%%
+
+cat >> configure.in <<END
+FINGERPRINT='my_fingerprint'
+AC_SUBST([FINGERPRINT])
+AC_OUTPUT
+END
+
+cat > Makefile.am <<'END'
+ACLOCAL_AMFLAGS = -I m4
+.PHONY: nil
+nil:
+## Used by "make distcheck" later.
+check-local:
+       test -f $(top_srcdir)/m4/foo.m4
+       test ! -r $(top_srcdir)/m4/bar.m4
+       test x'$(FINGERPRINT)' = x'DummyValue'
+END
+
+mkdir m4
+echo 'AC_DEFUN([my_fingerprint], [BadBadBad])' > m4/foo.m4
+
+$sleep # so that generated autotools files will be newer than prerequisites
+$ACLOCAL -I m4
+$AUTOCONF
+$AUTOMAKE
+
+for vpath in : false; do
+
+  if $vpath; then
+    mkdir build
+    cd build
+    top_srcdir=..
+  else
+    top_srcdir=.
+  fi
+
+  $top_srcdir/configure
+  $MAKE # should be no-op
+
+  $sleep
+  echo "AC_DEFUN([my_fingerprint], [$magic1])" > $top_srcdir/m4/foo.m4
+  $MAKE nil
+  $FGREP FINGERPRINT Makefile # for debugging
+  $FGREP $magic1 Makefile
+
+  $sleep
+  echo "AC_DEFUN([my_fingerprint], [$magic2])" > $top_srcdir/m4/foo.m4
+  $MAKE nil
+  $FGREP FINGERPRINT Makefile # for debugging
+  $FGREP $magic1 Makefile && Exit 1
+  $FGREP $magic2 Makefile
+
+  $sleep
+  echo "m4_include([m4/bar.m4])" > $top_srcdir/m4/foo.m4
+  echo "AC_DEFUN([my_fingerprint], [$magic3])" > $top_srcdir/m4/bar.m4
+  $MAKE nil
+  $FGREP FINGERPRINT Makefile # for debugging
+  $FGREP $magic1 Makefile && Exit 1
+  $FGREP $magic2 Makefile && Exit 1
+  $FGREP $magic3 Makefile
+
+  $sleep
+  echo "AC_DEFUN([my_fingerprint], [$magic1])" > $top_srcdir/m4/bar.m4
+  $MAKE nil
+  $FGREP $magic2 Makefile && Exit 1
+  $FGREP $magic3 Makefile && Exit 1
+  $FGREP $magic1 Makefile
+
+  $sleep
+  echo "AC_DEFUN([my_fingerprint], [DummyValue])" > $top_srcdir/m4/foo.m4
+  echo "AC_DEFUN([AM_UNUSED], [NoSuchMacro])" > $top_srcdir/m4/bar.m4
+  $MAKE nil # required to work around limitation of GNU make 3.82
+  $MAKE distcheck
+  $FGREP $magic1 Makefile && Exit 1 # sanity check
+  $FGREP $magic2 Makefile && Exit 1 # likewise
+  $FGREP $magic3 Makefile && Exit 1 # likewise
+
+  $MAKE distclean
+
+  cd $top_srcdir
+
+done
+
+:
diff --git a/tests/remake11.test b/tests/remake11.test
new file mode 100755 (executable)
index 0000000..7eaad6c
--- /dev/null
@@ -0,0 +1,84 @@
+#! /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/>.
+
+# Test remake rules in deeply nested subdirectories, and with a lot
+# of files.  This is basically a mild stress test, ensuring that rebuild
+# rules don't break in obvious ways in a slightly "heavier than usual"
+# setup.
+
+required=GNUmake
+. ./defs || Exit 1
+
+set -e
+
+ocwd=`pwd` || Exit 1
+
+magic1=::MagicStringOne::
+magic2=__MagicStringTwo__
+
+echo "AC_SUBST([FOO], [$magic1])" >> configure.in
+
+echo "@FOO@" > bar.in
+echo "AC_CONFIG_FILES([bar])" >> configure.in
+for i in 0 1 2 3 4 5 6 7 8 9; do
+  d=${d+"$d/"}sub$i
+  echo "SUBDIRS = sub$i" > Makefile.am
+  echo "AC_CONFIG_FILES([$d/Makefile])" >> "$ocwd"/configure.in
+  echo "AC_CONFIG_FILES([$d/bar])" >> "$ocwd"/configure.in
+  mkdir sub$i
+  cd sub$i
+  echo "$d: @FOO@" > bar.in
+done
+echo AC_OUTPUT >> "$ocwd"/configure.in
+: > Makefile.am
+unset d i
+bottom=`pwd`
+
+cd "$ocwd"
+
+makefiles_am_list=`find . -name Makefile.am | LC_ALL=C sort`
+makefiles_list=`echo "$makefiles_am_list" | sed 's/\.am$//'`
+bar_in_list=`find . -name bar.in | LC_ALL=C sort`
+bar_list=`echo "$bar_in_list" | sed 's/\.in$//'`
+
+cat configure.in # useful for debugging
+
+$ACLOCAL
+$AUTOMAKE
+$AUTOCONF
+
+./configure
+
+for f in configure config.status $makefiles_list $bar_list; do
+  $FGREP "$magic1" $f
+done
+
+$sleep
+sed "s/$magic1/$magic2/" configure.in >configure.tmp
+mv -f configure.tmp configure.in
+
+cd "$bottom"
+$MAKE
+cd "$ocwd"
+
+for f in configure config.status $makefiles_list $bar_list; do
+  $FGREP "$magic2" $f
+done
+$FGREP "$magic1" configure config.status $makefiles_list $bar_list && Exit 1
+
+$MAKE distcheck
+
+:
diff --git a/tests/remake12.test b/tests/remake12.test
new file mode 100755 (executable)
index 0000000..63ea39d
--- /dev/null
@@ -0,0 +1,122 @@
+#! /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/>.
+
+# Test basic remake rules for Makefiles with non-default names
+# and/or with multiple sources.
+
+required=GNUmake
+. ./defs || Exit 1
+
+set -e
+
+magic1=::MagicStringOne::
+magic2=__MagicStringTwo__
+magic3=%%MagicStringThree%%
+
+cat > configure.in <<END
+AC_INIT([$me], [1.0])
+AM_INIT_AUTOMAKE
+AC_CONFIG_FILES([zardoz])
+AC_CONFIG_LINKS([Makefile:Makefile])
+AC_OUTPUT
+END
+
+cat > zardoz.am <<END
+EXTRA_DIST = Makefile
+#H: $magic1
+END
+
+cat > Makefile <<END
+include zardoz
+nil:
+.PHONY: nil
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+./configure
+
+$MAKE nil
+grep '^#H:' zardoz.in # for debugging
+$FGREP $magic1 zardoz
+$FGREP $magic1 zardoz.in
+$MAKE distcheck
+$MAKE distclean # this shouldn't remove Makefile
+ls -l
+test -f Makefile
+
+./configure
+
+$sleep
+sed "s/%MAGIC3%/$magic3/" >> Makefile <<'END'
+my-check:
+       ls -l . $(srcdir) ;: for debugging
+       test -f $(srcdir)/quux.am
+       test -f $(srcdir)/quux.in
+       test -f $(srcdir)/bot.in
+       test -f $(srcdir)/top.in
+       test ! -r $(srcdir)/zardoz.am
+       test ! -r $(srcdir)/zardoz.in
+       grep FOO zardoz ;: for debugging
+       test x'$(FOO)' = x'%MAGIC3%'
+test:
+       ls -l ;: for debugging
+       test x'$(FOO)' = x'dummy'
+.PHONY: test my-check
+END
+sed "s/^#H:.*/#H: $magic2/" zardoz.am > t
+cat >> t <<'END'
+# used by "make distcheck" below
+check-local: my-check
+END
+mv -f t zardoz.am
+cat zardoz.am # for debugging
+$MAKE nil
+$FGREP my-check zardoz # sanity check
+$FGREP $magic1 zardoz zardoz.in && Exit 1
+$FGREP $magic2 zardoz
+$FGREP $magic2 zardoz.in
+
+./configure
+
+$sleep
+sed 's/^\(AC_CONFIG_FILES\)(.*/\1([zardoz:top.in:quux.in:bot.in])/' \
+  <configure.in >t
+mv -f t configure.in
+cat configure.in # for debugging
+sed '/^#H:/d' zardoz.am > quux.am
+echo 'FOO = dummy' >> quux.am
+echo 'BAR = $(BAZ)' > top.in
+echo "BAZ = $magic3" > bot.in
+$MAKE test
+$FGREP my-check zardoz # sanity check
+$FGREP $magic3 quux.in && Exit 1
+$FGREP $magic3 zardoz
+$FGREP $magic1 zardoz && Exit 1
+$FGREP $magic2 zardoz && Exit 1
+# After the remake above, the files `zardoz.am' and `zardoz.in'
+# should be no more needed
+echo 'endif' > zardoz.am # put in syntax error
+$MAKE test
+rm -f zardoz.in zardoz.am # get rid of them
+$MAKE test
+
+echo 'FOO = $(BAR)' >> quux.am
+$MAKE distcheck
+
+:
diff --git a/tests/remake1a.test b/tests/remake1a.test
new file mode 100755 (executable)
index 0000000..ce80c19
--- /dev/null
@@ -0,0 +1,57 @@
+#! /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 remaking rules in subdir are correctly generated.
+# See also sister "grepping" test `remake.test'.
+
+. ./defs || Exit 1
+
+fingerprint='=/FiNgErPrInT/='
+
+set -e
+
+cat > configure.in <<END
+AC_INIT([$me], [1.0])
+AM_INIT_AUTOMAKE
+AC_CONFIG_FILES([sub/Makefile])
+AC_OUTPUT
+END
+
+mkdir sub
+: > sub/Makefile.am
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+./configure
+
+# Rebuild rules should work even if there is no top-level
+# makefiles, if we are careful enough to trigger them only
+# in proper subdirs
+$sleep
+echo "# $fingerprint" > sub/Makefile.am
+cd sub
+$MAKE Makefile
+cd ..
+# Check that no spurious Makefile has been created in the
+# top-level directory.
+test ! -r Makefile
+# Check that the Makefile in the subdirectory has been properly
+# updated.
+$FGREP "$fingerprint" sub/Makefile
+
+:
index 3b63dea..452e951 100755 (executable)
@@ -1,5 +1,6 @@
 #! /bin/sh
-# Copyright (C) 1996, 1997, 2000, 2001, 2002  Free Software Foundation, Inc.
+# Copyright (C) 1996, 1997, 2000, 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
 # 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 remaking rules in subdir are correct.
+# Weak "grepping" test trying to ensure that remaking rules in subdir
+# are correct even when there is no upper-level Makefile.
+# TODO: we should really add also functional tests for this!
 
 . ./defs || Exit 1
 
-cat > configure.in << 'END'
-AC_INIT
-AM_INIT_AUTOMAKE(nonesuch, nonesuch)
-AC_OUTPUT(sub/Makefile)
+set -e
+
+cat > configure.in <<END
+AC_INIT([$me], [1.0])
+AM_INIT_AUTOMAKE
+AC_CONFIG_FILES([sub/Makefile])
+AC_OUTPUT
 END
 
 mkdir sub
 : > sub/Makefile.am
 
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
+
+grep '\$(AUTOMAKE).*sub/Makefile' sub/Makefile.in
 
-grep 'AUTOMAKE.*sub/Makefile' sub/Makefile.in
+:
index 08ec16a..708dca8 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2001, 2002  Free Software Foundation, Inc.
+# Copyright (C) 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
 # 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 remaking rules work when there is no subdir Makefile.
+# Weak "grepping" test trying to ensure that remake rules work for files
+# in a subdirectory even when there is no Makefile for that subdirectory.
+# See also sister functional test `remake3a.test'.
 
 . ./defs || Exit 1
 
-cat > configure.in << 'END'
-AC_INIT
-AM_INIT_AUTOMAKE(nonesuch, nonesuch)
-AC_OUTPUT(Makefile sub/foo)
+set -e
+
+cat >> configure.in << 'END'
+AC_CONFIG_FILES([sub/foo])
+AC_OUTPUT
 END
 
 : > Makefile.am
@@ -29,7 +32,9 @@ END
 mkdir sub
 : > sub/foo.in
 
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
 
 grep '^sub/foo' Makefile.in
+
+:
diff --git a/tests/remake3a.test b/tests/remake3a.test
new file mode 100755 (executable)
index 0000000..a58c462
--- /dev/null
@@ -0,0 +1,75 @@
+#! /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 that remake rules work for files in a subdirectory even when
+# there is no Makefile for that subdirectory.
+# See also sister "grepping" test `remake3.test'.
+
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_CONFIG_FILES([sub/foo])
+AC_OUTPUT
+END
+
+cat > Makefile.am <<'END'
+all-local: sub/foo
+END
+
+mkdir sub
+: > sub/foo.in
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+# First a VPATH build.
+mkdir build
+cd build
+../configure
+$sleep
+test -f sub/foo
+test ! -s sub/foo
+echo '#GrepMe#' > ../sub/foo.in
+$MAKE
+grep '#GrepMe#' sub/foo
+
+cd ..
+
+# Now try an in-tree build.
+: > sub/foo.in # restore its original (empty) content
+./configure
+$sleep
+test -f sub/foo
+test ! -s sub/foo
+echo '#GrepMe#' > sub/foo.in
+$MAKE
+grep '#GrepMe#' sub/foo
+
+# Finally try to check the distribution.
+$sleep
+echo '%GrepMe%' > sub/foo.in
+cat >>Makefile.am <<END
+check-local:
+       grep '%GrepMe%' sub/foo
+END
+$MAKE
+grep "grep '%GrepMe%' sub/foo" Makefile.in # sanity check
+$MAKE distcheck
+
+:
index d6dbed7..0621c90 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2003  Free Software Foundation, Inc.
+# Copyright (C) 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
@@ -50,7 +50,9 @@ $MAKE
 $sleep
 touch aclocal.m4
 $MAKE distdir
-cd remake4-1.0
+cd $me-1.0
 test ! -f rebuild_ok
 ./configure
 $MAKE
+
+:
index d353632..133f9a0 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2003  Free Software Foundation, Inc.
+# Copyright (C) 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
@@ -25,7 +25,7 @@ set -e
 
 cat >>configure.in <<'EOF'
 AM_MAINTAINER_MODE
-m4_include(foo.m4)
+m4_include([foo.m4])
 if test ! -f rebuild_ok; then
   ACLOCAL=false
   AUTOMAKE=false
@@ -70,3 +70,8 @@ $sleep
 echo 'AC_SUBST([YIPPY_YIPPY_YEAH])' >foo.m4
 $MAKE
 grep YIPPY_YIPPY_YEAH Makefile
+
+# Try the distribution, for completeness.
+$MAKE distcheck
+
+:
index a25e486..885bcb4 100755 (executable)
@@ -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
 # Make sure remaking rules work when subdir Makefile.in has been removed.
 
 . ./defs || Exit 1
+
 set -e
 
-cat > configure.in << 'END'
-AC_INIT
-AM_INIT_AUTOMAKE(nonesuch, nonesuch)
-AC_OUTPUT(Makefile sub/Makefile)
+cat >> configure.in << 'END'
+AC_CONFIG_FILES([sub/Makefile])
+AC_OUTPUT
 END
 
 cat > Makefile.am <<'END'
@@ -42,23 +42,25 @@ $MAKE
 # only.
 
 rm -f Makefile.in
-$MAKE >stdout
+$MAKE >stdout || { cat stdout; Exit 1; }
 cat stdout
 test `grep -c " --run " stdout` -eq 1
 
 rm -f sub/Makefile.in
-$MAKE >stdout
+$MAKE >stdout || { cat stdout; Exit 1; }
 cat stdout
 test `grep -c " --run " stdout` -eq 1
 
 $sleep  # Let touched files appear newer.
 
 touch Makefile.am
-$MAKE >stdout
+$MAKE >stdout || { cat stdout; Exit 1; }
 cat stdout
 test `grep -c " --run " stdout` -eq 1
 
 touch sub/Makefile.am
-$MAKE >stdout
+$MAKE >stdout || { cat stdout; Exit 1; }
 cat stdout
 test `grep -c " --run " stdout` -eq 1
+
+:
index 670f60b..66d4b9c 100755 (executable)
@@ -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
 # Make sure remaking rules fail when they should.
 
 . ./defs || Exit 1
+
 set -e
 
-cat > configure.in << 'END'
-AC_INIT
-AM_INIT_AUTOMAKE(nonesuch, nonesuch)
-AC_OUTPUT(Makefile sub/Makefile)
+cat >> configure.in << 'END'
+AC_CONFIG_FILES([sub/Makefile])
+AC_OUTPUT
 END
 
 cat > Makefile.am <<'END'
@@ -67,4 +67,5 @@ $MAKE && Exit 1
 
 rm -f Makefile.in
 $MAKE && Exit 1
+
 :
diff --git a/tests/remake8a.test b/tests/remake8a.test
new file mode 100755 (executable)
index 0000000..9e66540
--- /dev/null
@@ -0,0 +1,193 @@
+#! /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/>.
+
+# Test basic remake rules for Makefiles, for an *in-tree build*.
+# This testcase checks dependency of generated Makefile from Makefile.am,
+# configure.ac, acinclude.m4, aclocal.m4, and extra m4 files considered
+# by aclocal.
+# Keep this in sync with sister test `remake8b.test', which performs the
+# same checks for a VPATH build.
+
+required=GNUmake
+. ./defs || Exit 1
+
+set -e
+
+mv -f configure.in configure.stub
+
+cat > Makefile.am <<'END'
+all-local: foo
+foo:
+       echo '!Foo!' >$@
+check-local:
+       cat foo
+       grep '!Foo!' foo
+CLEANFILES = foo
+END
+
+cat configure.stub - > configure.in <<'END'
+AC_OUTPUT
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+srcdir='.' # to make syncing with remake8b.test easier.
+
+$srcdir/configure
+
+$MAKE
+cat foo
+grep '!Foo!' foo
+$MAKE distcheck
+
+rm -f foo
+
+# Modify just Makefile.am.
+
+$sleep
+
+cat > $srcdir/Makefile.am <<'END'
+all-local: bar
+bar:
+       echo '!Baz!' >$@
+check-local:
+       cat bar
+       grep '!Baz!' bar
+       test ! -r $(srcdir)/foo
+       test ! -r foo
+CLEANFILES = bar
+END
+
+$MAKE
+cat bar
+grep '!Baz!' bar
+test ! -r foo
+$MAKE distcheck
+
+rm -f bar
+
+# Modify Makefile.am and configure.in.
+
+$sleep
+
+cat > $srcdir/Makefile.am <<'END'
+all-local: quux
+check-local:
+       cat quux
+       grep '!Zardoz!' quux
+       test ! -r $(srcdir)/bar
+       test ! -r bar
+END
+
+cat $srcdir/configure.stub - > $srcdir/configure.in <<'END'
+AC_CONFIG_FILES([quux])
+AC_SUBST([QUUX], [Zardoz])
+AC_OUTPUT
+END
+
+cat > $srcdir/quux.in <<'END'
+!@QUUX@!
+END
+
+$MAKE
+cat quux
+grep '!Zardoz!' quux
+test ! -r bar
+$MAKE distcheck
+
+rm -f quux
+
+# Modify Makefile.am to add a directory of extra m4 files
+# considered by aclocal.
+
+$sleep
+
+mkdir $srcdir/m4
+
+cat > $srcdir/Makefile.am <<'END'
+ACLOCAL_AMFLAGS = -I m4
+all-local: quux
+check-local:
+       cat quux
+       grep '%Foo%' quux
+       test x'$(QUUX)' = x'%Foo%'
+END
+
+$MAKE # this should place aclocal flags in Makefile
+grep '.*-I m4' Makefile # sanity check
+
+# Modify configure.in and aclocal.m4.
+
+$sleep
+
+cat $srcdir/configure.stub - > $srcdir/configure.in <<'END'
+AC_CONFIG_FILES([quux])
+MY_CUSTOM_MACRO
+AC_OUTPUT
+END
+
+cat >> $srcdir/aclocal.m4 <<'END'
+AC_DEFUN([MY_CUSTOM_MACRO], [AC_SUBST([QUUX], [%Foo%])])
+END
+
+$MAKE
+cat quux
+grep '%Foo%' quux
+$MAKE distcheck
+
+# Modify Makefile.am, remove aclocal.m4, and add a new m4 file to
+# the directory of extra m4 files considered by aclocal.  This new
+# file should now provide a macro required by configure.in and that
+# was previously provided by aclocal.m4.
+
+$sleep
+
+sed 's/%Foo%/%Bar%/g' $srcdir/Makefile.am > t
+mv -f t $srcdir/Makefile.am
+cat $srcdir/Makefile.am
+rm -f $srcdir/aclocal.m4
+cat > $srcdir/m4/blah.m4 <<'END'
+AC_DEFUN([MY_CUSTOM_MACRO], [AC_SUBST([QUUX], [%Bar%])])
+END
+
+$MAKE
+cat quux
+grep '%Bar%' quux
+$MAKE distcheck
+
+# Modify Makefile.am, remove all the extra m4 files to considered
+# by aclocal, and add an acinclude.m4 file.  This last file should
+# now provide a macro required by configure.in, and that was
+# previously provided by the extra m4 files considered by aclocal.
+
+$sleep
+
+rm -f $srcdir/m4/*.m4
+sed 's/%Bar%/%Quux%/g' $srcdir/Makefile.am > t
+mv -f t $srcdir/Makefile.am
+cat $srcdir/Makefile.am
+cat > $srcdir/acinclude.m4 <<'END'
+AC_DEFUN([MY_CUSTOM_MACRO], [AC_SUBST([QUUX], [%Quux%])])
+END
+
+$MAKE
+cat quux
+grep '%Quux%' quux
+$MAKE distcheck
+
+:
diff --git a/tests/remake8b.test b/tests/remake8b.test
new file mode 100755 (executable)
index 0000000..3773aac
--- /dev/null
@@ -0,0 +1,195 @@
+#! /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/>.
+
+# Test basic remake rules for Makefiles, for a *VPATH build*.
+# This testcase checks dependency of generated Makefile from Makefile.am,
+# configure.ac, acinclude.m4, aclocal.m4, and extra m4 files considered
+# by aclocal.
+# Keep this in sync with sister test `remake8a.test', which performs the
+# same checks for a in-tree build.
+
+required=GNUmake
+. ./defs || Exit 1
+
+set -e
+
+mv -f configure.in configure.stub
+
+cat > Makefile.am <<'END'
+all-local: foo
+foo:
+       echo '!Foo!' >$@
+check-local:
+       cat foo
+       grep '!Foo!' foo
+CLEANFILES = foo
+END
+
+cat configure.stub - > configure.in <<'END'
+AC_OUTPUT
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+mkdir build
+cd build
+srcdir='..' # to make syncing with remake8a.test easier.
+
+$srcdir/configure
+
+$MAKE
+cat foo
+grep '!Foo!' foo
+$MAKE distcheck
+
+rm -f foo
+
+# Modify just Makefile.am.
+
+$sleep
+
+cat > $srcdir/Makefile.am <<'END'
+all-local: bar
+bar:
+       echo '!Baz!' >$@
+check-local:
+       cat bar
+       grep '!Baz!' bar
+       test ! -r $(srcdir)/foo
+       test ! -r foo
+CLEANFILES = bar
+END
+
+$MAKE
+cat bar
+grep '!Baz!' bar
+test ! -r foo
+$MAKE distcheck
+
+rm -f bar
+
+# Modify Makefile.am and configure.in.
+
+$sleep
+
+cat > $srcdir/Makefile.am <<'END'
+all-local: quux
+check-local:
+       cat quux
+       grep '!Zardoz!' quux
+       test ! -r $(srcdir)/bar
+       test ! -r bar
+END
+
+cat $srcdir/configure.stub - > $srcdir/configure.in <<'END'
+AC_CONFIG_FILES([quux])
+AC_SUBST([QUUX], [Zardoz])
+AC_OUTPUT
+END
+
+cat > $srcdir/quux.in <<'END'
+!@QUUX@!
+END
+
+$MAKE
+cat quux
+grep '!Zardoz!' quux
+test ! -r bar
+$MAKE distcheck
+
+rm -f quux
+
+# Modify Makefile.am to add a directory of extra m4 files
+# considered by aclocal.
+
+$sleep
+
+mkdir $srcdir/m4
+
+cat > $srcdir/Makefile.am <<'END'
+ACLOCAL_AMFLAGS = -I m4
+all-local: quux
+check-local:
+       cat quux
+       grep '%Foo%' quux
+       test x'$(QUUX)' = x'%Foo%'
+END
+
+$MAKE # this should place aclocal flags in Makefile
+grep '.*-I m4' Makefile # sanity check
+
+# Modify configure.in and aclocal.m4.
+
+$sleep
+
+cat $srcdir/configure.stub - > $srcdir/configure.in <<'END'
+AC_CONFIG_FILES([quux])
+MY_CUSTOM_MACRO
+AC_OUTPUT
+END
+
+cat >> $srcdir/aclocal.m4 <<'END'
+AC_DEFUN([MY_CUSTOM_MACRO], [AC_SUBST([QUUX], [%Foo%])])
+END
+
+$MAKE
+cat quux
+grep '%Foo%' quux
+$MAKE distcheck
+
+# Modify Makefile.am, remove aclocal.m4, and add a new m4 file to
+# the directory of extra m4 files considered by aclocal.  This new
+# file should now provide a macro required by configure.in and that
+# was previously provided by aclocal.m4.
+
+$sleep
+
+sed 's/%Foo%/%Bar%/g' $srcdir/Makefile.am > t
+mv -f t $srcdir/Makefile.am
+cat $srcdir/Makefile.am
+rm -f $srcdir/aclocal.m4
+cat > $srcdir/m4/blah.m4 <<'END'
+AC_DEFUN([MY_CUSTOM_MACRO], [AC_SUBST([QUUX], [%Bar%])])
+END
+
+$MAKE
+cat quux
+grep '%Bar%' quux
+$MAKE distcheck
+
+# Modify Makefile.am, remove all the extra m4 files to considered
+# by aclocal, and add an acinclude.m4 file.  This last file should
+# now provide a macro required by configure.in, and that was
+# previously provided by the extra m4 files considered by aclocal.
+
+$sleep
+
+rm -f $srcdir/m4/*.m4
+sed 's/%Bar%/%Quux%/g' $srcdir/Makefile.am > t
+mv -f t $srcdir/Makefile.am
+cat $srcdir/Makefile.am
+cat > $srcdir/acinclude.m4 <<'END'
+AC_DEFUN([MY_CUSTOM_MACRO], [AC_SUBST([QUUX], [%Quux%])])
+END
+
+$MAKE
+cat quux
+grep '%Quux%' quux
+$MAKE distcheck
+
+:
diff --git a/tests/remake9a.test b/tests/remake9a.test
new file mode 100755 (executable)
index 0000000..9cd2d9f
--- /dev/null
@@ -0,0 +1,106 @@
+#! /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/>.
+
+# Test remake rules when configure.in or its prerequisites change.
+# Keep in sync with the other sister tests `remake9*.test'.
+
+required=GNUmake
+. ./defs || Exit 1
+
+set -e
+
+magic1=::MagicStringOne::
+magic2=__MagicStringTwo__
+
+cat >> configure.in <<END
+FINGERPRINT=BadBadBad
+AC_SUBST([FINGERPRINT])
+AC_CONFIG_FILES([foo.sh:foo.in], [chmod a+x foo.sh])
+AC_OUTPUT
+END
+
+cat > Makefile.am <<'END'
+nil:
+.PHONY: nil
+
+$(srcdir)/configure.in: $(srcdir)/tweak-configure-in
+       $(SHELL) $(srcdir)/tweak-configure-in <$@ >$@-t
+       mv -f $@-t $@
+EXTRA_DIST = $(srcdir)/tweak-configure-in
+
+# Used by "make distcheck" later.
+check-local:
+       test x'$(FINGERPRINT)' = x'DummyValue'
+       test x"`./foo.sh`" = x"DummyValue"
+END
+
+cat > foo.in <<END
+#!/bin/sh
+echo '@FINGERPRINT@'
+END
+
+echo cat > tweak-configure-in # no-op by default
+
+$sleep # so that generated autotools files will be newer than prerequisites
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+for vpath in : false; do
+
+  if $vpath; then
+    mkdir build
+    cd build
+    srcdir=..
+  else
+    srcdir=.
+  fi
+
+  $srcdir/configure
+  $MAKE # should be no-op
+
+  $sleep
+  sed "s/^\\(FINGERPRINT\\)=.*/\\1=$magic1/" $srcdir/configure.in >t
+  mv -f t $srcdir/configure.in
+  $MAKE nil
+  $FGREP FINGERPRINT Makefile # for debugging
+  $FGREP $magic1 Makefile
+  test x"`./foo.sh`" = x"$magic1"
+
+  $sleep
+  echo 'sed "s/^\\(FINGERPRINT\\)=.*/\\1='$magic2'/"' \
+    > $srcdir/tweak-configure-in
+  $MAKE nil
+  $FGREP FINGERPRINT Makefile # for debugging
+  $FGREP $magic1 Makefile && Exit 1
+  $FGREP $magic2 Makefile
+  test x"`./foo.sh`" = x"$magic2"
+
+  $sleep
+  echo cat > $srcdir/tweak-configure-in # no-op again
+  sed "s/^\\(FINGERPRINT\\)=.*/\\1=DummyValue/" $srcdir/configure.in >t
+  mv -f t $srcdir/configure.in
+  $MAKE distcheck
+  $FGREP $magic1 Makefile && Exit 1 # sanity check
+  $FGREP $magic2 Makefile && Exit 1 # likewise
+
+  $MAKE distclean
+
+  cd $srcdir
+
+done
+
+:
diff --git a/tests/remake9b.test b/tests/remake9b.test
new file mode 100755 (executable)
index 0000000..636cc5f
--- /dev/null
@@ -0,0 +1,108 @@
+#! /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/>.
+
+# Test remake rules when Makefile.am or its prerequisites change.
+# Keep in sync with the other sister tests `remake9*.test'.
+
+required=GNUmake
+. ./defs || Exit 1
+
+set -e
+
+magic1=::MagicStringOne::
+magic2=__MagicStringTwo__
+
+cat >> configure.in <<END
+AC_OUTPUT
+END
+
+cat > Makefile.am <<'END'
+FINGERPRINT = BadBadBad
+
+all-local: nil
+nil: foo.sh
+.PHONY: nil
+
+$(srcdir)/Makefile.am: $(srcdir)/tweak-makefile-am
+       $(SHELL) $(srcdir)/tweak-makefile-am <$@ >$@-t
+       mv -f $@-t $@
+EXTRA_DIST = $(srcdir)/tweak-makefile-am
+
+foo.sh: Makefile
+       rm -f $@ $@-t
+       echo '#!/bin/sh' > $@-t
+       echo "echo '$(FINGERPRINT)'" >> $@-t
+       chmod a+x $@-t && mv -f $@-t $@
+CLEANFILES = foo.sh
+
+# Used by "make distcheck" later.
+check-local:
+       test x'$(FINGERPRINT)' = x'DummyValue'
+       test x"`./foo.sh`" = x"DummyValue"
+END
+
+echo cat > tweak-makefile-am # no-op by default
+
+$sleep # so that generated autotools files will be newer than prerequisites
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+for vpath in : false; do
+
+  if $vpath; then
+    mkdir build
+    cd build
+    srcdir=..
+  else
+    srcdir=.
+  fi
+
+  $srcdir/configure
+  $MAKE # should be no-op
+
+  $sleep
+  sed "s/^\\(FINGERPRINT\\) *=.*/\\1 = $magic1/" $srcdir/Makefile.am >t
+  mv -f t $srcdir/Makefile.am
+  $MAKE nil
+  $FGREP FINGERPRINT Makefile # for debugging
+  $FGREP $magic1 Makefile
+  test x"`./foo.sh`" = x"$magic1"
+
+  $sleep
+  echo 'sed "s/^\\(FINGERPRINT\\) *=.*/\\1 = '$magic2'/"' \
+    > $srcdir/tweak-makefile-am
+  $MAKE nil
+  $FGREP FINGERPRINT Makefile # for debugging
+  $FGREP $magic1 Makefile && Exit 1
+  $FGREP $magic2 Makefile
+  test x"`./foo.sh`" = x"$magic2"
+
+  $sleep
+  echo cat > $srcdir/tweak-makefile-am # no-op again
+  sed "s/^\\(FINGERPRINT\\) *=.*/\\1 = DummyValue/" $srcdir/Makefile.am >t
+  mv -f t $srcdir/Makefile.am
+  $MAKE distcheck
+  $FGREP $magic1 Makefile && Exit 1 # sanity check
+  $FGREP $magic2 Makefile && Exit 1 # likewise
+
+  $MAKE distclean
+
+  cd $srcdir
+
+done
+
+:
diff --git a/tests/remake9c.test b/tests/remake9c.test
new file mode 100755 (executable)
index 0000000..4514371
--- /dev/null
@@ -0,0 +1,109 @@
+#! /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/>.
+
+# Test remake rules when acinclude.m4 or its prerequisites change.
+# Keep in sync with the other sister tests `remake9*.test'.
+
+required=GNUmake
+. ./defs || Exit 1
+
+set -e
+
+magic1=::MagicStringOne::
+magic2=__MagicStringTwo__
+
+cat >> configure.in <<END
+FINGERPRINT='my_fingerprint'
+AC_SUBST([FINGERPRINT])
+AC_CONFIG_FILES([foo.sh:foo.in], [chmod a+x foo.sh])
+AC_OUTPUT
+END
+
+cat > Makefile.am <<'END'
+nil:
+.PHONY: nil
+
+# The right way to extend an autogenerated aclocal.m4 is to provide
+# an acinclude.m4 file.
+$(srcdir)/acinclude.m4: $(srcdir)/tweak-acinclude-m4
+       $(SHELL) $(srcdir)/tweak-acinclude-m4 <$@ >$@-t
+       mv -f $@-t $@
+       touch $@
+EXTRA_DIST = $(srcdir)/tweak-acinclude-m4
+
+# Used by "make distcheck" later.
+check-local:
+       test x'$(FINGERPRINT)' = x'DummyValue'
+       test x"`./foo.sh`" = x"DummyValue"
+END
+
+cat > foo.in <<END
+#!/bin/sh
+echo '@FINGERPRINT@'
+END
+
+echo "AC_DEFUN([my_fingerprint], [BadBadBad])" > acinclude.m4
+
+echo : > tweak-acinclude-m4 # no-op by default
+
+$sleep # so that generated autotools files will be newer than prerequisites
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+for vpath in : false; do
+
+  if $vpath; then
+    mkdir build
+    cd build
+    srcdir=..
+  else
+    srcdir=.
+  fi
+
+  $srcdir/configure
+  $MAKE # should be no-op
+
+  $sleep
+  echo "AC_DEFUN([my_fingerprint], [$magic1])" > $srcdir/acinclude.m4
+  $MAKE nil
+  $FGREP FINGERPRINT Makefile # for debugging
+  $FGREP $magic1 Makefile
+  test x"`./foo.sh`" = x"$magic1"
+
+  $sleep
+  echo "echo 'AC_DEFUN([my_fingerprint], [$magic2])'" \
+    > $srcdir/tweak-acinclude-m4
+  $MAKE nil
+  $FGREP FINGERPRINT Makefile # for debugging
+  $FGREP $magic1 Makefile && Exit 1
+  $FGREP $magic2 Makefile
+  test x"`./foo.sh`" = x"$magic2"
+
+  $sleep
+  echo : > $srcdir/tweak-acinclude-m4 # no-op again
+  echo "AC_DEFUN([my_fingerprint], [DummyValue])" > $srcdir/acinclude.m4
+  $MAKE distcheck
+  $FGREP $magic1 Makefile && Exit 1 # sanity check
+  $FGREP $magic2 Makefile && Exit 1 # likewise
+
+  $MAKE distclean
+
+  cd $srcdir
+
+done
+
+:
diff --git a/tests/remake9d.test b/tests/remake9d.test
new file mode 100755 (executable)
index 0000000..b83dd89
--- /dev/null
@@ -0,0 +1,109 @@
+#! /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/>.
+
+# Test remake rules when aclocal.m4 or its prerequisites change.
+# Keep in sync with the other sister tests `remake9*.test'.
+
+required=GNUmake
+. ./defs || Exit 1
+
+set -e
+
+magic1=::MagicStringOne::
+magic2=__MagicStringTwo__
+
+cat >> configure.in <<END
+FINGERPRINT='my_fingerprint'
+AC_SUBST([FINGERPRINT])
+AC_CONFIG_FILES([foo.sh:foo.in], [chmod a+x foo.sh])
+AC_OUTPUT
+END
+
+cat > Makefile.am <<'END'
+nil:
+.PHONY: nil
+
+# A non-autogenerated aclocal.m4 can be extended by hand.
+$(srcdir)/aclocal.m4: $(srcdir)/tweak-aclocal-m4
+       $(SHELL) $(srcdir)/tweak-aclocal-m4 <$@ >$@-t
+       mv -f $@-t $@
+       touch $@
+EXTRA_DIST = $(srcdir)/tweak-aclocal-m4
+
+# Used by "make distcheck" later.
+check-local:
+       test x'$(FINGERPRINT)' = x'DummyValue'
+       test x"`./foo.sh`" = x"DummyValue"
+END
+
+cat > foo.in <<END
+#!/bin/sh
+echo '@FINGERPRINT@'
+END
+
+echo cat > tweak-aclocal-m4 # no-op by default
+
+$sleep # so that generated autotools files will be newer than prerequisites
+$ACLOCAL
+# Cheatingly mark aclocal.m4 as non auto-generated.
+sed '/^ *#.*generated automatically/d' aclocal.m4 > t
+mv -f t aclocal.m4
+$AUTOCONF
+$AUTOMAKE
+
+for vpath in : false; do
+
+  if $vpath; then
+    mkdir build
+    cd build
+    srcdir=..
+  else
+    srcdir=.
+  fi
+
+  $srcdir/configure
+  $MAKE # should be no-op
+
+  $sleep
+  echo "AC_DEFUN([my_fingerprint], [$magic1])dnl %%%" >> $srcdir/aclocal.m4
+  $MAKE nil
+  $FGREP FINGERPRINT Makefile # for debugging
+  $FGREP $magic1 Makefile
+  test x"`./foo.sh`" = x"$magic1"
+
+  $sleep
+  echo "sed 's/.*dnl *%%%.*/AC_DEFUN([my_fingerprint], [$magic2])/'" \
+    > $srcdir/tweak-aclocal-m4
+  $MAKE nil
+  $FGREP FINGERPRINT Makefile # for debugging
+  $FGREP $magic1 Makefile && Exit 1
+  $FGREP $magic2 Makefile
+  test x"`./foo.sh`" = x"$magic2"
+
+  $sleep
+  echo cat > $srcdir/tweak-aclocal-m4 # no-op again
+  echo 'AC_DEFUN([my_fingerprint], [DummyValue])' >> $srcdir/aclocal.m4
+  $MAKE distcheck
+  $FGREP $magic1 Makefile && Exit 1 # sanity check
+  $FGREP $magic2 Makefile && Exit 1 # likewise
+
+  $MAKE distclean
+
+  cd $srcdir
+
+done
+
+:
diff --git a/tests/repeated-options.test b/tests/repeated-options.test
new file mode 100755 (executable)
index 0000000..84901f8
--- /dev/null
@@ -0,0 +1,80 @@
+#! /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 does not complain on repeated options, nor
+# generate broken or incorrect makefiles.
+
+required=bzip2
+. ./defs || Exit 1
+
+set -e
+
+cat >configure.in <<END
+AC_INIT([$me], [1.0])
+AM_INIT_AUTOMAKE([foreign dist-bzip2 no-dist-gzip no-dist-gzip dist-bzip2])
+AC_PROG_CC
+AM_PROG_CC_C_O
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
+END
+
+cat > Makefile.am <<'END'
+AUTOMAKE_OPTIONS = parallel-tests subdir-objects subdir-objects
+AUTOMAKE_OPTIONS += dist-bzip2 parallel-tests
+TESTS = foo.test
+EXTRA_DIST = $(TESTS)
+bin_PROGRAMS = sub/foo
+END
+
+mkdir sub
+
+cat > foo.test <<'END'
+#!/bin/sh
+test -f sub/foo && test -x sub/foo
+END
+chmod a+x foo.test
+
+cat > sub/foo.c <<'END'
+int main (void)
+{
+  return 0;
+}
+END
+
+cp $testsrcdir/../lib/compile .
+
+$ACLOCAL
+$AUTOMAKE --foreign --foreign -Wall 2>stderr || { cat stderr >&2; Exit 1; }
+test -s stderr && { cat stderr >&2; Exit 1; }
+rm -f stderr
+$AUTOCONF
+
+./configure
+$MAKE
+ls -l . sub
+test -f sub/foo.o
+test -f sub/foo
+$MAKE check
+ls -l
+test -f foo.log
+test -f test-suite.log
+$MAKE clean
+$MAKE distcheck
+ls -l
+test -f $me-1.0.tar.bz2
+test ! -r $me-1.0.tar.gz
+
+:
index 39bf349..3d89cf9 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 1996, 2001, 2002  Free Software Foundation, Inc.
+# Copyright (C) 1996, 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 +18,8 @@
 
 . ./defs || Exit 1
 
+set -e
+
 cat > configure.in <<EOF
 AC_INIT
 AM_INIT_GUILE_MODULE
@@ -32,6 +34,8 @@ module=[$1]
 AC_SUBST(module)])
 END
 
-$ACLOCAL || Exit 1
+$ACLOCAL
 
 grep 'DEFUN.*INIT_AUTOMAKE' aclocal.m4
+
+:
index c15e910..06b0c89 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 1996, 2001, 2002  Free Software Foundation, Inc.
+# Copyright (C) 1996, 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
 
 . ./defs || Exit 1
 
+set -e
+
 cat > Makefile.am << 'END'
 $(srcdir)/Makefile.am:
 END
 
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
 
 grep '^$(srcdir)/Makefile\.am' Makefile.in
+
+:
diff --git a/tests/silent-lex-gcc.test b/tests/silent-lex-gcc.test
new file mode 100755 (executable)
index 0000000..426dc50
--- /dev/null
@@ -0,0 +1,143 @@
+#!/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 silent-rules mode for Lex, forcing gcc depmode.
+# Keep this in sync with sister test `silent-lex-generic.test'.
+
+required='flex gcc'
+. ./defs || Exit 1
+
+set -e
+
+mkdir sub
+
+cat >>configure.in <<'EOF'
+AM_SILENT_RULES
+AM_PROG_CC_C_O
+AC_PROG_LEX
+AC_CONFIG_FILES([sub/Makefile])
+AC_OUTPUT
+EOF
+
+cat > Makefile.am <<'EOF'
+# Need generic and non-generic rules.
+bin_PROGRAMS = foo1 foo2
+foo1_SOURCES = foo.l
+foo2_SOURCES = $(foo1_SOURCES)
+foo2_CFLAGS = $(AM_CFLAGS)
+SUBDIRS = sub
+LDADD = $(LEXLIB)
+EOF
+
+cat > sub/Makefile.am <<'EOF'
+AUTOMAKE_OPTIONS = subdir-objects
+# Need generic and non-generic rules.
+bin_PROGRAMS = bar1 bar2
+bar1_SOURCES = bar.l
+bar2_SOURCES = $(bar1_SOURCES)
+bar2_CFLAGS = $(AM_CFLAGS)
+LDADD = $(LEXLIB)
+EOF
+
+cat > foo.l <<'EOF'
+%%
+"END"   return EOF;
+.
+%%
+EOF
+cp foo.l sub/bar.l
+
+$ACLOCAL
+$AUTOMAKE --add-missing
+$AUTOCONF
+
+# Force gcc ("fast") depmode.
+# This apparently useless "for" loop is here to simplify the syncing
+# with sister test `silent-lex-gcc.test'.
+for config_args in \
+  am_cv_CC_dependencies_compiler_type=gcc
+do
+  ./configure $config_args --enable-silent-rules
+
+  $MAKE >stdout || { cat stdout; Exit 1; }
+  cat stdout
+
+  $EGREP ' (-c|-o)' stdout && Exit 1
+  $EGREP '(mv|ylwrap) ' stdout && Exit 1
+
+  grep 'LEX .*foo\.' stdout
+  grep 'LEX .*bar\.' stdout
+  grep ' CC .*foo\.' stdout
+  grep ' CC .*bar\.' stdout
+  grep 'CCLD .*foo1' stdout
+  grep 'CCLD .*bar1' stdout
+  grep 'CCLD .*foo2' stdout
+  grep 'CCLD .*bar2' stdout
+
+  # Cleaning and then rebuilding with the same V flag (and without
+  # removing the generated sources in between) shouldn't trigger a
+  # different set of rules.
+  $MAKE clean
+
+  $MAKE >stdout || { cat stdout; Exit 1; }
+  cat stdout
+
+  $EGREP ' (-c|-o)' stdout && Exit 1
+  $EGREP '(mv|ylwrap) ' stdout && Exit 1
+
+  # Don't look for LEX, as probably lex hasn't been re-run.
+  grep ' CC .*foo\.' stdout
+  grep ' CC .*bar\.' stdout
+  grep 'CCLD .*foo1' stdout
+  grep 'CCLD .*bar1' stdout
+  grep 'CCLD .*foo2' stdout
+  grep 'CCLD .*bar2' stdout
+
+  # Ensure a truly clean rebuild.
+  $MAKE clean
+  rm -f foo.c sub/bar.c
+
+  $MAKE V=1 >stdout || { cat stdout; Exit 1; }
+  cat stdout
+
+  grep ' -c ' stdout
+  grep ' -o ' stdout
+  grep 'ylwrap ' stdout
+
+  $EGREP '(LEX|CC|CCLD) ' stdout && Exit 1
+
+  # Cleaning and then rebuilding with the same V flag (and without
+  # removing the generated sources in between) shouldn't trigger a
+  # different set of rules.
+  $MAKE clean
+
+  $MAKE V=1 >stdout || { cat stdout; Exit 1; }
+  cat stdout
+
+  # Don't look for ylwrap, as probably lex hasn't been re-run.
+  grep ' -c ' stdout
+  grep ' -o ' stdout
+
+  $EGREP '(LEX|CC|CCLD) ' stdout && Exit 1
+
+  # Ensure a truly clean reconfiguration/rebuild.
+  $MAKE clean
+  $MAKE maintainer-clean
+  rm -f foo.c sub/bar.c
+
+done
+
+:
similarity index 91%
rename from tests/silentlex.test
rename to tests/silent-lex-generic.test
index 78e0c7d..66535e8 100755 (executable)
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # Check silent-rules mode for Lex.
+# Keep this in sync with sister test `silent-lex-gcc.test'.
 
 required='flex'
-. ./defs
+. ./defs || Exit 1
 
 set -e
 
@@ -63,11 +64,11 @@ $ACLOCAL
 $AUTOMAKE --add-missing
 $AUTOCONF
 
-# configure once for fastdep, once for non-fastdep, once for nodep
+# Force dependency tracking explicitly, so that slow dependency
+# extractors are not rejected.  Try also with dependency tracking
+# explicitly disabled.
 for config_args in \
-  '' \
-  am_cv_CC_dependencies_compiler_type=gcc \
-  --disable-dependency-tracking
+  --enable-dependency-tracking --disable-dependency-tracking
 do
   ./configure $config_args --enable-silent-rules
 
diff --git a/tests/silent-many-gcc.test b/tests/silent-many-gcc.test
new file mode 100755 (executable)
index 0000000..d770a46
--- /dev/null
@@ -0,0 +1,220 @@
+#!/bin/sh
+# 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
+# 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 silent-rules mode, with gcc depmode and many languages at once.
+# This test partly overlaps with other silent*.test, but it serves as
+# a stress test by using many different languages at once -- so don't
+# remove this test script.
+# This test requires the GNU compilers; keep it in sync with sister test
+# `silent-many-generic.test', which should work with generic compilers.
+
+required='gcc g++ gfortran flex bison'
+. ./defs || Exit 1
+
+set -e
+
+# Avoids too much code duplication.
+do_and_check_silent_build ()
+{
+  case $1 in
+    --rebuild) rebuild=true;;
+            *) rebuild=false;;
+  esac
+
+  $MAKE >stdout || { cat stdout; Exit 1; }
+  cat stdout
+  # Avoid spurious failures with SunStudio Fortran compilers.
+  sed '/^NOTICE:/d' stdout > t
+  mv -f t stdout
+  cat stdout
+
+  $EGREP ' (-c|-o)' stdout && Exit 1
+  $EGREP '(mv|ylwrap) ' stdout && Exit 1
+
+  grep 'CXX .*foo1\.' stdout
+  grep 'CXX .*baz1\.' stdout
+  grep 'FC .*foo2\.'  stdout
+  grep 'FC .*baz2\.'  stdout
+  grep 'F77 .*foo3\.' stdout
+  grep 'F77 .*baz3\.' stdout
+  grep ' CC .*foo5\.' stdout
+  grep ' CC .*baz5\.' stdout
+  grep ' CC .*foo6\.' stdout
+  grep ' CC .*baz6\.' stdout
+
+  grep 'CXXLD .*foo' stdout
+  grep 'CCLD .*bar'  stdout
+  grep 'CXXLD .*baz' stdout
+  grep 'CCLD .*bla'  stdout
+
+  if $rebuild; then :; else
+    grep 'YACC .*foo6\.' stdout
+    grep 'YACC .*baz6\.' stdout
+    grep 'LEX .*foo5\.'  stdout
+    grep 'LEX .*baz5\.'  stdout
+  fi
+
+  unset rebuild
+}
+
+# Avoids too much code duplication.
+do_and_check_verbose_build ()
+{
+
+  case $1 in
+    --rebuild) rebuild=true;;
+            *) rebuild=false;;
+  esac
+
+  $MAKE V=1 >stdout || { cat stdout; Exit 1; }
+  cat stdout
+
+  grep ' -c ' stdout
+  grep ' -o ' stdout
+
+  $EGREP '(CC|CXX|FC|F77|LD) ' stdout && Exit 1
+
+  if $rebuild; then :; else
+    grep 'ylwrap ' stdout
+    $EGREP '(LEX|YACC) ' stdout && Exit 1
+  fi
+
+  unset rebuild
+}
+
+mkdir sub
+
+cat >>configure.in <<'EOF'
+AM_SILENT_RULES
+AM_PROG_CC_C_O
+AC_PROG_CXX
+AC_PROG_F77
+AC_PROG_FC
+AC_PROG_LEX
+AC_PROG_YACC
+AC_CONFIG_FILES([sub/Makefile])
+AC_OUTPUT
+EOF
+
+cat > Makefile.am <<'EOF'
+# Need generic and non-generic rules.
+bin_PROGRAMS = foo bar fo2
+bar_CFLAGS = $(AM_CFLAGS)
+foo_SOURCES = foo1.cpp foo2.f90 foo3.f foo5.l foo6.y
+fo2_SOURCES = $(foo_SOURCES)
+fo2_CPPFLAGS = $(AM_CPPFLAGS)
+fo2_FFLAGS = $(AM_FFLAGS)
+fo2_FCFLAGS = $(AM_FCFLAGS)
+SUBDIRS = sub
+AM_YFLAGS = -d
+LDADD = $(LEXLIB)
+BUILT_SOURCES = foo6.h
+EOF
+
+cat > sub/Makefile.am <<'EOF'
+AUTOMAKE_OPTIONS = subdir-objects
+# Need generic and non-generic rules.
+bin_PROGRAMS = baz bla ba2
+bla_CFLAGS = $(AM_CFLAGS)
+baz_SOURCES = baz1.cpp baz2.f90 baz3.f baz5.l baz6.y
+ba2_SOURCES = $(baz_SOURCES)
+ba2_CPPFLAGS = $(AM_CPPFLAGS)
+ba2_FFLAGS = $(AM_FFLAGS)
+ba2_FCFLAGS = $(AM_FCFLAGS)
+AM_YFLAGS = -d
+LDADD = $(LEXLIB)
+BUILT_SOURCES = baz6.h
+EOF
+
+cat > foo1.cpp <<'EOF'
+int main ()
+{
+  return 0;
+}
+EOF
+cat > foo2.f90 <<'EOF'
+      subroutine foo2
+      return
+      end
+EOF
+cat > foo3.f <<'EOF'
+      subroutine foo3
+      return
+      end
+EOF
+cat > foo5.l <<'EOF'
+%%
+"END"   return EOF;
+.
+%%
+EOF
+cat > foo6.y <<'EOF'
+%{
+void yyerror (char *s) {}
+%}
+%token EOF
+%%
+fubar : 'f' 'o' 'o' 'b' 'a' 'r' EOF {};
+EOF
+cp foo1.cpp bar.c
+cp foo1.cpp sub/baz.c
+cp foo1.cpp sub/bla.c
+cp foo1.cpp sub/baz1.cpp
+cp foo2.f90 sub/baz2.f90
+cp foo3.f sub/baz3.f
+cp foo5.l sub/baz5.l
+cp foo6.y sub/baz6.y
+
+$ACLOCAL
+$AUTOMAKE --add-missing
+$AUTOCONF
+
+# Force gcc ("fast") depmode.
+# This apparently useless "for" loop is here to simplify the syncing
+# with sister test `silent-many-gcc.test'.
+for config_args in \
+  am_cv_CC_dependencies_compiler_type=gcc
+do
+
+  ./configure $config_args --enable-silent-rules
+
+  do_and_check_silent_build
+  # Cleaning and then rebuilding with the same V flag (and without
+  # removing the generated sources in between) shouldn't trigger a
+  # different set of rules.
+  $MAKE clean
+  do_and_check_silent_build --rebuild
+
+  # Ensure a clean rebuild.
+  $MAKE clean
+  # This is required, since these files are not removed by `make clean'
+  # (as dictated by the GNU Coding Standards).
+  rm -f foo5.c foo6.[ch] sub/baz5.c sub/baz6.[ch]
+
+  do_and_check_verbose_build
+  # Cleaning and then rebuilding with the same V flag (and without
+  # removing the generated sources in between) shouldn't trigger a
+  # different set of rules.
+  $MAKE clean
+  do_and_check_verbose_build --rebuild
+
+  # Ensure a clean reconfiguration/rebuild.
+  $MAKE clean
+  $MAKE maintainer-clean
+
+done
+
+:
similarity index 88%
rename from tests/silent5.test
rename to tests/silent-many-generic.test
index e29f48f..223a97c 100755 (executable)
 # 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 silent-rules mode, languages other than C.
+# Check silent-rules mode, with many languages at once.
 # This test partly overlaps with other silent*.test, but it serves as
 # a stress test by using many different languages at once -- so don't
 # remove this test script.
+# This test should work with generic compilers; keep it in sync with
+# sister test `silent-many-gcc.test', which requires the GNU compilers
+# and forces the use of gcc depmode.
 
 # FIXME: generic C++/Fortran compilers should suffice here
 required='g++ gfortran flex bison'
-. ./defs
+. ./defs || Exit 1
 
 set -e
 
@@ -35,6 +38,10 @@ do_and_check_silent_build ()
 
   $MAKE >stdout || { cat stdout; Exit 1; }
   cat stdout
+  # Avoid spurious failures with SunStudio Fortran compilers.
+  sed '/^NOTICE:/d' stdout > t
+  mv -f t stdout
+  cat stdout
 
   $EGREP ' (-c|-o)' stdout && Exit 1
   $EGREP '(mv|ylwrap) ' stdout && Exit 1
@@ -177,11 +184,11 @@ $ACLOCAL
 $AUTOMAKE --add-missing
 $AUTOCONF
 
-# configure once for fastdep, once for non-fastdep, once for nodep
+# Force dependency tracking explicitly, so that slow dependency
+# extractors are not rejected.  Try also with dependency tracking
+# explicitly disabled.
 for config_args in \
-  '' \
-  am_cv_CC_dependencies_compiler_type=gcc \
-  --disable-dependency-tracking
+  --enable-dependency-tracking --disable-dependency-tracking
 do
 
   ./configure $config_args --enable-silent-rules
diff --git a/tests/silent-yacc-gcc.test b/tests/silent-yacc-gcc.test
new file mode 100755 (executable)
index 0000000..33ae8ae
--- /dev/null
@@ -0,0 +1,145 @@
+#!/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 silent-rules mode for Yacc, forcing gcc depmode.
+# Keep this in sync with sister test `silent-yacc-generic.test'.
+
+required='gcc bison'
+. ./defs || Exit 1
+
+set -e
+
+mkdir sub
+
+cat >>configure.in <<'EOF'
+AM_SILENT_RULES
+AM_PROG_CC_C_O
+AC_PROG_YACC
+AC_CONFIG_FILES([sub/Makefile])
+AC_OUTPUT
+EOF
+
+cat > Makefile.am <<'EOF'
+# Need generic and non-generic rules.
+bin_PROGRAMS = foo1 foo2
+foo1_SOURCES = foo.y
+foo2_SOURCES = $(foo1_SOURCES)
+foo2_CFLAGS = $(AM_CPPFLAGS)
+SUBDIRS = sub
+EOF
+
+cat > sub/Makefile.am <<'EOF'
+AUTOMAKE_OPTIONS = subdir-objects
+# Need generic and non-generic rules.
+bin_PROGRAMS = bar1 bar2
+bar1_SOURCES = bar.y
+bar2_SOURCES = $(bar1_SOURCES)
+bar2_CFLAGS = $(AM_CPPFLAGS)
+EOF
+
+cat > foo.y <<'EOF'
+%{
+void yyerror (char *s) {}
+int yylex (void) {return 0;}
+int main(void) {return 0;}
+%}
+%token EOF
+%%
+fubar : 'f' 'o' 'o' 'b' 'a' 'r' EOF {};
+EOF
+cp foo.y sub/bar.y
+
+$ACLOCAL
+$AUTOMAKE --add-missing
+$AUTOCONF
+
+# Force gcc ("fast") depmode.
+# This apparently useless "for" loop is here to simplify the syncing
+# with sister test `silent-yacc-gcc.test'.
+for config_args in \
+  am_cv_CC_dependencies_compiler_type=gcc
+do
+  ./configure $config_args --enable-silent-rules
+
+  $MAKE >stdout || { cat stdout; Exit 1; }
+  cat stdout
+
+  $EGREP ' (-c|-o)' stdout && Exit 1
+  $EGREP '(mv|ylwrap) ' stdout && Exit 1
+
+  grep 'YACC .*foo\.' stdout
+  grep 'YACC .*bar\.' stdout
+  grep ' CC .*foo\.' stdout
+  grep ' CC .*bar\.' stdout
+  grep 'CCLD .*foo1' stdout
+  grep 'CCLD .*bar1' stdout
+  grep 'CCLD .*foo2' stdout
+  grep 'CCLD .*bar2' stdout
+
+  # Cleaning and then rebuilding with the same V flag (and without
+  # removing the generated sources in between) shouldn't trigger a
+  # different set of rules.
+  $MAKE clean
+
+  $MAKE >stdout || { cat stdout; Exit 1; }
+  cat stdout
+
+  $EGREP ' (-c|-o)' stdout && Exit 1
+  $EGREP '(mv|ylwrap) ' stdout && Exit 1
+
+  # Don't look for YACC, as probably yacc hasn't been re-run.
+  grep ' CC .*foo\.' stdout
+  grep ' CC .*bar\.' stdout
+  grep 'CCLD .*foo1' stdout
+  grep 'CCLD .*bar1' stdout
+  grep 'CCLD .*foo2' stdout
+  grep 'CCLD .*bar2' stdout
+
+  # Ensure a truly clean rebuild.
+  $MAKE clean
+  rm -f foo.[ch] sub/bar.[ch]
+
+  $MAKE V=1 >stdout || { cat stdout; Exit 1; }
+  cat stdout
+
+  grep ' -c ' stdout
+  grep ' -o ' stdout
+  grep 'ylwrap ' stdout
+
+  $EGREP '(YACC|CC|CCLD) ' stdout && Exit 1
+
+  # Cleaning and then rebuilding with the same V flag (and without
+  # removing the generated sources in between) shouldn't trigger a
+  # different set of rules.
+  $MAKE clean
+
+  $MAKE V=1 >stdout || { cat stdout; Exit 1; }
+  cat stdout
+
+  # Don't look for ylwrap, as probably lex hasn't been re-run.
+  grep ' -c ' stdout
+  grep ' -o ' stdout
+
+  $EGREP '(YACC|CC|CCLD) ' stdout && Exit 1
+
+  # Ensure a truly clean reconfiguration/rebuild.
+  $MAKE clean
+  $MAKE maintainer-clean
+  rm -f foo.[ch] sub/bar.[ch]
+
+done
+
+:
similarity index 91%
rename from tests/silentyacc.test
rename to tests/silent-yacc-generic.test
index ac5f061..b7489da 100755 (executable)
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # Check silent-rules mode for Yacc.
+# Keep this in sync with sister test `silent-yacc-gcc.test'.
 
 required='bison'
-. ./defs
+. ./defs || Exit 1
 
 set -e
 
@@ -65,11 +66,11 @@ $ACLOCAL
 $AUTOMAKE --add-missing
 $AUTOCONF
 
-# configure once for fastdep, once for non-fastdep, once for nodep
+# Force dependency tracking explicitly, so that slow dependency
+# extractors are not rejected.  Try also with dependency tracking
+# explicitly disabled.
 for config_args in \
-  '' \
-  am_cv_CC_dependencies_compiler_type=gcc \
-  --disable-dependency-tracking
+  --enable-dependency-tracking --disable-dependency-tracking
 do
   ./configure $config_args --enable-silent-rules
 
index c91115c..97d881e 100755 (executable)
@@ -18,7 +18,7 @@
 
 # Please keep this file in sync with silent2.test.
 
-. ./defs
+. ./defs || Exit 1
 
 set -e
 
index da22718..aed8546 100755 (executable)
@@ -20,7 +20,7 @@
 # Please keep this file in sync with silent.test.
 
 required=gcc
-. ./defs
+. ./defs || Exit 1
 
 set -e
 
index d0a0131..17f1959 100755 (executable)
@@ -19,7 +19,7 @@
 # Please keep this file in sync with silent4.test and silent9.test.
 
 required=libtoolize
-. ./defs
+. ./defs || Exit 1
 
 set -e
 
@@ -85,6 +85,4 @@ grep ' -o libfoo' stdout
 # The libtool command line can contain e.g. a `--tag=CC' option.
 sed 's/--tag=[^ ]*/--tag=x/g' stdout | $EGREP '(CC|LD) ' && Exit 1
 
-$MAKE distclean
-
 :
index c6c1298..9c343c0 100755 (executable)
@@ -20,7 +20,7 @@
 # Please keep this file in sync with silent3.test and silent9.test.
 
 required="libtoolize gcc"
-. ./defs
+. ./defs || Exit 1
 
 set -e
 
@@ -86,6 +86,4 @@ grep ' -o libfoo' stdout
 # The libtool command line can contain e.g. a `--tag=CC' option.
 sed 's/--tag=[^ ]*/--tag=x/g' stdout | $EGREP '(CC|LD) ' && Exit 1
 
-$MAKE distclean
-
 :
index 2afe6bc..acd9cea 100755 (executable)
@@ -16,7 +16,7 @@
 
 # Check user extensibility of silent-rules mode.
 
-. ./defs
+. ./defs || Exit 1
 
 set -e
 
index cd8e1b5..5ae8ac0 100755 (executable)
@@ -16,7 +16,7 @@
 
 # Check user extensibility of silent-rules mode.
 
-. ./defs
+. ./defs || Exit 1
 
 set -e
 
diff --git a/tests/silent8.test b/tests/silent8.test
new file mode 100755 (executable)
index 0000000..e9877a9
--- /dev/null
@@ -0,0 +1,68 @@
+#!/bin/sh
+# 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
+# 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 texinfo rules in silent-rules mode.
+
+required='makeinfo-html tex texi2dvi-o dvips'
+. ./defs || Exit 1
+
+set -e
+
+cat >>configure.in <<'EOF'
+AM_SILENT_RULES
+AC_OUTPUT
+EOF
+
+cat > Makefile.am <<'EOF'
+info_TEXINFOS = foo.texi
+EOF
+
+cat > foo.texi <<'EOF'
+\input texinfo
+@c %**start of header
+@setfilename foo.info
+@settitle foo manual
+@c %**end of header
+@bye
+EOF
+
+$ACLOCAL
+$AUTOMAKE --add-missing
+$AUTOCONF
+
+./configure --disable-silent-rules
+
+# Make sure that all labels work in silent-mode
+$MAKE V=0 dvi html info ps pdf >stdout || { cat stdout; Exit 1; }
+cat stdout
+grep 'DVIPS    foo.ps' stdout || Exit 1
+grep 'MAKEINFO foo.html' stdout || Exit 1
+# NetBSD make will print `./foo.info' instead of `foo.info'.
+grep 'MAKEINFO.*foo.info' stdout || Exit 1
+grep 'TEXI2DVI foo.dvi' stdout || Exit 1
+grep 'TEXI2PDF foo.pdf' stdout || Exit 1
+
+# Now make sure the labels don't appear in verbose mode.
+$MAKE clean || Exit 1
+$MAKE V=1 dvi html info ps pdf >stdout || { cat stdout; Exit 1; }
+cat stdout
+grep 'DVIPS    foo.ps' stdout && Exit 1
+grep 'MAKEINFO foo.html' stdout && Exit 1
+grep 'MAKEINFO.*foo.info' stdout && Exit 1
+grep 'TEXI2DVI foo.dvi' stdout && Exit 1
+grep 'TEXI2PDF foo.pdf' stdout && Exit 1
+
+:
index 11375f8..f0abb29 100755 (executable)
@@ -19,7 +19,7 @@
 # Please keep this file in sync with silent3.test and silent4.test.
 
 required="libtoolize"
-. ./defs
+. ./defs || Exit 1
 
 set -e
 
@@ -85,6 +85,4 @@ grep ' -o libfoo' stdout
 # The libtool command line can contain e.g. a `--tag=CC' option.
 sed 's/--tag=[^ ]*/--tag=x/g' stdout | $EGREP '(CC|LD) ' && Exit 1
 
-$MAKE distclean
-
 :
index aa64d8f..40fc92e 100755 (executable)
@@ -17,7 +17,7 @@
 # Check silent-rules mode for C++.
 
 required='g++' # FIXME: any decent C++ compiler should be OK
-. ./defs
+. ./defs || Exit 1
 
 set -e
 
index 39495d4..cfdb186 100755 (executable)
@@ -18,7 +18,7 @@
 # Keep this ins sync with the sister test silentf90.test.
 
 required='gfortran' # FIXME: any working Fortran compiler should be OK!
-. ./defs
+. ./defs || Exit 1
 
 set -e
 
@@ -63,6 +63,10 @@ $AUTOCONF
 ./configure --enable-silent-rules
 $MAKE >stdout || { cat stdout; Exit 1; }
 cat stdout
+# Avoid spurious failures with SunStudio Fortran compilers.
+sed '/^NOTICE:/d' stdout > t
+mv -f t stdout
+cat stdout
 
 $EGREP ' (-c|-o)' stdout && Exit 1
 grep 'mv ' stdout && Exit 1
@@ -87,5 +91,4 @@ grep ' -o ' stdout
 
 $EGREP '(F77|FC|LD) ' stdout && Exit 1
 
-$MAKE clean
-$MAKE maintainer-clean
+:
index 9330bdd..4fe1c3f 100755 (executable)
@@ -18,7 +18,7 @@
 # Keep this ins sync with the sister test silentf77.test.
 
 required='gfortran' # FIXME: any working Fortran compiler should be OK!
-. ./defs
+. ./defs || Exit 1
 
 set -e
 
@@ -63,6 +63,10 @@ $AUTOCONF
 ./configure --enable-silent-rules
 $MAKE >stdout || { cat stdout; Exit 1; }
 cat stdout
+# Avoid spurious failures with SunStudio Fortran compilers.
+sed '/^NOTICE:/d' stdout > t
+mv -f t stdout
+cat stdout
 
 $EGREP ' (-c|-o)' stdout && Exit 1
 grep 'mv ' stdout && Exit 1
@@ -87,5 +91,4 @@ grep ' -o ' stdout
 
 $EGREP '(F77|FC|LD) ' stdout && Exit 1
 
-$MAKE clean
-$MAKE maintainer-clean
+:
index cc8898b..7aff525 100755 (executable)
@@ -1,5 +1,6 @@
 #! /bin/sh
-# Copyright (C) 1998, 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
+# Copyright (C) 1998, 2001, 2002, 2003, 2005, 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
@@ -31,27 +32,28 @@ sinclude([doesntexist.m4])
 EOF
 
 mkdir sub
+
 cat > sub/p.m4 << 'END'
-AC_SUBST(MAGICALPIG)
+AC_SUBST([MAGICALPIG])
 END
 
 cat > sub/h.m4 << 'END'
-AC_SUBST(MAGICALHOG)
+AC_SUBST([MAGICALHOG])
 END
 
 cat > sub/g.m4 << 'END'
-AC_SUBST(GREPME)
+AC_SUBST([GREPME])
 END
 
 : > Makefile.am
 
-echo 'sinclude(sub/g.m4)' >> acinclude.m4
-echo 'm4_sinclude(sub/doesntexist.m4)' >> acinclude.m4
+echo 'sinclude([sub/g.m4])' >> acinclude.m4
+echo 'm4_sinclude([sub/doesntexist.m4])' >> acinclude.m4
 
 $ACLOCAL
 
-echo 'm4_sinclude(sub/p.m4)' >> aclocal.m4
-echo 'm4_include(sub/h.m4)' >> aclocal.m4
+echo 'm4_sinclude([sub/p.m4])' >> aclocal.m4
+echo 'm4_include([sub/h.m4])' >> aclocal.m4
 
 $AUTOMAKE
 
@@ -59,3 +61,5 @@ grep doesntexist Makefile.in && Exit 1
 grep MAGICALPIG Makefile.in
 grep MAGICALHOG Makefile.in
 grep GREPME Makefile.in
+
+:
index a4ab5a8..05a90dd 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2000, 2001, 2002  Free Software Foundation, Inc.
+# Copyright (C) 2000, 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 +18,8 @@
 
 . ./defs || Exit 1
 
+set -e
+
 echo AC_PROG_CC >> configure.in
 
 cat > Makefile.am << 'END'
@@ -25,5 +27,5 @@ cat > Makefile.am << 'END'
 foo_SOURCES = foo.c
 END
 
-$ACLOCAL || Exit 1
+$ACLOCAL
 $AUTOMAKE
index 60006a5..40a383a 100755 (executable)
 
 . ./defs || Exit 1
 
-cat > configure.in << 'END'
-AC_INIT
-AM_INIT_AUTOMAKE(test, 0.1)
+set -e
+
+cat >> configure.in << 'END'
 AC_PROG_CC
 AM_PROG_CC_C_O
-AC_OUTPUT(Makefile)
+AC_OUTPUT
 END
 
 cat > Makefile.am << 'END'
@@ -35,14 +35,12 @@ END
 
 : > compile
 
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
-
-$FGREP -e '-o foo-foo' Makefile.in || Exit 1
-
-$FGREP 'foo.o.o' Makefile.in                       && Exit 1
-$FGREP 'foo.$(OBJEXT).$(OBJEXT)' Makefile.in       && Exit 1
+$ACLOCAL
+$AUTOMAKE
 
-$FGREP '$(foo_CFLAGS)' Makefile.in || Exit 1
+$FGREP ' -o foo-foo' Makefile.in
+$FGREP 'foo.o.o' Makefile.in && Exit 1
+$FGREP 'foo.$(OBJEXT).$(OBJEXT)' Makefile.in && Exit 1
+$FGREP '$(foo_CFLAGS)' Makefile.in
 
-Exit 0
+:
index d858769..2300142 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2001, 2002, 2004  Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 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
 
 . ./defs || Exit 1
 
+set -e
+
 cat >> configure.in << 'END'
 AC_PROG_CC
 AM_PROG_CC_C_O
-AM_CONDITIONAL(BAR, true)
+AM_CONDITIONAL([BAR], [true])
 END
 
 cat > Makefile.am << 'END'
@@ -38,8 +40,8 @@ END
 
 : > compile
 
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
 
 uncondval=`$FGREP 'foo-foo.o: foo.c' Makefile.in`
 
@@ -47,8 +49,10 @@ cat >> Makefile.am << 'END'
 foo_SOURCES += $(BAR_SRCS)
 END
 
-$AUTOMAKE || Exit 1
+$AUTOMAKE
 
 condval=`$FGREP 'foo-foo.o: foo.c' Makefile.in`
 
 test "x$uncondval" = "x$condval"
+
+:
index 399328f..ac52582 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 1996, 2001, 2002  Free Software Foundation, Inc.
+# Copyright (C) 1996, 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
 
 . ./defs || Exit 1
 
+set -e
+
 cat > Makefile.am << 'END'
 TAGS_DEPENDENCIES = joe
 ## Required to avoid error.
 ETAGS_ARGS = joe
 END
 
-$ACLOCAL || Exit 1
+$ACLOCAL
 $AUTOMAKE
+
+:
index ad1e232..3b423cf 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 1996, 2001, 2002  Free Software Foundation, Inc.
+# Copyright (C) 1996, 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
 
 . ./defs || Exit 1
 
+set -e
+
 cat > Makefile.am << 'EOF'
 bni_PROGRAMS = zot
 EOF
 
-if $ACLOCAL || Exit 1
-$AUTOMAKE; then
-   Exit 1
-fi
-Exit 0
+$ACLOCAL
+AUTOMAKE_fails
+grep 'bni_PROGRAMS' stderr
+grep 'bnidir.*undefined' stderr
+
+:
index cb96d27..aa07743 100755 (executable)
@@ -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
 set -e
 
 cat >> configure.in << END
-AM_CONFIG_HEADER(1.h
-                 2.h:config.hin
-                 3.h:sdir1/config1.hin)
+AM_CONFIG_HEADER([1.h
+                  2.h:config.hin
+                  3.h:sdir1/config1.hin])
 # AM_CONFIG_HEADER and AC_CONFIG_HEADERS should be synonyms.
-AC_CONFIG_HEADERS(sdir1/4.h
-                  sdir1/5.h:config.hin
-                  sdir1/6.h:sdir1/config1.hin
-                  sdir1/7.h:sdir2/config2.hin)
+AC_CONFIG_HEADERS([sdir1/4.h
+                   sdir1/5.h:config.hin
+                   sdir1/6.h:sdir1/config1.hin
+                   sdir1/7.h:sdir2/config2.hin])
 AC_OUTPUT
 END
 
@@ -68,4 +68,4 @@ test ! -f sdir1/stamp-h5
 test ! -f sdir1/stamp-h6
 test -f sdir1/stamp-h7
 
-Exit 0
+:
diff --git a/tests/strip2.test b/tests/strip2.test
new file mode 100755 (executable)
index 0000000..5786ded
--- /dev/null
@@ -0,0 +1,54 @@
+#! /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 install-strip works when STRIP consists of more than one word.
+# This test needs GNU binutils strip.  See sister test strip3.
+
+required=strip
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_PROG_CC
+AC_PROG_RANLIB
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+bin_PROGRAMS = foo
+lib_LIBRARIES = libfoo.a
+END
+
+cat > foo.c << 'END'
+int main () { return 0; }
+END
+
+cat > libfoo.c << 'END'
+int foo () { return 0; }
+END
+
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
+
+prefix=`pwd`/inst
+./configure --prefix="$prefix" STRIP='strip --verbose'
+$MAKE
+$MAKE install-strip
+
+:
diff --git a/tests/strip3.test b/tests/strip3.test
new file mode 100755 (executable)
index 0000000..b159673
--- /dev/null
@@ -0,0 +1,54 @@
+#! /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 install-strip works when STRIP consists of more than one word.
+# This test needs GNU binutils strip.  Libtool variant.
+
+required='libtoolize strip'
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_PROG_CC
+AC_PROG_LIBTOOL
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+bin_PROGRAMS = foo
+lib_LTLIBRARIES = libfoo.la
+END
+
+cat > foo.c << 'END'
+int main () { return 0; }
+END
+
+cat > libfoo.c << 'END'
+int foo () { return 0; }
+END
+
+libtoolize
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
+
+prefix=`pwd`/inst
+./configure --prefix="$prefix" STRIP='strip --verbose'
+$MAKE
+$MAKE install-strip
+
+:
index 6eb3aaa..5633ac6 100755 (executable)
@@ -69,7 +69,8 @@ $MAKE
 
 sed <configure.in >configure.tmp -e '/^AC_OUTPUT$/i\
 AC_CONFIG_FILES([maude/Makefile])\
-m4_include([confile.m4])'
+m4_include([confile.m4])\
+' # last newline required by older OpenBSD sed
 mv -f configure.tmp configure.in
 
 cat configure.in # might be useful for debugging
index 2045d58..83f3a31 100755 (executable)
@@ -64,6 +64,9 @@ $AUTOMAKE -a
 # Skip this test on configure errors (e.g., broken C++ compilers).
 ./configure || Exit 77
 
+# Ensure './libtool --help' will use the right tool versions.
+export AUTOCONF AUTOMAKE
+
 # Opportunistically check that --tag=CXX is used when supported.
 if ./libtool --help | grep tag=TAG; then
   $MAKE print >stdout || { cat stdout; Exit 1; }
diff --git a/tests/subst5.test b/tests/subst5.test
new file mode 100755 (executable)
index 0000000..7ffa1ad
--- /dev/null
@@ -0,0 +1,42 @@
+#! /bin/sh
+# Copyright (C) 2009 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 3 of the License, 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/>.
+
+# Complain about configure substitutions in EXTRA_PRIMARY variables.
+# Rationale: we need to know the literal values of, say, PROGRAMS.
+# Thus, we allow substitutions in bin_PROGRAMS, but then EXTRA_PROGRAMS
+# needs to list possible values of that substitution, literally.
+
+. ./defs || Exit 1
+
+set -e
+
+cat >>configure.in <<'END'
+AC_PROG_CC
+AC_SUBST([substed1])
+AC_SUBST([substed2])
+END
+
+cat > Makefile.am <<'END'
+bin_PROGRAMS = @substed1@
+EXTRA_PROGRAMS = @substed2@
+END
+
+$ACLOCAL
+AUTOMAKE_fails
+grep 'bin_PROGRAMS.*contains configure substitution' stderr && Exit 1
+grep 'EXTRA_PROGRAMS.*contains configure substitution' stderr
+
+Exit 0
index 131359c..d85ad8f 100755 (executable)
@@ -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
 
 :
index 505486f..3b2a4e5 100755 (executable)
@@ -1,5 +1,6 @@
 #! /bin/sh
-# Copyright (C) 1998, 2001, 2002, 2003  Free Software Foundation, Inc.
+# Copyright (C) 1998, 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
@@ -28,4 +29,6 @@ END
 
 $ACLOCAL
 AUTOMAKE_fails
-grep 'Makefile.am:2:.*blank line' stderr
+grep 'Makefile\.am:2:.*blank line' stderr
+
+:
diff --git a/tests/tags2.test b/tests/tags2.test
new file mode 100755 (executable)
index 0000000..f6e018c
--- /dev/null
@@ -0,0 +1,44 @@
+#! /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/>.
+
+# TAGS_DEPENDENCIES only make sense if other tag-worthy things (such as
+# sources) exist.
+
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_PROG_CC
+AC_OUTPUT
+END
+
+cat >Makefile.am << 'END'
+TAGS_DEPENDENCIES = foo
+END
+
+$ACLOCAL
+AUTOMAKE_fails
+grep 'define.*TAGS_DEPENDENCIES.*without' stderr
+
+cat >>Makefile.am << 'END'
+bin_PROGRAMS = bar
+END
+
+AUTOMAKE_run 0
+grep 'define.*TAGS_DEPENDENCIES.*without' stderr && Exit 1
+
+:
index b324568..f3ac9cc 100755 (executable)
 required=gcc
 . ./defs || Exit 1
 
-cat > configure.in << 'END'
-AC_INIT(foo.c)
-AM_INIT_AUTOMAKE(target-cflags,0.0)
+set -e
+
+cat >> configure.in << 'END'
 AC_PROG_CC
 AM_PROG_CC_C_O
-AC_OUTPUT(Makefile)
+AC_OUTPUT
 END
 
 cat > Makefile.am << 'END'
@@ -54,8 +54,6 @@ int main(void)
 #endif
 END
 
-set -e
-
 $ACLOCAL
 $AUTOCONF
 $AUTOMAKE -a
@@ -72,3 +70,5 @@ cd ..
 $MAKE
 ./foo
 ./bar
+
+:
index 0433b41..87e37a8 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2002, 2003  Free Software Foundation, Inc.
+# Copyright (C) 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
@@ -30,6 +30,7 @@ bin_PROGRAMS = ctags
 END
 
 $ACLOCAL
-$AUTOCONF
 AUTOMAKE_fails -a
 grep 'redefinition.*ctags' stderr
+
+:
index 3c2265d..4adf473 100755 (executable)
@@ -1,5 +1,6 @@
 #! /bin/sh
-# Copyright (C) 2003, 2004, 2007, 2008  Free Software Foundation, Inc.
+# Copyright (C) 2003, 2004, 2007, 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
@@ -56,7 +57,7 @@ END
 
 mkdir aux1
 mkdir tex
-cp "$testsrcdir/../lib/texinfo.tex" tex
+cp "$top_testsrcdir/lib/texinfo.tex" tex
 
 $ACLOCAL
 $AUTOMAKE --add-missing
index 6163a8d..c88db68 100755 (executable)
@@ -30,3 +30,9 @@ END
 
 $ACLOCAL
 $AUTOMAKE
+
+for i in 1 2 3 4; do
+  grep "^MY_FLAGS_$i *= *-DABC=345 *$" Makefile.in
+done
+
+:
index 6b738ab..842d567 100755 (executable)
@@ -30,7 +30,7 @@ L05 = "$(bad boy)"
 L06 = $(this:is= ok)
 L07 = ${three errors}${on this} $(long line)
 L08$(o u c h): $(wildcard *.c)
-       ${another error}
+       ${another Error}
        echo $${ok-this is}
 L11: $(thisis) $(ok)
        ${here}
@@ -70,7 +70,7 @@ grep 'on this' stderr
 grep 'long line' stderr
 grep 'o u c h' stderr
 grep 'wildcard' stderr
-grep 'another error' stderr
+grep 'another Error' stderr
 grep 'thisis' stderr && Exit 1
 grep 'here' stderr && Exit 1
 
@@ -82,3 +82,5 @@ $AUTOMAKE -Wno-portability
 # processed far later).
 echo 'AUTOMAKE_OPTIONS = -Wno-portability' >> Makefile.am
 $AUTOMAKE
+
+:
index 3a18d77..a33ab64 100755 (executable)
@@ -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
+
+:
diff --git a/tests/vartypo2.test b/tests/vartypo2.test
new file mode 100755 (executable)
index 0000000..5b87404
--- /dev/null
@@ -0,0 +1,71 @@
+#! /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 we warn about possible variable typos when we should,
+# Libtool variant.
+
+required=libtoolize
+. ./defs || Exit 1
+
+set -e
+
+cat >>configure.in <<'END'
+AC_PROG_LIBTOOL
+AC_OUTPUT
+END
+
+cat >Makefile.am <<'END'
+libfoo_la_SOURCES = unused
+nodist_libfoo_la_SOURCES = unused
+EXTRA_libfoo_la_SOURCES = unused
+libfoo_la_LIBADD = unused
+libfoo_la_DEPENDENCIES = unused
+EXTRA_libfoo_la_DEPENDENCIES = unused
+END
+
+libtoolize
+$ACLOCAL
+AUTOMAKE_fails --add-missing
+# The expected diagnostic is:
+# automake: warnings are treated as errors
+# Makefile.am:3: warning: variable `EXTRA_libfoo_la_SOURCES' is defined but no program or
+# Makefile.am:3: library has `libfoo_la' as canonical name (possible typo)
+# Makefile.am:1: warning: variable `libfoo_la_SOURCES' is defined but no program or
+# Makefile.am:1: library has `libfoo_la' as canonical name (possible typo)
+# Makefile.am:2: warning: variable `nodist_libfoo_la_SOURCES' is defined but no program or
+# Makefile.am:2: library has `libfoo_la' as canonical name (possible typo)
+# Makefile.am:4: warning: variable `libfoo_la_LIBADD' is defined but no program or
+# Makefile.am:4: library has `libfoo_la' as canonical name (possible typo)
+# Makefile.am:6: warning: variable `EXTRA_libfoo_la_DEPENDENCIES' is defined but no program or
+# Makefile.am:6: library has `libfoo_la' as canonical name (possible typo)
+# Makefile.am:5: warning: variable `libfoo_la_DEPENDENCIES' is defined but no program or
+# Makefile.am:5: library has `libfoo_la' as canonical name (possible typo)
+
+
+test -z "`grep 'as canonical' stderr | grep -v ' .libfoo_la. '`"
+test `grep 'variable.*is defined but' stderr | wc -l` = 6
+
+# If we add a global -Wnone, all warnings should disappear.
+$AUTOMAKE -Wnone
+
+# Likewise, if matching programs or libraries are defined.
+cat >>Makefile.am <<'END'
+lib_LTLIBRARIES = libfoo.la
+END
+
+$AUTOMAKE
+
+:
diff --git a/tests/vartypos.test b/tests/vartypos.test
new file mode 100755 (executable)
index 0000000..73e7c55
--- /dev/null
@@ -0,0 +1,90 @@
+#! /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 we warn about possible variable typos when we should.
+
+. ./defs || Exit 1
+
+set -e
+
+cat >>configure.in <<'END'
+AC_PROG_RANLIB
+AC_OUTPUT
+END
+
+cat >Makefile.am <<'END'
+foo_SOURCES = unused
+nodist_foo_SOURCES = unused
+EXTRA_foo_SOURCES = unused
+foo_LDADD = unused
+foo_LDFLAGS = unused
+foo_DEPENDENCIES = unused
+EXTRA_foo_DEPENDENCIES = unused
+
+libfoo_a_SOURCES = unused
+nodist_libfoo_a_SOURCES = unused
+EXTRA_libfoo_a_SOURCES = unused
+libfoo_a_LIBADD = unused
+libfoo_a_DEPENDENCIES = unused
+EXTRA_libfoo_a_DEPENDENCIES = unused
+END
+
+$ACLOCAL
+AUTOMAKE_fails
+# The expected diagnostic is:
+# automake: warnings are treated as errors
+# Makefile.am:2: warning: variable `nodist_foo_SOURCES' is defined but no program or
+# Makefile.am:2: library has `foo' as canonical name (possible typo)
+# Makefile.am:1: warning: variable `foo_SOURCES' is defined but no program or
+# Makefile.am:1: library has `foo' as canonical name (possible typo)
+# Makefile.am:9: warning: variable `libfoo_a_SOURCES' is defined but no program or
+# Makefile.am:9: library has `libfoo_a' as canonical name (possible typo)
+# Makefile.am:10: warning: variable `nodist_libfoo_a_SOURCES' is defined but no program or
+# Makefile.am:10: library has `libfoo_a' as canonical name (possible typo)
+# Makefile.am:11: warning: variable `EXTRA_libfoo_a_SOURCES' is defined but no program or
+# Makefile.am:11: library has `libfoo_a' as canonical name (possible typo)
+# Makefile.am:3: warning: variable `EXTRA_foo_SOURCES' is defined but no program or
+# Makefile.am:3: library has `foo' as canonical name (possible typo)
+# Makefile.am:12: warning: variable `libfoo_a_LIBADD' is defined but no program or
+# Makefile.am:12: library has `libfoo_a' as canonical name (possible typo)
+# Makefile.am:4: warning: variable `foo_LDADD' is defined but no program or
+# Makefile.am:4: library has `foo' as canonical name (possible typo)
+# Makefile.am:5: warning: variable `foo_LDFLAGS' is defined but no program or
+# Makefile.am:5: library has `foo' as canonical name (possible typo)
+# Makefile.am:14: warning: variable `EXTRA_libfoo_a_DEPENDENCIES' is defined but no program or
+# Makefile.am:14: library has `libfoo_a' as canonical name (possible typo)
+# Makefile.am:7: warning: variable `EXTRA_foo_DEPENDENCIES' is defined but no program or
+# Makefile.am:7: library has `foo' as canonical name (possible typo)
+# Makefile.am:6: warning: variable `foo_DEPENDENCIES' is defined but no program or
+# Makefile.am:6: library has `foo' as canonical name (possible typo)
+# Makefile.am:13: warning: variable `libfoo_a_DEPENDENCIES' is defined but no program or
+# Makefile.am:13: library has `libfoo_a' as canonical name (possible typo)
+
+test -z "`grep 'as canonical' stderr | grep -v ' .foo. ' | grep -v ' .libfoo_a. '`"
+test `grep 'variable.*is defined but' stderr | wc -l` = 13
+
+# If we add a global -Wnone, all warnings should disappear.
+$AUTOMAKE -Wnone
+
+# Likewise, if matching programs or libraries are defined.
+cat >>Makefile.am <<'END'
+bin_PROGRAMS = foo
+lib_LIBRARIES = libfoo.a
+END
+
+$AUTOMAKE
+
+:
index 4df84ed..a87b2b8 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2002, 2008  Free Software Foundation, Inc.
+# Copyright (C) 2002, 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
@@ -24,9 +24,9 @@ required='makeinfo tex texi2dvi GNUmake'
 
 set -e
 
-cat >configure.in <<'END'
+cat >configure.in <<END
 m4_include([version.m4])
-AC_INIT([version7], [THE_VERSION])
+AC_INIT([$me], [THE_VERSION])
 AM_INIT_AUTOMAKE
 AC_CONFIG_FILES([Makefile])
 AC_OUTPUT
@@ -59,9 +59,10 @@ $AUTOMAKE --add-missing
 $MAKE
 grep '2\.718' version.texi
 
-
 $sleep
 echo 'm4_define([THE_VERSION], [3.141])' > version.m4
 $MAKE distcheck
 ./configure --version | grep '3\.141'
 grep '3\.141' version.texi
+
+:
index 6d96400..b472164 100755 (executable)
@@ -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
@@ -46,14 +46,15 @@ END
 $ACLOCAL
 AUTOMAKE_fails
 # The expected diagnostic is
-#   Makefile.am:3: unused variable: `foo_SOURCES'
-#   sub/Makefile.am:2: `INCLUDES' is the old name for `AM_CPPFLAGS'
+#   Makefile.am:3: warning: variable `foo_SOURCES' is defined but no program or
+#                           library has `foo' as canonical name (possible typo)
+#   sub/Makefile.am:2: warning: `INCLUDES' is the old name for `AM_CPPFLAGS'
 grep '^Makefile.am:.*foo_SOURCES' stderr
 grep '^sub/Makefile.am:.*INCLUDES' stderr
 grep '^sub/Makefile.am:.*foo_SOURCES' stderr && Exit 1
 grep '^Makefile.am:.*INCLUDES' stderr && Exit 1
 # Only three lines of warnings.
-test `wc -l < stderr` = 3
+test `grep -v 'warnings are treated as errors' stderr | wc -l` = 3
 
 # On fast machines the autom4te.cache created during the above run of
 # $AUTOMAKE is likely to have the same time stamp as the configure.in
index 355f9d2..d1b173c 100755 (executable)
@@ -14,7 +14,7 @@
 # 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 to make sure --Werror and --add-missing work together.
+# Test to make sure -Werror and --add-missing work together.
 
 . ./defs || Exit 1
 
@@ -25,4 +25,4 @@ set -e
 rm -f install-sh depcomp missing mkinstalldirs
 
 $ACLOCAL
-$AUTOMAKE --Werror --add-missing
+$AUTOMAKE -Werror --add-missing
diff --git a/tests/werror4.test b/tests/werror4.test
new file mode 100755 (executable)
index 0000000..831d0fd
--- /dev/null
@@ -0,0 +1,68 @@
+#! /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/>.
+
+# -Werror and local -Werror settings should be flagged for the user.
+
+. ./defs || Exit 1
+
+set -e
+
+cat >>configure.in <<\END
+AC_CONFIG_FILES([sub/Makefile])
+AC_OUTPUT
+END
+
+mkdir sub
+cat >sub/Makefile.am <<\END
+AUTOMAKE_OPTIONS = -Werror
+SUB = foo
+SUB = bar
+END
+cat >Makefile.am <<\END
+AUTOMAKE_OPTIONS = -Werror
+VAR = foo
+VAR = bar
+END
+
+$ACLOCAL
+
+AUTOMAKE_fails -Wno-error
+grep 'VAR multiply defined' stderr
+grep 'SUB multiply defined' stderr
+test `grep -c 'warnings are treated as errors' stderr` -eq 1
+
+sed '/AUTOMAKE_OPTIONS/d' sub/Makefile.am > t
+mv -f t sub/Makefile.am
+
+AUTOMAKE_fails -Wno-error
+grep 'VAR multiply defined' stderr
+grep 'SUB multiply defined' stderr
+test `grep -c 'warnings are treated as errors' stderr` -eq 1
+
+sed '/AUTOMAKE_OPTIONS/d' Makefile.am > t
+mv -f t Makefile.am
+
+AUTOMAKE_fails -Werror
+grep 'VAR multiply defined' stderr
+grep 'SUB multiply defined' stderr
+test `grep -c 'warnings are treated as errors' stderr` -eq 1
+
+AUTOMAKE_run 0 -Wno-error
+grep 'VAR multiply defined' stderr
+grep 'SUB multiply defined' stderr
+grep 'warnings are treated as errors' stderr && Exit 1
+
+:
diff --git a/tests/yacc-basic.test b/tests/yacc-basic.test
new file mode 100755 (executable)
index 0000000..af0c488
--- /dev/null
@@ -0,0 +1,78 @@
+#! /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/>.
+
+# Basic semantic checks on Yacc support.
+
+required=bison
+. ./defs || Exit 1
+
+set -e
+
+distdir=$me-1.0
+
+cat >> configure.in << 'END'
+AC_PROG_CC
+AC_PROG_YACC
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+bin_PROGRAMS = foo
+foo_SOURCES = parse.y foo.c
+END
+
+cat > parse.y << 'END'
+%{
+#include <stdio.h>
+#include <stdlib.h>
+int yylex () { return (getchar ()); }
+void yyerror (char *s) {}
+%}
+%%
+a : 'a' { exit(0); };
+END
+
+cat > foo.c << 'END'
+int main () { yyparse (); return 1; }
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
+
+./configure
+$MAKE
+
+echo a | ./foo
+echo b | ./foo && Exit 1
+
+# The generated file `parse.c' must be shipped.
+$MAKE distdir
+test -f $distdir/parse.c
+
+# Sanity check on distribution.
+$MAKE distcheck
+
+# While we are at it, make sure that parse.c is erased by
+# maintainer-clean, and not by distclean.
+test -f parse.c
+$MAKE distclean
+test -f parse.c
+./configure # we must re-create `Makefile'
+$MAKE maintainer-clean
+test ! -f parse.c
+
+:
index bf6782f..13b7fe3 100755 (executable)
@@ -1,5 +1,6 @@
 #! /bin/sh
-# Copyright (C) 1996, 2001, 2002, 2006  Free Software Foundation, Inc.
+# Copyright (C) 1996, 2001, 2002, 2006, 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
@@ -34,4 +35,6 @@ END
 $ACLOCAL
 $AUTOMAKE -a
 
-grep 'zardoz.c' Makefile.in
+$FGREP 'zardoz.c' Makefile.in
+
+:
index a095edc..f598595 100755 (executable)
@@ -1,5 +1,6 @@
 #! /bin/sh
-# Copyright (C) 1999, 2001, 2002, 2003, 2006  Free Software Foundation, Inc.
+# Copyright (C) 1999, 2001, 2002, 2003, 2006, 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
@@ -26,6 +27,10 @@ AC_PROG_CC
 AC_PROG_YACC
 END
 
+# Run it here once and for all, since we are not going to modify
+# configure.in anymore.
+$ACLOCAL
+
 cat > Makefile.am <<'END'
 bin_PROGRAMS = zardoz
 zardoz_SOURCES = zardoz.y
@@ -34,53 +39,36 @@ END
 # Don't redefine several times the same variable.
 cp Makefile.am Makefile.src
 
-$ACLOCAL
 $AUTOMAKE -a
-
 # If zardoz.h IS mentioned, fail
-grep 'zardoz.h' Makefile.in > /dev/null && Exit 1
-
-
+$FGREP 'zardoz.h' Makefile.in && Exit 1
 
 cp Makefile.src Makefile.am
 echo 'AM_YFLAGS = -d' >> Makefile.am
-
 $AUTOMAKE
-
 # If zardoz.h is NOT mentioned, fail
-grep 'zardoz.h' Makefile.in > /dev/null
-
-
+$FGREP 'zardoz.h' Makefile.in
 
 cp Makefile.src Makefile.am
 echo 'AM_YFLAGS = ' >> Makefile.am
-
 $AUTOMAKE
-
 # If zardoz.h IS mentioned, fail
-grep 'zardoz.h' Makefile.in > /dev/null && Exit 1
-
-
+$FGREP 'zardoz.h' Makefile.in && Exit 1
 
 cp Makefile.src Makefile.am
 echo 'YFLAGS = -d' >> Makefile.am
-
-# YFLAGS is a use variable.
+# YFLAGS is a user variable.
 AUTOMAKE_fails
-grep 'YFLAGS' stderr
+grep 'YFLAGS.* user variable' stderr
+grep 'AM_YFLAGS.* instead' stderr
 $AUTOMAKE -Wno-gnu
-
 # If zardoz.h is NOT mentioned, fail
-grep 'zardoz.h' Makefile.in > /dev/null
-
-
+$FGREP 'zardoz.h' Makefile.in
 
 cp Makefile.src Makefile.am
 echo 'YFLAGS = ' >> Makefile.am
-
 $AUTOMAKE -Wno-gnu
-
 # If zardoz.h IS mentioned, fail
-grep 'zardoz.h' Makefile.in > /dev/null && Exit 1
+$FGREP 'zardoz.h' Makefile.in && Exit 1
 
 :
index 86d897c..46f8d3e 100755 (executable)
@@ -1,5 +1,6 @@
 #! /bin/sh
-# Copyright (C) 1999, 2001, 2002, 2006  Free Software Foundation, Inc.
+# Copyright (C) 1999, 2001, 2002, 2006, 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
@@ -30,24 +31,22 @@ cat > Makefile.am <<'END'
 AUTOMAKE_OPTIONS = no-dependencies
 bin_PROGRAMS = zardoz
 zardoz_SOURCES = zardoz.y
-magic:
-       @echo $(DIST_COMMON)
 END
 
 $ACLOCAL
 $AUTOMAKE -a
 
-$FGREP -v @SET_MAKE@ Makefile.in > Makefile.sed
 # It should not be disted here
-grep 'zardoz.h' Makefile.in && Exit 1
+$FGREP 'zardoz.h' Makefile.in && Exit 1
 
-cp Makefile.am Save
+cp Makefile.am Makefile.sav
 # Test all available flags to make sure header is distributed with
 # `-d'.
 for flag in YFLAGS AM_YFLAGS zardoz_YFLAGS; do
-   cp Save Makefile.am
+   cp Makefile.sav Makefile.am
    echo "$flag = -d" >> Makefile.am
-
    $AUTOMAKE -Wno-gnu
-   grep 'zardoz.h' Makefile.in
+   $FGREP 'zardoz.h' Makefile.in
 done
+
+:
index 0435ec0..bb25290 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2001, 2002  Free Software Foundation, Inc.
+# Copyright (C) 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
 required='bison gcc'
 . ./defs || Exit 1
 
-cat > configure.in << 'END'
-AC_INIT
-AC_CONFIG_AUX_DIR([.])
-AM_INIT_AUTOMAKE(foo, 0.1)
-PACKAGE=foo
-VERSION=0.1
+set -e
+
+cat >> configure.in << 'END'
 AC_PROG_CC
 AC_PROG_YACC
-AC_OUTPUT(Makefile)
+AC_OUTPUT
 END
 
 cat > Makefile.am << 'END'
@@ -60,8 +57,6 @@ cat > foo.c << 'END'
 int main () { return 0; }
 END
 
-set -e
-
 $ACLOCAL
 $AUTOCONF
 $AUTOMAKE -a
@@ -86,6 +81,5 @@ test -f parse.c
 $MAKE maintainer-clean
 test ! -f bar.c
 test ! -f parse.c
-:
 
-Exit 0
+:
index 8b00ed8..77de2e9 100755 (executable)
@@ -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
 
 set -e
 
-cat > configure.in << 'END'
-AC_INIT
-AM_INIT_AUTOMAKE(nonesuch, nonesuch)
+cat >> configure.in << 'END'
 AC_PROG_CC
 AM_PROG_CC_C_O
 AC_PROG_YACC
-AC_OUTPUT(Makefile)
 END
 
 cat > Makefile.am << 'END'
@@ -69,8 +66,8 @@ maude_SOURCES = sub/maude.y
 maude_YFLAGS = -d
 END
 
-$ACLOCAL || Exit 1
-$AUTOMAKE -a || Exit 1
+$ACLOCAL
+$AUTOMAKE -a
 
 # Rule should use maude_YFLAGS.
 grep 'AM_YFLAGS.*maude' Makefile.in && Exit 1
@@ -80,3 +77,5 @@ grep 'maudec' Makefile.in && Exit 1
 
 # Make sure the .o file is required.
 grep '^am_maude_OBJECTS.*maude' Makefile.in
+
+:
index f10effd..b9b259b 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2001, 2002, 2003, 2004, 2006, 2007  Free Software
+# Copyright (C) 2001, 2002, 2003, 2004, 2006, 2007, 2010 Free Software
 # Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
@@ -27,13 +27,13 @@ set -e
 
 cat > configure.in << 'END'
 AC_INIT([yacc6], [1.0])
+# `aux' is not an acceptable file/directory name on Windows systems
 AC_CONFIG_AUX_DIR([aux1])
 AM_INIT_AUTOMAKE
-AC_CONFIG_FILES([Makefile])
+AC_CONFIG_FILES([Makefile sub/Makefile])
 AC_PROG_CC
 AM_PROG_CC_C_O
 AC_PROG_YACC
-AC_CONFIG_FILES([sub/Makefile])
 AC_OUTPUT
 END
 
@@ -89,11 +89,11 @@ $AUTOMAKE -a
 test -f aux1/ylwrap
 test ! -f ylwrap
 test ! -f sub/ylwrap
-$FGREP '(top_srcdir)/aux1/ylwrap' sub/Makefile.in
+$FGREP '$(top_srcdir)/aux1/ylwrap' sub/Makefile.in
 ./configure
 $MAKE
-grep '#.*line.*foo.y' sub/foo.c
-grep '#.*line.*bar.y' sub/bar.c
+grep '#.*line.*foo\.y' sub/foo.c
+grep '#.*line.*bar\.y' sub/bar.c
 
 $sleep
 : > z
@@ -106,3 +106,5 @@ sed s/TOKEN/TEKON/g sub/bar.y >sub/bar.yt
 mv -f sub/bar.yt sub/bar.y
 $MAKE
 $MAKE test-time-changed
+
+:
index 2edd15c..2b866bc 100755 (executable)
@@ -1,5 +1,6 @@
 #! /bin/sh
-# Copyright (C) 2001, 2002, 2003, 2004  Free Software Foundation, Inc.
+# Copyright (C) 2001, 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
@@ -23,6 +24,8 @@
 required=bison
 . ./defs || Exit 1
 
+set -e
+
 cat >> configure.in << 'END'
 AC_PROG_CC
 AC_PROG_YACC
@@ -52,8 +55,6 @@ WORD: "up";
 %%
 END
 
-set -e
-
 $ACLOCAL
 $AUTOMAKE -a
 $AUTOCONF
@@ -83,8 +84,9 @@ $MAKE distclean
 test -f foo.h
 test -f foo.c
 # ... but maintainer-clean should.
-./configure
+./configure # we must re-create `Makefile'
 $MAKE maintainer-clean
 test ! -f foo.h
 test ! -f foo.c
+
 :
index 979415c..797f4e7 100755 (executable)
@@ -1,5 +1,6 @@
 #! /bin/sh
-# Copyright (C) 2002, 2003, 2004, 2006  Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003, 2004, 2006, 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
@@ -22,11 +23,7 @@ required="gcc bison"
 
 set -e
 
-cat > configure.in << 'END'
-AC_INIT([yacc8], [1.0])
-AC_CONFIG_AUX_DIR([.])
-AM_INIT_AUTOMAKE
-AC_CONFIG_FILES([Makefile])
+cat >> configure.in << 'END'
 AC_PROG_CC
 AM_PROG_CC_C_O
 AC_PROG_YACC
@@ -39,15 +36,16 @@ bin_PROGRAMS = foo/foo
 foo_foo_SOURCES = foo/parse.y
 AM_YFLAGS = -d
 
+.PHONY: obj
 obj: foo/parse.$(OBJEXT)
 
-test1: obj
-       test -f foo/parse.c
-       test -f foo/parse.$(OBJEXT)
-
-test2: obj
+.PHONY: test1 test2
+test1: foo/parse.$(OBJEXT)
        test -f foo/parse.c
        test -f foo/parse.$(OBJEXT)
+test2: foo/parse2.$(OBJEXT)
+       test -f foo/parse2.c
+       test -f foo/parse2.$(OBJEXT)
 END
 
 mkdir foo
@@ -104,9 +102,11 @@ EXTRA_foo_foo_SOURCES = foo/parse2.y
 END
 
 $AUTOMAKE -a
-test -f ./ylwrap || Exit 1
+test -f ./ylwrap
 
 cd sub
 # Regenerate Makefile (automatic in GNU Make, but not in other Makes)
 ./config.status
 $MAKE test2
+
+:
index d11d3fe..d2e7632 100755 (executable)
@@ -16,6 +16,7 @@
 
 # Removal recovery rules for headers should not remove files with `make -n'.
 
+required=bison
 . ./defs || Exit 1
 
 set -e
index 9013f40..9c4ae24 100755 (executable)
@@ -1,5 +1,6 @@
 #! /bin/sh
-# Copyright (C) 1997, 2001, 2002, 2006  Free Software Foundation, Inc.
+# Copyright (C) 1997, 2001, 2002, 2006, 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
@@ -14,7 +15,8 @@
 # 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 to make sure yacc + c++ works.
+# Test to make sure Yacc + C++ is supported.
+# Please keep this is sync with sister test lexcpp.test.
 
 . ./defs || Exit 1
 
@@ -26,11 +28,20 @@ AC_PROG_YACC
 END
 
 cat > Makefile.am << 'END'
-bin_PROGRAMS = zardoz
-zardoz_SOURCES = zardoz.yy
+bin_PROGRAMS = foo bar baz qux
+foo_SOURCES = foo.y++
+bar_SOURCES = bar.ypp
+baz_SOURCES = baz.yy
+qux_SOURCES = qux.yxx
 END
 
 $ACLOCAL
 $AUTOMAKE -a
 
-grep zardoz.cc Makefile.in
+sed -e 's/^/ /' -e 's/$/ /' Makefile.in >mk
+$FGREP ' foo.c++ ' mk
+$FGREP ' bar.cpp ' mk
+$FGREP ' baz.cc '  mk
+$FGREP ' qux.cxx ' mk
+
+:
index 6db5fd7..7f44671 100755 (executable)
@@ -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
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # This test checks that dependent files are updated before including
-# in the distribution. `parse.c' depends on `parce.y'. The later is
+# in the distribution. `parse.c' depends on `parse.y'. The later is
 # updated so that `parse.c' should be rebuild. Then we are running
 # `make' and `make distdir' and check whether the version of `parse.c'
 # to be distributed is up to date.
 
+# Please keep this in sync with sister test `lexvapth.test'.
+
 required='gcc bison'
 . ./defs || Exit 1
 
-cat > configure.in << 'END'
-AC_INIT
-AC_CONFIG_AUX_DIR([.])
-AM_INIT_AUTOMAKE(foo, 0.1)
-PACKAGE=foo
-VERSION=0.1
+set -e
+
+distdir=$me-1.0
+
+cat >> configure.in << 'END'
 AC_PROG_CC
 AC_PROG_YACC
-AC_OUTPUT(Makefile)
+AC_OUTPUT
 END
 
 cat > Makefile.am << 'END'
@@ -53,8 +54,6 @@ cat > foo.c << 'END'
 int main () { return 0; }
 END
 
-set -e
-
 $ACLOCAL
 $AUTOCONF
 $AUTOMAKE -a
@@ -82,7 +81,7 @@ END
 
 $MAKE
 $MAKE distdir
-grep fubar foo-0.1/parse.c
+$FGREP fubar $distdir/parse.c
 
 #
 # Now check to make sure that `make dist' will rebuild the parser.
@@ -103,4 +102,6 @@ maude : 'm' 'a' 'u' 'd' 'e' {};
 END
 
 $MAKE distdir
-grep maude foo-0.1/parse.c
+$FGREP maude $distdir/parse.c
+
+: