automake-commit
[Top][All Lists]
Advanced

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

[Automake-commit] [SCM] GNU Automake branch, maint, updated. v1.13-1-ga3


From: Stefano Lattarini
Subject: [Automake-commit] [SCM] GNU Automake branch, maint, updated. v1.13-1-ga31c991
Date: Fri, 28 Dec 2012 18:02:39 +0000

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

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

The branch, maint has been updated
       via  a31c991e5f4d58f236e26ab4d3197aa68d564110 (commit)
       via  2f552a970f2e8c00f0fc01ad72ff995716be2a06 (commit)
       via  c010d62f6e5d48cc8fbd0a51e3e16d1b474f8a54 (commit)
       via  27eb4254ec9acdd435bbd76a54201955a1b0fa78 (commit)
       via  b9951d654abb76c5419f1e2b453f1ca06fdb331b (commit)
       via  31a07e69c1be42d5fc30257d42d5165c76a1d4ed (commit)
       via  929c20cc15c3188dd3bf7557ab3dad62c6db2178 (commit)
       via  31d006502cb4fed4c6c5977630cefdf3b619ec24 (commit)
       via  4fd9dcd62759c21ba6324dd6861a49dbfae12fba (commit)
       via  72f22d497983b8881cbe277297e2f47dc800f788 (commit)
       via  9ebccd05291f99c446908e6485f338f4ea47ecf5 (commit)
       via  3b503c42e33b53ae82e160f002289b39152347cb (commit)
       via  6179686fe621bfbf542614dfe5eb7a4e6c973393 (commit)
       via  fb214402c043a70581f19d4856a81362a5a1a0d6 (commit)
       via  f4eceb86c31f0d9b1cb76aa88d57676ebb48b342 (commit)
       via  f3d6ca85d3fc962b77d2e0fbe06cab253394a110 (commit)
       via  a1f9336b9dee4dcb97dd8488f22b1bc684f956f9 (commit)
       via  fba280d0923da6ef0d55db11edb0944ee1261987 (commit)
       via  37ce97010c0c428663a38b270d843c4a4fad52f2 (commit)
       via  b8c7e3f7ebf3ff8841b6bc1d224bbc87d71261ff (commit)
       via  2674291c3389fcde8c7206f858df12d66f123837 (commit)
       via  de736a2222a4ffe7dfb82b60ba2fa10192548a31 (commit)
       via  d7a59576910338592410afd23bb726348fa59000 (commit)
       via  6a38d7404f561cf4fd6494b3b243eae89951c947 (commit)
       via  10ebd158644c2266607943de90a817e4f23c96bc (commit)
       via  27954741470878f637c152a2666187ce2807abb1 (commit)
       via  71626475407387f8229367e52a1bd9a1f6292bfa (commit)
       via  0ff68f958c88e6dfbee2f1c5091561e2eb1f6cba (commit)
       via  487cf08d4c76d4cd1ff1e30d169eb6b5edf354a4 (commit)
       via  2543f06b180e91371eb9e20c38d96142e0827fde (commit)
       via  3a00a3c5db2ccdea53485e93e154ab7c89ed512e (commit)
       via  4f855e0d1078bb7c1d869d3929259c525f4c5fff (commit)
       via  24d0dcbe1777e20fb07505ebe215df72bda21c42 (commit)
       via  4d27453ce1fae61e4ef4a5e2f21122515e4f0260 (commit)
       via  afd3bc19e09591e1e11ef46513cccd2e38382922 (commit)
       via  2b09f2006452cc6b1dfb4ce56565b6af3f72fb92 (commit)
       via  3ad09d87325a64e5619268f4afa20a7adb9eeabf (commit)
       via  1518257a9328d914d763da188c5fda9a03dba3f2 (commit)
       via  83cc9fd054566db15736c07c0a46c288d28082c2 (commit)
       via  5d3b980bd2b63733a98f626e5f23c5c9661cc3cc (commit)
       via  b53a3b016eba7c20e0d445fa6bd8923c7a3334bb (commit)
       via  35ef2ffe421130676ee10361dda09bef4785a194 (commit)
       via  0c1a92102dc1cf17e32aacde6dc1f21584425711 (commit)
       via  5d84b891ff16e702cc273a0584e6746e7cd70458 (commit)
       via  1d51ce40acac781d98e23ab234b3a00bfc1885a7 (commit)
       via  8469853ac0e693b28a48e30310ff1417bcf61d6a (commit)
       via  883723873c94bdd3a9a3c9a376e3b2b266db5ca3 (commit)
       via  a55591f32d816db41335835eb8bc92aa4d5c5267 (commit)
       via  fe1625a4b00b402d6333be0d7999a41ed4983204 (commit)
       via  6d1fe29e2c844fe3d50267af02ae69e687fd5e37 (commit)
       via  cb6a19d9d0c46ddf03b2494333bed2c3d7dc1e15 (commit)
       via  ab49d2bc115ba121b00ac06229d4044a004f67e9 (commit)
       via  3e6643af3c1d4ae729c59ed6d2b803767a03e3c3 (commit)
       via  18143e7cfe66eaddffa481211ad4e340a11a22f4 (commit)
       via  1efb88cadad61a031d1c297310bc2634562f2e87 (commit)
       via  92bd5d25c2ba94b8664202990d0152e68d440632 (commit)
       via  60fe7d3d124f9b3f3b580432f44acbc6f4bcd7b7 (commit)
       via  26432142c64229f6c11c833aa8019e672593d2c1 (commit)
       via  33c836b2ad72c1384ba0a8983989322b88e6bfa2 (commit)
       via  f0dd2dee9e4cebdc2ef1c5a9875728185bfd60eb (commit)
       via  326cd5f0797b32616a7a6caaa854b04c4ebd53f7 (commit)
       via  b7c507eadfa7b9ef40ba433dee0d231432ab7c39 (commit)
       via  834e16016b07aab9e3613a0b08a86dbadeff88c0 (commit)
       via  d114599bd66589794c6b78130bbc0db4ac91c334 (commit)
       via  838238295952cc86e5ccfe59113e6c315cf640ec (commit)
       via  256659b06280ab4be5103c760b777e26980863c3 (commit)
       via  bd337b9b203aa92fc524d24d325329b099d8cbc2 (commit)
       via  4a5955172d2d39ef03191d2ca69edc585a12910d (commit)
       via  9018a126345d53a83b0666e7e44e8b1d0d1bb8ee (commit)
       via  fd60ad28737e90d8732f28ce85d6cdaa781bdeed (commit)
       via  d2155d50e6ef6d11845583af0113a717642f53df (commit)
       via  2296a5e1fbe39415111ad5fdce475fe49897233d (commit)
       via  696f44c0840d931656f986e9f4fb623e63df16ba (commit)
       via  cbcf5001c535a05d3262b92465aabfcbe39320e1 (commit)
       via  93c2c33e04e4e5b78da45ec8c251899acce5d322 (commit)
       via  dd3fb7edb9639ae5c22c5fc0cfcd8d053f6c1688 (commit)
       via  7dbf3d6acb8d3281140cb7958c4937d33e3e53ef (commit)
       via  153f861b91221d14842c495efa0b1f10d9455855 (commit)
       via  0faf1588b9e820c20351c92afa44c9d0e8a3a412 (commit)
       via  57770a2cce19e74b3a90f2bf60db2af5b6fee5d8 (commit)
       via  7f45725b97c8cc2cbb39ff50885dd39356072338 (commit)
       via  b6dba4cf2b4a00c068c934f2f858a97108efefb0 (commit)
       via  9fed1c8186e58ff7b2152e3901d5d62b6d86d9b9 (commit)
       via  50d533cd6f34509f64533b436bf57266d9a743d8 (commit)
       via  55ea5e0f7c8bdff233315f33218351809365a19d (commit)
       via  5ddf10071d94acf2ae0e69e187641f22cce0199a (commit)
       via  f897907bee30ec66fdebfe04d3c2d6ad8b8da501 (commit)
       via  b0f4556918deaf2efa42a298c27f42195e909815 (commit)
       via  26b78559eef83ee5535564c782680f33fd9899f5 (commit)
       via  df23dafc30d54164035281aec1f6ce14d0f4b0fc (commit)
       via  7411adcdad588acf2a167dd05e5a942fa752e90e (commit)
       via  154fedbdbbc962f112989cc3c963daa4467b7618 (commit)
       via  c1b83e1af60b866cf5cdeebf77d0275019bad8b2 (commit)
       via  f25f4bfcc358152a619b246bf91aa8653eb6cadd (commit)
       via  076e8fa284c2453099286876684be913512af381 (commit)
       via  23a4376fc462bbe0e36b5515671724b7e3d89fb9 (commit)
       via  cb60ae36f86e0d3bb1a879fda60ef925a8316c6c (commit)
       via  9799821061b9f4bf6c6e4e4384c633b5fcb0fe97 (commit)
       via  2abe18335cffce365cbe09bdc1d0315f5ed8f24d (commit)
       via  c6cc38027572445a25d749db99473f82521cc79e (commit)
       via  2868ff8ca1792a7d5298923aff49647a754bc23e (commit)
       via  1a93e9857e4f211769147fe9d0e9ffe6326c38fe (commit)
       via  ae1f40f55d32d5f4fe6887ba38c56c169de83d57 (commit)
       via  03b7cf99c697f1b9d601de50b8fcd4698d254d21 (commit)
       via  2a7c9aeaab41f9bf66a92a68e1fe186b2af89038 (commit)
       via  3e472de16e7cc0f10d2dc339f4308eb3ceadf55d (commit)
       via  670b3bd58c6afa0c3e29107b7634a6b9091d2bcf (commit)
       via  12f0caf6d2d2c013c03200a12449d5f97428e0cf (commit)
       via  b9ee5dfe75d1a524cfb0fc925851dcc13cfbfa0b (commit)
       via  48e99a7ee6b2ef12bb5d7861f5b71ccd6f69c6e9 (commit)
       via  56cd2dda0edcc4089954fd560712d762b80cebe5 (commit)
       via  e4fbe2ab6dee137d2f4735ca539613bb67411ebb (commit)
       via  63f8c3647b2e8015dc637791bb92981d4a00dab7 (commit)
       via  11927353c180858e7d7f4e775f8de68781ce4d71 (commit)
       via  106428fe4e73d5f9f5e7cc2e44a1e9b3b85606c1 (commit)
       via  06143bdbbf8c3d358d51b646165634473c193afe (commit)
       via  e3e58b6c41c0df669129ba7988273b7b944ae56c (commit)
       via  3c774c5eb56ee1c538d9f153d941dd4596de2db3 (commit)
       via  f3af1eb0c7926a203839c9d06fa3e368d5ff4103 (commit)
       via  43619a0fa3edc6c0c4ce3b49835d2c48c4afb862 (commit)
       via  54a47b07f8385136ed85626093cdff94dc7124fd (commit)
       via  47388dbc2c169a4f594801fdb8660ff8e31ef300 (commit)
       via  3ffce6240040e51a60fc5a40cbb8d669baa5f7b5 (commit)
       via  2d5571e7dbfb41eec4a2657c4c076257a320d496 (commit)
       via  158b46f23ea71c9c96e1f298e69cdc9822bcfc46 (commit)
       via  1ee9c78b296198bcec16bd9a9f01511ded9780e0 (commit)
       via  094b83a641e3b5b4aedf8820cb2af9d1c32cb476 (commit)
       via  3645d0ff5e0e4ee1163b97cf2a498246a014a85c (commit)
       via  6fc5c9acb05b5e42ca02b861568ee191876dea6f (commit)
       via  fec53184220122d7ff8c88757be4d2eaafec13b2 (commit)
       via  7cd72e5d9283fcd778e7d694d3a420b934e842d3 (commit)
       via  226be35fe1dad069485d9fa45c3fc3389f3e92a2 (commit)
       via  9bed1c1024afc2ddf5b3fb719b8320fa16ad18df (commit)
       via  2f88456d63e72f9a82410873f8f041814097dbd4 (commit)
       via  7eccbf44fcee432c20ccd95b384f1c3494e4712c (commit)
       via  bdb984ba47508ac1d44d173d8d99c95254ef98e9 (commit)
       via  15b8b62ac20add6de8954053335487a7a492a462 (commit)
       via  cbd1a6049adbbc21081104a1cb7c2b793652106a (commit)
       via  b3a5c6b4973209af0aa125f8916fff4070080ee9 (commit)
       via  bbd192421043a482f00e9532de2a127c708323cf (commit)
       via  51ea4f3ffc52524f88e01fd9e583e90fd2a537b7 (commit)
       via  5e0539a3cc36e426e315ebf55df95b78f4822235 (commit)
       via  cd1a9ccc1bd0248d2c504f367089f2481d364324 (commit)
       via  67abae49732991b596e6fa6d9d93a925720abe64 (commit)
       via  18dac9077caa49f69aa39e306b146ae700e14e9c (commit)
       via  53d49841f875a7a1e86a874ee5e5d171872ac733 (commit)
       via  d7d983b0276e903b492054d99cbbd6918279cb6a (commit)
       via  22786e467794bb1ee0daf4f47b59de7db612204b (commit)
       via  3da1457d426f1be7b9f792fce1461a7b8227d7e7 (commit)
       via  097930059adbd5061a5f78e2b91e339f91a32a18 (commit)
       via  1b3c7eaf50a74cbb0300631505bbb870f5cc95d3 (commit)
       via  f2436f5b665184ce8fa2e3babe1b1edfa69299f6 (commit)
       via  ca9b4d336a67bd0c1a6c66008ae3038f03b52872 (commit)
       via  5fb73b05d111bc3da4d16007a2b1a6aee8e49198 (commit)
       via  e18ac4b80c7817b124880f007ba1c796f8ac9794 (commit)
       via  848744c8189abdba50d0fdf5dbd2a713ac210632 (commit)
       via  f99ee7616ced4d07684a30a67b72e46aba00c65f (commit)
       via  498492fdb4dd7db6a0d3aa631c350a57da3d2ab5 (commit)
       via  e2f007f0c78e011c5fab60bfad332f6aad0989f1 (commit)
       via  8c784651a7da7dc85bd989e75ce63e35762ce27f (commit)
       via  5d99776ce05b7a954ccf30d7ed666494c0db4e91 (commit)
       via  60a69375f9802af288ccc82ca4c15b85ce869e28 (commit)
       via  b21d68690612214d8edd810acf11880c3c0ad586 (commit)
       via  da9ad6fafeaf5dfa710a1a2b4176d1a049fddf13 (commit)
       via  70b71392807b18e57217e9ed7975965866ae88bc (commit)
       via  27478539b094a2b0bee4f8a452bec552edcabdbe (commit)
       via  b4b6a1a61dd0ee28e3d50869c959dea04e6a6b71 (commit)
       via  ebc92e19939b215d76804fde2e51a5850bcf23a0 (commit)
       via  0fcbd7c19e18265a4d2ca9f2158ec98daf4d67a9 (commit)
       via  78c4ba0d0799522c1cf0ad2ea666c100c609216c (commit)
       via  9adbc8d7d5a2a90e97d29af5ebff176fb3d794f3 (commit)
       via  57f5a614203a2bc62b0640d2296ed3c9de12958f (commit)
       via  1ece804ec8acafa07b28e6a77a8a97dc591a5001 (commit)
       via  9465eb2651d9af30519882c4b583acc8ce91b8bb (commit)
       via  edbcd8f1948b35f956bba1586d7cc2e628b98338 (commit)
       via  3b83966e81cd038e79be4225225787d3766c54ec (commit)
       via  062aeb245e68208dccb3ccc9b28e100a81dbc79b (commit)
       via  488de31efa525d864ad56cd023f3b33c83101088 (commit)
       via  a22717dffe37f30ef2ad2c355b68c9b3b5e4b8c7 (commit)
       via  7c6310c3a069ad18b3be277be606c7109f8e9a82 (commit)
       via  5741ca220ca4ac908abdf78cc475e1e590b00a23 (commit)
       via  9c22243af8307cd11923b3373314a5c7723d7c6d (commit)
       via  3c64d54cba6c3dbc09953b50a511e50f8e749421 (commit)
       via  32d81dcd41d33c3e31fe64c243946570b2d400d3 (commit)
       via  205c7572497789676bea3167b9cdeede69236a16 (commit)
       via  ffe04c8d92d775712e6e574103215eb863adfb29 (commit)
       via  6d7399c92f7b16d0e14fc8165602a7b77e31d12b (commit)
       via  7b1697bd9b600cec62b8d52c56d80c60d39108a7 (commit)
       via  4de5cb063668bce6690d7ff1f0af6e46616836a5 (commit)
       via  ed1dc9dddc2a3d5746ccf5722336ecc9dcf5ed29 (commit)
       via  2ef0a2d367b4db6ca77ff5b8e5f504bdbdbd18de (commit)
       via  c8d13b6142410d2641a13f1f4a38293b1b26cd05 (commit)
       via  995e5ff0da20c9b500ecdd2eee2f793b6a27e980 (commit)
       via  5f54e9ecd61a681f861e139b28d1704544dcf42f (commit)
       via  2fbd43d6fd5277a234d5b0caf231af246d1c0ac8 (commit)
       via  be7cd4faef59ecf9dd6f25231542594f64a35709 (commit)
       via  11a645aa91e606eb9c1bdd67ad1f7a10584f100c (commit)
       via  712c083e54d3d7e9971d918d516e19dc383bdcb5 (commit)
       via  cb4977815bc4661f97bee27565ae4475b912281f (commit)
       via  32fab2739b960d4dfa393e8d88160f29e9a4b169 (commit)
       via  e92bd2e745cc8273654b51cc1c3712211e9b3def (commit)
       via  21da52c2d428168f06fecf1d7527dc5d1505633a (commit)
       via  8ad470b671fdbdefe59ed60a1a5aa642c93d30c0 (commit)
       via  a12d9e9c49075f607106b719535f1f185ef43b4d (commit)
       via  52062eb2e135838f946a34e2773a70a02d243d50 (commit)
       via  e186355f246be84a48c1113dc528d689c1d4b717 (commit)
       via  cb702406c1d494885b529f02010f9c6ec8b0ce36 (commit)
       via  f67dfa6e414c0cc0f6a807694aedba67923922d9 (commit)
       via  5e771b27e52cda72b1bfde18ed7a4f118fad24e0 (commit)
       via  7b6129b9bb74773e1a02c5c43614f9fd47179369 (commit)
       via  e251673828b140ebfcabfc520bfe8c20e0f06e4f (commit)
       via  069d788020864a4a1b1c380ad41513c74d116c8b (commit)
       via  12405c9fccb92791116c0391cbd7669ea00e9a04 (commit)
       via  adb834ebf078a00ed67ebc325c692452e6e5dcf6 (commit)
       via  68075ce0b2c88cb6972031b9bb3505338c5ab321 (commit)
       via  4094eb3eeb89758ac625e678d1351162172bb4d7 (commit)
       via  6dad21bfc921cecde339723a463f1bf6abdbf2ba (commit)
       via  7f3f467aab0184dedddca2b5c6edd48dab6303db (commit)
       via  1e8526488f16c127e89ccd8be0df1bd33076c351 (commit)
       via  a1241883c9a783077cf51b6fc2f8b7dd4c2c900f (commit)
       via  0fec8df49cf76b50e5ea2d4fafea57c0aed8a90d (commit)
       via  cd4dab35d5d592b83318670ec9084de968ccfbc4 (commit)
       via  1ad72bca60963a9736cc4795057af3750a116728 (commit)
       via  b618b5854c68784781593b44bdd9c7ae7bd9d79e (commit)
       via  14141f258ac8d5d14b9479eaf2bb82189bd17bf5 (commit)
       via  e2dd3ffbb403bd5611981404c3cdcf392deb34d1 (commit)
       via  140ce85ed89d28f8130c6dcf471408823c268a33 (commit)
       via  de9e3447ddbaa5488d0d695611eeaa880b09a035 (commit)
       via  5b0cc39546e984928814bb947f6cd701aa9d4ced (commit)
       via  1564671026d62a31e6194162b0c3d3e5f424b2f5 (commit)
       via  0842c52351b512e1b67ae35afb39de9e0b893418 (commit)
       via  d8a5518d6deedbd6cbbce9213c897e836783f44b (commit)
       via  8a1c64fec9c31ea0145f576e8fce7c2c7140d701 (commit)
       via  83249bd36c0cd76d80addc8bc0ab5db565635316 (commit)
       via  d3500f61b9bae2c5729f2383d9ab62248d42800a (commit)
       via  bc1038325d663ab99a6f01e4db172b02743d8319 (commit)
       via  d2ca16855177719a0fa4fe65fe2a9ec8d7a06aec (commit)
       via  8ce1b6c9863659835c7a5bcd13d2c1b6b55a1e69 (commit)
       via  5368def8bb1635d7275a2ac3e08b8127933afe05 (commit)
       via  ec799b7b8baf649b8031d9b5cbdecf78a057c3a3 (commit)
      from  b869415eb63efcea39162fc24a69eb51d94c3c6b (commit)

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

- Log -----------------------------------------------------------------
-----------------------------------------------------------------------

Summary of changes:
 .gitignore                                         |    5 +
 Makefile.am                                        |   72 ++--
 NEWS                                               |  233 +++++++--
 aclocal.in                                         |  167 ++++--
 automake.in                                        |  464 +++++-----------
 configure.ac                                       |    8 +-
 contrib/check-html.am                              |   21 +-
 contrib/t/help-multilib.sh                         |   32 ++
 contrib/t/local.am                                 |   25 +
 contrib/t/multilib.sh                              |  160 ++++++
 contrib/t/parallel-tests-html-recursive.sh         |  163 ++++++
 contrib/t/parallel-tests-html.sh                   |  144 +++++
 defs                                               |   22 -
 doc/automake.texi                                  |  590 ++++++++------------
 gen-testsuite-part                                 |    2 +-
 lib/Automake/Options.pm                            |   21 +-
 lib/am/check.am                                    |   13 +-
 lib/am/configure.am                                |    6 +-
 lib/am/data.am                                     |    3 +-
 lib/am/dejagnu.am                                  |   29 +-
 lib/am/distdir.am                                  |   27 -
 lib/am/libs.am                                     |    6 +-
 lib/am/lisp.am                                     |   90 ++--
 lib/am/ltlib.am                                    |    9 +-
 lib/am/progs.am                                    |   16 +-
 lib/am/python.am                                   |    3 +-
 lib/am/scripts.am                                  |    3 +-
 lib/am/subdirs.am                                  |   17 +-
 lib/am/tags.am                                     |  103 ++--
 lib/am/texibuild.am                                |   32 +-
 lib/am/texinfos.am                                 |   32 +-
 lib/depcomp                                        |  407 +++++++-------
 lib/elisp-comp                                     |   93 ---
 lib/missing                                        |  403 +++++---------
 lib/test-driver                                    |    2 +-
 lib/ylwrap                                         |   33 +-
 m4/amversion.m4                                    |    6 +-
 m4/ccstdc.m4                                       |   23 -
 m4/depout.m4                                       |    2 +-
 m4/dmalloc.m4                                      |    2 -
 m4/extra-recurs.m4                                 |   16 +
 m4/header.m4                                       |    9 -
 m4/init.m4                                         |   20 +-
 m4/internal/ac-config-macro-dirs.m4                |   15 +
 m4/lispdir.m4                                      |    2 -
 m4/maintainer.m4                                   |    2 -
 m4/missing.m4                                      |    8 +-
 m4/mkdirp.m4                                       |    2 +-
 m4/obsol-gt.m4                                     |   10 -
 m4/obsol-lt.m4                                     |   10 -
 m4/obsolete.m4                                     |   35 --
 maint.mk                                           |    8 +-
 syntax-checks.mk                                   |   32 +-
 t/ac-output-old.tap                                |   25 +-
 t/acloca10.sh                                      |    2 +-
 t/acloca11.sh                                      |   45 --
 t/acloca12.sh                                      |   46 --
 t/acloca13.sh                                      |   70 ---
 t/acloca14.sh                                      |  108 ----
 t/acloca15.sh                                      |   47 --
 t/acloca16.sh                                      |   36 --
 t/acloca17.sh                                      |   41 --
 t/acloca18.sh                                      |  137 -----
 t/acloca19.sh                                      |   49 --
 t/acloca20.sh                                      |   41 --
 t/acloca21.sh                                      |   31 -
 t/acloca22.sh                                      |   53 --
 t/acloca23.sh                                      |   37 --
 t/aclocal-I-order-1.sh                             |   49 ++
 t/aclocal-I-order-2.sh                             |   46 ++
 t/aclocal-I-order-3.sh                             |   46 ++
 t/aclocal-acdir.sh                                 |   31 +-
 t/aclocal-amflags.sh                               |   69 +++
 t/aclocal-autoconf-version-check.sh                |   51 ++
 t/aclocal-comments-respected.sh                    |   31 +
 t/aclocal-deleted-header-aclocal-amflags.sh        |   60 ++
 t/aclocal-deleted-header.sh                        |   57 ++
 t/aclocal-deps-subdir.sh                           |   69 +++
 t/aclocal-deps.sh                                  |   75 +++
 t/aclocal-dirlist-abspath.sh                       |   42 ++
 t/aclocal-dirlist-globbing.sh                      |   55 ++
 t/aclocal-dirlist.sh                               |   56 ++
 t/aclocal-install-absdir.sh                        |    2 +-
 t/aclocal-install-fail.sh                          |    2 +-
 t/aclocal-install-mkdir.sh                         |    2 +-
 ...local-m4-include-are-scanned-aclocal-amflags.sh |  108 ++++
 t/aclocal-m4-include-are-scanned.sh                |  108 ++++
 t/aclocal-m4-sinclude.sh                           |   73 +++
 t/aclocal-macrodir.tap                             |  211 +++++++
 t/aclocal-macrodirs.tap                            |  416 ++++++++++++++
 t/aclocal-missing-macros.sh                        |   41 ++
 t/aclocal-no-extra-scan.sh                         |   37 ++
 t/aclocal-no-force.sh                              |  117 ++++
 t/aclocal-no-install-no-mkdir.sh                   |    2 +-
 t/aclocal-no-symlinked-overwrite.sh                |   41 ++
 t/aclocal-no-unused-required.sh                    |   42 ++
 t/aclocal-path-install-serial.sh                   |    2 +-
 t/aclocal-path-install.sh                          |    4 +-
 t/aclocal-path-nonexistent.sh                      |    2 +-
 t/aclocal-path-precedence.sh                       |    4 +-
 t/aclocal-path.sh                                  |    2 +-
 t/aclocal-pr450.sh                                 |   49 ++
 t/aclocal-print-acdir.sh                           |    5 +-
 t/aclocal-remake-misc.sh                           |   74 +++
 t/aclocal-req.sh                                   |   34 ++
 t/aclocal-scan-configure-ac-pr319.sh               |   47 ++
 t/aclocal-serial.sh                                |  137 +++++
 t/aclocal-underquoted-defun.sh                     |   37 ++
 t/aclocal-verbose-install.sh                       |    2 +-
 t/aclocal.sh                                       |    2 +-
 t/aclocal3.sh                                      |   41 --
 t/aclocal4.sh                                      |   75 ---
 t/aclocal5.sh                                      |   69 ---
 t/aclocal6.sh                                      |   74 ---
 t/aclocal7.sh                                      |  117 ----
 t/aclocal8.sh                                      |   42 --
 t/aclocal9.sh                                      |   49 --
 t/acsilent.sh                                      |    9 +-
 t/acsubst.sh                                       |    2 +-
 t/acsubst2.sh                                      |    2 +-
 t/add-missing-multiple.sh                          |   47 ++
 t/add-missing.tap                                  |   13 +-
 t/all.sh                                           |    2 +-
 t/all2.sh                                          |    2 +-
 t/alloca.sh                                        |    2 +-
 t/alloca2.sh                                       |    2 +-
 t/alpha.sh                                         |    2 +-
 t/alpha2.sh                                        |    2 +-
 t/am-default-source-ext.sh                         |    2 +-
 t/am-macro-not-found.sh                            |    2 +-
 t/am-missing-prog.sh                               |    6 +-
 t/am-tests-environment.sh                          |    2 +-
 t/amassign.sh                                      |    2 +-
 t/amhello-binpkg.sh                                |    2 +-
 t/amhello-cflags.sh                                |    2 +-
 t/amhello-cross-compile.sh                         |    2 +-
 t/aminit-moreargs-deprecation.sh                   |    2 +-
 t/amopt.sh                                         |    2 +-
 t/amopts-location.sh                               |    2 +-
 t/amopts-variable-expansion.sh                     |    2 +-
 t/amsubst.sh                                       |    2 +-
 t/ansi2knr-no-more.sh                              |    2 +-
 t/ar-lib.sh                                        |    2 +-
 t/ar-lib2.sh                                       |    2 +-
 t/ar-lib3.sh                                       |    2 +-
 t/ar-lib4.sh                                       |    2 +-
 t/ar-lib5a.sh                                      |    2 +-
 t/ar-lib5b.sh                                      |    2 +-
 t/ar-lib6a.sh                                      |    2 +-
 t/ar-lib6b.sh                                      |    2 +-
 t/ar-lib7.sh                                       |    2 +-
 t/ar.sh                                            |    2 +-
 t/ar2.sh                                           |    2 +-
 t/ar3.sh                                           |    2 +-
 t/ar4.sh                                           |    2 +-
 t/ar5.sh                                           |    2 +-
 t/asm.sh                                           |    2 +-
 t/asm2.sh                                          |    2 +-
 t/asm3.sh                                          |    2 +-
 t/autodist-acconfig-no-subdir.sh                   |    2 +-
 t/autodist-acconfig.sh                             |    2 +-
 t/autodist-aclocal-m4.sh                           |    2 +-
 t/autodist-config-headers.sh                       |    2 +-
 t/autodist-configure-no-subdir.sh                  |    2 +-
 t/autodist-no-duplicate.sh                         |    2 +-
 t/autodist-stamp-vti.sh                            |    2 +-
 t/autodist-subdir.sh                               |    2 +-
 t/autodist.sh                                      |    2 +-
 t/autohdr-subdir-pr12495.sh                        |    2 +-
 t/autohdr.sh                                       |    2 +-
 t/autohdr2.sh                                      |   30 -
 t/autohdr3.sh                                      |    2 +-
 t/autohdr4.sh                                      |    2 +-
 t/autohdrdry.sh                                    |    4 +-
 t/automake-cmdline.tap                             |    2 +-
 t/auxdir-autodetect.sh                             |    2 +-
 t/auxdir-computed.tap                              |    2 +-
 t/auxdir-misplaced.sh                              |    2 +-
 t/auxdir-nonexistent.sh                            |    2 +-
 t/auxdir-unportable.tap                            |    2 +-
 t/auxdir.sh                                        |    2 +-
 t/auxdir6.sh                                       |    2 +-
 t/auxdir7.sh                                       |    2 +-
 t/auxdir8.sh                                       |    2 +-
 t/ax/am-test-lib.sh                                |   17 +-
 t/ax/depcomp.sh                                    |    2 +-
 t/ax/extract-testsuite-summary.pl                  |    4 +-
 t/ax/tap-setup.sh                                  |    2 +-
 t/ax/tap-summary-aux.sh                            |    5 +-
 t/ax/testsuite-summary-checks.sh                   |    8 +-
 t/backcompat-acout.sh                              |   66 +++
 t/backcompat.sh                                    |    2 +-
 t/backcompat2.sh                                   |    2 +-
 t/backcompat3.sh                                   |   13 +-
 t/backcompat4.sh                                   |   66 ---
 t/backcompat5.sh                                   |  126 -----
 t/backcompat6.sh                                   |    8 +-
 t/backsl.sh                                        |    2 +-
 t/backsl2.sh                                       |    2 +-
 t/backsl3.sh                                       |    2 +-
 t/backsl4.sh                                       |    2 +-
 t/badline.sh                                       |    2 +-
 t/badopt.sh                                        |    2 +-
 t/badprog.sh                                       |    2 +-
 t/block.sh                                         |   34 --
 t/built-sources-check.sh                           |    2 +-
 t/built-sources-cond.sh                            |    2 +-
 t/built-sources-fork-bomb.sh                       |    2 +-
 t/built-sources-install.sh                         |    2 +-
 t/built-sources-subdir.sh                          |    2 +-
 t/built-sources.sh                                 |    2 +-
 t/candist.sh                                       |    2 +-
 t/canon-name.sh                                    |    2 +-
 t/canon.sh                                         |    2 +-
 t/canon2.sh                                        |    2 +-
 t/canon3.sh                                        |    2 +-
 t/canon4.sh                                        |    2 +-
 t/canon5.sh                                        |    2 +-
 t/canon6.sh                                        |    2 +-
 t/canon7.sh                                        |    2 +-
 t/canon8.sh                                        |    2 +-
 t/ccnoco.sh                                        |    5 +-
 t/ccnoco2.sh                                       |    2 +-
 t/ccnoco3.sh                                       |    5 +-
 t/check-concurrency-bug9245.sh                     |    2 +-
 t/check-exported-srcdir.sh                         |    4 +-
 t/check-fd-redirect.sh                             |    2 +-
 t/check-no-test-driver.sh                          |   10 +-
 t/check-subst-prog.sh                              |    2 +-
 t/check-subst.sh                                   |    4 +-
 t/check-tests-in-builddir.sh                       |   10 +-
 t/check.sh                                         |    2 +-
 t/check10.sh                                       |    2 +-
 t/check11.sh                                       |    2 +-
 t/check12.sh                                       |    2 +-
 t/check2.sh                                        |    2 +-
 t/check4.sh                                        |    2 +-
 t/check5.sh                                        |    2 +-
 t/check6.sh                                        |    2 +-
 t/check7.sh                                        |    2 +-
 t/check8.sh                                        |    4 +-
 t/checkall.sh                                      |    2 +-
 t/clean.sh                                         |    2 +-
 t/clean2.sh                                        |   68 ---
 t/colneq.sh                                        |    2 +-
 t/colneq2.sh                                       |    2 +-
 t/colneq3.sh                                       |    2 +-
 t/colon.sh                                         |    2 +-
 t/colon2.sh                                        |    2 +-
 t/colon3.sh                                        |    2 +-
 t/colon4.sh                                        |    2 +-
 t/colon5.sh                                        |    2 +-
 t/colon6.sh                                        |    2 +-
 t/colon7.sh                                        |    2 +-
 t/color-tests-opt.sh                               |   39 ++
 t/color-tests.sh                                   |  151 +++++
 t/color-tests2.sh                                  |  204 +++++++
 t/color.sh                                         |  152 -----
 t/color2.sh                                        |  190 -------
 t/commen10.sh                                      |    2 +-
 t/commen11.sh                                      |    2 +-
 t/comment-block.sh                                 |   34 ++
 t/comment.sh                                       |    2 +-
 t/comment2.sh                                      |    2 +-
 t/comment3.sh                                      |    2 +-
 t/comment4.sh                                      |    2 +-
 t/comment5.sh                                      |    2 +-
 t/comment6.sh                                      |    2 +-
 t/comment7.sh                                      |    4 +-
 t/comment8.sh                                      |    2 +-
 t/comment9.sh                                      |    2 +-
 t/comments-in-var-def.sh                           |    2 +-
 t/compile.sh                                       |    2 +-
 t/compile2.sh                                      |    2 +-
 t/compile3.sh                                      |    2 +-
 t/compile4.sh                                      |    2 +-
 t/compile5.sh                                      |    2 +-
 t/compile6.sh                                      |    2 +-
 t/compile_f90_c_cxx.sh                             |    2 +-
 t/compile_f_c_cxx.sh                               |    8 +-
 t/cond-basic.sh                                    |    2 +-
 t/cond.sh                                          |    2 +-
 t/cond10.sh                                        |    2 +-
 t/cond11.sh                                        |    2 +-
 t/cond13.sh                                        |    2 +-
 t/cond14.sh                                        |    2 +-
 t/cond15.sh                                        |    2 +-
 t/cond16.sh                                        |    2 +-
 t/cond17.sh                                        |    2 +-
 t/cond18.sh                                        |    2 +-
 t/cond19.sh                                        |    2 +-
 t/cond20.sh                                        |    2 +-
 t/cond21.sh                                        |    2 +-
 t/cond22.sh                                        |    2 +-
 t/cond23.sh                                        |    2 +-
 t/cond24.sh                                        |    2 +-
 t/cond25.sh                                        |    2 +-
 t/cond26.sh                                        |    2 +-
 t/cond27.sh                                        |    2 +-
 t/cond28.sh                                        |    2 +-
 t/cond3.sh                                         |    2 +-
 t/cond30.sh                                        |    2 +-
 t/cond31.sh                                        |    2 +-
 t/cond32.sh                                        |    2 +-
 t/cond33.sh                                        |    2 +-
 t/cond34.sh                                        |    2 +-
 t/cond35.sh                                        |    2 +-
 t/cond36.sh                                        |    2 +-
 t/cond37.sh                                        |    2 +-
 t/cond38.sh                                        |    2 +-
 t/cond39.sh                                        |    2 +-
 t/cond4.sh                                         |    2 +-
 t/cond40.sh                                        |    2 +-
 t/cond41.sh                                        |    2 +-
 t/cond42.sh                                        |    2 +-
 t/cond43.sh                                        |    2 +-
 t/cond44.sh                                        |    2 +-
 t/cond45.sh                                        |    2 +-
 t/cond46.sh                                        |    2 +-
 t/cond5.sh                                         |    2 +-
 t/cond6.sh                                         |    2 +-
 t/cond7.sh                                         |    2 +-
 t/cond8.sh                                         |    2 +-
 t/cond9.sh                                         |    2 +-
 t/condd.sh                                         |    2 +-
 t/condhook.sh                                      |    2 +-
 t/condhook2.sh                                     |    2 +-
 t/condinc.sh                                       |    2 +-
 t/condinc2.sh                                      |    2 +-
 t/condlib.sh                                       |    2 +-
 t/condman2.sh                                      |    2 +-
 t/condman3.sh                                      |    2 +-
 t/confdeps.sh                                      |    2 +-
 t/conff.sh                                         |    2 +-
 t/conff2.sh                                        |    6 +-
 t/conffile-leading-dot.sh                          |    2 +-
 t/confh-subdir-clean.sh                            |    4 +-
 t/confh.sh                                         |    4 +-
 t/confh4.sh                                        |    4 +-
 t/confh5.sh                                        |    2 +-
 t/confh6.sh                                        |    4 +-
 t/confh7.sh                                        |    4 +-
 t/confh8.sh                                        |    4 +-
 t/configure.sh                                     |    2 +-
 t/confincl.sh                                      |    2 +-
 t/conflnk.sh                                       |    2 +-
 t/conflnk2.sh                                      |    2 +-
 t/conflnk3.sh                                      |    2 +-
 t/conflnk4.sh                                      |    2 +-
 t/confsub.sh                                       |    4 +-
 t/confvar.sh                                       |    2 +-
 t/confvar2.sh                                      |    2 +-
 t/copy.sh                                          |    2 +-
 t/cscope.tap                                       |    2 +-
 t/cscope2.sh                                       |    2 +-
 t/cscope3.sh                                       |    2 +-
 t/cxx-demo.sh                                      |    2 +-
 t/cxx-lt-demo.sh                                   |    2 +-
 t/cxx.sh                                           |    2 +-
 t/cxx2.sh                                          |    2 +-
 t/cxxcpp.sh                                        |    2 +-
 t/cxxlibobj.sh                                     |    2 +-
 t/cxxlink.sh                                       |    2 +-
 t/cxxnoc.sh                                        |    2 +-
 t/cygnus-check-without-all.sh                      |   50 --
 t/cygnus-dependency-tracking.sh                    |   74 ---
 t/cygnus-deprecation.sh                            |   68 ---
 t/cygnus-imply-foreign.sh                          |   60 --
 t/cygnus-no-dist.sh                                |   86 ---
 t/cygnus-no-installinfo.sh                         |   55 --
 t/cygnus-no-more.sh                                |   46 ++
 t/cygnus-requires-maintainer-mode.sh               |   53 --
 t/cygwin32.sh                                      |    2 +-
 t/dash.sh                                          |    2 +-
 t/defun.sh                                         |    2 +-
 t/defun2.sh                                        |    2 +-
 t/dejagnu-absolute-builddir.sh                     |    2 +-
 t/dejagnu-relative-srcdir.sh                       |    2 +-
 t/dejagnu-siteexp-append.sh                        |    2 +-
 t/dejagnu-siteexp-extend.sh                        |    2 +-
 t/dejagnu-siteexp-useredit.sh                      |    2 +-
 t/dejagnu.sh                                       |    2 +-
 t/dejagnu2.sh                                      |    2 +-
 t/dejagnu3.sh                                      |    2 +-
 t/dejagnu4.sh                                      |    2 +-
 t/dejagnu5.sh                                      |    2 +-
 t/dejagnu6.sh                                      |    2 +-
 t/dejagnu7.sh                                      |    2 +-
 t/deleted-am.sh                                    |    2 +-
 t/deleted-m4.sh                                    |    2 +-
 t/depacl2.sh                                       |    2 +-
 t/depcomp-implicit-auxdir.sh                       |    2 +-
 t/depcomp.sh                                       |    2 +-
 t/depcomp2.sh                                      |    2 +-
 t/depcomp8a.sh                                     |   11 +-
 t/depcomp8b.sh                                     |    6 +-
 t/depdist.sh                                       |    2 +-
 t/depend.sh                                        |    2 +-
 t/depend3.sh                                       |    2 +-
 t/depend4.sh                                       |    2 +-
 t/depend5.sh                                       |    7 +-
 t/depend6.sh                                       |    2 +-
 t/deprecated-acinit.sh                             |    2 +-
 t/destdir.sh                                       |    2 +-
 t/dir-named-obj-is-bad.sh                          |    2 +-
 t/dirlist-abspath.sh                               |   42 --
 t/dirlist.sh                                       |   57 --
 t/dirlist2.sh                                      |   60 --
 t/discover.sh                                      |    2 +-
 t/dist-auxdir-many-subdirs.sh                      |    7 +-
 t/dist-auxfile-2.sh                                |    2 +-
 t/dist-auxfile.sh                                  |    2 +-
 t/dist-formats.tap                                 |    2 +-
 t/dist-included-parent-dir.sh                      |    2 +-
 t/dist-missing-am.sh                               |    2 +-
 t/dist-missing-included-m4.sh                      |    2 +-
 t/dist-missing-m4.sh                               |    2 +-
 t/dist-pr109765.sh                                 |    2 +-
 t/dist-readonly.sh                                 |    2 +-
 t/dist-repeated.sh                                 |    2 +-
 t/distcheck-configure-flags-am.sh                  |    2 +-
 t/distcheck-configure-flags-subpkg.sh              |    2 +-
 t/distcheck-configure-flags.sh                     |    2 +-
 t/distcheck-hook.sh                                |    2 +-
 t/distcheck-hook2.sh                               |    2 +-
 t/distcheck-missing-m4.sh                          |    2 +-
 t/distcheck-outdated-m4.sh                         |    2 +-
 t/distcheck-override-infodir.sh                    |    2 +-
 t/distcheck-pr10470.sh                             |    2 +-
 t/distcheck-pr9579.sh                              |    2 +-
 t/distcheck-writable-srcdir.sh                     |    2 +-
 t/distcleancheck.sh                                |    2 +-
 t/distcom-subdir.sh                                |    4 +-
 t/distcom2.sh                                      |    4 +-
 t/distcom3.sh                                      |    2 +-
 t/distcom4.sh                                      |    5 +-
 t/distcom5.sh                                      |    2 +-
 t/distdir.sh                                       |    2 +-
 t/disthook.sh                                      |    2 +-
 t/distlinks.sh                                     |    2 +-
 t/distlinksbrk.sh                                  |    2 +-
 t/distname.sh                                      |    2 +-
 t/dmalloc.sh                                       |    2 +-
 t/doc-parsing-buglets-colneq-subst.sh              |    2 +-
 t/doc-parsing-buglets-tabs.sh                      |    2 +-
 t/dollar.sh                                        |    2 +-
 t/dollarvar.sh                                     |   13 +-
 t/dollarvar2.sh                                    |    2 +-
 t/double.sh                                        |    2 +-
 t/dup2.sh                                          |    2 +-
 t/else.sh                                          |    2 +-
 t/empty-data-primary.sh                            |    2 +-
 t/empty-sources-primary.tap                        |    2 +-
 t/exdir.sh                                         |    2 +-
 t/exdir2.sh                                        |    2 +-
 t/exdir3.sh                                        |    2 +-
 t/exeext.sh                                        |    2 +-
 t/exeext2.sh                                       |    2 +-
 t/exeext3.sh                                       |    2 +-
 t/exeext4.sh                                       |    2 +-
 t/exsource.sh                                      |    2 +-
 t/ext.sh                                           |    9 +-
 t/ext2.sh                                          |    2 +-
 t/ext3.sh                                          |    2 +-
 t/extra-portability.sh                             |    2 +-
 t/extra-portability2.sh                            |    2 +-
 t/extra-portability3.sh                            |    2 +-
 t/extra-programs-empty.sh                          |    2 +-
 t/extra.sh                                         |    2 +-
 t/extra10.sh                                       |    2 +-
 t/extra11.sh                                       |    2 +-
 t/extra12.sh                                       |    2 +-
 t/extra2.sh                                        |    2 +-
 t/extra3.sh                                        |    2 +-
 t/extra4.sh                                        |    2 +-
 t/extra5.sh                                        |    2 +-
 t/extra6.sh                                        |    2 +-
 t/extra7.sh                                        |    2 +-
 t/extra8.sh                                        |    2 +-
 t/extra9.sh                                        |    2 +-
 t/extradep.sh                                      |    2 +-
 t/extradep2.sh                                     |    2 +-
 t/f90only.sh                                       |    2 +-
 t/flavor.sh                                        |   19 +-
 t/flibs.sh                                         |    2 +-
 t/fn99.sh                                          |    2 +-
 t/fn99subdir.sh                                    |    2 +-
 t/fnoc.sh                                          |    2 +-
 t/fonly.sh                                         |    2 +-
 t/forcemiss.sh                                     |    2 +-
 t/forcemiss2.sh                                    |    2 +-
 t/fort1.sh                                         |    2 +-
 t/fort2.sh                                         |    2 +-
 t/fort4.sh                                         |    2 +-
 t/fort5.sh                                         |    2 +-
 t/fortdep.sh                                       |    2 +-
 t/gcj.sh                                           |    2 +-
 t/gcj2.sh                                          |    2 +-
 t/gcj3.sh                                          |    2 +-
 t/gcj4.sh                                          |    2 +-
 t/gcj5.sh                                          |    2 +-
 t/gcj6.sh                                          |    2 +-
 t/get-sysconf.sh                                   |    2 +-
 t/gettext-macros.sh                                |    6 +-
 t/gettext.sh                                       |    2 +-
 t/gettext2.sh                                      |    2 +-
 t/gettext3.sh                                      |    2 +-
 t/gnits.sh                                         |    2 +-
 t/gnits2.sh                                        |    2 +-
 t/gnits3.sh                                        |    2 +-
 t/gnumake.sh                                       |    2 +-
 t/gnuwarn.sh                                       |    2 +-
 t/gnuwarn2.sh                                      |    2 +-
 t/hdr-vars-defined-once.sh                         |    2 +-
 t/header.sh                                        |    2 +-
 t/help-depend.sh                                   |    2 +-
 t/help-depend2.sh                                  |    2 +-
 t/help-dmalloc.sh                                  |    2 +-
 t/help-init.sh                                     |    2 +-
 t/help-lispdir.sh                                  |    2 +-
 t/help-multilib.sh                                 |   34 --
 t/help-python.sh                                   |    2 +-
 t/help-silent.sh                                   |   21 +-
 t/help-upc.sh                                      |    2 +-
 t/help.sh                                          |    2 +-
 t/help2.sh                                         |    2 +-
 t/help3.sh                                         |    2 +-
 t/help4.sh                                         |    2 +-
 t/hfs.sh                                           |    2 +-
 t/implicit.sh                                      |    2 +-
 t/init.sh                                          |    2 +-
 t/init2.sh                                         |    2 +-
 t/insh2.sh                                         |    2 +-
 t/install-info-dir.sh                              |    2 +-
 t/install2.sh                                      |    2 +-
 t/installdir.sh                                    |    2 +-
 t/instdat.sh                                       |    2 +-
 t/instdat2.sh                                      |    2 +-
 t/instdir-cond.sh                                  |    2 +-
 t/instdir-cond2.sh                                 |    2 +-
 t/instdir-java.sh                                  |    2 +-
 t/instdir-lisp.sh                                  |    2 +-
 t/instdir-ltlib.sh                                 |    2 +-
 t/instdir-no-empty.sh                              |    2 +-
 t/instdir-prog.sh                                  |    2 +-
 t/instdir-python.sh                                |    2 +-
 t/instdir-texi.sh                                  |    4 +-
 t/instdir.sh                                       |    2 +-
 t/instdir2.sh                                      |    2 +-
 t/instexec.sh                                      |    2 +-
 t/instfail-info.sh                                 |    2 +-
 t/instfail-java.sh                                 |    2 +-
 t/instfail-libtool.sh                              |    2 +-
 t/instfail.sh                                      |    2 +-
 t/insthook.sh                                      |    2 +-
 t/instman.sh                                       |    2 +-
 t/instman2.sh                                      |    2 +-
 t/instmany-mans.sh                                 |    2 +-
 t/instmany-python.sh                               |    2 +-
 t/instmany.sh                                      |    2 +-
 t/instsh.sh                                        |    2 +-
 t/instsh2.sh                                       |    2 +-
 t/instsh3.sh                                       |    2 +-
 t/instspc.tap                                      |    2 +-
 t/interp.sh                                        |    2 +-
 t/interp2.sh                                       |    2 +-
 t/java-check.sh                                    |    2 +-
 t/java-clean.sh                                    |    2 +-
 t/java-compile-install.sh                          |    2 +-
 t/java-compile-run-flat.sh                         |    6 +-
 t/java-compile-run-nested.sh                       |   12 +-
 t/java-empty-classpath.sh                          |    2 +-
 t/java-extra.sh                                    |    2 +-
 t/java-mix.sh                                      |    2 +-
 t/java-no-duplicate.sh                             |    2 +-
 t/java-nobase.sh                                   |    2 +-
 t/java-noinst.sh                                   |    2 +-
 t/java-rebuild.sh                                  |    2 +-
 t/java-sources.sh                                  |    2 +-
 t/java-uninstall.sh                                |    2 +-
 t/java.sh                                          |    2 +-
 t/java2.sh                                         |    2 +-
 t/java3.sh                                         |    2 +-
 t/javadir-undefined.sh                             |    2 +-
 t/javaflags.sh                                     |    2 +-
 t/javaprim.sh                                      |    2 +-
 t/javasubst.sh                                     |    2 +-
 t/ldadd.sh                                         |    2 +-
 t/ldflags.sh                                       |    2 +-
 t/lex-clean-cxx.sh                                 |    2 +-
 t/lex-clean.sh                                     |    2 +-
 t/lex-depend-cxx.sh                                |    2 +-
 t/lex-depend-grep.sh                               |    2 +-
 t/lex-depend.sh                                    |    2 +-
 t/lex-header.sh                                    |    2 +-
 t/lex-lib-external.sh                              |    2 +-
 t/lex-lib.sh                                       |    2 +-
 t/lex-libobj.sh                                    |    2 +-
 t/lex-line.sh                                      |    2 +-
 t/lex-nodist.sh                                    |    2 +-
 t/lex-noyywrap.sh                                  |    2 +-
 t/lex-pr204.sh                                     |    2 +-
 t/lex-subobj-nodep.sh                              |    2 +-
 t/lex.sh                                           |    2 +-
 t/lex2.sh                                          |    2 +-
 t/lex3.sh                                          |    2 +-
 t/lex5.sh                                          |    2 +-
 t/lexcpp.sh                                        |    2 +-
 t/lexvpath.sh                                      |    2 +-
 t/lflags.sh                                        |    2 +-
 t/lflags2.sh                                       |    2 +-
 t/libexec.sh                                       |    2 +-
 t/libobj-basic.sh                                  |    2 +-
 t/libobj10.sh                                      |    2 +-
 t/libobj12.sh                                      |    2 +-
 t/libobj13.sh                                      |    2 +-
 t/libobj14.sh                                      |    2 +-
 t/libobj15a.sh                                     |    2 +-
 t/libobj15b.sh                                     |    2 +-
 t/libobj15c.sh                                     |    2 +-
 t/libobj16a.sh                                     |    2 +-
 t/libobj16b.sh                                     |    2 +-
 t/libobj17.sh                                      |    2 +-
 t/libobj18.sh                                      |    2 +-
 t/libobj19.sh                                      |    2 +-
 t/libobj2.sh                                       |    2 +-
 t/libobj20a.sh                                     |    2 +-
 t/libobj20b.sh                                     |    2 +-
 t/libobj20c.sh                                     |    2 +-
 t/libobj3.sh                                       |    2 +-
 t/libobj4.sh                                       |    2 +-
 t/libobj5.sh                                       |    2 +-
 t/libobj7.sh                                       |    2 +-
 t/library.sh                                       |    2 +-
 t/library2.sh                                      |    2 +-
 t/library3.sh                                      |    2 +-
 t/libtoo10.sh                                      |    2 +-
 t/libtoo11.sh                                      |    2 +-
 t/libtool-macros.sh                                |    2 +-
 t/libtool.sh                                       |    2 +-
 t/libtool2.sh                                      |    2 +-
 t/libtool3.sh                                      |    2 +-
 t/libtool4.sh                                      |    2 +-
 t/libtool5.sh                                      |    2 +-
 t/libtool6.sh                                      |    2 +-
 t/libtool7.sh                                      |    2 +-
 t/libtool8.sh                                      |    2 +-
 t/libtool9.sh                                      |    2 +-
 t/license.sh                                       |    2 +-
 t/license2.sh                                      |    2 +-
 t/link_c_cxx.sh                                    |    2 +-
 t/link_cond.sh                                     |    2 +-
 t/link_dist.sh                                     |    2 +-
 t/link_f90_only.sh                                 |    2 +-
 t/link_f_only.sh                                   |    2 +-
 t/link_fc.sh                                       |    2 +-
 t/link_fccxx.sh                                    |    2 +-
 t/link_fcxx.sh                                     |    2 +-
 t/link_override.sh                                 |    2 +-
 t/lisp-flags.sh                                    |   41 ++
 t/lisp-loadpath.sh                                 |   67 +++
 t/lisp-pr11806.sh                                  |    2 +-
 t/lisp-subdir-mix.sh                               |   96 ++++
 t/lisp-subdir.sh                                   |   80 +++
 t/lisp-subdir2.sh                                  |   78 +++
 t/lisp2.sh                                         |    2 +-
 t/lisp3.sh                                         |   12 +-
 t/lisp4.sh                                         |    3 +-
 t/lisp5.sh                                         |    3 +-
 t/lisp6.sh                                         |    7 +-
 t/lisp7.sh                                         |    4 +-
 t/lisp8.sh                                         |    6 +-
 t/lispdry.sh                                       |    6 +-
 t/list-of-tests.mk                                 |  154 +++---
 t/listval.sh                                       |    2 +-
 t/location.sh                                      |    2 +-
 t/longlin2.sh                                      |    2 +-
 t/longline.sh                                      |    2 +-
 t/ltcond.sh                                        |    2 +-
 t/ltcond2.sh                                       |   16 +-
 t/ltconv.sh                                        |    2 +-
 t/ltdeps.sh                                        |    2 +-
 t/ltinit.sh                                        |    2 +-
 t/ltinstloc.sh                                     |    2 +-
 t/ltlibobjs.sh                                     |    2 +-
 t/ltlibsrc.sh                                      |    2 +-
 t/ltorder.sh                                       |    2 +-
 t/lzma.sh                                          |    2 +-
 t/m4-inclusion.sh                                  |    2 +-
 t/maintclean-vpath.sh                              |    2 +-
 t/maintclean.sh                                    |    2 +-
 t/maintmode-configure-msg.sh                       |    2 +-
 t/make-dryrun.tap                                  |    2 +-
 t/make.sh                                          |    2 +-
 t/makefile-deps.sh                                 |    2 +-
 t/makej.sh                                         |    2 +-
 t/makej2.sh                                        |    2 +-
 t/maken.sh                                         |    2 +-
 t/maken3.sh                                        |   12 +-
 t/makevars.sh                                      |    2 +-
 t/man.sh                                           |    2 +-
 t/man2.sh                                          |    2 +-
 t/man3.sh                                          |    2 +-
 t/man4.sh                                          |  105 ----
 t/man5.sh                                          |    2 +-
 t/man6.sh                                          |    6 +-
 t/man7.sh                                          |    2 +-
 t/man8.sh                                          |    2 +-
 t/mdate.sh                                         |    2 +-
 t/mdate2.sh                                        |    2 +-
 t/mdate3.sh                                        |    2 +-
 t/mdate4.sh                                        |    2 +-
 t/mdate5.sh                                        |    2 +-
 t/mdate6.sh                                        |    2 +-
 t/missing-auxfile-stops-makefiles-creation.sh      |    2 +-
 t/missing-version-mismatch.sh                      |   50 ++
 t/missing.sh                                       |   66 ---
 t/missing2.sh                                      |   58 --
 t/missing3.sh                                      |   50 +-
 t/missing4.sh                                      |   47 --
 t/missing5.sh                                      |   64 ---
 t/missing6.sh                                      |   51 --
 t/mkdir_p.sh                                       |    2 +-
 t/mkdirp-deprecation.sh                            |   42 +--
 t/mkinst2.sh                                       |    2 +-
 t/mkinst3.sh                                       |    2 +-
 t/mkinstall.sh                                     |    2 +-
 t/mmode.sh                                         |    2 +-
 t/mmodely.sh                                       |    2 +-
 t/multlib.sh                                       |  162 ------
 t/no-extra-makefile-code.sh                        |    2 +-
 t/no-spurious-install-recursive.sh                 |    2 +-
 t/nobase-libtool.sh                                |    2 +-
 t/nobase-nodist.sh                                 |    2 +-
 t/nobase-python.sh                                 |    2 +-
 t/nobase.sh                                        |    2 +-
 t/nodef.sh                                         |    4 +-
 t/nodef2.sh                                        |    2 +-
 t/nodep.sh                                         |    2 +-
 t/nodep2.sh                                        |    9 +-
 t/nodepcomp.sh                                     |    2 +-
 t/nodist.sh                                        |    2 +-
 t/nodist2.sh                                       |    2 +-
 t/nodist3.sh                                       |    2 +-
 t/noinst.sh                                        |    2 +-
 t/noinstdir.sh                                     |    2 +-
 t/nolink.sh                                        |    2 +-
 t/nostdinc.sh                                      |    2 +-
 t/notrans.sh                                       |    2 +-
 t/number.sh                                        |    2 +-
 t/objc-basic.sh                                    |    2 +-
 t/objc-deps.sh                                     |    2 +-
 t/objc-flags.sh                                    |    4 +-
 t/objc-megademo.sh                                 |   12 +-
 t/objc-minidemo.sh                                 |    2 +-
 t/objcxx-basic.sh                                  |   13 +-
 t/objcxx-deps.sh                                   |   12 +-
 t/objcxx-flags.sh                                  |   15 +-
 t/objcxx-minidemo.sh                               |   12 +-
 t/objext-pr10128.sh                                |    2 +-
 t/obsolete.sh                                      |   57 --
 t/oldvars.sh                                       |    2 +-
 t/order.sh                                         |    2 +-
 t/output-order.sh                                  |    2 +-
 t/output.sh                                        |    2 +-
 t/output10.sh                                      |    2 +-
 t/output11.sh                                      |    2 +-
 t/output12.sh                                      |    2 +-
 t/output13.sh                                      |    2 +-
 t/output2.sh                                       |    2 +-
 t/output3.sh                                       |    2 +-
 t/output4.sh                                       |    2 +-
 t/output5.sh                                       |    2 +-
 t/output6.sh                                       |    2 +-
 t/output7.sh                                       |    2 +-
 t/output8.sh                                       |    2 +-
 t/output9.sh                                       |    2 +-
 t/override-conditional-1.sh                        |    2 +-
 t/override-conditional-2.sh                        |    2 +-
 t/override-html.sh                                 |    2 +-
 t/override-suggest-local.sh                        |    2 +-
 t/parallel-am.sh                                   |    2 +-
 t/parallel-am2.sh                                  |    2 +-
 t/parallel-am3.sh                                  |    2 +-
 t/parallel-tests-basics.sh                         |    2 +-
 t/parallel-tests-cmdline-override.sh               |    2 +-
 t/parallel-tests-concurrency-2.sh                  |    2 +-
 t/parallel-tests-concurrency.sh                    |    2 +-
 t/parallel-tests-console-output.sh                 |    2 +-
 t/parallel-tests-driver-install.sh                 |   49 +--
 t/parallel-tests-dry-run-1.sh                      |    4 +-
 t/parallel-tests-dry-run-2.sh                      |    4 +-
 t/parallel-tests-empty-testlogs.sh                 |    2 +-
 t/parallel-tests-empty.sh                          |    2 +-
 t/parallel-tests-exeext.sh                         |    2 +-
 t/parallel-tests-exit-statuses.sh                  |    2 +-
 t/parallel-tests-extra-programs.sh                 |    2 +-
 t/parallel-tests-fd-redirect-exeext.sh             |    2 +-
 t/parallel-tests-fd-redirect.sh                    |    2 +-
 t/parallel-tests-fork-bomb.sh                      |    2 +-
 t/parallel-tests-generated-and-distributed.sh      |    2 +-
 t/parallel-tests-harderror.sh                      |    2 +-
 t/parallel-tests-interrupt.tap                     |    4 +-
 t/parallel-tests-log-compiler-1.sh                 |    2 +-
 t/parallel-tests-log-compiler-2.sh                 |    2 +-
 t/parallel-tests-log-compiler-example.sh           |    2 +-
 t/parallel-tests-log-override-1.sh                 |    2 +-
 t/parallel-tests-log-override-2.sh                 |    2 +-
 t/parallel-tests-log-override-recheck.sh           |    2 +-
 t/parallel-tests-no-color-in-log.sh                |    4 +-
 t/parallel-tests-no-spurious-summary.sh            |    2 +-
 t/parallel-tests-once.sh                           |    2 +-
 t/parallel-tests-recheck-depends-on-all.sh         |    2 +-
 t/parallel-tests-recheck-pr11791.sh                |    2 +-
 t/parallel-tests-recheck.sh                        |    2 +-
 t/parallel-tests-reset-term.sh                     |    4 +-
 t/parallel-tests-subdir.sh                         |    4 +-
 t/parallel-tests-suffix-prog.sh                    |    2 +-
 t/parallel-tests-suffix.sh                         |    2 +-
 t/parallel-tests-trailing-whitespace.sh            |    2 +-
 t/parallel-tests-unreadable.sh                     |    2 +-
 t/parallel-tests2.sh                               |  146 -----
 t/parse.sh                                         |    2 +-
 t/percent.sh                                       |    2 +-
 t/percent2.sh                                      |    2 +-
 t/perf/cond.sh                                     |    2 +-
 t/perf/testsuite-recheck.sh                        |    2 +-
 t/perf/testsuite-summary.sh                        |    4 +-
 t/phony.sh                                         |    2 +-
 t/pkg-config-macros.sh                             |    2 +-
 t/pluseq.sh                                        |    2 +-
 t/pluseq10.sh                                      |    2 +-
 t/pluseq11.sh                                      |    2 +-
 t/pluseq2.sh                                       |    2 +-
 t/pluseq3.sh                                       |    2 +-
 t/pluseq4.sh                                       |    2 +-
 t/pluseq5.sh                                       |    2 +-
 t/pluseq6.sh                                       |    2 +-
 t/pluseq7.sh                                       |    2 +-
 t/pluseq8.sh                                       |    2 +-
 t/pluseq9.sh                                       |    2 +-
 t/posixsubst-data.sh                               |    2 +-
 t/posixsubst-extradist.sh                          |    2 +-
 t/posixsubst-ldadd.sh                              |    2 +-
 t/posixsubst-libraries.sh                          |    2 +-
 t/posixsubst-ltlibraries.sh                        |    2 +-
 t/posixsubst-programs.sh                           |    2 +-
 t/posixsubst-scripts.sh                            |    2 +-
 t/posixsubst-sources.sh                            |    2 +-
 t/posixsubst-tests.sh                              |    2 +-
 t/postproc.sh                                      |    2 +-
 t/ppf77.sh                                         |    2 +-
 t/pr2.sh                                           |    2 +-
 t/pr211.sh                                         |    2 +-
 t/pr220.sh                                         |    2 +-
 t/pr224.sh                                         |    2 +-
 t/pr229.sh                                         |    2 +-
 t/pr243.sh                                         |    2 +-
 t/pr266.sh                                         |    2 +-
 t/pr279-2.sh                                       |    2 +-
 t/pr279.sh                                         |    2 +-
 t/pr287.sh                                         |    2 +-
 t/pr300-lib.sh                                     |    2 +-
 t/pr300-ltlib.sh                                   |    2 +-
 t/pr300-prog.sh                                    |    2 +-
 t/pr307.sh                                         |    2 +-
 t/pr401.sh                                         |    2 +-
 t/pr401b.sh                                        |    2 +-
 t/pr401c.sh                                        |    2 +-
 t/pr72.sh                                          |    2 +-
 t/pr87.sh                                          |    2 +-
 t/pr9.sh                                           |    2 +-
 t/prefix.sh                                        |    2 +-
 t/primary-prefix-couples-documented-valid.sh       |    2 +-
 t/primary-prefix-couples-force-valid.sh            |    2 +-
 t/primary-prefix-invalid-couples.tap               |    3 +-
 t/primary-prefix-valid-couples.sh                  |    3 +-
 t/primary.sh                                       |    2 +-
 t/primary2.sh                                      |    2 +-
 t/primary3.sh                                      |    2 +-
 t/print-libdir.sh                                  |    2 +-
 t/proginst.sh                                      |    2 +-
 t/programs-primary-rewritten.sh                    |    2 +-
 t/py-compile-basedir.sh                            |    2 +-
 t/py-compile-basic.sh                              |    2 +-
 t/py-compile-destdir.sh                            |    2 +-
 t/py-compile-env.sh                                |    2 +-
 t/py-compile-option-terminate.sh                   |    2 +-
 t/py-compile-usage.sh                              |    2 +-
 t/python-am-path-iftrue.sh                         |    2 +-
 t/python-dist.sh                                   |    2 +-
 t/python-missing.sh                                |    2 +-
 t/python-pr10995.sh                                |    2 +-
 t/python-too-old.sh                                |    2 +-
 t/python-vars.sh                                   |    2 +-
 t/python-virtualenv.sh                             |    2 +-
 t/python.sh                                        |    2 +-
 t/python10.sh                                      |    2 +-
 t/python11.sh                                      |    2 +-
 t/python12.sh                                      |    2 +-
 t/python2.sh                                       |    2 +-
 t/python3.sh                                       |    2 +-
 t/recurs-user-deeply-nested.sh                     |   97 ++++
 t/recurs-user-indir.sh                             |   99 ++++
 t/recurs-user-keep-going.sh                        |   95 ++++
 t/recurs-user-many.sh                              |   73 +++
 t/recurs-user-no-subdirs.sh                        |   52 ++
 t/recurs-user-no-top-level.sh                      |   50 ++
 t/recurs-user-override.sh                          |   68 +++
 t/recurs-user-phony.sh                             |   64 +++
 t/recurs-user-wrap.sh                              |   59 ++
 t/recurs-user.sh                                   |   81 +++
 t/recurs-user2.sh                                  |  103 ++++
 t/recurs.sh                                        |   36 --
 t/recurs2.sh                                       |   29 -
 t/relativize.tap                                   |    2 +-
 t/remake-aclocal-version-mismatch.sh               |   47 ++
 t/remake-after-acinclude-m4.sh                     |    2 +-
 t/remake-after-aclocal-m4.sh                       |    2 +-
 t/remake-after-configure-ac.sh                     |    2 +-
 t/remake-after-makefile-am.sh                      |    2 +-
 t/remake-all-1.sh                                  |    2 +-
 t/remake-all-2.sh                                  |    2 +-
 t/remake-am-pr10111.sh                             |    2 +-
 t/remake-deeply-nested.sh                          |    2 +-
 t/remake-deleted-am-2.sh                           |    2 +-
 t/remake-deleted-am-subdir.sh                      |    2 +-
 t/remake-deleted-am.sh                             |    2 +-
 t/remake-deleted-m4-file.sh                        |    2 +-
 t/remake-fail.sh                                   |    2 +-
 t/remake-gnulib-add-acsubst.sh                     |    2 +-
 t/remake-gnulib-add-header.sh                      |    2 +-
 t/remake-gnulib-remove-header.sh                   |    2 +-
 t/remake-include-aclocal.sh                        |    6 +-
 t/remake-include-configure.sh                      |    2 +-
 t/remake-include-makefile.sh                       |    2 +-
 t/remake-m4-pr10111.sh                             |    2 +-
 t/remake-macrodir.sh                               |   83 +++
 t/remake-maintainer-mode.sh                        |    2 +-
 t/remake-makefile-intree.sh                        |   14 +-
 t/remake-makefile-vpath.sh                         |   14 +-
 t/remake-mild-stress.sh                            |    2 +-
 t/remake-moved-m4-file.sh                          |    2 +-
 t/remake-not-after-make-dist.sh                    |    2 +-
 t/remake-recurs-user.sh                            |   89 +++
 t/remake-renamed-am.sh                             |    2 +-
 t/remake-renamed-m4-file.sh                        |    2 +-
 t/remake-renamed-m4-macro-and-file.sh              |    2 +-
 t/remake-renamed-m4-macro.sh                       |    2 +-
 t/remake-subdir-from-subdir.sh                     |    2 +-
 t/remake-subdir-gnu.sh                             |    2 +-
 t/remake-subdir-grepping.sh                        |    2 +-
 t/remake-subdir-long-time.sh                       |    2 +-
 t/remake-subdir-no-makefile.sh                     |    2 +-
 t/remake-subdir-only.sh                            |    2 +-
 t/remake-subdir.sh                                 |    2 +-
 t/remake-subdir2.sh                                |    2 +-
 t/remake-subdir3.sh                                |    4 +-
 t/remake-timing-bug-pr8365.sh                      |    2 +-
 t/repeated-options.sh                              |    2 +-
 t/req.sh                                           |   39 --
 t/reqd.sh                                          |   45 --
 t/reqd2.sh                                         |    2 +-
 t/rulepat.sh                                       |    2 +-
 t/sanity.sh                                        |    2 +-
 t/seenc.sh                                         |    2 +-
 t/self-check-configure-help.sh                     |    2 +-
 t/self-check-dir.tap                               |   10 +-
 t/self-check-exit.tap                              |   20 +-
 t/self-check-explicit-skips.sh                     |    4 +-
 t/self-check-is-blocked-signal.tap                 |    2 +-
 t/self-check-is_newest.tap                         |    2 +-
 t/self-check-me.tap                                |   10 +-
 t/self-check-report.sh                             |    2 +-
 t/self-check-seq.tap                               |    2 +-
 t/self-check-unindent.tap                          |    2 +-
 t/serial-tests.sh                                  |    2 +-
 t/silent-amopts.sh                                 |   28 -
 t/silent-c.sh                                      |   91 +++
 t/silent-configsite.sh                             |   14 +-
 t/silent-custom.sh                                 |  101 ++++
 t/silent-cxx.sh                                    |  107 ++++
 t/silent-f77.sh                                    |   91 +++
 t/silent-f90.sh                                    |   91 +++
 t/silent-gen.sh                                    |   88 +++
 t/silent-lex.sh                                    |    3 +-
 t/silent-lt.sh                                     |   96 ++++
 t/silent-many-gcc.sh                               |  241 --------
 t/silent-many-generic.sh                           |  266 ---------
 t/silent-many-languages.sh                         |  262 +++++++++
 t/silent-nested-vars.sh                            |    2 +-
 t/silent-nowarn.sh                                 |   44 --
 t/silent-obsolescent-warns.sh                      |   71 ---
 t/silent-texi.sh                                   |   87 +++
 t/silent-yacc-headers.sh                           |    3 +-
 t/silent-yacc.sh                                   |    4 +-
 t/silent.sh                                        |   83 ---
 t/silent2.sh                                       |   84 ---
 t/silent3.sh                                       |   87 ---
 t/silent4.sh                                       |   88 ---
 t/silent6.sh                                       |  101 ----
 t/silent7.sh                                       |   92 ---
 t/silent8.sh                                       |   66 ---
 t/silent9.sh                                       |   87 ---
 t/silentcxx-gcc.sh                                 |  109 ----
 t/silentcxx.sh                                     |  110 ----
 t/silentf77.sh                                     |   92 ---
 t/silentf90.sh                                     |   92 ---
 t/sourcefile-in-subdir.sh                          |    2 +-
 t/space.sh                                         |    2 +-
 t/specflg-dummy.sh                                 |    2 +-
 t/specflg6.sh                                      |    2 +-
 t/specflg7.sh                                      |    2 +-
 t/specflg8.sh                                      |    2 +-
 t/specflg9.sh                                      |    2 +-
 t/spell.sh                                         |    2 +-
 t/spell2.sh                                        |    2 +-
 t/spell3.sh                                        |    2 +-
 t/spelling.sh                                      |    2 +-
 t/spy-rm.tap                                       |    2 +-
 t/spy.sh                                           |    2 +-
 t/src-acsubst.sh                                   |    2 +-
 t/stamph2.sh                                       |    9 +-
 t/stdinc.sh                                        |    2 +-
 t/stdlib.sh                                        |    2 +-
 t/stdlib2.sh                                       |    2 +-
 t/strictness-override.sh                           |    2 +-
 t/strictness-precedence.sh                         |    2 +-
 t/strip.sh                                         |    2 +-
 t/strip2.sh                                        |    2 +-
 t/strip3.sh                                        |    2 +-
 t/subdir-ac-subst.sh                               |    2 +-
 t/subdir-add-pr46.sh                               |    2 +-
 t/subdir-add2-pr46.sh                              |    6 +-
 t/subdir-am-cond.sh                                |    2 +-
 t/subdir-cond-err.sh                               |    2 +-
 t/subdir-cond-gettext.sh                           |    2 +-
 t/subdir-distclean.sh                              |    2 +-
 t/subdir-env-interference.sh                       |    2 +-
 t/subdir-order.sh                                  |    2 +-
 t/subdir-subsub.sh                                 |    2 +-
 t/subdir-with-slash.sh                             |    2 +-
 t/subdir.sh                                        |    2 +-
 t/subobj-clean-lt-pr10697.sh                       |    2 +-
 t/subobj-clean-pr10697.sh                          |    2 +-
 t/subobj.sh                                        |    2 +-
 t/subobj10.sh                                      |    2 +-
 t/subobj11a.sh                                     |    2 +-
 t/subobj11b.sh                                     |    2 +-
 t/subobj11c.sh                                     |    2 +-
 t/subobj2.sh                                       |    2 +-
 t/subobj4.sh                                       |    2 +-
 t/subobj5.sh                                       |    2 +-
 t/subobj6.sh                                       |    2 +-
 t/subobj7.sh                                       |    2 +-
 t/subobj8.sh                                       |    2 +-
 t/subobj9.sh                                       |    2 +-
 t/subobjname.sh                                    |    2 +-
 t/subpkg-macrodir.sh                               |   85 +++
 t/subpkg-yacc.sh                                   |    2 +-
 t/subpkg.sh                                        |   12 +-
 t/subpkg2.sh                                       |   12 +-
 t/subpkg3.sh                                       |    2 +-
 t/subpkg4.sh                                       |    2 +-
 t/subst-no-trailing-empty-line.sh                  |    2 +-
 t/subst.sh                                         |    2 +-
 t/subst3.sh                                        |    2 +-
 t/subst4.sh                                        |    2 +-
 t/subst5.sh                                        |    2 +-
 t/substre2.sh                                      |    2 +-
 t/substref.sh                                      |    2 +-
 t/substtarg.sh                                     |    2 +-
 t/suffix-chain.tap                                 |    2 +-
 t/suffix-custom-subobj-and-specflg.sh              |    2 +-
 t/suffix-custom-subobj.sh                          |    2 +-
 t/suffix.sh                                        |    2 +-
 t/suffix10.tap                                     |    2 +-
 t/suffix11.tap                                     |    2 +-
 t/suffix2.sh                                       |    2 +-
 t/suffix3.tap                                      |    2 +-
 t/suffix4.sh                                       |    2 +-
 t/suffix5.sh                                       |    2 +-
 t/suffix6.sh                                       |    2 +-
 t/suffix6b.sh                                      |    2 +-
 t/suffix6c.sh                                      |    2 +-
 t/suffix7.sh                                       |    2 +-
 t/suffix8.tap                                      |    2 +-
 t/suffix9.sh                                       |    2 +-
 t/symlink.sh                                       |    2 +-
 t/symlink2.sh                                      |    2 +-
 t/syntax.sh                                        |    2 +-
 t/tags-pr12372.sh                                  |    7 +-
 t/tags.sh                                          |    2 +-
 t/tags2.sh                                         |    2 +-
 t/tagsub.sh                                        |    2 +-
 t/tap-ambiguous-directive.sh                       |    2 +-
 t/tap-autonumber.sh                                |    2 +-
 t/tap-bad-prog.tap                                 |    2 +-
 t/tap-bailout-and-logging.sh                       |    2 +-
 t/tap-bailout-leading-space.sh                     |    2 +-
 t/tap-bailout-suppress-badexit.sh                  |    2 +-
 t/tap-bailout-suppress-later-diagnostic.sh         |    2 +-
 t/tap-bailout-suppress-later-errors.sh             |    2 +-
 t/tap-bailout.sh                                   |    2 +-
 t/tap-basic.sh                                     |    2 +-
 t/tap-color.sh                                     |    2 +-
 t/tap-common-setup.sh                              |    2 +-
 t/tap-deps.sh                                      |    2 +-
 t/tap-diagnostic-custom.sh                         |    2 +-
 t/tap-diagnostic.sh                                |    2 +-
 t/tap-doc.sh                                       |    2 +-
 t/tap-doc2.sh                                      |    4 +-
 t/tap-driver-stderr.sh                             |    2 +-
 t/tap-empty-diagnostic.sh                          |    2 +-
 t/tap-empty.sh                                     |    2 +-
 t/tap-escape-directive-2.sh                        |    2 +-
 t/tap-escape-directive.sh                          |    2 +-
 t/tap-exit.sh                                      |    2 +-
 t/tap-fancy.sh                                     |    2 +-
 t/tap-fancy2.sh                                    |    2 +-
 t/tap-global-log.sh                                |    2 +-
 t/tap-global-result.sh                             |    2 +-
 t/tap-log.sh                                       |    2 +-
 t/tap-merge-stdout-stderr.sh                       |    2 +-
 t/tap-missing-plan-and-bad-exit.sh                 |    2 +-
 t/tap-more.sh                                      |    2 +-
 t/tap-more2.sh                                     |    2 +-
 t/tap-msg0-bailout.sh                              |    2 +-
 t/tap-msg0-directive.sh                            |    2 +-
 t/tap-msg0-misc.sh                                 |    2 +-
 t/tap-msg0-planskip.sh                             |    2 +-
 t/tap-msg0-result.sh                               |    2 +-
 t/tap-negative-numbers.sh                          |    2 +-
 t/tap-no-disable-hard-error.sh                     |    2 +-
 t/tap-no-merge-stdout-stderr.sh                    |    2 +-
 t/tap-no-spurious-numbers.sh                       |    2 +-
 t/tap-no-spurious-summary.sh                       |    2 +-
 t/tap-no-spurious.sh                               |    2 +-
 t/tap-not-ok-skip.sh                               |    2 +-
 t/tap-number-wordboundary.sh                       |    2 +-
 t/tap-numbers-leading-zero.sh                      |    2 +-
 t/tap-numeric-description.sh                       |    2 +-
 t/tap-out-of-order.sh                              |    2 +-
 t/tap-passthrough-exit.sh                          |    2 +-
 t/tap-passthrough.sh                               |    2 +-
 t/tap-plan-corner.sh                               |    2 +-
 t/tap-plan-errors.sh                               |    2 +-
 t/tap-plan-leading-zero.sh                         |    2 +-
 t/tap-plan-malformed.sh                            |    2 +-
 t/tap-plan-middle.sh                               |    2 +-
 t/tap-plan-whitespace.sh                           |    2 +-
 t/tap-plan.sh                                      |    2 +-
 t/tap-planskip-and-logging.sh                      |    2 +-
 t/tap-planskip-badexit.sh                          |    2 +-
 t/tap-planskip-bailout.sh                          |    2 +-
 t/tap-planskip-case-insensitive.sh                 |    2 +-
 t/tap-planskip-late.sh                             |    2 +-
 t/tap-planskip-later-errors.sh                     |    2 +-
 t/tap-planskip-unplanned-corner.sh                 |    2 +-
 t/tap-planskip-unplanned.sh                        |    2 +-
 t/tap-planskip-whitespace.sh                       |    2 +-
 t/tap-planskip.sh                                  |    2 +-
 t/tap-realtime.sh                                  |    4 +-
 t/tap-recheck-logs.sh                              |    2 +-
 t/tap-recheck.sh                                   |    2 +-
 t/tap-result-comment.sh                            |    2 +-
 t/tap-signal.tap                                   |    2 +-
 t/tap-test-number-0.sh                             |    2 +-
 t/tap-todo-skip-together.sh                        |    2 +-
 t/tap-todo-skip-whitespace.sh                      |    2 +-
 t/tap-todo-skip.sh                                 |    2 +-
 t/tap-unplanned.sh                                 |    2 +-
 t/tap-whitespace-normalization.sh                  |    2 +-
 t/tap-with-and-without-number.sh                   |    2 +-
 t/tap-xfail-tests.sh                               |    2 +-
 t/tar-override.sh                                  |    2 +-
 t/tar.sh                                           |    2 +-
 t/tar2.sh                                          |    2 +-
 t/tar3.sh                                          |    2 +-
 t/target-cflags.sh                                 |    2 +-
 t/targetclash.sh                                   |    2 +-
 t/test-driver-acsubst.sh                           |    2 +-
 t/test-driver-cond.sh                              |    2 +-
 t/test-driver-create-log-dir.sh                    |    2 +-
 t/test-driver-custom-multitest-recheck.sh          |    2 +-
 t/test-driver-custom-multitest-recheck2.sh         |    2 +-
 t/test-driver-custom-multitest.sh                  |    2 +-
 t/test-driver-custom-no-extra-driver.sh            |    2 +-
 t/test-driver-custom-xfail-tests.sh                |    2 +-
 t/test-driver-custom.sh                            |    2 +-
 t/test-driver-fail.sh                              |    2 +-
 t/test-driver-is-distributed.sh                    |   40 +-
 t/test-driver-strip-vpath.sh                       |    2 +-
 t/test-driver-trs-suffix-registered.sh             |    2 +-
 t/test-extensions-cond.sh                          |    2 +-
 t/test-extensions.sh                               |    2 +-
 t/test-harness-vpath-rewrite.sh                    |    2 +-
 t/test-log.sh                                      |    2 +-
 t/test-logs-repeated.sh                            |    2 +-
 t/test-metadata-global-log.sh                      |    4 +-
 t/test-metadata-global-result.sh                   |    2 +-
 t/test-metadata-recheck.sh                         |    2 +-
 t/test-metadata-results.sh                         |    2 +-
 t/test-missing.sh                                  |    2 +-
 t/test-missing2.sh                                 |    2 +-
 t/test-trs-basic.sh                                |    2 +-
 t/test-trs-recover.sh                              |    2 +-
 t/test-trs-recover2.sh                             |    2 +-
 t/tests-environment-and-log-compiler.sh            |    2 +-
 t/tests-environment-backcompat.sh                  |    4 +-
 t/tests-environment-fd-redirect.sh                 |    2 +-
 t/tests-environment.sh                             |    2 +-
 t/testsuite-summary-count-many.sh                  |    2 +-
 t/testsuite-summary-reference-log.sh               |    2 +-
 t/transform.sh                                     |    2 +-
 t/transform2.sh                                    |    2 +-
 t/transform3.sh                                    |    2 +-
 t/txinfo-no-clutter.sh                             |   91 +++-
 t/txinfo-unrecognized-extension.sh                 |    2 +-
 t/txinfo.sh                                        |    2 +-
 t/txinfo10.sh                                      |    2 +-
 t/txinfo13.sh                                      |    4 +-
 t/txinfo16.sh                                      |    2 +-
 t/txinfo17.sh                                      |    2 +-
 t/txinfo19.sh                                      |    2 +-
 t/txinfo2.sh                                       |    2 +-
 t/txinfo20.sh                                      |    2 +-
 t/txinfo21.sh                                      |   21 +-
 t/txinfo22.sh                                      |    2 +-
 t/txinfo23.sh                                      |    4 +-
 t/txinfo24.sh                                      |    4 +-
 t/txinfo25.sh                                      |    4 +-
 t/txinfo26.sh                                      |    2 +-
 t/txinfo27.sh                                      |    2 +-
 t/txinfo28.sh                                      |    4 +-
 t/txinfo29.sh                                      |    2 +-
 t/txinfo3.sh                                       |    2 +-
 t/txinfo30.sh                                      |   63 ---
 t/txinfo31.sh                                      |    2 +-
 t/txinfo32.sh                                      |    2 +-
 t/txinfo33.sh                                      |    4 +-
 t/txinfo4.sh                                       |    2 +-
 t/txinfo5.sh                                       |   38 --
 t/txinfo5b.sh                                      |   42 --
 t/txinfo6.sh                                       |    2 +-
 t/txinfo7.sh                                       |    2 +-
 t/txinfo8.sh                                       |    2 +-
 t/txinfo9.sh                                       |    2 +-
 t/uninstall-fail.sh                                |    2 +-
 t/uninstall-pr9578.sh                              |    2 +-
 t/unused.sh                                        |    2 +-
 t/upc.sh                                           |    2 +-
 t/upc2.sh                                          |    2 +-
 t/upc3.sh                                          |    2 +-
 t/var-recurs.sh                                    |   34 ++
 t/var-recurs2.sh                                   |   31 +
 t/vars.sh                                          |    2 +-
 t/vars3.sh                                         |    2 +-
 t/vartar.sh                                        |    2 +-
 t/vartypo2.sh                                      |    2 +-
 t/vartypos.sh                                      |    2 +-
 t/version.sh                                       |   41 --
 t/version2.sh                                      |   41 --
 t/version3.sh                                      |    2 +-
 t/version4.sh                                      |    2 +-
 t/version6.sh                                      |    2 +-
 t/version7.sh                                      |    2 +-
 t/version8.sh                                      |    2 +-
 t/vpath.sh                                         |    2 +-
 t/vtexi.sh                                         |    2 +-
 t/vtexi2.sh                                        |    2 +-
 t/vtexi3.sh                                        |    2 +-
 t/vtexi4.sh                                        |    4 +-
 t/warning-groups-win-over-strictness.sh            |    2 +-
 t/warnings-obsolete-default.sh                     |    2 +-
 t/warnings-override.sh                             |    2 +-
 t/warnings-precedence.sh                           |    2 +-
 t/warnings-strictness-interactions.sh              |    2 +-
 t/warnings-unknown.sh                              |    6 +-
 t/warnings-win-over-strictness.sh                  |    2 +-
 t/warnopts.sh                                      |    2 +-
 t/werror.sh                                        |    2 +-
 t/werror2.sh                                       |    2 +-
 t/werror3.sh                                       |    2 +-
 t/werror4.sh                                       |    2 +-
 t/whoami.sh                                        |    2 +-
 t/xsource.sh                                       |    2 +-
 t/yacc-auxdir.sh                                   |    2 +-
 t/yacc-basic.sh                                    |    2 +-
 t/yacc-bison-skeleton-cxx.sh                       |    2 +-
 t/yacc-bison-skeleton.sh                           |    2 +-
 t/yacc-clean-cxx.sh                                |    2 +-
 t/yacc-clean.sh                                    |    2 +-
 t/yacc-cxx.sh                                      |    2 +-
 t/yacc-d-basic.sh                                  |   56 +-
 t/yacc-d-cxx.sh                                    |    2 +-
 t/yacc-d-vpath.sh                                  |    2 +-
 t/yacc-deleted-headers.sh                          |    2 +-
 t/yacc-depend.sh                                   |    2 +-
 t/yacc-depend2.sh                                  |    2 +-
 t/yacc-dist-nobuild-subdir.sh                      |    2 +-
 t/yacc-dist-nobuild.sh                             |    2 +-
 t/yacc-grepping.sh                                 |    2 +-
 t/yacc-grepping2.sh                                |    2 +-
 t/yacc-headers-and-dist-pr47.sh                    |    2 +-
 t/yacc-line.sh                                     |    2 +-
 t/yacc-mix-c-cxx.sh                                |    2 +-
 t/yacc-nodist.sh                                   |    2 +-
 t/yacc-pr204.sh                                    |    2 +-
 t/yacc-subdir.sh                                   |    2 +-
 t/yacc-weirdnames.sh                               |    2 +-
 t/yacc4.sh                                         |    2 +-
 t/yaccdry.sh                                       |    2 +-
 t/yaccpp.sh                                        |    2 +-
 t/yaccvpath.sh                                     |    2 +-
 t/yflags-cmdline-override.sh                       |    2 +-
 t/yflags-conditional.sh                            |    2 +-
 t/yflags-d-false-positives.sh                      |    2 +-
 t/yflags-force-conditional.sh                      |    2 +-
 t/yflags-force-override.sh                         |    2 +-
 t/yflags-var-expand.sh                             |    2 +-
 t/yflags.sh                                        |    2 +-
 t/yflags2.sh                                       |    2 +-
 1323 files changed, 8928 insertions(+), 8924 deletions(-)
 create mode 100755 contrib/t/help-multilib.sh
 create mode 100644 contrib/t/local.am
 create mode 100755 contrib/t/multilib.sh
 create mode 100755 contrib/t/parallel-tests-html-recursive.sh
 create mode 100755 contrib/t/parallel-tests-html.sh
 delete mode 100644 defs
 delete mode 100755 lib/elisp-comp
 delete mode 100644 m4/ccstdc.m4
 create mode 100644 m4/extra-recurs.m4
 delete mode 100644 m4/header.m4
 create mode 100644 m4/internal/ac-config-macro-dirs.m4
 delete mode 100644 m4/obsol-gt.m4
 delete mode 100644 m4/obsol-lt.m4
 delete mode 100644 m4/obsolete.m4
 delete mode 100755 t/acloca11.sh
 delete mode 100755 t/acloca12.sh
 delete mode 100755 t/acloca13.sh
 delete mode 100755 t/acloca14.sh
 delete mode 100755 t/acloca15.sh
 delete mode 100755 t/acloca16.sh
 delete mode 100755 t/acloca17.sh
 delete mode 100755 t/acloca18.sh
 delete mode 100755 t/acloca19.sh
 delete mode 100755 t/acloca20.sh
 delete mode 100755 t/acloca21.sh
 delete mode 100755 t/acloca22.sh
 delete mode 100755 t/acloca23.sh
 create mode 100755 t/aclocal-I-order-1.sh
 create mode 100755 t/aclocal-I-order-2.sh
 create mode 100755 t/aclocal-I-order-3.sh
 create mode 100755 t/aclocal-amflags.sh
 create mode 100755 t/aclocal-autoconf-version-check.sh
 create mode 100755 t/aclocal-comments-respected.sh
 create mode 100755 t/aclocal-deleted-header-aclocal-amflags.sh
 create mode 100755 t/aclocal-deleted-header.sh
 create mode 100755 t/aclocal-deps-subdir.sh
 create mode 100755 t/aclocal-deps.sh
 create mode 100755 t/aclocal-dirlist-abspath.sh
 create mode 100755 t/aclocal-dirlist-globbing.sh
 create mode 100755 t/aclocal-dirlist.sh
 create mode 100755 t/aclocal-m4-include-are-scanned-aclocal-amflags.sh
 create mode 100755 t/aclocal-m4-include-are-scanned.sh
 create mode 100755 t/aclocal-m4-sinclude.sh
 create mode 100755 t/aclocal-macrodir.tap
 create mode 100755 t/aclocal-macrodirs.tap
 create mode 100755 t/aclocal-missing-macros.sh
 create mode 100755 t/aclocal-no-extra-scan.sh
 create mode 100755 t/aclocal-no-force.sh
 create mode 100755 t/aclocal-no-symlinked-overwrite.sh
 create mode 100755 t/aclocal-no-unused-required.sh
 create mode 100755 t/aclocal-pr450.sh
 create mode 100755 t/aclocal-remake-misc.sh
 create mode 100755 t/aclocal-req.sh
 create mode 100755 t/aclocal-scan-configure-ac-pr319.sh
 create mode 100755 t/aclocal-serial.sh
 create mode 100755 t/aclocal-underquoted-defun.sh
 delete mode 100755 t/aclocal3.sh
 delete mode 100755 t/aclocal4.sh
 delete mode 100755 t/aclocal5.sh
 delete mode 100755 t/aclocal6.sh
 delete mode 100755 t/aclocal7.sh
 delete mode 100755 t/aclocal8.sh
 delete mode 100755 t/aclocal9.sh
 create mode 100755 t/add-missing-multiple.sh
 delete mode 100755 t/autohdr2.sh
 create mode 100755 t/backcompat-acout.sh
 delete mode 100755 t/backcompat4.sh
 delete mode 100755 t/backcompat5.sh
 delete mode 100755 t/block.sh
 delete mode 100755 t/clean2.sh
 create mode 100755 t/color-tests-opt.sh
 create mode 100755 t/color-tests.sh
 create mode 100755 t/color-tests2.sh
 delete mode 100755 t/color.sh
 delete mode 100755 t/color2.sh
 create mode 100755 t/comment-block.sh
 delete mode 100755 t/cygnus-check-without-all.sh
 delete mode 100755 t/cygnus-dependency-tracking.sh
 delete mode 100755 t/cygnus-deprecation.sh
 delete mode 100755 t/cygnus-imply-foreign.sh
 delete mode 100755 t/cygnus-no-dist.sh
 delete mode 100755 t/cygnus-no-installinfo.sh
 create mode 100755 t/cygnus-no-more.sh
 delete mode 100755 t/cygnus-requires-maintainer-mode.sh
 delete mode 100755 t/dirlist-abspath.sh
 delete mode 100755 t/dirlist.sh
 delete mode 100755 t/dirlist2.sh
 delete mode 100755 t/help-multilib.sh
 create mode 100755 t/lisp-flags.sh
 create mode 100755 t/lisp-loadpath.sh
 create mode 100755 t/lisp-subdir-mix.sh
 create mode 100755 t/lisp-subdir.sh
 create mode 100755 t/lisp-subdir2.sh
 delete mode 100755 t/man4.sh
 create mode 100755 t/missing-version-mismatch.sh
 delete mode 100755 t/missing.sh
 delete mode 100755 t/missing2.sh
 delete mode 100755 t/missing4.sh
 delete mode 100755 t/missing5.sh
 delete mode 100755 t/missing6.sh
 delete mode 100755 t/multlib.sh
 delete mode 100755 t/obsolete.sh
 delete mode 100755 t/parallel-tests2.sh
 create mode 100755 t/recurs-user-deeply-nested.sh
 create mode 100755 t/recurs-user-indir.sh
 create mode 100755 t/recurs-user-keep-going.sh
 create mode 100755 t/recurs-user-many.sh
 create mode 100755 t/recurs-user-no-subdirs.sh
 create mode 100755 t/recurs-user-no-top-level.sh
 create mode 100755 t/recurs-user-override.sh
 create mode 100755 t/recurs-user-phony.sh
 create mode 100755 t/recurs-user-wrap.sh
 create mode 100755 t/recurs-user.sh
 create mode 100755 t/recurs-user2.sh
 delete mode 100755 t/recurs.sh
 delete mode 100755 t/recurs2.sh
 create mode 100755 t/remake-aclocal-version-mismatch.sh
 create mode 100755 t/remake-macrodir.sh
 create mode 100755 t/remake-recurs-user.sh
 delete mode 100755 t/req.sh
 delete mode 100755 t/reqd.sh
 delete mode 100755 t/silent-amopts.sh
 create mode 100755 t/silent-c.sh
 create mode 100755 t/silent-custom.sh
 create mode 100755 t/silent-cxx.sh
 create mode 100755 t/silent-f77.sh
 create mode 100755 t/silent-f90.sh
 create mode 100755 t/silent-gen.sh
 create mode 100755 t/silent-lt.sh
 delete mode 100755 t/silent-many-gcc.sh
 delete mode 100755 t/silent-many-generic.sh
 create mode 100755 t/silent-many-languages.sh
 delete mode 100755 t/silent-nowarn.sh
 delete mode 100755 t/silent-obsolescent-warns.sh
 create mode 100755 t/silent-texi.sh
 delete mode 100755 t/silent.sh
 delete mode 100755 t/silent2.sh
 delete mode 100755 t/silent3.sh
 delete mode 100755 t/silent4.sh
 delete mode 100755 t/silent6.sh
 delete mode 100755 t/silent7.sh
 delete mode 100755 t/silent8.sh
 delete mode 100755 t/silent9.sh
 delete mode 100755 t/silentcxx-gcc.sh
 delete mode 100755 t/silentcxx.sh
 delete mode 100755 t/silentf77.sh
 delete mode 100755 t/silentf90.sh
 create mode 100755 t/subpkg-macrodir.sh
 delete mode 100755 t/txinfo30.sh
 delete mode 100755 t/txinfo5.sh
 delete mode 100755 t/txinfo5b.sh
 create mode 100755 t/var-recurs.sh
 create mode 100755 t/var-recurs2.sh
 delete mode 100755 t/version.sh
 delete mode 100755 t/version2.sh

diff --git a/.gitignore b/.gitignore
index 88457fa..a32310e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -20,6 +20,8 @@
 /doc/automake*.dvi
 /doc/automake*.pdf
 /doc/automake*.ps
+/doc/automake*.t2d/
+/doc/automake*.t2p/
 /doc/automake*.1
 /doc/aclocal*.1
 /doc/stamp-vti
@@ -47,6 +49,9 @@
 /t/*.dir
 /t/*.log
 /t/*.trs
+/contrib/t/*.dir
+/contrib/t/*.log
+/contrib/t/*.trs
 /t/pm/*.log
 /t/pm/*.trs
 /t/perf/*.log
diff --git a/Makefile.am b/Makefile.am
index 8fea72e..6a4ebd4 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -73,13 +73,13 @@ EXTRA_DIST += \
   syntax-checks.mk \
   HACKING
 
-## Make versioned links.  We only run the transform on the root name;
-## then we make a versioned link with the transformed base name.  This
-## seemed like the most reasonable approach.
+# Make versioned links.  We only run the transform on the root name;
+# then we make a versioned link with the transformed base name.  This
+# seemed like the most reasonable approach.
 install-exec-hook:
        @$(POST_INSTALL)
        @for p in $(bin_SCRIPTS); do \
-         f="`echo $$p|sed '$(transform)'`"; \
+         f=`echo $$p | sed '$(transform)'`; \
          fv="$$f-$(APIVERSION)"; \
          rm -f "$(DESTDIR)$(bindir)/$$fv"; \
          echo " $(LN) '$(DESTDIR)$(bindir)/$$f' '$(DESTDIR)$(bindir)/$$fv'"; \
@@ -88,13 +88,13 @@ install-exec-hook:
 
 uninstall-hook:
        @for p in $(bin_SCRIPTS); do \
-         f="`echo $$p|sed '$(transform)'`"; \
+         f=`echo $$p | sed '$(transform)'`; \
          fv="$$f-$(APIVERSION)"; \
          rm -f "$(DESTDIR)$(bindir)/$$fv"; \
        done
 
-## These files depend on Makefile so they are rebuilt if $(VERSION),
-## $(datadir) or other do_subst'ituted variables change.
+# These files depend on Makefile so they are rebuilt if $(VERSION),
+# $(datadir) or other do_subst'ituted variables change.
 automake: automake.in
 aclocal: aclocal.in
 automake aclocal: Makefile
@@ -105,9 +105,9 @@ automake aclocal: Makefile
 ## comments, and that is perfectly legit.
        $(AM_V_at)chmod a+x,a-w address@hidden && mv -f address@hidden $@
 
-## The master location for INSTALL is lib/INSTALL.
-## This is where "make fetch" will install new versions.
-## Make sure we also update this copy.
+# 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
        $(AM_V_GEN)cp $(srcdir)/lib/INSTALL $@
 
@@ -131,9 +131,9 @@ dist_pkgvdata_DATA = \
   lib/INSTALL \
   lib/texinfo.tex
 
-## These must all be executable when installed.  However, if we use
-## _SCRIPTS, then the program transform will be applied, which is not
-## what we want.  So we make them executable by hand.
+# These must all be executable when installed.  However, if we use
+# _SCRIPTS, then the program transform will be applied, which is not
+# what we want.  So we make them executable by hand.
 dist_script_DATA = \
   lib/config.guess \
   lib/config.sub \
@@ -141,7 +141,6 @@ dist_script_DATA = \
   lib/mdate-sh \
   lib/missing \
   lib/mkinstalldirs \
-  lib/elisp-comp \
   lib/ylwrap \
   lib/depcomp \
   lib/compile \
@@ -267,14 +266,13 @@ dist_automake_ac_DATA = \
   m4/ar-lib.m4 \
   m4/as.m4 \
   m4/auxdir.m4 \
-  m4/ccstdc.m4 \
   m4/cond.m4 \
   m4/cond-if.m4 \
   m4/depend.m4 \
   m4/depout.m4 \
   m4/dmalloc.m4 \
+  m4/extra-recurs.m4 \
   m4/gcj.m4 \
-  m4/header.m4 \
   m4/init.m4 \
   m4/install-sh.m4 \
   m4/lead-dot.m4 \
@@ -285,9 +283,6 @@ dist_automake_ac_DATA = \
   m4/minuso.m4 \
   m4/missing.m4 \
   m4/mkdirp.m4 \
-  m4/obsol-gt.m4 \
-  m4/obsol-lt.m4 \
-  m4/obsolete.m4 \
   m4/options.m4 \
   m4/protos.m4 \
   m4/python.m4 \
@@ -300,6 +295,9 @@ dist_automake_ac_DATA = \
   m4/upc.m4 \
   m4/vala.m4
 
+automake_internal_acdir = $(automake_acdir)/internal
+dist_automake_internal_ac_DATA = m4/internal/ac-config-macro-dirs.m4
+
 dist_system_ac_DATA = m4/acdir/README
 
 # We build amversion.m4 here, instead of from config.status,
@@ -336,7 +334,8 @@ AM_TAP_LOG_DRIVER_FLAGS = --merge
 
 EXTRA_DIST += t/README t/ax/is t/ax/is_newest
 
-TESTS = ## Will be updated later.
+## Will be updated later.
+TESTS =
 
 # Some testsuite-influential variables should be overridable from the
 # test scripts, but not from the environment.
@@ -392,12 +391,17 @@ $(srcdir)/t/testsuite-part.am:
        $(AM_V_at)mv -f t/testsuite-part.tmp $@
 EXTRA_DIST += gen-testsuite-part
 
-## The dependecies declared here are not truly complete, but such
-## completeness would cause more issues than it would solve.  See
-## automake bug#11347.
+# The dependecies declared here are not truly complete, but such
+# completeness would cause more issues than it would solve.  See
+# automake bug#11347.
 $(generated_TESTS): $(srcdir)/gen-testsuite-part
 $(srcdir)/t/testsuite-part.am: $(srcdir)/gen-testsuite-part Makefile.am
 
+# Hand-written tests for stuff in 'contrib/'.
+include $(srcdir)/contrib/t/local.am
+TESTS += $(contrib_TESTS)
+EXTRA_DIST += $(contrib_TESTS)
+
 # Static dependencies valid for each test case (also further
 # extended later).  Note that use 'noinst_' rather than 'check_'
 # as the prefix, because we really want them to be built by
@@ -429,7 +433,8 @@ EXTRA_DIST += t/ax/test-defs.in
 CLEANFILES += t/ax/test-defs.sh
 nodist_noinst_DATA = t/ax/test-defs.sh
 
-noinst_SCRIPTS = # Will be updated soon.
+## Will be updated soon.
+noinst_SCRIPTS =
 
 t/ax/shell-no-trail-bslash: t/ax/shell-no-trail-bslash.in Makefile
        $(AM_V_at)rm -f $@ address@hidden
@@ -515,7 +520,7 @@ check-no-trailing-backslash-in-recipes:
 .PHONY: check-no-trailing-backslash-in-recipes
 
 ## Checking the list of tests.
-test_subdirs = t t/pm
+test_subdirs = t t/pm contrib/t
 include $(srcdir)/t/CheckListOfTests.am
 
 # Run the testsuite with the installed aclocal and automake.
@@ -535,13 +540,16 @@ EXTRA_DIST += $(perf_TESTS)
 clean-local: clean-local-check
 .PHONY: clean-local-check
 clean-local-check:
-       -set x t/*.dir; shift; \
-        if test "$$#,$$1" = "1,*.dir"; then \
-          : there is no test directory to clean; \
-        else \
-          find "$$@" -type d ! -perm -700 -exec chmod u+rwx {} ';'; \
-          rm -rf "$$@"; \
-        fi;
+## Directories candidate to be test directories match this wildcard.
+       @globs='t/*.dir t/*/*.dir */t/*.dir */t/*/*.dir'; \
+## The 'nullglob' bash option is not portable, so use perl.
+       dirs=`$(PERL) -e "print join(' ', glob('$$globs'));"` || exit 1; \
+       if test -n "$$dirs"; then \
+## Errors in find are acceptable, errors in rm are not.
+           find $$dirs -type d ! -perm -700 -exec chmod u+rwx {} ';'; \
+           echo " rm -rf $$dirs"; \
+           rm -rf $$dirs || exit 1; \
+       fi
 
 
 ## ---------------- ##
diff --git a/NEWS b/NEWS
index 7a230ef..bdafaed 100644
--- a/NEWS
+++ b/NEWS
@@ -1,38 +1,84 @@
-New in 1.12.6:
+New in 1.13:
 
 * WARNING: Future backward-incompatibilities!
 
-  - Future versions of Automake will likely drop support for the
-    long-deprecated 'configure.in' name for the Autoconf input file.
-    You are advised to use the recommended name 'configure.ac' instead.
+  - Automake 1.14 will likely require Autoconf 2.70 or later (which is
+    still unreleased at the moment of writing, but is planned to be
+    released before Automake 1.14 is).
 
-  - Support for the "Cygnus-style" trees (as enabled by the 'cygnus'
-    option) will be removed in the next major Automake release (1.13).
+  - Automake 1.14 will likely drop support for the long-deprecated
+    'configure.in' name for the Autoconf input file.  You are advised
+    to use the recommended name 'configure.ac' instead.
 
   - The long-obsolete (since automake 1.10) AM_PROG_MKDIR m4 macro will
     be removed in Automake 1.14.  The $(mkdir_p) make variable and the
     @mkdir_p@ substitution will still remain available (as aliases of
-    $(MKDIR_P)) for the moment, for better backward compatibility.
+    $(MKDIR_P)) for the moment, for better backward compatibility; but
+    you are advised to stop using ASAP.
+
+  - The ACLOCAL_AMFLAGS special make variable will be fully deprecated
+    in Automake 1.14 (where it will raise warnings in the "obsolete"
+    category).  You are advised to start relying on the new Automake
+    support for AC_CONFIG_MACRO_DIRS instead (which is introduced with
+    this release; see below for more information).
+
+  - Support for IRIX and the SGI C/C++ compilers will be removed in
+    Automake 1.14: they have seen their last release in 2006, and SGI
+    is expected to retire support from them in December 2013; see
+    <http://www.sgi.com/services/support/irix_mips_support.html> for
+    more information.
+
+  - Future versions of Automake might remove support for MS-DOS and
+    Windows 95/98/ME (support for them was offered by relying on the
+    DJGPP project).  Note however that both Cygwin and MSYS/MinGW on
+    modern Windows versions will continue to be fully supported.
+
+  - Support for the long-deprecated INCLUDES variable will be removed
+    altogether in Automake 1.14.  The AM_CPPFLAGS variable should be
+    used instead.
+
+  - Automake-provided scripts and makefile recipes might (finally!)
+    start assuming a POSIX shell in Automake 1.14.
+
+  - Starting from Automake 1.14, third-party m4 files located in the
+    system-wide aclocal directory, as well as in any directory listed
+    in the ACLOCAL_PATH environment variable, will take precedence
+    over "built-in" Automake macros.  For example (assuming Automake
+    is installed in the /usr/local hierarchy), a definition of the
+    AM_PROG_VALAC macro found in '/usr/local/share/aclocal/my-vala.m4'
+    should take precedence over the same-named automake-provided macro
+    (defined in '/usr/local/share/aclocal-1.14/vala.m4').
+
+* Bugs fixed:
+
+  - ylwrap renames properly header guards in generated header files
+    (*.h), instead of leaving Y_TAB_H.
+
+  - ylwrap now also converts header guards in implementation files
+    (*.c).  Because ylwrap failed to rename properly #include in the
+    implementation files, current versions of Bison (e.g., 2.7)
+    duplicate the generated header file in the implementation file.
+    The header guard then protects the implementation file from
+    duplicate definitions from the header file.
 
-  - Autoconf 2.65 or later will be required by the next major Automake
-    version (1.13).  Until now, Automake has required Autoconf version
-    2.62 or later.
+* Version requirements:
+
+  - Autoconf 2.65 or greater is now required.
+
+  - The rules to build PDF and DVI output from Texinfo input now
+    require Texinfo 4.9 or later.
 
-  - Starting from the next major Automake version (1.13), the rules
-    to build pdf, ps and dvi output from Texinfo input will use the
-    '--build-dir' option by default.  Since such an option was only
-    introduced in Texinfo 4.9, this means that Makefiles generated by
-    future Automake versions will require at least that version of
-    Texinfo.
+* Obsolete features:
 
-  - Starting from the next major Automake version (1.13), the parallel
-    testsuite harness (previously only enabled by the 'parallel-tests'
-    option) will become the default one; the older serial testsuite
-    harness will still be available through the use of the 'serial-tests'
-    option.
+  - Support for the "Cygnus-style" trees (once enabled by the 'cygnus'
+    option) has been removed.  See discussion about automake bug#11034
+    for more background: <http://debbugs.gnu.org/11034>.
 
-  - The following long-obsolete m4 macros will be removed in the
-    next major Automake version (1.13):
+  - The deprecated aclocal option '--acdir' has been removed.  You
+    should use the options '--automake-acdir' and '--system-acdir'
+    instead (which have been introduced in Automake 1.11.2).
+
+  - The following long-obsolete m4 macros have been removed:
 
       AM_PROG_CC_STDC:    superseded by AC_PROG_CC since October 2002
       fp_PROG_CC_STDC:    broken alias for AM_PROG_CC_STDC
@@ -46,20 +92,139 @@ New in 1.12.6:
                           of the now-removed automatic de-ANSI-fication
                           support of Automake)
 
-  - All the "old alias" macros in 'm4/obsolete.m4' will be removed in
-    the next major Automake version (1.13).
+  - All the "old alias" macros in 'm4/obsolete.m4' have been removed.
+
+  - Use of the long-deprecated two- and three-arguments invocation forms
+    of the AM_INIT_AUTOMAKE is no longer documented.  It's still supported
+    though (albeit with a warning in the 'obsolete' category), to cater
+    for people who want to define the version number for their package
+    dynamically (e.g., from the current VCS revision).  We'll have to
+    continue this support until Autoconf itself is fixed to allow better
+    support for such dynamic version numbers.
+
+* Elisp byte-compilation:
+
+  - The byte compilation of '.el' files into '.elc' files is now done
+    with a suffix rule.  This has simplified the compilation process, and
+    more importantly made it less brittle.  The downside is that emacs is
+    now invoked once for each '.el' files, which cause some noticeable
+    slowdowns.  These should however be mitigated on multicore machines
+    (which are becoming the norm today) if concurrent  make ("make -j")
+    is used.
+
+  - Elisp files placed in a subdirectory are now byte-compiled to '.elc'
+    files in the same subdirectory; for example, byte-compiling of file
+    'sub/foo.el' file will result in 'sub/foo.elc' rather than in
+    'foo.elc'.  This behaviour is backward-incompatible with older
+    Automake versions, but it is more natural and more sane.  See also
+    automake bug#7441.
+
+  - The Emacs invocation performing byte-compilation of '.el' files honors
+    the $(AM_ELCFLAGS) and $(ELCFLAGS) variables; as typical, the former
+    one is  developer-reserved and the latter one user-reserved.
+
+  - The 'elisp-comp' script, once provided by Automake, has been rendered
+    obsoleted by the just-described changes, and thus removed.
+
+* Changes to Automake-generated testsuite harnesses:
+
+  - The parallel testsuite harness (previously only enabled by the
+    'parallel-tests' option) is the default one; the older serial
+    testsuite harness will still be available through the use of the
+    'serial-tests' option (introduced in Automake 1.12).
 
-  - The '--acdir' option of aclocal is deprecated, and will probably
-    be removed in the next major Automake release (1.13).  You should
-    use the options '--automake-acdir' and '--system-acdir' instead
-    (which have been introduced in Automake 1.11.2).
+  - The 'color-tests' option is now unconditionally activated by default.
+    In particular, this means that testsuite output is now colorized by
+    default if the attached terminal seems to support ANSI escapes, and
+    that the user can force output colorization by setting the variable
+    AM_COLOR_TESTS to "always".  The 'color-tests' is still recognized
+    for backward-compatibility, although it's a handled as a no-op now.
 
-  - The 'missing' script will no longer try to update the timestamp
-    of out-of-date files that require a maintainer-specific tool to be
+* Silent rules support:
+
+  - Support for silent rules is now always active in Automake-generated
+    Makefiles.  So, although the verbose output is still the default,
+    the user can now always use "./configure --enable-silent-rules" or
+    "make V=0" to enable quieter output in the package he's building.
+
+  - The 'silent-rules' option has now become a no-op, preserved for
+    backward-compatibility only.  In particular, its use no longer
+    disables the warnings in the 'portability-recursive' category.
+
+* Texinfo Support:
+
+  - The rules to build PDF and DVI files from Texinfo input now require
+    Texinfo 4.9 or later.
+
+  - The rules to build PDF and DVI files from Texinfo input now use the
+    '--build-dir' option, to keep the auxiliary files used by texi2dvi
+    and texi2pdf around without cluttering the build directory, and to
+    make it possible to run the "dvi" and "pdf" recipes in parallel.
+
+* Automatic remake rules and 'missing' script:
+
+  - The 'missing' script no longer tries to update the timestamp of
+    out-of-date files that require a maintainer-specific tool to be
     remade, in case the user lacks such a tool (or has a too-old version
-    of it).  In fact, starting from Automake 1.13, all it'll do will be
-    giving more useful warnings than a bare "command not found" from a
-    make recipe would.
+    of it).  It just gives a useful warning, and in some cases also a
+    tip about how to obtain such a tool.
+
+  - The missing script has thus become useless as a (poor) way to work
+    around the sketched-timestamps issues that can happen for projects
+    that keep generated files committed in their VCS repository.  Such
+    projects are now encouraged to write a custom "fix-timestamps.sh"
+    script to avoid such issues; a simple example is provided in the
+    "CVS and generated files" chapter of the automake manual.
+
+* Recursive targets:
+
+  - The user can now define his own recursive targets that recurse
+    in the directories specified in $(SUBDIRS).  This can be done by
+    specifying the name of such targets in invocations of the new
+    'AM_EXTRA_RECURSIVE_TARGETS' m4 macro.
+
+* Tags:
+
+  - Any failure in the recipe of the "tags", "ctags", "cscope" or
+    "cscopelist" targets in a subdirectory is now propagated to the
+    top-level make invocation.
+
+  - Tags are correctly computed also for files in _SOURCES variables that
+    only list files with non-standard suffixes (see automake bug#12372).
+
+* Improvements to aclocal and related rebuilds rules:
+
+  - Autoconf-provided macros AC_CONFIG_MACRO_DIR and AC_CONFIG_MACRO_DIRS
+    are now traced by aclocal, and can be used to declare the local m4
+    include directories.  Formerly, one had to specify it with an explicit
+    '-I' option to the 'aclocal' invocation.
+
+  - The special make variable ACLOCAL_AMFLAGS is deprecated; future
+    Automake versions will warn about its use, and later version will
+    remove support for it altogether.
+
+* The depcomp script:
+
+  - Dropped support for libtool 1.4.
+
+  - Various internal refactorings.  They should cause no visible change,
+    but the chance for regression is there anyway, so please report any
+    unexpected or suspicious behaviour.
+
+  - Support for pre-8.0 versions of the Intel C Compiler has been dropped.
+    This should cause no problem, since icc 8.0 has been released in
+    December 2003 -- almost nine years ago.
+
+  - Support for tcc (the Tiny C Compiler) has been improved, and is now
+    handled through a dedicated 'tcc' mode.
+
+* The ylwrap script:
+
+  - ylwrap generates header guards with a single '_' for series of non
+    alphabetic characters, instead of several.  This is what Bison >=
+    2.5.1 does.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 Bugs fixed in 1.12.6:
 
diff --git a/aclocal.in b/aclocal.in
index 8f02b00..05b89e7 100644
--- a/aclocal.in
+++ b/aclocal.in
@@ -46,6 +46,16 @@ use File::Path ();
 
 # Some globals.
 
+# Support AC_CONFIG_MACRO_DIRS also with older autoconf.
+# FIXME: To be removed in Automake 1.14, once we can assume autoconf
+#        2.70 or later.
+# FIXME: keep in sync with 'internal/ac-config-macro-dirs.m4'.
+my $ac_config_macro_dirs_fallback =
+  'm4_ifndef([AC_CONFIG_MACRO_DIRS], [' .
+    'm4_defun([_AM_CONFIG_MACRO_DIRS], [])' .
+    'm4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])' .
+  '])';
+
 # We do not operate in threaded mode.
 $perl_threads = 0;
 
@@ -53,7 +63,7 @@ $perl_threads = 0;
 # user-supplied directories first, then the directory containing the
 # automake macros, and finally the system-wide directories for
 # third-party macros.
-# @user_includes can be augmented with -I.
+# @user_includes can be augmented with -I or AC_CONFIG_MACRO_DIRS.
 # @automake_includes can be reset with the '--automake-acdir' option.
 # @system_includes can be augmented with the 'dirlist' file or the
 # ACLOCAL_PATH environment variable, and reset with the '--system-acdir'
@@ -144,10 +154,14 @@ my $m4_include_rx = 
"(m4_|m4_s|s)include\\((?:\\[([^]]+)\\]|([^],)\n]+))\\)";
 my $serial_line_rx = '^#\s*serial\s+(\S*)';
 my $serial_number_rx = '^\d+(?:\.\d+)*$';
 
-# Autoconf version
-# Set by trace_used_macros.
+# Autoconf version.  This variable is set by 'trace_used_macros'.
 my $ac_version;
 
+# User directory containing extra m4 files for macros definition,
+# as extracted from calls to the macro AC_CONFIG_MACRO_DIRS.
+# This variable is updated by 'trace_used_macros'.
+my @ac_config_macro_dirs;
+
 # If set, names a temporary file that must be erased on abnormal exit.
 my $erase_me;
 
@@ -161,7 +175,7 @@ sub check_acinclude ();
 sub reset_maps ();
 sub install_file ($$);
 sub list_compare (address@hidden@);
-sub scan_m4_dirs ($@);
+sub scan_m4_dirs ($$@);
 sub scan_m4_files ();
 sub add_macro ($);
 sub scan_configure_dep ($);
@@ -341,28 +355,20 @@ sub list_compare (address@hidden@)
 
 ################################################################
 
-# scan_m4_dirs($TYPE, @DIRS)
-# --------------------------
+# scan_m4_dirs($TYPE, $ERR_ON_NONEXISTING, @DIRS)
+# -----------------------------------------------
 # Scan all M4 files installed in @DIRS for new macro definitions.
 # Register each file as of type $TYPE (one of the FT_* constants).
-my $first_user_m4dir = 1;
-sub scan_m4_dirs ($@)
+sub scan_m4_dirs ($$@)
 {
-  my ($type, @dirlist) = @_;
+  my ($type, $err_on_nonexisting, @dirlist) = @_;
 
   foreach my $m4dir (@dirlist)
     {
       if (! opendir (DIR, $m4dir))
        {
-         if ($install && $type == FT_USER && $first_user_m4dir)
-            {
-              # We will try to create this directory later, so don't
-              # complain if it doesn't exist.
-              # TODO: maybe we should avoid complaining only if errno
-              # is ENONENT?
-              $first_user_m4dir = 0;
-              next;
-            }
+         # TODO: maybe avoid complaining only if errno == ENONENT?
+         next unless $err_on_nonexisting;
          fatal "couldn't open directory '$m4dir': $!";
        }
 
@@ -397,9 +403,16 @@ sub scan_m4_files ()
     }
 
   # Finally, scan all files in our search paths.
-  scan_m4_dirs (FT_USER, @user_includes);
-  scan_m4_dirs (FT_AUTOMAKE, @automake_includes);
-  scan_m4_dirs (FT_SYSTEM, @system_includes);
+
+  if (@user_includes)
+    {
+      # Don't complain if the first user directory doesn't exist, in case
+      # we need to create it later (can happen if '--install' was given).
+      scan_m4_dirs (FT_USER, !$install, $user_includes[0]);
+      scan_m4_dirs (FT_USER, 1, @user_includes[1..$#user_includes]);
+    }
+  scan_m4_dirs (FT_AUTOMAKE, 1, @automake_includes);
+  scan_m4_dirs (FT_SYSTEM,   1, @system_includes);
 
   # Construct a new function that does the searching.  We use a
   # function (instead of just evaluating $search in the loop) so that
@@ -714,19 +727,46 @@ sub trace_used_macros ()
   my %files = map { $map{$_} => 1 } keys %macro_seen;
   %files = strip_redundant_includes %files;
 
+  # When AC_CONFIG_MACRO_DIRS is used, avoid possible spurious warnings
+  # from autom4te about macros being "m4_require'd but not m4_defun'd";
+  # for more background, see:
+  # http://lists.gnu.org/archive/html/autoconf-patches/2012-11/msg00004.html
+  # as well as autoconf commit 'v2.69-44-g1ed0548', "warn: allow aclocal
+  # to silence m4_require warnings".
+  my $early_m4_code .= "m4_define([m4_require_silent_probe], [-])";
+
   my $traces = ($ENV{AUTOM4TE} || '@am_AUTOM4TE@');
   $traces .= " --language Autoconf-without-aclocal-m4 ";
+  $traces = "echo '$early_m4_code' | $traces - ";
+
+  # Support AC_CONFIG_MACRO_DIRS also with older autoconf.
+  # Note that we can't use '$ac_config_macro_dirs_fallback' here, because
+  # a bug in option parsing code of autom4te 2.68 and earlier will cause
+  # it to read standard input last, even if the "-" argument is specified
+  # early.
+  # FIXME: To be removed in Automake 1.14, once we can assume autoconf
+  #        2.70 or later.
+  $traces .= "$automake_includes[0]/internal/ac-config-macro-dirs.m4 ";
+
   # All candidate files.
   $traces .= join (' ',
                   (map { "'$_'" }
                    (grep { exists $files{$_} } @file_order))) . " ";
+
   # All candidate macros.
   $traces .= join (' ',
-                  (map { "--trace='$_:\$f::\$n::\$1'" }
+                  (map { "--trace='$_:\$f::\$n::\${::}%'" }
                    ('AC_DEFUN',
                     'AC_DEFUN_ONCE',
                     'AU_DEFUN',
-                    '_AM_AUTOCONF_VERSION')),
+                    '_AM_AUTOCONF_VERSION',
+                    'AC_CONFIG_MACRO_DIR_TRACE',
+                     # FIXME: Tracing the next two macros is a hack for
+                     # compatibility with older autoconf.  Remove this in
+                     # Automake 1.14, when we can assume Autoconf 2.70 or
+                     # later.
+                    'AC_CONFIG_MACRO_DIR',
+                    '_AM_CONFIG_MACRO_DIRS')),
                   # Do not trace $1 for all other macros as we do
                   # not need it and it might contains harmful
                   # characters (like newlines).
@@ -736,6 +776,8 @@ sub trace_used_macros ()
 
   my $tracefh = new Automake::XFile ("$traces $configure_ac |");
 
+  @ac_config_macro_dirs = ();
+
   my %traced = ();
 
   while ($_ = $tracefh->getline)
@@ -745,14 +787,43 @@ sub trace_used_macros ()
 
       $traced{$macro} = 1 if exists $macro_seen{$macro};
 
-      $map_traced_defs{$arg1} = $file
-       if ($macro eq 'AC_DEFUN'
-           || $macro eq 'AC_DEFUN_ONCE'
-           || $macro eq 'AU_DEFUN');
-
-      $ac_version = $arg1 if $macro eq '_AM_AUTOCONF_VERSION';
+      if ($macro eq 'AC_DEFUN' || $macro eq 'AC_DEFUN_ONCE'
+            || $macro eq 'AU_DEFUN')
+        {
+          $map_traced_defs{$arg1} = $file;
+        }
+      elsif ($macro eq '_AM_AUTOCONF_VERSION')
+        {
+          $ac_version = $arg1;
+        }
+      elsif ($macro eq 'AC_CONFIG_MACRO_DIR_TRACE')
+        {
+          push @ac_config_macro_dirs, $arg1;
+        }
+      # FIXME: We still need to trace AC_CONFIG_MACRO_DIR
+      # for compatibility with older autoconf.  Remove this
+      # once we can assume Autoconf 2.70 or later.
+      elsif ($macro eq 'AC_CONFIG_MACRO_DIR')
+        {
+          @ac_config_macro_dirs = ($arg1);
+        }
+      # FIXME:This is an hack for compatibility with older autoconf.
+      # Remove this once we can assume Autoconf 2.70 or later.
+      elsif ($macro eq '_AM_CONFIG_MACRO_DIRS')
+        {
+           # Empty leading/trailing fields might be produced by split,
+           # hence the grep is really needed.
+           push @ac_config_macro_dirs, grep (/./, (split /\s+/, $arg1));
+        }
     }
 
+  # FIXME: in Autoconf >= 2.70, AC_CONFIG_MACRO_DIR calls
+  # AC_CONFIG_MACRO_DIR_TRACE behind the scenes, which could
+  # leave unwanted duplicates in @ac_config_macro_dirs.
+  # Remove this in Automake 1.14, when we'll stop tracing
+  # AC_CONFIG_MACRO_DIR explicitly.
+  @ac_config_macro_dirs = uniq @ac_config_macro_dirs;
+
   $tracefh->close;
 
   return %traced;
@@ -878,6 +949,7 @@ $output";
 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
 # PARTICULAR PURPOSE.
 
+$ac_config_macro_dirs_fallback
 $output";
 
   # We try not to update $output_file unless necessary, because
@@ -973,15 +1045,6 @@ EOF
   exit 0;
 }
 
-# Using --acdir overrides both the automake (versioned) directory and
-# the public (unversioned) system directory.  This usage is obsolete.
-sub handle_acdir_option ($$)
-{
-  msg 'obsolete', '', "'--acdir' is deprecated\n";
-  @system_includes = ($_[1]);
-  @automake_includes = ();
-}
-
 # Parse command line.
 sub parse_arguments ()
 {
@@ -992,7 +1055,6 @@ sub parse_arguments ()
     (
      'help'            => sub { usage(0); },
      'version'         => \&version,
-     'acdir=s'         => \&handle_acdir_option,
      'system-acdir=s'  => sub { shift; @system_includes = @_; },
      'automake-acdir=s'        => sub { shift; @automake_includes = @_; },
      'diff:s'          => \$diff_command,
@@ -1029,12 +1091,6 @@ sub parse_arguments ()
       $dry_run = 1;
     }
 
-  if ($install && address@hidden)
-    {
-      fatal ("--install should copy macros in the directory indicated by the"
-            . "\nfirst -I option, but no -I was supplied");
-    }
-
   # Finally, adds any directory listed in the 'dirlist' file.
   if (open (DIRLIST, "$system_includes[0]/dirlist"))
     {
@@ -1084,16 +1140,35 @@ $configure_ac = require_configure_ac;
 # we did not rerun aclocal, the next run of aclocal would produce a
 # different aclocal.m4.
 my $loop = 0;
+my $rerun_due_to_macrodir = 0;
 while (1)
   {
     ++$loop;
-    prog_error "too many loops" if $loop > 2;
+    prog_error "too many loops" if $loop > 2 + $rerun_due_to_macrodir;
 
     reset_maps;
     scan_m4_files;
     scan_configure;
     last if $exit_code;
     my %macro_traced = trace_used_macros;
+
+    if (!$rerun_due_to_macrodir && @ac_config_macro_dirs)
+      {
+        # The directory specified in calls to the AC_CONFIG_MACRO_DIRS
+        # m4 macro (if any) must go after the user includes specified
+        # explicitly with the '-I' option.
+        push @user_includes, @ac_config_macro_dirs;
+        # We might have to scan some new directory of .m4 files.
+        $rerun_due_to_macrodir++;
+        next;
+      }
+
+    if ($install && address@hidden)
+      {
+        fatal "installation of third-party macros impossible without " .
+              "-I options nor AC_CONFIG_MACRO_DIR{,S} m4 macro(s)";
+      }
+
     last if write_aclocal ($output_file, keys %macro_traced);
     last if $dry_run;
   }
diff --git a/automake.in b/automake.in
index 11c670a..3194c99 100644
--- a/automake.in
+++ b/automake.in
@@ -232,7 +232,7 @@ my @common_files =
     (qw(ABOUT-GNU ABOUT-NLS AUTHORS BACKLOG COPYING COPYING.DOC COPYING.LIB
        COPYING.LESSER ChangeLog INSTALL NEWS README THANKS TODO
        ar-lib compile config.guess config.rpath
-       config.sub depcomp elisp-comp install-sh libversion.in mdate-sh
+       config.sub depcomp install-sh libversion.in mdate-sh
        missing mkinstalldirs py-compile texinfo.tex ylwrap),
      @libtool_files, @libtool_sometimes);
 
@@ -363,6 +363,9 @@ my $ac_gettext_location;
 # Whether AM_GNU_GETTEXT_INTL_SUBDIR has been seen.
 my $seen_gettext_intl = 0;
 
+# The arguments of the AM_EXTRA_RECURSIVE_TARGETS call (if any).
+my @extra_recursive_targets = ();
+
 # Lists of tags supported by Libtool.
 my %libtool_tags = ();
 # 1 if Libtool uses LT_SUPPORTED_TAG.  If it does, then it also
@@ -460,9 +463,11 @@ my %required_targets =
    'install-ps-am'   => 1,
    'install-info-am' => 1,
    'installcheck-am' => 1,
-   'uninstall-am' => 1,
-
-   'install-man' => 1,
+   'uninstall-am'    => 1,
+   'tags-am'         => 1,
+   'ctags-am'        => 1,
+   'cscopelist-am'   => 1,
+   'install-man'     => 1,
   );
 
 # Queue to push require_conf_file requirements to.
@@ -1104,11 +1109,11 @@ sub backname ($)
 
 ################################################################
 
-# 'silent-rules' mode handling functions.
+# Silent rules handling functions.
 
 # verbose_var (NAME)
 # ------------------
-# The public variable stem used to implement 'silent-rules'.
+# The public variable stem used to implement silent rules.
 sub verbose_var ($)
 {
     my ($name) = @_;
@@ -1117,7 +1122,7 @@ sub verbose_var ($)
 
 # verbose_private_var (NAME)
 # --------------------------
-# The naming policy for the private variables for 'silent-rules'.
+# The naming policy for the private variables for silent rules.
 sub verbose_private_var ($)
 {
     my ($name) = @_;
@@ -1126,9 +1131,9 @@ sub verbose_private_var ($)
 
 # define_verbose_var (NAME, VAL-IF-SILENT, [VAL-IF-VERBOSE])
 # ----------------------------------------------------------
-# For 'silent-rules' mode, setup VAR and dispatcher, to expand to
-# VAL-IF-SILENT if silent, to VAL-IF-VERBOSE (defaulting to empty)
-# if not.
+# For  silent rules, setup VAR and dispatcher, to expand to
+# VAL-IF-SILENT if silent, to VAL-IF-VERBOSE (defaulting to
+# empty) if not.
 sub define_verbose_var ($$;$)
 {
     my ($name, $silent_val, $verbose_val) = @_;
@@ -1137,21 +1142,19 @@ sub define_verbose_var ($$;$)
     my $pvar = verbose_private_var ($name);
     my $silent_var = $pvar . '_0';
     my $verbose_var = $pvar . '_1';
-    if (option 'silent-rules')
-      {
-       # For typical 'make's, 'configure' replaces AM_V (inside @@) with $(V)
-       # and AM_DEFAULT_V (inside @@) with $(AM_DEFAULT_VERBOSITY).
-       # For strict POSIX 2008 'make's, it replaces them with 0 or 1 instead.
-       # See AM_SILENT_RULES in m4/silent.m4.
-       define_variable ($var, '$(' . $pvar . '_@'.'AM_V'.'@)', INTERNAL);
-       define_variable ($pvar . '_', '$(' . $pvar . '_@'.'AM_DEFAULT_V'.'@)', 
INTERNAL);
-        Automake::Variable::define ($silent_var, VAR_AUTOMAKE, '', TRUE,
-                                    $silent_val, '', INTERNAL, VAR_ASIS)
-         if (! vardef ($silent_var, TRUE));
-        Automake::Variable::define ($verbose_var, VAR_AUTOMAKE, '', TRUE,
-                                    $verbose_val, '', INTERNAL, VAR_ASIS)
-         if (! vardef ($verbose_var, TRUE));
-}
+    # For typical 'make's, 'configure' replaces AM_V (inside @@) with $(V)
+    # and AM_DEFAULT_V (inside @@) with $(AM_DEFAULT_VERBOSITY).
+    # For strict POSIX 2008 'make's, it replaces them with 0 or 1 instead.
+    # See AM_SILENT_RULES in m4/silent.m4.
+    define_variable ($var, '$(' . $pvar . '_@'.'AM_V'.'@)', INTERNAL);
+    define_variable ($pvar . '_', '$(' . $pvar . '_@'.'AM_DEFAULT_V'.'@)',
+                     INTERNAL);
+    Automake::Variable::define ($silent_var, VAR_AUTOMAKE, '', TRUE,
+                                $silent_val, '', INTERNAL, VAR_ASIS)
+      if (! vardef ($silent_var, TRUE));
+    Automake::Variable::define ($verbose_var, VAR_AUTOMAKE, '', TRUE,
+                                $verbose_val, '', INTERNAL, VAR_ASIS)
+      if (! vardef ($verbose_var, TRUE));
 }
 
 # Above should not be needed in the general automake code.
@@ -1162,17 +1165,13 @@ sub define_verbose_var ($$;$)
 sub verbose_flag ($)
 {
     my ($name) = @_;
-    return '$(' . verbose_var ($name) . ')'
-      if (option 'silent-rules');
-    return '';
+    return '$(' . verbose_var ($name) . ')';
 }
 
 sub verbose_nodep_flag ($)
 {
     my ($name) = @_;
-    return '$(' . verbose_var ($name) . subst ('am__nodep') . ')'
-      if (option 'silent-rules');
-    return '';
+    return '$(' . verbose_var ($name) . subst ('am__nodep') . ')';
 }
 
 # silent_flag
@@ -1185,19 +1184,16 @@ sub silent_flag ()
 
 # define_verbose_tagvar (NAME)
 # ----------------------------
-# Engage the needed 'silent-rules' machinery for tag NAME.
+# Engage the needed silent rules machinery for tag NAME.
 sub define_verbose_tagvar ($)
 {
     my ($name) = @_;
-    if (option 'silent-rules')
-      {
-       define_verbose_var ($name, '@echo "  '. $name . ' ' x (8 - length 
($name)) . '" $@;');
-      }
+    define_verbose_var ($name, '@echo "  '. $name . ' ' x (8 - length ($name)) 
. '" $@;');
 }
 
 # define_verbose_texinfo
 # ----------------------
-# Engage the needed 'silent-rules' machinery for assorted texinfo commands.
+# Engage the needed silent rules machinery for assorted texinfo commands.
 sub define_verbose_texinfo ()
 {
   my @tagvars = ('DVIPS', 'MAKEINFO', 'INFOHTML', 'TEXI2DVI', 'TEXI2PDF');
@@ -1211,7 +1207,7 @@ sub define_verbose_texinfo ()
 
 # define_verbose_libtool
 # ----------------------
-# Engage the needed 'silent-rules' machinery for 'libtool --silent'.
+# Engage the needed silent rules machinery for 'libtool --silent'.
 sub define_verbose_libtool ()
 {
     define_verbose_var ('lt', '--silent');
@@ -1220,7 +1216,6 @@ sub define_verbose_libtool ()
 
 sub handle_silent ()
 {
-    return unless option 'silent-rules';
     # Define "$(AM_V_P)", expanding to a shell conditional that can be
     # used in make recipes to determine whether we are being run in
     # silent mode or not.  The choice of the name derives from the LISP
@@ -1228,7 +1223,7 @@ sub handle_silent ()
     # also "the '-P' convention" in the Jargon File); we do so for lack
     # of a better convention.
     define_verbose_var ('P', 'false', ':');
-    # *Always* provide the user with 'AM_V_GEN' for 'silent-rules' mode.
+    # *Always* provide the user with '$(AM_V_GEN)', unconditionally.
     define_verbose_tagvar ('GEN');
     define_verbose_var ('at', '@');
 }
@@ -1254,10 +1249,6 @@ sub handle_options
       return 1 if process_option_list (@options);
     }
 
-  # Override portability-recursive warning.
-  switch_warning ('no-portability-recursive')
-    if option 'silent-rules';
-
   if ($strictness == GNITS)
     {
       set_option ('readme-alpha', INTERNAL);
@@ -1321,7 +1312,7 @@ sub handle_languages
     {
        # Include auto-dep code.  Don't include it if DEP_FILES would
        # be empty.
-       if (&saw_sources_p (0) && keys %dep_files)
+       if (keys %extension_seen && keys %dep_files)
        {
            # Set location of depcomp.
            &define_variable ('depcomp',
@@ -2978,35 +2969,15 @@ sub handle_scripts
 ## Handling Texinfo files.  ##
 ## ------------------------ ##
 
-# ($OUTFILE, $VFILE, @CLEAN_FILES)
+# ($OUTFILE, $VFILE)
 # &scan_texinfo_file ($FILENAME)
 # ------------------------------
 # $OUTFILE     - name of the info file produced by $FILENAME.
 # $VFILE       - name of the version.texi file used (undef if none).
-# @CLEAN_FILES - list of byproducts (indexes etc.)
 sub scan_texinfo_file ($)
 {
   my ($filename) = @_;
 
-  # Some of the following extensions are always created, no matter
-  # whether indexes are used or not.  Other (like cps, fns, ... pgs)
-  # are only created when they are used.  We used to scan $FILENAME
-  # for their use, but that is not enough: they could be used in
-  # included files.  We can't scan included files because we don't
-  # know the include path.  Therefore we always erase these files, no
-  # matter whether they are used or not.
-  #
-  # (tmp is only created if an @macro is used and a certain e-TeX
-  # feature is not available.)
-  my %clean_suffixes =
-    map { $_ => 1 } (qw(aux log toc tmp
-                       cp cps
-                       fn fns
-                       ky kys
-                       vr vrs
-                       tp tps
-                       pg pgs)); # grep 'new.*index' texinfo.tex
-
   my $texi = new Automake::XFile "< $filename";
   verb "reading $filename";
 
@@ -3034,23 +3005,6 @@ sub scan_texinfo_file ($)
        {
          $vfile = $1;
        }
-
-      # Try to find new or unused indexes.
-
-      # Creating a new category of index.
-      elsif (/address@hidden(code)?index (\w+)/)
-       {
-         $clean_suffixes{$2} = 1;
-         $clean_suffixes{"$2s"} = 1;
-       }
-
-      # Merging an index into an another.
-      elsif (/address@hidden(code)?index (\w+) (\w+)/)
-       {
-         delete $clean_suffixes{"$2s"};
-         $clean_suffixes{"$3s"} = 1;
-       }
-
     }
 
   if (! $outfile)
@@ -3061,8 +3015,7 @@ sub scan_texinfo_file ($)
 
   my $infobase = basename ($filename);
   $infobase =~ s/\.te?xi(nfo)?$//;
-  return ($outfile, $vfile,
-         map { "$infobase.$_" } (sort keys %clean_suffixes));
+  return ($outfile, $vfile);
 }
 
 
@@ -3202,10 +3155,13 @@ sub handle_texinfo_helper ($)
 
       # If 'version.texi' is referenced by input file, then include
       # automatic versioning capability.
-      my ($out_file, $vtexi, @clean_files) =
+      my ($out_file, $vtexi) =
        scan_texinfo_file ("$relative_dir/$texi")
        or next;
-      push (@mostly_cleans, @clean_files);
+      # Directory of auxiliary files and build by-products used by texi2dvi
+      # and texi2pdf.
+      push @mostly_cleans, "$infobase.t2d";
+      push @mostly_cleans, "$infobase.t2p";
 
       # If the Texinfo source is in a subdirectory, create the
       # resulting info in this subdirectory.  If it is in the current
@@ -3393,11 +3349,6 @@ sub handle_texinfo_helper ($)
       $texinfodir = ('$(srcdir)/'
                     . dirname (variable_value ('TEXINFO_TEX')));
     }
-  elsif (option 'cygnus')
-    {
-      $texinfodir = '$(top_srcdir)/../texinfo';
-      define_variable ('TEXINFO_TEX', "$texinfodir/texinfo.tex", INTERNAL);
-    }
   elsif ($config_aux_dir_set_in_configure_ac)
     {
       $texinfodir = $am_config_aux_dir;
@@ -3636,85 +3587,43 @@ sub handle_data
 # Handle TAGS.
 sub handle_tags
 {
-    my @tag_deps = ();
-    my @ctag_deps = ();
-    my @cscope_deps = ();
-    if (var ('SUBDIRS'))
-    {
-       $output_rules .= ("tags-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) tags); \\\n"
-                         . "\tdone\n");
-       push (@tag_deps, 'tags-recursive');
-       &depend ('.PHONY', 'tags-recursive');
-       &depend ('.MAKE', 'tags-recursive');
-
-       $output_rules .= ("ctags-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) ctags); \\\n"
-                         . "\tdone\n");
-       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)
-       || var ('ETAGS_ARGS')
-       || @tag_deps)
-    {
-       my @config;
-       foreach my $spec (@config_headers)
-       {
-           my ($out, @ins) = split_config_file_spec ($spec);
-           foreach my $in (@ins)
-             {
-               # If the config header source is in this directory,
-               # require it.
-               push @config, basename ($in)
-                 if $relative_dir eq dirname ($in);
-             }
-       }
-       $output_rules .= &file_contents ('tags',
-                                        new Automake::Location,
-                                        CONFIG    => "@config",
-                                        TAGSDIRS  => "@tag_deps",
-                                        CTAGSDIRS => "@ctag_deps",
-                                        CSCOPEDIRS => "@cscope_deps");
+    my @config;
+    foreach my $spec (@config_headers)
+      {
+        my ($out, @ins) = split_config_file_spec ($spec);
+       foreach my $in (@ins)
+         {
+            # If the config header source is in this directory,
+           # require it.
+           push @config, basename ($in)
+              if $relative_dir eq dirname ($in);
+          }
+      }
 
+    define_variable ('am__tagged_files',
+                     '$(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)'
+                     . "@config", INTERNAL);
+
+    if (rvar('am__tagged_files')->value_as_list_recursive
+          || var ('ETAGS_ARGS') || var ('SUBDIRS'))
+      {
+       $output_rules .= &file_contents ('tags', new Automake::Location);
        set_seen 'TAGS_DEPENDENCIES';
-    }
-    elsif (reject_var ('TAGS_DEPENDENCIES',
-                      "it doesn't make sense to define 'TAGS_DEPENDENCIES'"
-                      . " without\nsources or 'ETAGS_ARGS'"))
-    {
-    }
+      }
     else
-    {
+      {
+        reject_var ('TAGS_DEPENDENCIES',
+                   "it doesn't make sense to define 'TAGS_DEPENDENCIES'"
+                   . " without\nsources or 'ETAGS_ARGS'");
        # Every Makefile must define some sort of TAGS rule.
        # 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 and cscope.
-       $output_rules .= "ctags: CTAGS\nCTAGS:\n\n";
-       $output_rules .= "cscope cscopelist:\n\n";
-    }
+       # to fail because some subdirectory failed.  Ditto ctags and
+        # cscope.
+        $output_rules .=
+          "tags TAGS:\n\n" .
+          "ctags CTAGS:\n\n" .
+          "cscope cscopelist:\n\n";
+      }
 }
 
 
@@ -3743,26 +3652,6 @@ sub user_phony_rule ($)
 }
 
 
-# $BOOLEAN
-# &for_dist_common ($A, $B)
-# -------------------------
-# Subroutine for &handle_dist: sort files to dist.
-#
-# We put README first because it then becomes easier to make a
-# Usenet-compliant shar file (in these, README must be first).
-#
-# FIXME: do more ordering of files here.
-sub for_dist_common
-{
-    return 0
-       if $a eq $b;
-    return -1
-       if $a eq 'README';
-    return 1
-       if $b eq 'README';
-    return $a cmp $b;
-}
-
 # handle_dist
 # -----------
 # Handle 'dist' target.
@@ -3873,7 +3762,7 @@ sub handle_dist ()
   # Files to distributed.  Don't use ->value_as_list_recursive
   # as it recursively expands '$(dist_pkgdata_DATA)' etc.
   my @dist_common = split (' ', rvar ('DIST_COMMON')->variable_value);
-  @dist_common = uniq (sort for_dist_common (@dist_common));
+  @dist_common = uniq @dist_common;
   variable_delete 'DIST_COMMON';
   define_pretty_variable ('DIST_COMMON', TRUE, INTERNAL, @dist_common);
 
@@ -4136,8 +4025,8 @@ sub handle_configure ($$$@)
   define_pretty_variable ('am__configure_deps', TRUE, INTERNAL,
                          @configuredeps);
 
-  my $automake_options = '--' . (global_option 'cygnus' ? 'cygnus' : 
$strictness_name)
-                        . (global_option 'no-dependencies' ? ' --ignore-deps' 
: '');
+  my $automake_options = '--' . $strictness_name .
+                        (global_option 'no-dependencies' ? ' --ignore-deps' : 
'');
 
   $output_rules .= file_contents
     ('configure',
@@ -4601,6 +4490,32 @@ sub handle_all ($)
       }
 }
 
+# Generate helper targets for user recursion, where needed.
+sub handle_user_recursion ()
+{
+  return unless @extra_recursive_targets;
+
+  define_pretty_variable ('am__extra_recursive_targets', TRUE, INTERNAL,
+                          map { "$_-recursive" } @extra_recursive_targets);
+  my $aux = var ('SUBDIRS') ? 'recursive' : 'am';
+  foreach my $target (@extra_recursive_targets)
+    {
+      # This allows the default target's rules to be overridden in
+      # Makefile.am.
+      user_phony_rule ($target);
+      depend ("$target", "$target-$aux");
+      depend ("$target-am", "$target-local");
+      # Every user-defined recursive target 'foo' *must* have a valid
+      # associated 'foo-local' rule; we define it as an empty rule by
+      # default, so that the user can transparently extend it in his
+      # own Makefile.am.
+      pretty_print_rule ("$target-local:");
+      # $target-recursive might as well be undefined, so do not add
+      # it here; it's taken care of in subdirs.am anyway.
+      depend (".PHONY", "$target-am", "$target-local");
+    }
+}
+
 
 # &do_check_merge_target ()
 # -------------------------
@@ -4611,25 +4526,16 @@ sub do_check_merge_target ()
   push @check_tests, 'check-local'
     if user_phony_rule 'check-local';
 
-  # In --cygnus mode, check doesn't depend on all.
-  if (option 'cygnus')
+  # The check target must depend on the local equivalent of
+  # 'all', to ensure all the primary targets are built.  Then it
+  # must build the local check rules.
+  $output_rules .= "check-am: all-am\n";
+  if (@check)
     {
-      # Just run the local check rules.
-      pretty_print_rule ('check-am:', "\t\t", @check);
-    }
-  else
-    {
-      # The check target must depend on the local equivalent of
-      # 'all', to ensure all the primary targets are built.  Then it
-      # must build the local check rules.
-      $output_rules .= "check-am: all-am\n";
-      if (@check)
-        {
-         pretty_print_rule ("\t\$(MAKE) \$(AM_MAKEFLAGS)", "\t  ",
-                            @check);
-         depend ('.MAKE', 'check-am');
-       }
+      pretty_print_rule ("\t\$(MAKE) \$(AM_MAKEFLAGS)", "\t  ", @check);
+      depend ('.MAKE', 'check-am');
     }
+
   if (@check_tests)
     {
       pretty_print_rule ("\t\$(MAKE) \$(AM_MAKEFLAGS)", "\t  ",
@@ -4820,9 +4726,7 @@ sub handle_tests_dejagnu
 sub handle_per_suffix_test
 {
   my ($test_suffix, %transform) = @_;
-  my ($pfx, $generic, $parallel_tests_option, $am_exeext);
-  prog_error ("called with 'parallel-tests' option not set")
-    unless $parallel_tests_option = option 'parallel-tests';
+  my ($pfx, $generic, $am_exeext);
   if ($test_suffix eq '')
     {
       $pfx = '';
@@ -4839,13 +4743,12 @@ sub handle_per_suffix_test
                                                     : 'FALSE';
     }
   # The "test driver" program, deputed to handle tests protocol used by
-  # test scripts.  By default, it's assumed that no protocol is used,
-  # so we fall back to the old "parallel-tests" behaviour, implemented
-  # by the 'test-driver' auxiliary script.
+  # test scripts.  By default, it's assumed that no protocol is used, so
+  # we fall back to the old behaviour, implemented by the 'test-driver'
+  # auxiliary script.
   if (! var "${pfx}LOG_DRIVER")
     {
-      require_conf_file ($parallel_tests_option->{position}, FOREIGN,
-                        'test-driver');
+      require_conf_file ("parallel-tests", FOREIGN, 'test-driver');
       define_variable ("${pfx}LOG_DRIVER",
                        "\$(SHELL) $am_config_aux_dir/test-driver",
                        INTERNAL);
@@ -4904,8 +4807,7 @@ sub handle_tests
       push (@check_tests, 'check-TESTS');
       my $check_deps = "@check";
       $output_rules .= &file_contents ('check', new Automake::Location,
-                                      COLOR => !! option 'color-tests',
-                                      PARALLEL_TESTS => !! option 
'parallel-tests',
+                                      SERIAL_TESTS => !! option 'serial-tests',
                                        CHECK_DEPS => $check_deps);
 
       # Tests that are known programs should have $(EXEEXT) appended.
@@ -4914,7 +4816,7 @@ sub handle_tests
       append_exeext { exists $known_programs{$_[0]} } 'XFAIL_TESTS'
        if (var ('XFAIL_TESTS'));
 
-      if (my $parallel_tests = option 'parallel-tests')
+      if (! option 'serial-tests')
         {
          define_variable ('TEST_SUITE_LOG', 'test-suite.log', INTERNAL);
          my $suff = '.test';
@@ -4964,7 +4866,7 @@ sub handle_tests
                if ($val =~ /(\$\((top_)?srcdir\))\//o)
                  {
                    msg ('error', $subvar->rdef ($cond)->location,
-                        "parallel-tests: using '$1' in TESTS is currently 
broken: '$val'");
+                        "using '$1' in TESTS is currently broken: '$val'");
                  }
 
                foreach my $test_suffix (@test_suffixes)
@@ -5037,8 +4939,6 @@ sub handle_emacs_lisp
 
   require_variables ($elfiles[0][0], "Emacs Lisp sources seen", TRUE,
                     'EMACS', 'lispdir');
-  require_conf_file ($elfiles[0][0], FOREIGN, 'elisp-comp');
-  &define_variable ('elisp_comp', "$am_config_aux_dir/elisp-comp", INTERNAL);
 }
 
 # Handle Python
@@ -5229,15 +5129,15 @@ sub scan_autoconf_traces ($)
                AC_REQUIRE_AUX_FILE => 1,
                AC_SUBST_TRACE => 1,
                AM_AUTOMAKE_VERSION => 1,
-                AM_PROG_MKDIR_P => 0, # FIXME: to be removed in 1.13
+                AM_PROG_MKDIR_P => 0, # FIXME: to be removed in 1.14
                AM_CONDITIONAL => 2,
+               AM_EXTRA_RECURSIVE_TARGETS => 1,
                AM_GNU_GETTEXT => 0,
                AM_GNU_GETTEXT_INTL_SUBDIR => 0,
                AM_INIT_AUTOMAKE => 0,
                AM_MAINTAINER_MODE => 0,
                AM_PROG_AR => 0,
                AM_PROG_CC_C_O => 0,
-               AM_SILENT_RULES => 0,
                _AM_SUBST_NOTMAKE => 1,
                _AM_COND_IF => 1,
                _AM_COND_ELSE => 1,
@@ -5385,7 +5285,7 @@ sub scan_autoconf_traces ($)
 
          $seen_automake_version = 1;
        }
-      elsif ($macro eq 'AM_PROG_MKDIR_P') # FIXME: to be removed in 1.13
+      elsif ($macro eq 'AM_PROG_MKDIR_P') # FIXME: to be removed in 1.14
        {
          msg 'obsolete', $where, <<'EOF';
 The 'AM_PROG_MKDIR_P' macro is deprecated, and will soon be removed.
@@ -5397,6 +5297,13 @@ EOF
        {
          $configure_cond{$args[1]} = $where;
        }
+      elsif ($macro eq 'AM_EXTRA_RECURSIVE_TARGETS')
+       {
+          # Empty leading/trailing fields might be produced by split,
+          # hence the grep is really needed.
+          push @extra_recursive_targets,
+               grep (/./, (split /\s+/, $args[1]));
+       }
       elsif ($macro eq 'AM_GNU_GETTEXT')
        {
          $seen_gettext = $where;
@@ -5438,10 +5345,6 @@ EOF
        {
          $seen_cc_c_o = $where;
        }
-      elsif ($macro eq 'AM_SILENT_RULES')
-        {
-         set_global_option ('silent-rules', $where);
-       }
       elsif ($macro eq '_AM_COND_IF')
         {
          cond_stack_if ('', $args[1], $where);
@@ -5598,26 +5501,6 @@ sub scan_autoconf_files ()
 
 ################################################################
 
-# Set up for Cygnus mode.
-sub check_cygnus
-{
-  my $cygnus = option 'cygnus';
-  return unless $cygnus;
-
-  # This feature is deprecated, will be removed in the next
-  # Automake major release.
-  msg 'obsolete', $cygnus->get,
-      "support for Cygnus-style trees is deprecated";
-
-  set_strictness ('foreign');
-  set_option ('no-installinfo', $cygnus);
-  set_option ('no-dependencies', $cygnus);
-  set_option ('no-dist', $cygnus);
-
-  err_ac "'AM_MAINTAINER_MODE' required when --cygnus specified"
-    if !$seen_maint_mode;
-}
-
 # Do any extra checking for GNU standards.
 sub check_gnu_standards
 {
@@ -6028,76 +5911,9 @@ sub resolve_linker
 sub saw_extension
 {
     my ($ext) = @_;
-    if (! defined $extension_seen{$ext})
-    {
-       $extension_seen{$ext} = 1;
-    }
-    else
-    {
-       ++$extension_seen{$ext};
-    }
+    $extension_seen{$ext} = 1;
 }
 
-# Return the number of files seen for a given language.  Knows about
-# special cases we care about.  FIXME: this is hideous.  We need
-# something that involves real language objects.  For instance yacc
-# and yaccxx could both derive from a common yacc class which would
-# know about the strange ylwrap requirement.  (Or better yet we could
-# just not support legacy yacc!)
-sub count_files_for_language
-{
-    my ($name) = @_;
-
-    my @names;
-    if ($name eq 'yacc' || $name eq 'yaccxx')
-    {
-       @names = ('yacc', 'yaccxx');
-    }
-    elsif ($name eq 'lex' || $name eq 'lexxx')
-    {
-       @names = ('lex', 'lexxx');
-    }
-    else
-    {
-       @names = ($name);
-    }
-
-    my $r = 0;
-    foreach $name (@names)
-    {
-       my $lang = $languages{$name};
-       foreach my $ext (@{$lang->extensions})
-       {
-           $r += $extension_seen{$ext}
-               if defined $extension_seen{$ext};
-       }
-    }
-
-    return $r
-}
-
-# Called to ask whether source files have been seen . If HEADERS is 1,
-# headers can be included.
-sub saw_sources_p
-{
-    my ($headers) = @_;
-
-    # count all the sources
-    my $count = 0;
-    foreach my $val (values %extension_seen)
-    {
-       $count += $val;
-    }
-
-    if (!$headers)
-    {
-       $count -= count_files_for_language ('header');
-    }
-
-    return $count > 0;
-}
-
-
 # register_language (%ATTRIBUTE)
 # ------------------------------
 # Register a single language.
@@ -6863,8 +6679,6 @@ sub transform_token ($$$)
 #   - replaces %KEY% with $VAL,
 #   - enables/disables ?KEY? and ?!KEY?,
 #   - replaces %?KEY% with TRUE or FALSE.
-#   - replaces %KEY?IFTRUE%, %KEY:IFFALSE%, and %KEY?IFTRUE:IFFALSE% with
-#     IFTRUE / IFFALSE, as appropriate.
 sub transform ($$)
 {
   my ($token, $transform) = @_;
@@ -6876,11 +6690,6 @@ sub transform ($$)
     {
       return transform_token ($token, $transform, $1);
     }
-  # %KEY?IFTRUE%, %KEY:IFFALSE%, and %KEY?IFTRUE:IFFALSE%.
-  elsif ($token =~ /^%([\w\-]+)(?:\?([^?:%]+))?(?::([^?:%]+))?%$/)
-    {
-      return transform_token ($token, $transform, $1) ? ($2 || '') : ($3 || 
'');
-    }
   # %?KEY%.
   elsif ($token =~ /^%\?([\w\-]+)%$/)
     {
@@ -6911,8 +6720,7 @@ sub preprocess_file ($%)
 
   # Complete %transform with global options.
   # Note that %transform goes last, so it overrides global options.
-  %transform = ('CYGNUS'      => !! option 'cygnus',
-                'MAINTAINER-MODE'
+  %transform = ( 'MAINTAINER-MODE'
                 => $seen_maint_mode ? subst ('MAINTAINER_MODE_TRUE') : '',
 
                 'XZ'          => !! option 'dist-xz',
@@ -6925,7 +6733,6 @@ sub preprocess_file ($%)
 
                 'INSTALL-INFO' =>  ! option 'no-installinfo',
                 'INSTALL-MAN'  =>  ! option 'no-installman',
-                'HAVE-MANS'    => !! var ('MANS'),
                 'CK-NEWS'      => !! option 'check-news',
 
                 'SUBDIRS'      => !! var ('SUBDIRS'),
@@ -6958,7 +6765,6 @@ sub preprocess_file ($%)
 
   # Substitute Automake template tokens.
   s/(?: % \?? [\w\-]+ %
-      | % [\w\-]+ (?:\?[^?:%]+)? (?::[^?:%]+)? %
       | \? !? [\w\-]+ \?
     )/transform($&, \%transform)/gex;
   # transform() may have added some ##%-comments to strip.
@@ -8046,7 +7852,6 @@ sub generate_makefile ($$)
     if var 'DIST_SUBDIRS' && ! var 'SUBDIRS';
 
   # Check first, because we might modify some state.
-  check_cygnus;
   check_gnu_standards;
   check_gnits_standards;
 
@@ -8081,6 +7886,7 @@ sub generate_makefile ($$)
   handle_data;
   handle_headers;
   handle_subdirs;
+  handle_user_recursion;
   handle_tags;
   handle_minor_options;
   # Must come after handle_programs so that %known_programs is up-to-date.
@@ -8231,7 +8037,6 @@ Dependency tracking:
       --include-deps     enable dependency tracking code
 
 Flavors:
-      --cygnus           assume program is part of Cygnus-style tree
       --foreign          set strictness to foreign
       --gnits            set strictness to gnits
       --gnu              set strictness to gnu
@@ -8289,7 +8094,6 @@ EOF
 sub parse_arguments ()
 {
   my $strict = 'gnu';
-  my $cygnus = 0;
   my $ignore_deps = 0;
   my @warnings = ();
 
@@ -8302,7 +8106,6 @@ sub parse_arguments ()
      'gnu'             => sub { $strict = 'gnu'; },
      'gnits'           => sub { $strict = 'gnits'; },
      'foreign'         => sub { $strict = 'foreign'; },
-     'cygnus'          => \$cygnus,
      'include-deps'    => sub { $ignore_deps = 0; },
      'i|ignore-deps'   => sub { $ignore_deps = 1; },
      'no-force'        => sub { $force_generation = 0; },
@@ -8318,7 +8121,6 @@ sub parse_arguments ()
 
   set_strictness ($strict);
   my $cli_where = new Automake::Location;
-  set_global_option ('cygnus', $cli_where) if $cygnus;
   set_global_option ('no-dependencies', $cli_where) if $ignore_deps;
   for my $warning (@warnings)
     {
diff --git a/configure.ac b/configure.ac
index 543cf10..5f410e0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -16,7 +16,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 AC_PREREQ([2.69])
-AC_INIT([GNU Automake], [1.12.6a], address@hidden)
+AC_INIT([GNU Automake], [1.13.0a], address@hidden)
 
 AC_CONFIG_SRCDIR([automake.in])
 AC_CONFIG_AUX_DIR([lib])
@@ -40,7 +40,7 @@ dnl We call AC_PROG_CC in an unusual way, and only for use in 
our
 dnl testsuite, so also use 'no-dependencies' and 'no-define' among
 dnl the automake options to avoid bloating and potential problems.
 AM_INIT_AUTOMAKE([dist-xz filename-length-max=99 color-tests
-                  parallel-tests silent-rules no-define no-dependencies])
+                  no-define no-dependencies])
 
 ## Keep this on a line of its own, since it must be found and processed
 ## by the 'update-copyright' rule in our Makefile.
@@ -139,7 +139,7 @@ AC_CHECK_PROGS([LEX], [lex flex], [false])
 # following tests, but some users were unable to figure out that their
 # installation was broken since --version appeared to work.
 
-required_autoconf_version=2.62
+required_autoconf_version=2.65
 AC_CACHE_CHECK([whether autoconf is installed], [am_cv_autoconf_installed],
 [if AM_RUN_LOG([$am_AUTOCONF --version]);
 then
@@ -605,9 +605,7 @@ AC_SUBST([EXEEXT])
 ## ---------------------- ##
 
 AC_CONFIG_FILES([Makefile])
-
 AC_CONFIG_LINKS([GNUmakefile:GNUmakefile])
-AC_CONFIG_LINKS([defs:defs])
 
 AC_CONFIG_FILES([t/wrap/aclocal-${APIVERSION}:t/wrap/aclocal.in],
                 [chmod +x t/wrap/aclocal-${APIVERSION}],
diff --git a/contrib/check-html.am b/contrib/check-html.am
index 4495ac0..36a5dbe 100644
--- a/contrib/check-html.am
+++ b/contrib/check-html.am
@@ -29,18 +29,17 @@ mostlyclean-check-html:
        rm -f $(TEST_SUITE_HTML)
 
 .log.html:
-       @list='$(RST2HTML) $$RST2HTML rst2html rst2html.py';            \
-       for r2h in $$list; do                                           \
-         if ($$r2h --version) >/dev/null 2>&1; then                    \
-           R2H=$$r2h;                                                  \
-         fi;                                                           \
-       done;                                                           \
-       if test -z "$$R2H"; then                                        \
-         echo >&2 "cannot find rst2html, cannot create $@";            \
+       @list='$(RST2HTML) rst2html rst2html.py';                       \
+       while :; do                                                     \
+         for r2h in $$list; do                                         \
+           if ($$r2h --version) >/dev/null 2>&1; then break 2;         \
+           else :; fi;                                                 \
+         done;                                                         \
+         echo "cannot find rst2html, cannot create $@" >&2;            \
          exit 2;                                                       \
-       fi;                                                             \
-       $$R2H $< >address@hidden
-       @mv address@hidden $@
+       done;                                                           \
+       $$r2h $(AM_RST2HTMLFLAGS) $(RST2HTMLFLAGS) $< >address@hidden           
\
+         && mv -f address@hidden $@
 
 # Be sure to run check first, and then to convert the result.
 # Beware of concurrent executions.  Run "check" not "check-TESTS", as
diff --git a/contrib/t/help-multilib.sh b/contrib/t/help-multilib.sh
new file mode 100755
index 0000000..7973d92
--- /dev/null
+++ b/contrib/t/help-multilib.sh
@@ -0,0 +1,32 @@
+#! /bin/sh
+# Copyright (C) 2010-2012 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 our macro 'AM_ENABLE_MULTILIB' adds proper text to
+# the configure help screen.
+
+. test-init.sh
+
+cat > configure.ac <<END
+AC_INIT([$me], [1.0])
+AM_ENABLE_MULTILIB
+END
+
+cat "$am_top_srcdir"/contrib/multilib/multi.m4 > aclocal.m4
+$AUTOCONF
+
+grep_configure_help --enable-multilib ' many library versions \(default\)'
+
+:
diff --git a/contrib/t/local.am b/contrib/t/local.am
new file mode 100644
index 0000000..3859c70
--- /dev/null
+++ b/contrib/t/local.am
@@ -0,0 +1,25 @@
+# Copyright (C) 1995-2012 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Automake: tests for stuff in 'contrib/'.
+
+## Relative to the top-level directory.
+contrib_testsuite_dir = contrib/t
+
+contrib_TESTS = \
+  $(contrib_testsuite_dir)/parallel-tests-html.sh \
+  $(contrib_testsuite_dir)/parallel-tests-html-recursive.sh \
+  $(contrib_testsuite_dir)/help-multilib.sh \
+  $(contrib_testsuite_dir)/multilib.sh
diff --git a/contrib/t/multilib.sh b/contrib/t/multilib.sh
new file mode 100755
index 0000000..bfcdb53
--- /dev/null
+++ b/contrib/t/multilib.sh
@@ -0,0 +1,160 @@
+#! /bin/sh
+# Copyright (C) 2003-2012 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 multilib support.
+# Based on a test case from Ralf Corsepius.
+
+required='gcc GNUmake'
+. test-init.sh
+
+mldir=$am_top_srcdir/contrib/multilib
+mkdir m4
+cp "$mldir"/config-ml.in "$mldir"/symlink-tree .
+cp "$mldir"/multi.m4 m4
+
+ACLOCAL_PATH=${ACLOCAL_PATH+"$ACLOCAL_PATH:"}$(pwd)/m4
+export ACLOCAL_PATH
+
+cat >configure.ac <<'END'
+AC_INIT([multlib], [1.0])
+AC_CONFIG_SRCDIR(libfoo/foo.c)
+AC_CONFIG_AUX_DIR(.)
+AM_INIT_AUTOMAKE
+AC_CONFIG_FILES([Makefile])
+AC_CONFIG_SUBDIRS(libfoo)
+AC_CONFIG_SUBDIRS(libbar)
+AC_OUTPUT
+END
+
+cat >mycc <<'END'
+#! /bin/sh
+case ${1+"$@"} in
+ *-print-multi-lib*)
+  echo ".;"
+  echo "debug;@g"
+  exit 0 ;;
+esac
+gcc ${1+"$@"}
+END
+
+chmod +x mycc
+PATH=$(pwd)$PATH_SEPARATOR$PATH; export PATH
+
+cat >Makefile.am <<'EOF'
+SUBDIRS = @subdirs@
+EXTRA_DIST = config-ml.in symlink-tree
+check-all:
+       test -f debug/libfoo/libfoo.a
+       test -f debug/libbar/libbar.a
+       test -f libfoo/libfoo.a
+       test -f libbar/libbar.a
+EOF
+
+# libfoo tests multilib supports when there are no subdirectories
+# libbar tests multilib supports when there are subdirectories
+
+mkdir libfoo
+cp "$mldir"/multilib.am libfoo/
+
+cat >libfoo/configure.ac <<'END'
+AC_PREREQ(2.57)
+AC_INIT(libfoo, 0.1, address@hidden)
+AC_CONFIG_SRCDIR(foo.c)
+# Apparently it doesn't work to have auxdir=.. when
+# multilib uses symlinked trees.
+AC_CONFIG_AUX_DIR(.)
+AM_INIT_AUTOMAKE
+AC_PROG_CC
+AM_PROG_AR
+AC_PROG_RANLIB
+AM_ENABLE_MULTILIB(Makefile,[..])
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
+END
+
+cat >libfoo/Makefile.am <<'END'
+noinst_LIBRARIES = libfoo.a
+libfoo_a_SOURCES = foo.c
+include $(top_srcdir)/multilib.am
+END
+
+: > libfoo/foo.c
+
+mkdir libbar
+cp "$mldir"/multilib.am libbar/
+
+cat >libbar/configure.ac <<'END'
+AC_PREREQ(2.57)
+AC_INIT(libbar, 0.1, address@hidden)
+# Apparently it doesn't work to have auxdir=.. when
+# multilib uses symlinked trees.
+AC_CONFIG_AUX_DIR(.)
+AM_INIT_AUTOMAKE
+AC_PROG_CC
+AM_PROG_AR
+AC_PROG_RANLIB
+AM_ENABLE_MULTILIB(Makefile,[..])
+AC_CONFIG_FILES([Makefile sub/Makefile])
+AC_OUTPUT
+END
+
+cat >libbar/Makefile.am <<'END'
+SUBDIRS = sub
+noinst_LIBRARIES = libbar.a
+libbar_a_SOURCES = bar.c
+include $(top_srcdir)/multilib.am
+END
+
+mkdir libbar/sub
+echo 'include $(top_srcdir)/multilib.am' >libbar/sub/Makefile.am
+: > libbar/bar.c
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE --add-missing
+
+cd libfoo
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE --add-missing
+cd ..
+
+cd libbar
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE --add-missing
+cd ..
+
+# Check VPATH builds
+mkdir build
+cd build
+../configure --enable-multilib CC=mycc
+$MAKE
+test -f debug/libfoo/libfoo.a
+test -f debug/libbar/libbar.a
+test -f libfoo/libfoo.a
+test -f libbar/libbar.a
+$MAKE install
+$MAKE distcleancheck
+
+# Check standard builds.
+cd ..
+# Why to I have to specify --with-target-subdir?
+./configure --enable-multilib --with-target-subdir=. CC=mycc
+$MAKE check
+DISTCHECK_CONFIGURE_FLAGS='--enable-multilib CC=mycc' $MAKE distcheck
+
+:
diff --git a/contrib/t/parallel-tests-html-recursive.sh 
b/contrib/t/parallel-tests-html-recursive.sh
new file mode 100755
index 0000000..8d038ef
--- /dev/null
+++ b/contrib/t/parallel-tests-html-recursive.sh
@@ -0,0 +1,163 @@
+#! /bin/sh
+# Copyright (C) 2012 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/>.
+
+# Recursive use of 'check-html'.  See Automake bug#11287.
+
+. test-init.sh
+
+# Try the variants that are tried in check-html.am.
+while :; do
+  for r2h in $RST2HTML rst2html rst2html.py; do
+    echo "$me: running $r2h --version"
+    $r2h --version && break 2
+    : For shells with busted 'set -e'.
+  done
+  skip_all_ "no proper rst2html program found"
+done
+unset r2h
+
+cp "$am_top_srcdir"/contrib/check-html.am . \
+  || fatal_ "cannot fetch 'check-html.am' from contrib"
+
+cat >> configure.ac << 'END'
+AM_EXTRA_RECURSIVE_TARGETS([check-html])
+AC_CONFIG_FILES([sub/Makefile sub/more/Makefile])
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+SUBDIRS = sub
+EXTRA_DIST = $(TESTS)
+TEST_SUITE_LOG = mylog.log
+TESTS = foo.test bar.sh mu
+XFAIL_TESTS = bar.sh
+check_SCRIPTS = bla
+bla:
+       echo '#!/bin/sh' > address@hidden
+       echo 'echo Blah Blah Blah' >> address@hidden
+       chmod a+x,a-w address@hidden
+       mv -f address@hidden $@
+CLEANFILES = bla
+include $(srcdir)/check-html.am
+END
+
+mkdir sub
+echo SUBDIRS = more > sub/Makefile.am
+
+mkdir sub/more
+cat > sub/more/Makefile.am << 'END'
+include $(top_srcdir)/check-html.am
+TEST_EXTENSIONS = .test .sh
+TESTS = sh.sh test.test
+LOG_COMPILER = true
+test.log: sh.log
+nodist_check_DATA = x.txt
+$(nodist_check_DATA):
+       echo $@ > $@
+CLEANFILES = $(nodist_check_DATA)
+EXTRA_DIST = $(TESTS)
+END
+
+cat > foo.test <<'END'
+#! /bin/sh
+./bla
+exit 77
+END
+
+cat > bar.sh <<'END'
+#! /bin/sh
+echo "this is $0"
+exit 1
+END
+
+cat > mu <<'END'
+#! /bin/sh
+set -x
+test -f sub/more/test.log
+test -f sub/more/sh.log
+END
+
+cat > sub/more/test.test << 'END'
+#!/bin/sh
+echo "this is $0"
+set -x
+test -f sh.log
+test -f x.txt
+exit 77
+END
+
+cat > sub/more/sh.sh << 'END'
+#!/bin/sh
+set -x
+test ! -f test.log
+test -f x.txt
+END
+
+
+cat > sub/more/mu << 'END'
+#!/bin/sh
+exit 99
+END
+
+chmod a+x foo.test bar.sh mu sub/more/test.test sub/more/sh.sh
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
+
+./configure
+
+$MAKE check-html
+grep 'Blah Blah Blah' mylog.html
+grep 'this is .*bar\.sh' mylog.html
+grep 'this is .*test\.test' sub/more/test-suite.html
+# check-html should cause check_SCRIPTS and check_DATA to be created.
+test -f bla
+test -f sub/more/x.txt
+
+# "make clean" should remove HTML files.
+$MAKE clean
+test ! -e mylog.html
+test ! -e sub/more/test-suite.html
+test ! -e bla
+test ! -e sub/more/x.txt
+
+# Create HTML output for individual tests.
+
+$MAKE bla
+$MAKE foo.html bar.sh.html
+grep 'Blah Blah Blah' foo.html
+grep 'this is .*bar\.sh' bar.sh.html
+test ! -e mu.hml
+
+ocwd=$(pwd) || fatal_ "getting current workind directory"
+( cd sub/more \
+    && $MAKE sh.html \
+    && test -f sh.html \
+    && test ! -e test.html \
+    && $MAKE test.html \
+    && grep 'this is .*test\.test' test.html) || exit 1
+
+# HTML output removed by mostlyclean.
+$MAKE check-html
+test -f mylog.html
+test -f sub/more/test-suite.html
+$MAKE mostlyclean
+find . -name '*.html' | grep . && exit 1
+
+$MAKE distcheck
+
+:
diff --git a/contrib/t/parallel-tests-html.sh b/contrib/t/parallel-tests-html.sh
new file mode 100755
index 0000000..120cb78
--- /dev/null
+++ b/contrib/t/parallel-tests-html.sh
@@ -0,0 +1,144 @@
+#! /bin/sh
+# Copyright (C) 2009-2012 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 parallel-tests features:
+#  - check-html
+#  - recheck-html
+
+. test-init.sh
+
+# Try the variants that are tried in check-html.am.
+while :; do
+  for r2h in $RST2HTML rst2html rst2html.py; do
+    echo "$me: running $r2h --version"
+    $r2h --version && break 2
+    : For shells with busted 'set -e'.
+  done
+  skip_all_ "no proper rst2html program found"
+done
+unset r2h
+
+cp "$am_top_srcdir"/contrib/check-html.am . \
+  || fatal_ "cannot fetch 'check-html.am' from contrib"
+
+cat >> configure.ac << 'END'
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+TEST_SUITE_LOG = mylog.log
+TESTS = foo.test bar.test baz.test
+check_SCRIPTS = bla
+bla:
+       echo bla > $@
+CLEANFILES = bla
+include $(srcdir)/check-html.am
+END
+
+cat > foo.test <<'END'
+#! /bin/sh
+echo "this is $0"
+test -f bla || exit 1
+exit 0
+END
+
+cat > bar.test <<'END'
+#! /bin/sh
+echo "this is $0"
+exit 99
+END
+
+cat > baz.test <<'END'
+#! /bin/sh
+echo "this is $0"
+exit 1
+END
+
+chmod a+x foo.test bar.test baz.test
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
+
+./configure
+
+$MAKE check-html && exit 1
+test -f mylog.html
+# check-html should cause check_SCRIPTS to be created.
+test -f bla
+
+# "make clean" should remove HTML files.
+$MAKE clean
+test ! -e mylog.html
+test ! -e bla
+
+# Always create the HTML output, even if there were no failures.
+rm -f mylog.html
+env TESTS=foo.test $MAKE -e check-html
+test -f mylog.html
+
+# Create summarizing HTML output also with recheck-html.
+rm -f mylog.html
+env TESTS=foo.test $MAKE -e recheck-html
+test -f mylog.html
+
+# Create HTML output for an individual test.
+$MAKE foo.html
+grep 'this is .*foo\.test' foo.html
+test ! -e bar.html
+test ! -e baz.html
+
+# Create HTML output for individual tests.  Since the pre-existing log
+# files are expected to be used for the HTML conversion, this should
+# go smoothly even for failed tests.
+$MAKE bar.html baz.html
+grep 'this is .*bar\.test' bar.html
+grep 'this is .*baz\.test' baz.html
+
+# HTML output removed by mostlyclean.
+$MAKE mostlyclean
+test ! -e foo.html
+test ! -e bar.html
+test ! -e baz.html
+test ! -e mylog.html
+
+# check-html and recheck-html should cause check_SCRIPTS to be created,
+# and recheck-html should rerun no tests if check has not been run.
+
+$MAKE clean
+test ! -e mylog.html
+env TEST_LOGS=foo.log $MAKE -e check-html
+test -f bla
+test -f foo.log
+test ! -e bar.log
+test ! -e baz.log
+test -f mylog.html
+
+$MAKE clean
+env TESTS=foo.test $MAKE -e recheck-html
+test -f bla
+test ! -e foo.log
+test -f mylog.html
+
+$MAKE clean
+$MAKE recheck-html
+test -f bla
+test ! -e foo.log
+test ! -e bar.log
+test ! -e baz.log
+test -f mylog.html
+
+:
diff --git a/defs b/defs
deleted file mode 100644
index 586181e..0000000
--- a/defs
+++ /dev/null
@@ -1,22 +0,0 @@
-# -*- shell-script -*-
-#
-# Copyright (C) 1996-2012 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 file is here for backward-compatibility with the existing
-# tests still unconverted to the use of 'test-init.sh'.  It should
-# eventually be removed, once all the tests have been converted.
-
-. test-init.sh
diff --git a/doc/automake.texi b/doc/automake.texi
index 701ef42..d2e3b38 100644
--- a/doc/automake.texi
+++ b/doc/automake.texi
@@ -115,7 +115,6 @@ section entitled ``GNU Free Documentation License.''
 * Conditionals::                Conditionals
 * Silencing Make::              Obtain less verbose output from @command{make}
 * Gnits::                       The effect of @option{--gnu} and 
@option{--gnits}
-* Cygnus::                      The effect of @option{--cygnus} (deprecated, 
soon to be removed)
 * Not Enough::                  When Automake is not Enough
 * Distributing::                Distributing the Makefile.in
 * API Versioning::              About compatibility between Automake versions
@@ -190,7 +189,6 @@ Auto-generating aclocal.m4
 Autoconf macros supplied with Automake
 
 * Public Macros::               Macros that you can use.
-* Obsolete Macros::             Macros that will soon be removed.
 * Private Macros::              Macros that you should not use.
 
 Directories
@@ -360,9 +358,9 @@ Conditionals
 
 Silencing Make
 
-* Make verbosity::               Make is verbose by default
-* Tricks For Silencing Make::    Standard and generic ways to silence make
-* Automake silent-rules Option:: How Automake can help in silencing make
+* Make verbosity::              Make is verbose by default
+* Tricks For Silencing Make::   Standard and generic ways to silence make
+* Automake Silent Rules::       How Automake can help in silencing make
 
 When Automake Isn't Enough
 
@@ -1954,14 +1952,6 @@ standard is actually published (which may never happen).
 @xref{Gnits}, for more information on the precise implications of the
 strictness level.
 
-Automake also has a special (and @emph{today deprecated}) ``cygnus'' mode
-that is similar to strictness but handled differently.  This mode is
-useful for packages that are put into a ``Cygnus'' style tree (e.g., older
-versions of the GCC and gdb trees).  @xref{Cygnus}, for more information
-on this mode.  Please note that this mode @emph{is deprecated and will be
-removed in the next major Automake release (1.13)}; you must avoid its use
-in new packages, and should stop using it in existing packages as well.
-
 
 @node Uniform
 @section The Uniform Naming Scheme
@@ -2290,9 +2280,6 @@ generate not only the desired output but also dependency 
information
 that is then used by the automatic dependency tracking feature
 (@pxref{Dependencies}).
 
address@hidden elisp-comp
-This program is used to byte-compile Emacs Lisp code.
-
 @item install-sh
 This is a replacement for the @command{install} program that works on
 platforms where @command{install} is unavailable or unusable.
@@ -2303,9 +2290,9 @@ a file and prints some date information about it.
 
 @item missing
 This wraps a number of programs that are typically only required by
-maintainers.  If the program in question doesn't exist,
address@hidden prints an informative warning and attempts to fix
-things so that the build can continue.
+maintainers.  If the program in question doesn't exist, or seems to old,
address@hidden will print an informative warning before failing out,
+to provide the user with more context and information.
 
 @item mkinstalldirs
 This script used to be a wrapper around @samp{mkdir -p}, which is not
@@ -2599,13 +2586,6 @@ scripts and data files (like e.g., @file{texinfo.texi} 
and
 When used with @option{--add-missing}, causes installed files to be
 copied.  The default is to make a symbolic link.
 
address@hidden --cygnus
address@hidden --cygnus
-Causes the generated @file{Makefile.in}s to follow Cygnus rules, instead
-of GNU or Gnits rules.  For more information, see @ref{Cygnus}.
-Note that @emph{this mode of operation is deprecated, and will be removed}
-in the next major Automake release (1.13).
-
 @item -f
 @opindex -f
 @itemx --force-missing
@@ -2712,8 +2692,6 @@ variables.
 The categories output by default are @samp{obsolete}, @samp{syntax} and
 @samp{unsupported}.  Additionally, @samp{gnu} and @samp{portability}
 are enabled in @option{--gnu} and @option{--gnits} strictness.
-On the other hand, the @option{silent-rules} options (@pxref{Options})
-turns off portability warnings about recursive variable expansions.
 
 @c Checked by extra-portability.sh
 Turning off @samp{portability} will also turn off @samp{extra-portability},
@@ -2947,7 +2925,6 @@ Automake will look for various helper scripts, such as
 @file{config.guess},
 @file{config.sub},
 @file{depcomp},
address@hidden,
 @file{compile},
 @file{install-sh},
 @file{ltmain.sh},
@@ -2981,9 +2958,9 @@ macro.
 @item AC_CONFIG_HEADERS
 Automake will generate rules to rebuild these headers from the
 corresponding templates (usually, the template for a @file{foo.h}
-header being @file{foo.h.in}).  Older versions of Automake required
-the use of @code{AM_CONFIG_HEADER} (@pxref{Macros}); this is no
-longer the case.
+header being @file{foo.h.in}).  Older versions of Automake
+required the use of @code{AM_CONFIG_HEADER}; this is no longer
+the case, and that macro has indeed been removed.
 
 As with @code{AC_CONFIG_FILES} (@pxref{Requirements}), parts of the
 specification using shell variables will be ignored as far as
@@ -3625,32 +3602,19 @@ henceforth be visible to @command{autoconf}.  However 
if it contains
 numerous macros, it will rapidly become difficult to maintain, and it
 will be almost impossible to share macros between packages.
 
address@hidden ACLOCAL_AMFLAGS
 The second possibility, which we do recommend, is to write each macro
-in its own file and gather all of these files in a directory.  This
-directory is usually called @file{m4/}.  To build @file{aclocal.m4},
-one should therefore instruct @command{aclocal} to scan @file{m4/}.
-From the command line, this is done with @samp{aclocal -I m4}.  The
-top-level @file{Makefile.am} should also be updated to define
-
address@hidden
-ACLOCAL_AMFLAGS = -I m4
address@hidden example
-
address@hidden contains options to pass to @command{aclocal}
-when @file{aclocal.m4} is to be rebuilt by @command{make}.  This line is
-also used by @command{autoreconf} (@pxref{autoreconf Invocation, ,
-Using @command{autoreconf} to Update @file{configure} Scripts,
-autoconf, The Autoconf Manual}) to run @command{aclocal} with suitable
-options, or by @command{autopoint} (@pxref{autopoint Invocation, ,
-Invoking the @command{autopoint} Program, gettext, GNU gettext tools})
-and @command{gettextize} (@pxref{gettextize Invocation, , Invoking the
address@hidden Program, gettext, GNU gettext tools}) to locate
-the place where Gettext's macros should be installed.  So even if you
-do not really care about the rebuild rules, you should define
address@hidden
-
-When @samp{aclocal -I m4} is run, it will build an @file{aclocal.m4}
+in its own file and gather all these files in a directory.  This
+directory is usually called @file{m4/}.  Then it's enough to update
address@hidden by adding a proper call to @code{AC_CONFIG_MACRO_DIRS}:
+
address@hidden
+AC_CONFIG_MACRO_DIRS([m4])
address@hidden example
+
address@hidden will then take care of automatically adding @file{m4/}
+to its search path for m4 files.
+
+When @samp{aclocal} is run, it will build an @file{aclocal.m4}
 that @code{m4_include}s any file from @file{m4/} that defines a
 required macro.  Macros not found locally will still be searched in
 system-wide directories, as explained in @ref{Macro Search Path}.
@@ -3679,19 +3643,14 @@ this requirement will hinder development.  An easy 
solution is to copy
 such third-party macros in your local @file{m4/} directory so they get
 distributed.
 
-Since Automake 1.10, @command{aclocal} offers an option to copy these
-system-wide third-party macros in your local macro directory, solving
-the above problem.  Simply use:
-
address@hidden
-ACLOCAL_AMFLAGS = -I m4 --install
address@hidden example
+Since Automake 1.10, @command{aclocal} offers the option @code{--install}
+to copy these system-wide third-party macros in your local macro directory,
+helping to solve the above problem.
 
address@hidden
 With this setup, system-wide macros will be copied to @file{m4/}
-the first time you run @command{autoreconf}.  Then the locally
-installed macros will have precedence over the system-wide installed
-macros each time @command{aclocal} is run again.
+the first time you run @command{aclocal}.  Then the locally installed
+macros will have precedence over the system-wide installed macros
+each time @command{aclocal} is run again.
 
 One reason why you should keep @option{--install} in the flags even
 after the first run is that when you later edit @file{configure.ac}
@@ -3772,16 +3731,14 @@ MyPackage uses an @file{m4/} directory to store local 
macros as
 explained in @ref{Local Macros}, and has
 
 @example
-ACLOCAL_AMFLAGS = -I m4 --install
+AC_CONFIG_MACRO_DIRS([m4])
 @end example
 
 @noindent
-in its top-level @file{Makefile.am}.
+in its @file{configure.ac}.
 
 Initially the @file{m4/} directory is empty.  The first time we run
address@hidden, it will fetch the options to pass to
address@hidden in @file{Makefile.am}, and run @samp{aclocal -I m4
---install}.  @command{aclocal} will notice that
address@hidden --install}, it will notice that
 
 @itemize @bullet
 @item
@@ -3799,9 +3756,8 @@ and @command{aclocal} was given the @option{--install} 
option, it will
 copy this file in @file{m4/thirdparty.m4}, and output an
 @file{aclocal.m4} that contains @samp{m4_include([m4/thirdparty.m4])}.
 
-The next time @samp{aclocal -I m4 --install} is run (either via
address@hidden, by hand, or from the @file{Makefile} rebuild
-rules) something different happens.  @command{aclocal} notices that
+The next time @samp{aclocal --install} is run, something different
+happens.  @command{aclocal} notices that
 
 @itemize @bullet
 @item
@@ -3827,8 +3783,8 @@ the system-wide file in case of equal serial numbers.
 
 Now suppose the system-wide third-party macro is changed.  This can
 happen if the package installing this macro is updated.  Let's suppose
-the new macro has serial number 2.  The next time @samp{aclocal -I m4
---install} is run the situation is the following:
+the new macro has serial number 2.  The next time @samp{aclocal --install}
+is run the situation is the following:
 
 @itemize @bullet
 @item
@@ -3854,16 +3810,16 @@ macro in @file{m4/thirdparty.m4}, in this case 
overriding the old
 version.  MyPackage just had its macro updated as a side effect of
 running @command{aclocal}.
 
-If you are leery of letting @command{aclocal} update your local macro,
-you can run @samp{aclocal -I m4 --diff} to review the changes
address@hidden -I m4 --install} would perform on these macros.
+If you are leery of letting @command{aclocal} update your local
+macro, you can run @samp{aclocal --diff} to review the changes
address@hidden --install} would perform on these macros.
 
 Finally, note that the @option{--force} option of @command{aclocal} has
 absolutely no effect on the files installed by @option{--install}.  For
 instance, if you have modified your local macros, do not expect
 @option{--install --force} to replace the local macros by their
 system-wide versions.  If you want to do so, simply erase the local
-macros you want to revert, and run @samp{aclocal -I m4 --install}.
+macros you want to revert, and run @samp{aclocal --install}.
 
 
 @node Future of aclocal
@@ -3940,19 +3896,19 @@ Automake ships with several Autoconf macros that you 
can use from your
 Runs many macros required for proper operation of the generated Makefiles.
 
 @vindex AUTOMAKE_OPTIONS
-Today, @code{AM_INIT_AUTOMAKE} is called with a single argument: a
-space-separated list of Automake options that should
-be applied to every @file{Makefile.am} in the tree.  The effect is as if
-each option were listed in @code{AUTOMAKE_OPTIONS} (@pxref{Options}).
address@hidden is called with a single argument: a space-separated
+list of Automake options that should be applied to every @file{Makefile.am}
+in the tree.  The effect is as if each option were listed in
address@hidden (@pxref{Options}).
+
address@hidden FIXME: Remove this "modernization advice" in Automake 1.14 (and 
adjust
address@hidden FIXME: the error message in m4/init.m4:AM_INIT_AUTOMAKE 
accordingly).
 
 @acindex AC_INIT
-This macro can also be called in @emph{another, deprecated form} (support
-for which will be @emph{removed in the next major Automake release (1.13)}):
+This macro could once (before Automake 1.13) also be called in the
address@hidden obsolete and completely unsupported} form
 @code{AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])}.  In this form,
-there are two required arguments: the package and the version number.
-This form is obsolete because the @var{package} and @var{version} can
-be obtained from Autoconf's @code{AC_INIT} macro (which itself has an
-old and a new form).
+there were two required arguments: the package and the version number.
 
 @anchor{Modernize AM_INIT_AUTOMAKE invocation}
 If your @file{configure.ac} has:
@@ -3963,7 +3919,8 @@ AM_INIT_AUTOMAKE([mumble], [1.5])
 @end example
 
 @noindent
-you should modernize it as follows:
+you must modernize it as follows in order to make it work with Automake
+1.13 or later:
 
 @example
 AC_INIT([mumble], [1.5])
@@ -4075,7 +4032,8 @@ the @command{missing} script is appropriate.
 
 @item AM_SILENT_RULES
 @acindex AM_SILENT_RULES
-Enable the machinery for less verbose build output (@pxref{Options}).
+Control the machinery for less verbose build output
+(@pxref{Automake Silent Rules}).
 
 @item AM_WITH_DMALLOC
 @acindex AM_WITH_DMALLOC
@@ -4105,19 +4063,6 @@ Invocation, , Using @command{autoupdate} to Modernize
 
 @table @code
 
address@hidden AM_CONFIG_HEADER
address@hidden AM_CONFIG_HEADER
-Automake will generate rules to automatically regenerate the config
-header.  This obsolete macro is a synonym of @code{AC_CONFIG_HEADERS}
-today (@pxref{Optional}).
-
address@hidden AM_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL
address@hidden AM_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL
-If the use of @code{TIOCGWINSZ} requires @file{<sys/ioctl.h>}, then
-define @code{GWINSZ_IN_SYS_IOCTL}.  Otherwise @code{TIOCGWINSZ} can be
-found in @file{<termios.h>}.  This macro is obsolete, you should
-use Autoconf's @code{AC_HEADER_TIOCGWINSZ} instead.
-
 @item AM_PROG_MKDIR_P
 @acindex AM_PROG_MKDIR_P
 @cindex @code{mkdir -p}, macro check
@@ -4138,15 +4083,6 @@ you are advised to switch ASAP to the more modern 
Autoconf-provided
 interface instead; both the macro and the variable @emph{will be
 removed} in the next major Automake release.
 
address@hidden AM_SYS_POSIX_TERMIOS
address@hidden AM_SYS_POSIX_TERMIOS
address@hidden POSIX termios headers
address@hidden termios POSIX headers
-Check to see if POSIX termios headers and functions are available on the
-system.  If so, set the shell variable @code{am_cv_sys_posix_termios} to
address@hidden  If not, set the variable to @samp{no}.  This macro is obsolete,
-you should use Autoconf's @code{AC_SYS_POSIX_TERMIOS} instead.
-
 @end table
 
 
@@ -4284,6 +4220,34 @@ will be built.  It is customary to arrange test 
directories to be
 built after everything else since they are meant to test what has
 been constructed.
 
+In addition to the built-in recursive targets defined by Automake
+(@code{all}, @code{check}, etc.), the developer can also define his
+own recursive targets.  That is done by passing the names of such
+targets as arguments to the m4 macro @code{AM_EXTRA_RECURSIVE_TARGETS}
+in @file{configure.ac}.  Automake generates rules to handle the
+recursion for such targets; and the developer can define real actions
+for them by defining corresponding @code{-local} targets.
+
address@hidden
+% @kbd{cat configure.ac}
+AC_INIT([pkg-name], [1.0]
+AM_INIT_AUTOMAKE
+AM_EXTRA_RECURSIVE_TARGETS([foo])
+AC_CONFIG_FILES([Makefile sub/Makefile sub/src/Makefile])
+AC_OUTPUT
+% @kbd{cat Makefile.am}
+SUBDIRS = sub
+foo-local:
+        @@echo This will be run by "make foo".
+% @kbd{cat sub/Makefile.am}
+SUBDIRS = src
+% @kbd{cat sub/src/Makefile.am}
+foo-local:
+        @@echo This too will be run by a "make foo" issued either in
+        @@echo the 'sub/src/' directory, the 'sub/' directory, or the
+        @@echo top-level directory.
address@hidden example
+
 @node Conditional Subdirectories
 @section Conditional Subdirectories
 @cindex Subdirectories, building conditionally
@@ -5507,9 +5471,8 @@ The libtool rules also use a @code{LIBTOOLFLAGS} variable 
that should
 not be set in @file{Makefile.am}: this is a user variable (@pxref{Flag
 Variables Ordering}.  It allows users to run @samp{make
 LIBTOOLFLAGS=--silent}, for instance.  Note that the verbosity of
address@hidden can also be influenced with the Automake
address@hidden option (@pxref{Options}).
-
address@hidden can also be influenced by the Automake support
+for silent rules (@pxref{Automake Silent Rules}).
 
 @node LTLIBOBJS, Libtool Issues, Libtool Flags, A Shared Library
 @subsection @code{LTLIBOBJS} and @code{LTALLOCA}
@@ -6138,9 +6101,9 @@ Automake already provides some @option{-I} options 
automatically, in a
 separate variable that is also passed to every compilation that invokes
 the C preprocessor.  In particular it generates @samp{-I.},
 @samp{-I$(srcdir)}, and a @option{-I} pointing to the directory holding
address@hidden (if you've used @code{AC_CONFIG_HEADERS} or
address@hidden).  You can disable the default @option{-I}
-options using the @option{nostdinc} option.
address@hidden (if you've used @code{AC_CONFIG_HEADERS}).  You can
+disable the default @option{-I} options using the @option{nostdinc}
+option.
 
 When a file to be included is generated during the build and not part
 of a distribution tarball, its location is under @code{$(builddir)},
@@ -7551,7 +7514,10 @@ Lisp sources are not distributed by default.  You can 
prefix the
 distributed.
 
 Automake will byte-compile all Emacs Lisp source files using the Emacs
-found by @code{AM_PATH_LISPDIR}, if any was found.
+found by @code{AM_PATH_LISPDIR}, if any was found.  When performing such
+byte-compilation, the flags specified in the (developer-reserved)
address@hidden and (user-reserved) @code{ELCFLAGS} make variables
+will be passed to the Emacs invocation.
 
 Byte-compiled Emacs Lisp files are not portable among all versions of
 Emacs, so it makes sense to turn this off if you expect sites to have
@@ -8849,21 +8815,20 @@ also data files to be passed to one or more test 
scripts defined by
 different means (the so-called ``log compilers'', @pxref{Parallel Test
 Harness}).
 
-Test scripts can be executed serially or concurrently.  Automake
-supports both these kinds of test execution, with the serial test harness
-being the default (for backward-compatibility reasons only, as its use
-is nowadays discouraged).  The concurrent test harness relies on the
-concurrence capabilities (if any) offered by the underlying @command{make}
+Test scripts can be executed serially or concurrently.  Automake supports
+both these kinds of test execution, with the parallel test harness being
+the default.  The concurrent test harness relies on the concurrence
+capabilities (if any) offered by the underlying @command{make}
 implementation, and can thus only be as good as those are.
 
 By default, only the exit statuses of the test scripts are considered when
 determining the testsuite outcome.  But Automake allows also the use of
 more complex test protocols, either standard (@pxref{Using the TAP test
-protocol}) or custom (@pxref{Custom Test Drivers}).  Note that you can
-enable such protocols only when the parallel harness is used: they won't
-work with the serial test harness.  In the rest of this section we are
-going to concentrate mostly on protocol-less tests, since we cover
-test protocols in a later section (again, @pxref{Custom Test Drivers}).
+protocol}) or custom (@pxref{Custom Test Drivers}).  Note that you can't
+enable such protocols when the serial harness is used, though.
+In the rest of this section we are going to concentrate mostly on
+protocol-less tests, since we cover test protocols in a later section
+(again, @pxref{Custom Test Drivers}).
 
 @cindex Exit status 77, special interpretation
 @cindex Exit status 99, special interpretation
@@ -8922,18 +8887,18 @@ run.
 @anchor{Simple tests and color-tests}
 @vindex AM_COLOR_TESTS
 @cindex Colorized testsuite output
-If the Automake option @code{color-tests} is used (@pxref{Options})
-and standard output is connected to a capable terminal, then the test
-results and the summary are colored appropriately.  The user can disable
-colored output by setting the @command{make} variable
address@hidden, or force colored output even without a connecting
-terminal with @samp{AM_COLOR_TESTS=always}.  It's also worth noting that
-some @command{make} implementations, when used in parallel mode, have
-slightly different semantics (@pxref{Parallel make,,, autoconf,
-The Autoconf Manual}), which can break the automatic detection of a
-connection to a capable terminal.  If this is the case, you'll have to
-resort to the use of @samp{AM_COLOR_TESTS=always} in order to have the
-testsuite output colorized.
+If the standard output is connected to a capable terminal, then the test
+results and the summary are colored appropriately.  The developer and the
+user can disable colored output by setting the @command{make} variable
address@hidden; the user can in addition force colored output
+even without a connecting terminal with @samp{AM_COLOR_TESTS=always}.  
+It's also worth noting that some @command{make} implementations,
+when used in parallel mode, have slightly different semantics
+(@pxref{Parallel make,,, autoconf, The Autoconf Manual}), which can
+break the automatic detection of a connection to a capable terminal.
+If this is the case, the user will have to resort to the use of
address@hidden in order to have the testsuite output
+colorized.
 
 Test programs that need data files should look for them in @code{srcdir}
 (which is both a make variable and an environment variable made available
@@ -9009,14 +8974,12 @@ by the tests, not the tests themselves.  Of course you 
can set
 @code{TESTS = $(check_PROGRAMS)} if all your programs are test cases.
 
 @node Serial Test Harness
address@hidden Serial Test Harness
address@hidden Older (and obsolescent) serial test harness
 @cindex @option{serial-tests}, Using
 
address@hidden:} This harness, while still being the default one, is
-obsolescent, and kept mostly for backward-compatibility reasons.  The user
-is advised to use the parallel test harness instead (@pxref{Parallel Test
-Harness}).  Be warned that future Automake versions might switch to use
-that more modern and feature-rich harness by default.
address@hidden harness is obsolescent}, and kept for backward-compatibility
+reasons only.  The user is strongly advised to just use the parallel test
+harness instead (@pxref{Parallel Test Harness}).
 
 The serial test harness is enabled by the Automake option
 @option{serial-tests}. It operates by simply running the tests serially,
@@ -9051,14 +9014,12 @@ versions.
 
 @node Parallel Test Harness
 @subsection Parallel Test Harness
address@hidden @option{parallel-tests}, Using
 
-The parallel (or concurrent) test harness is enabled by the Automake option
address@hidden  It features automatic collection of the test
-scripts output in @file{.log} files, concurrent execution of tests with
address@hidden -j}, specification of inter-test dependencies, lazy reruns of
-tests that have not completed in a prior run, and hard errors for exceptional
-failures.
+By default, Automake generated a parallel (concurrent) test harness.  It
+features automatic collection of the test scripts output in @file{.log}
+files, concurrent execution of tests with @code{make -j}, specification
+of inter-test dependencies, lazy reruns of tests that have not completed
+in a prior run, and hard errors for exceptional failures.
 
 This harness is still somewhat experimental and may undergo changes in
 order to satisfy additional portability requirements.
@@ -9362,9 +9323,9 @@ definition of generic and extension-specific 
@code{LOG_COMPILER} and
 @end itemize
 
 @noindent
-On the other hand, the exact semantics of how (and if)
address@hidden, @code{XFAIL_TESTS}, and hard errors are supported
-and handled is left to the individual test drivers.
+On the other hand, the exact semantics of how (and if) testsuite output
+colorization, @code{XFAIL_TESTS}, and hard errors are supported and
+handled is left to the individual test drivers.
 
 @c TODO: We should really add a working example in the doc/ directory,
 @c TODO: and reference if from here.
@@ -9426,11 +9387,10 @@ with the parallel test harness and its default driver.
 @subsubsection Command-line arguments for test drivers
 
 A custom driver can rely on various command-line options and arguments
-being passed to it automatically by the Automake's @option{parallel-tests}
-harness.  It is @emph{mandatory} that it understands all of them (even
-if the exact interpretation of the associated semantics can legitimately
-change between a test driver and another, and even be a no-op in some
-drivers).
+being passed to it automatically by the Automake-generated test harness.
+It is @emph{mandatory} that it understands all of them (even if the exact
+interpretation of the associated semantics can legitimately change
+between a test driver and another, and even be a no-op in some drivers).
 
 @noindent
 Here is the list of options:
@@ -9474,9 +9434,9 @@ for this program.
 Note that the exact semantics attached to the @option{--color-tests},
 @option{--expect-failure} and @option{--enable-hard-errors} options are
 left up to the individual test drivers.  Still, having a behaviour
-compatible or at least similar to that provided by the default
address@hidden driver is advised, as that would offer a better
-consistency and a more pleasant user experience.
+compatible or at least similar to that provided by the default driver
+is advised, as that would offer a better consistency and a more pleasant
+user experience.
 
 @node Log files generation and test results recording
 @subsubsection Log files generation and test results recording
@@ -9518,8 +9478,8 @@ The only recognized test results are currently 
@code{PASS}, @code{XFAIL},
 @code{SKIP}, @code{FAIL}, @code{XPASS} and @code{ERROR}.  These results,
 when declared with @code{:test-result:}, can be optionally followed by
 text holding the name and/or a brief description of the corresponding
-test; the @option{parallel-tests} harness will ignore such extra text when
-generating @file{test-suite.log} and preparing the testsuite summary.
+test; the harness will ignore such extra text when generating
address@hidden and preparing the testsuite summary.
 
 @c Keep in sync with 'test-metadata-recheck.sh'.
 @item @code{:recheck:}
@@ -9627,7 +9587,7 @@ on standard output; a test harness (also called ``TAP 
consumer'') will
 parse and interpret these results, and properly present them to the user,
 and/or register them for later analysis.  The exact details of how this
 is accomplished can vary among different test harnesses.  The Automake
-parallel harness will present the results on the console in the usual
+harness will present the results on the console in the usual
 fashion (@pxref{Testsuite progress on console}), and will use the
 @file{.trs} files (@pxref{Basics of test metadata}) to store the test
 results and related metadata.  Apart from that, it will try to remain
@@ -9711,7 +9671,7 @@ Here is an example of how the TAP driver can be set up 
and used.
 % @kbd{cat configure.ac}
 AC_INIT([GNU Try Tap], [1.0], [bug-automake@@gnu.org])
 AC_CONFIG_AUX_DIR([build-aux])
-AM_INIT_AUTOMAKE([foreign parallel-tests -Wall -Werror])
+AM_INIT_AUTOMAKE([foreign -Wall -Werror])
 AC_CONFIG_FILES([Makefile])
 AC_REQUIRE_AUX_FILE([tap-driver.sh])
 AC_PROG_AWK
@@ -9792,7 +9752,7 @@ mainstream versions, which you should be aware of.
 A @code{Bail out!} directive doesn't stop the whole testsuite, but only
 the test script it occurs in.  This doesn't follow TAP specifications,
 but on the other hand it maximizes compatibility (and code sharing) with
-the ``hard error'' concept of the default @option{parallel-tests} driver.
+the ``hard error'' concept of the default testsuite driver.
 @item
 The @code{version} and @code{pragma} directives are not supported.
 @item
@@ -9916,15 +9876,6 @@ Automake generates rules to automatically rebuild 
@file{Makefile}s,
 If you are using @code{AM_MAINTAINER_MODE} in @file{configure.ac}, then
 these automatic rebuilding rules are only enabled in maintainer mode.
 
address@hidden ACLOCAL_AMFLAGS
-Sometimes you need to run @command{aclocal} with an argument like
address@hidden to tell it where to find @file{.m4} files.  Since
-sometimes @command{make} will automatically run @command{aclocal}, you
-need a way to specify these arguments.  You can do this by defining
address@hidden; this holds arguments that are passed verbatim
-to @command{aclocal}.  This variable is only useful in the top-level
address@hidden
-
 @vindex CONFIG_STATUS_DEPENDENCIES
 @vindex CONFIGURE_DEPENDENCIES
 @cindex @file{version.sh}, example
@@ -9967,27 +9918,8 @@ be read as a side effect of running @command{configure}, 
like @file{version.sh}
 in the example above.
 
 Speaking of @file{version.sh} scripts, we recommend against them
-today.  They are mainly used when the version of a package is updated
-automatically by a script (e.g., in daily builds).  Here is what some
-old-style @file{configure.ac}s may look like:
-
address@hidden
-AC_INIT
-. $srcdir/version.sh
-AM_INIT_AUTOMAKE([name], $VERSION_NUMBER)
address@hidden
address@hidden example
-
address@hidden
-Here, @file{version.sh} is a shell fragment that sets
address@hidden  The problem with this example is that
address@hidden cannot track dependencies (listing @file{version.sh}
-in @command{CONFIG_STATUS_DEPENDENCIES}, and distributing this file is up
-to the user), and that it uses the obsolete form of @code{AC_INIT} and
address@hidden  Upgrading to the new syntax is not
-straightforward, because shell variables are not allowed in
address@hidden's arguments.  We recommend that @file{version.sh} be
-replaced by an M4 file that is included by @file{configure.ac}:
+today.  We recommend that @file{version.sh} be replaced by an M4 file
+that is included by @file{configure.ac}:
 
 @example
 m4_include([version.m4])
@@ -10001,9 +9933,7 @@ Here @file{version.m4} could contain something like
 @samp{m4_define([VERSION_NUMBER], [1.2])}.  The advantage of this
 second form is that @command{automake} will take care of the
 dependencies when defining the rebuild rule, and will also distribute
-the file automatically.  An inconvenience is that @command{autoconf}
-will now be rerun each time the version number is bumped, when only
address@hidden had to be rerun in the previous setup.
+the file automatically.
 
 
 @node Options
@@ -10071,15 +10001,12 @@ then @samp{portability} warnings will be 
@emph{disabled} in
 @item @option{gnits}
 @itemx @option{gnu}
 @itemx @option{foreign}
address@hidden @option{cygnus}
 @cindex Option, @option{gnits}
 @cindex Option, @option{gnu}
 @cindex Option, @option{foreign}
address@hidden Option, @option{cygnus}
 @opindex gnits
 @opindex gnu
 @opindex foreign
address@hidden cygnus
 
 Set the strictness as appropriate.  The @option{gnits} option also
 implies options @option{readme-alpha} and @option{check-news}.
@@ -10090,13 +10017,6 @@ implies options @option{readme-alpha} and 
@option{check-news}.
 Cause @samp{make dist} to fail unless the current version number appears
 in the first few lines of the @file{NEWS} file.
 
address@hidden @option{color-tests}
address@hidden Option, @option{color-tests}
address@hidden color-tests
-Cause output of the serial and parallel test harnesses (see @ref{Simple
-Tests}) and of properly-written custom test drivers (@pxref{Custom Test
-Drivers}) to be colorized on capable terminals.
-
 @item @option{dejagnu}
 @cindex Option, @option{dejagnu}
 @opindex dejagnu
@@ -10214,18 +10134,19 @@ are ordinarily automatically provided by Automake.
 Don't require @file{texinfo.tex}, even if there are texinfo files in
 this directory.
 
address@hidden @option{parallel-tests}
address@hidden Option, @option{parallel-tests}
address@hidden parallel-tests
-Enable test suite harness for @code{TESTS} that can run tests in parallel
-(@pxref{Parallel Test Harness}, for more information).
-
 @item @option{serial-tests}
 @cindex Option, @option{serial-tests}
 @opindex serial-tests
 Enable the older serial test suite harness for @code{TESTS} (@pxref{Serial
-Test Harness}, for more information).  This is still the default for the
-moment.
+Test Harness}, for more information).
+
address@hidden @option{parallel-tests}
address@hidden Option, @option{parallel-tests}
address@hidden parallel-tests
+Enable test suite harness for @code{TESTS} that can run tests in parallel
+(@pxref{Parallel Test Harness}, for more information).  This option is
+only kept for backward-compatibility, since the parallel test harness is
+the default now.
 
 @item @option{readme-alpha}
 @cindex Option, @option{readme-alpha}
@@ -10239,23 +10160,6 @@ non-alpha releases.  The second form is
 @address@hidden@address@hidden, where @var{alpha} is a
 letter; it should be omitted for non-alpha releases.
 
address@hidden @option{silent-rules}
address@hidden Option, @option{silent-rules}
address@hidden silent-rules
-Enable less verbose build rules.  This can be used to let build rules
-output status lines of the form:
address@hidden
-GEN @var{output-file}
- CC @var{object-file}
address@hidden example
address@hidden
-instead of printing the command that will be executed to update
address@hidden or to compile @var{object-file}.  It can also
-silence @command{libtool} output.
-
-For more information about how to use, enable, or disable silent
-rules, @pxref{Automake silent-rules Option}.
-
 @item @option{std-options}
 @cindex Options, @option{std-options}
 @cindex @samp{make installcheck}, testing @option{--help} and 
@option{--version}
@@ -10737,9 +10641,9 @@ Libtool Sources}).
 @cindex Silent @command{make} rules
 
 @menu
-* Make verbosity::               Make is verbose by default
-* Tricks For Silencing Make::    Standard and generic ways to silence make
-* Automake silent-rules Option:: How Automake can help in silencing make
+* Make verbosity::              Make is verbose by default
+* Tricks For Silencing Make::   Standard and generic ways to silence make
+* Automake Silent Rules::       How Automake can help in silencing make
 @end menu
 
 @node Make verbosity
@@ -10774,8 +10678,8 @@ the easy detection of potentially important warning 
messages.
 
 Here we describe some common idioms/tricks to obtain a quieter make
 output, with their relative advantages and drawbacks.  In the next
-section (@ref{Automake silent-rules Option}) we'll see how Automake
-can help in this respect.
+section (@ref{Automake Silent Rules}) we'll see how Automake can help
+in this respect, providing more elaborate and flexible idioms.
 
 @itemize @bullet
 
@@ -10827,20 +10731,19 @@ automatically activated if the @option{-s} flag is 
used.
 
 @end itemize
 
address@hidden Automake silent-rules Option
address@hidden Automake Silent Rules
 @section How Automake can help in silencing make
 
 The tricks and idioms for silencing @command{make} described in the
 previous section can be useful from time to time, but we've seen that
 they all have their serious drawbacks and limitations.  That's why
 automake provides support for a more advanced and flexible way of
-obtaining quieter output from @command{make}: the @option{silent-rules}
-mode.
+obtaining quieter output from @command{make} (for most rules at least).
 
 @c TODO: Maybe describe in brief the precedent set by the build system
 @c of the Linux Kernel, from which Automake took inspiration ... Links?
 
-To give the gist of what @option{silent-rules} can do, here is a simple
+To give the gist of what Automake can do in this respect, here is a simple
 comparison between a typical @command{make} output (where silent rules
 are disabled) and one with silent rules enabled:
 
@@ -10889,7 +10792,7 @@ func.c:4:3: warning: ‘i’ used uninitialized in this 
function
   CCLD   foo
 @end example
 
address@hidden silent-rules and libtool
address@hidden silent rules and libtool
 Also, in projects using @command{libtool}, the use of silent rules can
 automatically enable the @command{libtool}'s @option{--silent} option:
 
@@ -10915,26 +10818,9 @@ libtool: link: cd .libs && rm -f libx.so && ln -s 
libx.so.0.0.0 libx.so
   CCLD   libx.la
 @end example
 
-Let's now see how the @option{silent-rules} mode interfaces with the
-package developer and the package user.
-
-To enable the use of @option{silent-rules} in his package, a developer
-needs to do either of the following:
-
address@hidden @bullet
address@hidden
-Add the @option{silent-rules} option as argument to @code{AM_INIT_AUTOMAKE}.
address@hidden
-Call the @code{AM_SILENT_RULES} macro from within the @file{configure.ac}
-file.
address@hidden itemize
-
-It is not possible to instead specify @option{silent-rules} in a
address@hidden file.
-
-If the developer has done either of the above, then the user of the
-package may influence the verbosity at @command{configure} run time as
-well as at @command{make} run time:
+For Automake-generated @file{Makefile}s, the user may influence the
+verbosity at @command{configure} run time as well as at @command{make}
+run time:
 
 @itemize @bullet
 @item
@@ -10950,17 +10836,16 @@ time may be overridden: @code{make V=1} will produce 
verbose output,
 @code{make V=0} less verbose output.
 @end itemize
 
address@hidden default verbosity for silent-rules
address@hidden default verbosity for silent rules
 Note that silent rules are @emph{disabled} by default; the user must
 enable them explicitly at either @command{configure} run time or at
 @command{make} run time.  We think that this is a good policy, since
 it provides the casual user with enough information to prepare a good
 bug report in case anything breaks.
 
-Still, notwithstanding the rationales above, a developer who wants to
-make silent rules enabled by default in his own package can do so by
-adding a @samp{yes} argument to the @code{AM_SILENT_RULES} call in
address@hidden  We advise against this approach, though.
+Still, notwithstanding the rationales above, a developer who really
+wants to make silent rules enabled by default in his own package can
+do so by calling @code{AM_SILENT_RULES([yes])} in @file{configure.ac}.
 
 @c Keep in sync with silent-configsite.sh
 Users who prefer to have silent rules enabled by default can edit their
@@ -10973,16 +10858,13 @@ For portability to different @command{make} 
implementations, package authors
 are advised to not set the variable @code{V} inside the @file{Makefile.am}
 file, to allow the user to override the value for subdirectories as well.
 
-The current implementation of this feature normally uses nested
-variable expansion @samp{$(@var{var1}$(V))}, a @file{Makefile} feature
-that is not required by POSIX 2008 but is widely supported in
-practice.  The @option{silent-rules} option thus turns off warnings
-about recursive variable expansion, which are in turn enabled by
address@hidden (@pxref{automake Invocation}).  On the rare
address@hidden implementations that do not support nested variable
-expansion, whether rules are silent is always determined at configure
-time, and cannot be overridden at make time.  Future versions of POSIX
-are likely to require nested variable expansion, so this minor
+To work at its best, the current implementation of this feature normally
+uses nested variable expansion @samp{$(@var{var1}$(V))}, a @file{Makefile}
+feature that is not required by POSIX 2008 but is widely supported in
+practice.  On the rare @command{make} implementations that do not support
+nested variable expansion, whether rules are silent is always determined at
+configure time, and cannot be overridden at make time.  Future versions of
+POSIX are likely to require nested variable expansion, so this minor
 limitation should go away with time.
 
 @vindex @code{AM_V_GEN}
@@ -11107,64 +10989,6 @@ The file @file{THANKS} is required.
 @end itemize
 
 
address@hidden Cygnus
address@hidden The effect of @option{--cygnus}
-
address@hidden @option{cygnus} strictness
-
address@hidden features described in this section are deprecated; you must
-not use any of them in new code, and should remove their use from older
-but still maintained code: they will be withdrawn the next major Automake
-release (1.13).}
-
-Some packages, notably GNU GCC and GNU gdb, used to have a build
-environment originally written at Cygnus Support (subsequently renamed
-Cygnus Solutions, and then later purchased by Red Hat).  Packages with
-this ancestry are sometimes referred to as ``Cygnus'' trees.
-
-A Cygnus tree has slightly different rules for how a
address@hidden is to be constructed.  Passing @option{--cygnus} to
address@hidden will cause any generated @file{Makefile.in} to
-comply with Cygnus rules.
-
-Here are the precise effects of @option{--cygnus}:
-
address@hidden @bullet
-
address@hidden
-The @option{foreign} strictness is implied.
-
address@hidden
-The options @option{no-installinfo}, @option{no-dependencies} and
address@hidden are implied (@pxref{Options}).
-
address@hidden
-The macro @code{AM_MAINTAINER_MODE} is required.
-
address@hidden
-Info files are always created in the build directory, and not in the
-source directory.  Packages that don't use the @option{cygnus} option
-can emulate this effect by using the @option{no-installinfo} option
-and listing the generated info files in the @code{CLEANFILES} variable.
-
address@hidden
address@hidden is not required if a Texinfo source file is
-specified.  The assumption is that the file will be supplied, but in a
-place that Automake cannot find -- it is an artifact of how Cygnus
-packages are typically bundled.  This effect can be emulated in
-packages not using the @option{cygnus} option with a proper definition
-of the @code{TEXINFO_TEX} variable (@pxref{Texinfo}).
-
address@hidden
-Certain tools will be searched for in the build tree as well as in the
-user's @env{PATH}.  These tools are @command{runtest}, @command{expect},
address@hidden and @command{texi2dvi}.
-
address@hidden
-The @code{check} target doesn't depend on @code{all}.
address@hidden itemize
-
-
 @node Not Enough
 @chapter When Automake Isn't Enough
 
@@ -11719,12 +11543,12 @@ lists.
 
 Packages made with Autoconf and Automake ship with some generated
 files like @file{configure} or @file{Makefile.in}.  These files were
-generated on the developer's host and are distributed so that
+generated on the developer's machine and are distributed so that
 end-users do not have to install the maintainer tools required to
 rebuild them.  Other generated files like Lex scanners, Yacc parsers,
 or Info documentation, are usually distributed on similar grounds.
 
-Automake outputs rules in @file{Makefile}s to rebuild these files.  For
+Automake output rules in @file{Makefile}s to rebuild these files.  For
 instance, @command{make} will run @command{autoconf} to rebuild
 @file{configure} whenever @file{configure.ac} is changed.  This makes
 development safer by ensuring a @file{configure} is never out-of-date
@@ -11787,10 +11611,41 @@ If users use @command{cvs update} to update their 
copy, instead of
 inaccurate.  Some rebuild rules will be triggered and attempt to
 run developer tools such as @command{autoconf} or @command{automake}.
 
-Actually, calls to such tools are all wrapped into a call to the
address@hidden script discussed later (@pxref{maintainer-mode}).
address@hidden will take care of fixing the timestamps when these
-tools are not installed, so that the build can continue.
+Calls to such tools are all wrapped into a call to the @command{missing}
+script discussed later (@pxref{maintainer-mode}), so that the user will
+see more descriptive warnings about missing or out-of-date tools, and
+possible suggestions about how to obtain them, rather than just some
+``command not found'' error, or (worse) some obscure message from some
+older version of the required tool they happen to have installed.
+
+Maintainers interested in keeping their package buildable from a CVS
+checkout even for those users that lack maintainer-specific tools might
+want to provide an helper script (or to enhance their existing bootstrap
+script) to fix the timestamps after a
address@hidden update} or a @command{git checkout}, to prevent spurious
+rebuilds.  In case of a project committing the Autotools-generated
+files, as well as the generated @file{.info} files, such script might
+look something like this:
+
address@hidden
+#!/bin/sh
+# fix-timestamp.sh: prevents useless rebuilds after "cvs update"
+sleep 1
+# aclocal-generated aclocal.m4 depends on locally-installed
+# '.m4' macro files, as well as on 'configure.ac'
+touch aclocal.m4
+sleep 1
+# autoconf-generated configure depends on aclocal.m4 and on
+# configure.ac
+configure config.h.in
+# so does autoheader-generated config.h.in
+configure config.h.in
+# and all the automake-generated Makefile.in files
+touch `find . -name Makefile.in -print`
+# finally, the makeinfo-generated '.info' files depend on the
+# corresponding '.texi' files
+touch doc/*.info
address@hidden smallexample
 
 @item
 In distributed development, developers are likely to have different
@@ -11887,20 +11742,20 @@ tools shouldn't be required during a user build and 
they are not
 checked for in @file{configure}.
 
 However, if for some reason a rebuild rule is triggered and involves a
-missing tool, @command{missing} will notice it and warn the user.
-Besides the warning, when a tool is missing, @command{missing} will
-attempt to fix timestamps in a way that allows the build to continue.
-For instance, @command{missing} will touch @file{configure} if
address@hidden is not installed.  When all distributed files are
-kept under version control, this feature of @command{missing} allows a
-user @emph{with no maintainer tools} to build a package off its version
-control repository, bypassing any timestamp inconsistency (implied by
-e.g.@: @samp{cvs update} or @samp{git clone}).
+missing tool, @command{missing} will notice it and warn the user, even
+suggesting how to obtain such a tool (at least in case it is a well-known
+one, like @command{makeinfo} or @command{bison}).  This is more helpful
+and user-friendly than just having the rebuild rules spewing out a terse
+error message like @samp{sh: @var{tool}: command not found}.  Similarly,
address@hidden will warn the user if it detects that a maintainer
+tool it attempted to use seems too old (be warned that diagnosing this
+correctly is typically more difficult that detecting missing tools, and
+requires cooperation from the tool itself, so it won't always work).
 
 If the required tool is installed, @command{missing} will run it and
 won't attempt to continue after failures.  This is correct during
 development: developers love fixing failures.  However, users with
-wrong versions of maintainer tools may get an error when the rebuild
+missing or too old maintainer tools may get an error when the rebuild
 rule is spuriously triggered, halting the build.  This failure to let
 the build continue is one of the arguments of the
 @code{AM_MAINTAINER_MODE} advocates.
@@ -12465,13 +12320,6 @@ obeys this naming scheme.  The slight difference is 
that
 @code{MAKEFLAGS} is passed to address@hidden implicitly by
 @command{make} itself.
 
-However you should not think that all variables ending with
address@hidden follow this convention.  For instance,
address@hidden (@pxref{Checking the Distribution}) and
address@hidden (see @ref{Rebuilding} and @ref{Local Macros}),
-are two variables that are only useful to the maintainer and have no
-user counterpart.
-
 @code{ARFLAGS} (@pxref{A Library}) is usually defined by Automake and
 has neither @code{AM_} nor per-target cousin.
 
@@ -13070,8 +12918,8 @@ generated by @command{automake} effectively:
 
 @itemize
 @item
-If less verbose output has been enabled in the package with the
address@hidden option (@pxref{Options}), you can use
+If less verbose output has been enabled in the package with the use
+of silent rules (@pxref{Automake Silent Rules}), you can use
 @code{make V=1} to see the commands being executed.
 @item
 @code{make -n} can help show what would be done without actually doing
@@ -13188,7 +13036,7 @@ suite failures, please attach the @file{test-suite.log} 
file.
 @c  LocalWords:  texinfo setfilename settitle setchapternewpage texi direntry
 @c  LocalWords:  dircategory in's aclocal ifinfo titlepage Tromey vskip pt sp
 @c  LocalWords:  filll defcodeindex ov cv op tr syncodeindex fn cp vr ifnottex
address@hidden  LocalWords:  dir Automake's ac Dist Gnits gnits cygnus dfn 
Autoconf's pxref
address@hidden  LocalWords:  dir Automake's ac Dist Gnits gnits dfn Autoconf's 
pxref
 @c  LocalWords:  cindex Autoconf autoconf perl samp cvs dist trindex SUBST foo
 @c  LocalWords:  xs emph FIXME ref vindex pkglibdir pkgincludedir pkgdatadir mt
 @c  LocalWords:  pkg libdir cpio bindir sbindir rmt pax sbin zar zardir acindex
diff --git a/gen-testsuite-part b/gen-testsuite-part
index a95fb04..6bd8e15 100755
--- a/gen-testsuite-part
+++ b/gen-testsuite-part
@@ -385,7 +385,7 @@ foreach my $lt (TRUE, FALSE)
               # Automatically generated test.  DO NOT EDIT BY HAND!
               @vars_init
               required="@required"
-              . ./defs || exit 1
+              . test-init.sh
               plan_ $planned
               . depcomp.sh
               exit \$?
diff --git a/lib/Automake/Options.pm b/lib/Automake/Options.pm
index 2f977bd..186d4ca 100644
--- a/lib/Automake/Options.pm
+++ b/lib/Automake/Options.pm
@@ -269,7 +269,6 @@ sub _is_valid_easy_option ($)
   return scalar grep { $opt eq $_ } qw(
     check-news
     color-tests
-    cygnus
     dejagnu
     dist-bzip2
     dist-lzip
@@ -287,6 +286,9 @@ sub _is_valid_easy_option ($)
     no-texinfo.tex
     nostdinc
     readme-alpha
+    serial-tests
+    parallel-tests
+    silent-rules
     std-options
     subdir-objects
   );
@@ -319,29 +321,20 @@ sub _process_option_list (\%@)
           error ($where,
                  "automatic de-ANSI-fication support has been removed");
         }
+      elsif ($_ eq 'cygnus')
+        {
+          error $where, "support for Cygnus-style trees has been removed";
+        }
       elsif ($_ eq 'dist-lzma')
         {
           error ($where, "support for lzma-compressed distribution " .
                          "archives has been removed");
         }
-      elsif ($_ eq 'parallel-tests')
-        {
-          # Just recognize it explicitly.
-        }
-      elsif ($_ eq 'serial-tests')
-        {
-          # This is a little of an hack, but good enough for the moment.
-          delete $options->{'parallel-tests'};
-        }
       elsif (/^filename-length-max=(\d+)$/)
         {
           delete $options->{$_};
           $options->{'filename-length-max'} = [$_, $1];
         }
-      elsif ($_ eq 'silent-rules')
-        {
-          _option_must_be_from_configure ($_, $where);
-        }
       elsif ($_ eq 'tar-v7' || $_ eq 'tar-ustar' || $_ eq 'tar-pax')
         {
           _option_must_be_from_configure ($_, $where);
diff --git a/lib/am/check.am b/lib/am/check.am
index f319e36..f085f8e 100644
--- a/lib/am/check.am
+++ b/lib/am/check.am
@@ -17,7 +17,7 @@
 am__tty_colors_dummy = \
   mgn= red= grn= lgn= blu= brg= std=; \
   am__color_tests=no
-if %?COLOR%
+
 am__tty_colors = { \
   $(am__tty_colors_dummy); \
   if test "X$(AM_COLOR_TESTS)" = Xno; then \
@@ -40,13 +40,10 @@ am__tty_colors = { \
     std=''; \
   fi; \
 }
-else !%?COLOR%
-am__tty_colors = $(am__tty_colors_dummy)
-endif !%?COLOR%
 
 .PHONY: check-TESTS
 
-if %?PARALLEL_TESTS%
+if !%?SERIAL_TESTS%
 
 include inst-vars.am
 
@@ -463,7 +460,9 @@ AM_RECURSIVE_TARGETS += check recheck
 
 .PHONY: recheck
 
-else !%?PARALLEL_TESTS%
+else %?SERIAL_TESTS%
+
+## Obsolescent serial testsuite driver.
 
 check-TESTS: $(TESTS)
        @failed=0; all=0; xfail=0; xpass=0; skip=0; \
@@ -569,4 +568,4 @@ check-TESTS: $(TESTS)
          test "$$failed" -eq 0; \
        else :; fi
 
-endif !%?PARALLEL_TESTS%
+endif %?SERIAL_TESTS%
diff --git a/lib/am/configure.am b/lib/am/configure.am
index 20534c7..95332fa 100644
--- a/lib/am/configure.am
+++ b/lib/am/configure.am
@@ -113,13 +113,13 @@ $(top_srcdir)/configure: %MAINTAINER-MODE% 
$(am__configure_deps)
 ## aclocal.m4.  ##
 ## ------------ ##
 
-## aclocal.m4 must be built by the top-level Makefile, because this is
-## where the user is expected to define $(ACLOCAL_AMFLAGS).
-##
 ## Whenever a configure dependency changes we need to rebuild
 ## aclocal.m4 too.  Changing configure.ac, or any file included by
 ## aclocal.m4 might require adding more files to aclocal.m4.  Hence
 ## the $(am__configure_deps) dependency.
+## We still need $(ACLOCAL_AMFLAGS) for sake of backward-compatibility;
+## we should hopefully be able to get rid of it in a not-so-distant
+## future.
 if %?REGEN-ACLOCAL-M4%
 $(ACLOCAL_M4): %MAINTAINER-MODE% $(am__aclocal_m4_deps)
 ?TOPDIR_P?     $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
diff --git a/lib/am/data.am b/lib/am/data.am
index b8b6588..b91f55c 100644
--- a/lib/am/data.am
+++ b/lib/am/data.am
@@ -24,7 +24,8 @@ endif %?INSTALL%
 
 if %?INSTALL%
 am__installdirs += "$(DESTDIR)$(%NDIR%dir)"
-.PHONY install-%EXEC?exec:data%-am: install-%DIR%%PRIMARY%
+?EXEC?.PHONY install-exec-am: install-%DIR%%PRIMARY%
+?!EXEC?.PHONY install-data-am: install-%DIR%%PRIMARY%
 install-%DIR%%PRIMARY%: $(%DIR%_%PRIMARY%)
        @$(NORMAL_INSTALL)
 if %?BASE%
diff --git a/lib/am/dejagnu.am b/lib/am/dejagnu.am
index f1ee471..50c1f51 100644
--- a/lib/am/dejagnu.am
+++ b/lib/am/dejagnu.am
@@ -20,24 +20,8 @@ DEJATOOL = $(PACKAGE)
 ## Default flags to pass to dejagnu.  The user can override this.
 RUNTESTDEFAULTFLAGS = --tool $$tool --srcdir $$srcdir
 
-## In Cygnus mode, these are found in the build tree.
-## Otherwise they are looked for in $PATH.
-if %?CYGNUS%
-EXPECT = `if test -f $(top_builddir)/../expect/expect; then \
-           echo $(top_builddir)/../expect/expect; \
-         else \
-           echo expect; \
-         fi`
-
-RUNTEST = `if test -f $(top_srcdir)/../dejagnu/runtest; then \
-            echo $(top_srcdir)/../dejagnu/runtest; \
-          else \
-            echo runtest; \
-          fi`
-else ! %?CYGNUS%
 EXPECT = expect
 RUNTEST = runtest
-endif ! %?CYGNUS%
 
 
 .PHONY: check-DEJAGNU
@@ -45,21 +29,14 @@ check-DEJAGNU: site.exp
 ## Life is easiest with an absolute srcdir, so do that.
        srcdir='$(srcdir)'; export srcdir; \
        EXPECT=$(EXPECT); export EXPECT; \
-## Allow this to work when expect and DejaGnu are in tree.
-## Only required when --cygnus in force.
-?CYGNUS?       if [ -f $(top_builddir)/../expect/expect ]; then \
-?CYGNUS?         TCL_LIBRARY=`$(am__cd) $(top_srcdir)/../tcl/library && pwd`; \
-?CYGNUS?         export TCL_LIBRARY; \
-?CYGNUS?       fi; \
-       runtest=$(RUNTEST); \
 ## If runtest can't be found, print a warning but don't die.  It is
 ## pointless to cause a failure if the tests cannot be run at all.
-       if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \
+       if $(SHELL) -c "$(RUNTEST) --version" > /dev/null 2>&1; then \
          exit_status=0; l='$(DEJATOOL)'; for tool in $$l; do \
-           if $$runtest $(AM_RUNTESTFLAGS) $(RUNTESTDEFAULTFLAGS) 
$(RUNTESTFLAGS); \
+           if $(RUNTEST) $(AM_RUNTESTFLAGS) $(RUNTESTDEFAULTFLAGS) 
$(RUNTESTFLAGS); \
            then :; else exit_status=1; fi; \
          done; \
-       else echo "WARNING: could not find 'runtest'" 1>&2; :;\
+       else echo "WARNING: could not find '$(RUNTEST)'" 1>&2; :;\
        fi; \
        exit $$exit_status
 
diff --git a/lib/am/distdir.am b/lib/am/distdir.am
index 07f0502..1f2eef0 100644
--- a/lib/am/distdir.am
+++ b/lib/am/distdir.am
@@ -14,7 +14,6 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-## DIST_COMMON comes first so that README can be the very first file.
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 
 if %?TOPDIR_P%
@@ -91,32 +90,6 @@ if  %?CK-NEWS%
 endif  %?CK-NEWS%
 endif %?TOPDIR_P%
 ##
-## 'missing help2man' may have created some bogus man pages.  Ensure they
-## are not distributed.
-##
-if %?INSTALL-MAN%
-if %?HAVE-MANS%
-       @list='$(MANS)'; if test -n "$$list"; then \
-         list=`for p in $$list; do \
-           if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
-## Note that we check existing man pages here only.  If there are man pages
-## which are not distributed, and may be generated only conditionally, then
-## we should not error out because of them.  This could be refined to take
-## into account only dist_*_MANS, but then we'd be missing out on those
-## the user distributes with EXTRA_DIST.
-           if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
-         if test -n "$$list" && \
-           grep 'ab help2man is required to generate this page' $$list 
>/dev/null; then \
-           echo "error: found man pages containing the 'missing help2man' 
replacement text:" >&2; \
-           grep -l 'ab help2man is required to generate this page' $$list | 
sed 's/^/         /' >&2; \
-           echo "       to fix them, install help2man, remove and regenerate 
the man pages;" >&2; \
-           echo "       typically 'make maintainer-clean' will remove them" 
>&2; \
-           exit 1; \
-         else :; fi; \
-       else :; fi
-endif %?HAVE-MANS%
-endif %?INSTALL-MAN%
-##
 ## Only for the top dir.
 ##
 if %?TOPDIR_P%
diff --git a/lib/am/libs.am b/lib/am/libs.am
index d1f63ae..f94a712 100644
--- a/lib/am/libs.am
+++ b/lib/am/libs.am
@@ -24,7 +24,8 @@ endif %?INSTALL%
 
 if %?INSTALL%
 am__installdirs += "$(DESTDIR)$(%NDIR%dir)"
-.PHONY install-%EXEC?exec:data%-am: install-%DIR%LIBRARIES
+?EXEC?.PHONY install-exec-am: install-%DIR%LIBRARIES
+?!EXEC?.PHONY install-data-am: install-%DIR%LIBRARIES
 install-%DIR%LIBRARIES: $(%DIR%_LIBRARIES)
        @$(NORMAL_INSTALL)
 if %?BASE%
@@ -69,7 +70,8 @@ endif !%?BASE%
        @list='$(%DIR%_LIBRARIES)'; test -n "$(%NDIR%dir)" || list=; \
        for p in $$list; do \
          if test -f $$p; then \
-           %BASE?$(am__strip_dir):f=$$p;% \
+?BASE?     $(am__strip_dir) \
+?!BASE?            f=$$p; \
 ## Must ranlib after installing because mod time changes.
 ## cd to target directory because AIX ranlib messes up with whitespace
 ## in the argument.
diff --git a/lib/am/lisp.am b/lib/am/lisp.am
index 050d7dc..fc3575b 100644
--- a/lib/am/lisp.am
+++ b/lib/am/lisp.am
@@ -22,60 +22,28 @@ endif %?INSTALL%
 ## Building.  ##
 ## ---------- ##
 
-elc-stamp: $(LISP)
-       @echo 'WARNING: Warnings can be ignored. :-)'
-       @rm -f elc-temp && touch elc-temp
-       if test "$(EMACS)" != no; then \
-## Make sure "$@" isn't empty initially.
-         set x; \
-## Populate "$@" with elisp files (found in the current directory
-## or in $srcdir).
-         list='$(LISP)'; for p in $$list; do \
-           if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
-           set x "$$@" "$$d$$p"; shift; \
-         done; \
-## Finally call elisp-comp for all files.
-         shift; \
-         abs_srcdir="$(abs_srcdir)" EMACS="$(EMACS)" $(SHELL) \
-           $(elisp_comp) "$$@" || exit 1; \
-       else : ; fi
-       @mv -f elc-temp $@
-
-## Do not use $(ELCFILES) as target, because it may have been emptied
-## by the user (to disable byte-compilation), and POSIX does not allow
-## an empty target.
-$(am__ELCFILES): elc-stamp
-## Recover from the removal of address@hidden
-##
-## Do not call "make elc-stamp" if emacs is not available, because it would
-## be useless.
-##
-## If "make -n" is called, do not execute any command in the recipe that
-## changes the tree; however, invoke the recursive make for debuggability.
-       @if $(am__make_dryrun); then dry=:; else dry=; fi; \
-       if test "$(EMACS)" != no && test ! -f $@; then \
-## If "make -j" is used and more than one file has been erased, several
-## processes can execute this block.  We have to make sure that only
-## the first one will run "$(MAKE) $(AM_MAKEFLAGS) elc-stamp", and the
-## other ones will wait.
-##
-## There is a race here if only one child of make receive a signal.
-## In that case the build may fail.  We remove elc-stamp when we receive
-## a signal so we are sure the build will succeed the next time.
-         $$dry trap 'rm -rf elc-lock elc-stamp' 1 2 13 15; \
-         if $$dry mkdir elc-lock 2>/dev/null; then \
-## This code is being executed by the first process.
-           $$dry rm -f elc-stamp; \
-           $(MAKE) $(AM_MAKEFLAGS) elc-stamp; \
-           $$dry rmdir elc-lock; \
-         else \
-## This code is being executed by the follower processes.
-## Wait until the first process is done.
-           while test -d elc-lock && test -z "$$dry"; do sleep 1; done; \
-## Succeed if and only if the first process succeeded.
-           $$dry test -f elc-stamp; exit $$?; \
-         fi; \
-       else : ; fi
+.el.elc:
+## We add $(builddir) and $(srcdir) to load-path, so that any '.el' files
+## that $< depends upon can be found (including generated ones).
+## We prefer files from the build directory to those from the source
+## directory, in true VPATH spirit.
+## The destination file is normally determined by appending "c" to the
+## input (which would erronously put it in $(srcdir) in VPATH builds),
+## so we override that, too.
+       if test "$(EMACS)" != "no"; then \
+         am__subdir_includes=''; \
+         case $@ in */*) \
+           am__dir=`echo '$@' | sed 's,/[^/]*$$,,'`; \
+           am__subdir_includes="-L $$am__dir -L $(srcdir)/$$am__dir"; \
+         esac; \
+## Emacs byte-compilation won't create this automatically, sadly.
+         test -d $$am__dir || $(MKDIR_P) $$am__dir || exit 1; \
+         $(EMACS) --batch \
+           $(AM_ELCFLAGS) $(ELCFLAGS) \
+           $$am__subdir_includes -L $(builddir) -L $(srcdir) \
+           --eval "(defun byte-compile-dest-file (f) \"address@hidden")" \
+           --eval "(unless (byte-compile-file \"$<\") (kill-emacs 1))"; \
+       else :; fi
 
 
 ## ------------ ##
@@ -84,8 +52,13 @@ $(am__ELCFILES): elc-stamp
 
 if %?INSTALL%
 am__installdirs += "$(DESTDIR)$(%NDIR%dir)"
-%DIR%LISP_INSTALL = %BASE?$(INSTALL_DATA):$(install_sh_DATA)%
-.PHONY install-%EXEC?exec:data%-am: install-%DIR%LISP
+
+?BASE?%DIR%LISP_INSTALL = $(INSTALL_DATA)
+?!BASE?%DIR%LISP_INSTALL = $(install_sh_DATA)
+
+?EXEC?.PHONY install-exec-am: install-%DIR%LISP
+?!EXEC?.PHONY install-data-am: install-%DIR%LISP
+
 install-%DIR%LISP: $(%DIR%_LISP) $(ELCFILES)
        @$(NORMAL_INSTALL)
 ## Do not install anything if EMACS was not found.
@@ -101,7 +74,8 @@ install-%DIR%LISP: $(%DIR%_LISP) $(ELCFILES)
          for p in $$list; do \
 ## A lisp file can be in the source directory or the build directory.
            if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
-           %BASE?$(am__strip_dir):$(am__vpath_adj)% \
+?BASE?     $(am__strip_dir) \
+?!BASE?            $(am__vpath_adj) \
            echo " $(%DIR%LISP_INSTALL) '$$d$$p' '$(DESTDIR)$(%NDIR%dir)/$$f'"; 
\
            $(%DIR%LISP_INSTALL) "$$d$$p" "$(DESTDIR)$(%NDIR%dir)/$$f" || exit 
$$?; \
 ## Only install .elc file if it exists.
@@ -138,7 +112,7 @@ endif %?INSTALL%
 
 .PHONY clean-am: clean-lisp
 clean-lisp:
-       -rm -f elc-stamp $(ELCFILES)
+       -rm -f $(ELCFILES)
 
 
 ## -------------- ##
diff --git a/lib/am/ltlib.am b/lib/am/ltlib.am
index 1ca26b5..af3a256 100644
--- a/lib/am/ltlib.am
+++ b/lib/am/ltlib.am
@@ -23,8 +23,12 @@ endif %?INSTALL%
 ## ------------ ##
 
 if %?INSTALL%
+
 am__installdirs += "$(DESTDIR)$(%NDIR%dir)"
-.PHONY install-%EXEC?exec:data%-am: install-%DIR%LTLIBRARIES
+
+?EXEC?.PHONY install-exec-am: install-%DIR%LTLIBRARIES
+?!EXEC?.PHONY install-data-am: install-%DIR%LTLIBRARIES
+
 install-%DIR%LTLIBRARIES: $(%DIR%_LTLIBRARIES)
        @$(NORMAL_INSTALL)
 if %?BASE%
@@ -89,7 +93,8 @@ uninstall-%DIR%LTLIBRARIES:
        @$(NORMAL_UNINSTALL)
        @list='$(%DIR%_LTLIBRARIES)'; test -n "$(%NDIR%dir)" || list=; \
        for p in $$list; do \
-         %BASE?$(am__strip_dir):f=$$p;% \
+?BASE?   $(am__strip_dir) \
+?!BASE?          f=$$p; \
 ?LIBTOOL?        echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) 
--mode=uninstall rm -f '$(DESTDIR)$(%NDIR%dir)/$$f'"; \
 ?LIBTOOL?        $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) 
--mode=uninstall rm -f "$(DESTDIR)$(%NDIR%dir)/$$f"; \
 ?!LIBTOOL?       echo " rm -f '$(DESTDIR)$(%NDIR%dir)/$$f'"; \
diff --git a/lib/am/progs.am b/lib/am/progs.am
index 2be8bca..104270c 100644
--- a/lib/am/progs.am
+++ b/lib/am/progs.am
@@ -20,7 +20,8 @@
 
 if %?INSTALL%
 am__installdirs += "$(DESTDIR)$(%NDIR%dir)"
-.PHONY install-%EXEC?exec:data%-am: install-%DIR%PROGRAMS
+?EXEC?.PHONY install-exec-am: install-%DIR%PROGRAMS
+?!EXEC?.PHONY install-data-am: install-%DIR%PROGRAMS
 install-%DIR%PROGRAMS: $(%DIR%_PROGRAMS)
        @$(NORMAL_INSTALL)
 ## Funny invocation because Makefile variable can be empty, leading to
@@ -34,13 +35,16 @@ install-%DIR%PROGRAMS: $(%DIR%_PROGRAMS)
 ## On Cygwin with libtool test won't see 'foo.exe' but instead 'foo'.
 ## So we check for both.
        sed 's/$(EXEEXT)$$//' | \
-       while read p p1; do if test -f $$p%LIBTOOL? || test -f $$p1%; \
-         then echo "$$p"; echo "$$p"; else :; fi; \
+       while read p p1; do if test -f $$p \
+?LIBTOOL?       || test -f $$p1 \
+         ; then echo "$$p"; echo "$$p"; else :; fi; \
        done | \
 ## We now have a list of sourcefile pairs, separated by newline.
 ## Turn that into "sourcefile source_base target_dir xformed_target_base",
 ## with newlines being turned into spaces in a second step.
-       sed -e 'p;s,.*/,,;n;h' -e '%BASE?s|.*|.|:s|[^/]*$$||; s|^$$|.|%' \
+       sed -e 'p;s,.*/,,;n;h' \
+?BASE?     -e 's|.*|.|' \
+?!BASE?            -e 's|[^/]*$$||; s|^$$|.|' \
            -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
@@ -86,7 +90,9 @@ uninstall-%DIR%PROGRAMS:
 ## but keep the directory part in the hold buffer, in order to
 ## reapply it again afterwards in the nobase case.  Append $(EXEEXT).
          sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
-             -e 's/$$/$(EXEEXT)/'%BASE? : -e 'x;s,[^/]*$$,,;G;s,\n,,'%`; \
+             -e 's/$$/$(EXEEXT)/' \
+?!BASE?              -e 'x;s,[^/]*$$,,;G;s,\n,,' \
+       `; \
        test -n "$$list" || exit 0; \
        echo " ( cd '$(DESTDIR)$(%NDIR%dir)' && rm -f" $$files ")"; \
        cd "$(DESTDIR)$(%NDIR%dir)" && rm -f $$files
diff --git a/lib/am/python.am b/lib/am/python.am
index 2f12af4..143245e 100644
--- a/lib/am/python.am
+++ b/lib/am/python.am
@@ -26,7 +26,8 @@ endif %?INSTALL%
 
 if %?INSTALL%
 am__installdirs += "$(DESTDIR)$(%NDIR%dir)"
-.PHONY install-%EXEC?exec:data%-am: install-%DIR%PYTHON
+?EXEC?.PHONY install-exec-am: install-%DIR%PYTHON
+?!EXEC?.PHONY install-data-am: install-%DIR%PYTHON
 install-%DIR%PYTHON: $(%DIR%_PYTHON)
        @$(NORMAL_INSTALL)
 if %?BASE%
diff --git a/lib/am/scripts.am b/lib/am/scripts.am
index 64e093e..88c1c92 100644
--- a/lib/am/scripts.am
+++ b/lib/am/scripts.am
@@ -25,7 +25,8 @@ endif %?INSTALL%
 if %?INSTALL%
 ## if doesn't work properly for Automake variables yet.
 am__installdirs += "$(DESTDIR)$(%NDIR%dir)"
-.PHONY install-%EXEC?exec:data%-am: install-%DIR%SCRIPTS
+?EXEC?.PHONY install-exec-am: install-%DIR%SCRIPTS
+?!EXEC?.PHONY install-data-am: install-%DIR%SCRIPTS
 install-%DIR%SCRIPTS: $(%DIR%_SCRIPTS)
        @$(NORMAL_INSTALL)
 ## Funny invocation because Makefile variable can be empty, leading to
diff --git a/lib/am/subdirs.am b/lib/am/subdirs.am
index 3fc2888..005483a 100644
--- a/lib/am/subdirs.am
+++ b/lib/am/subdirs.am
@@ -17,13 +17,17 @@
 RECURSIVE_TARGETS += all-recursive check-recursive installcheck-recursive
 RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive        \
   distclean-recursive maintainer-clean-recursive
+
+am__recursive_targets = \
+  $(RECURSIVE_TARGETS) \
+  $(RECURSIVE_CLEAN_TARGETS) \
+  $(am__extra_recursive_targets)
+
 ## All documented targets which invoke 'make' recursively, or depend
-## on targets that do so.
-AM_RECURSIVE_TARGETS += $(RECURSIVE_TARGETS:-recursive=) \
-  $(RECURSIVE_CLEAN_TARGETS:-recursive=)
+## on targets that do so.  GNUmakefile from gnulib depends on this.
+AM_RECURSIVE_TARGETS += $(am__recursive_targets:-recursive=)
 
-.PHONY: $(RECURSIVE_TARGETS) $(RECURSIVE_CLEAN_TARGETS)
-.MAKE: $(RECURSIVE_TARGETS) $(RECURSIVE_CLEAN_TARGETS)
+.PHONY .MAKE: $(am__recursive_targets)
 
 # This directory's subdirectories are mostly independent; you can cd
 # into them and run 'make' without going through this Makefile.
@@ -32,7 +36,7 @@ AM_RECURSIVE_TARGETS += $(RECURSIVE_TARGETS:-recursive=) \
 #     (which will cause the Makefiles to be regenerated when you run 'make');
 # (2) otherwise, pass the desired values on the 'make' command line.
 
-$(RECURSIVE_TARGETS) $(RECURSIVE_CLEAN_TARGETS):
+$(am__recursive_targets):
 ## Using $failcom allows "-k" to keep its natural meaning when running a
 ## recursive rule.
        @fail= failcom='exit 1'; \
@@ -66,7 +70,6 @@ $(RECURSIVE_TARGETS) $(RECURSIVE_CLEAN_TARGETS):
          $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
        fi; test -z "$$fail"
 
-
 mostlyclean: mostlyclean-recursive
 clean: clean-recursive
 distclean: distclean-recursive
diff --git a/lib/am/tags.am b/lib/am/tags.am
index fccacca..730ccc5 100644
--- a/lib/am/tags.am
+++ b/lib/am/tags.am
@@ -14,20 +14,31 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates.  Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+## Handle VPATH correctly.
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
+
 ## ---- ##
 ## ID.  ##
 ## ---- ##
 
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-## Make sure the list of sources is unique.
-       list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-## Handle VPATH correctly.
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-             END { if (nonempty) { for (i in files) print i; }; }'`; \
-       mkid -fID $$unique
+ID: $(am__tagged_files)
+       $(am__define_uniq_tagged_files); mkid -fID $$unique
 
 
 ## ------ ##
@@ -35,14 +46,17 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
 ## ------ ##
 
 ETAGS = etags
-.PHONY: tags
+.PHONY: TAGS tags
 if %?SUBDIRS%
-AM_RECURSIVE_TARGETS += tags TAGS
-endif %?SUBDIRS%
-tags: TAGS
-
-TAGS: %TAGSDIRS% $(HEADERS) $(SOURCES) %CONFIG% $(TAGS_DEPENDENCIES) \
-               $(TAGS_FILES) $(LISP)
+AM_RECURSIVE_TARGETS += TAGS
+RECURSIVE_TARGETS += tags-recursive
+tags: tags-recursive
+else !%?SUBDIRS%
+tags: tags-am
+endif !%?SUBDIRS%
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
 ## We use the positional parameters to build the subdir list with
 ## absolute names, without the need to worry about white space in `pwd`.
        set x; \
@@ -67,14 +81,7 @@ TAGS: %TAGSDIRS% $(HEADERS) $(SOURCES) %CONFIG% 
$(TAGS_DEPENDENCIES) \
 ?SUBDIRS?            set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
 ?SUBDIRS?        fi; \
 ?SUBDIRS?      done; \
-## Make sure the list of sources is unique.
-       list='$(SOURCES) $(HEADERS) %CONFIG% $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-## Handle VPATH correctly.
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       $(am__define_uniq_tagged_files); \
 ## Remove the 'x' we added first:
        shift; \
 ## Make sure we have something to run etags on.
@@ -97,23 +104,16 @@ TAGS: %TAGSDIRS% $(HEADERS) $(SOURCES) %CONFIG% 
$(TAGS_DEPENDENCIES) \
 CTAGS = ctags
 .PHONY: CTAGS ctags
 if %?SUBDIRS%
-AM_RECURSIVE_TARGETS += ctags CTAGS
-endif %?SUBDIRS%
-ctags: CTAGS
-
-## We have a dummy name here because 'tags' has already been in use
-## for a long time to mean Emacs-style tags.  Oops.  This means the
-## dependencies here are useless.
-CTAGS: %CTAGSDIRS% $(HEADERS) $(SOURCES) %CONFIG% $(TAGS_DEPENDENCIES) \
-               $(TAGS_FILES) $(LISP)
-## Make sure the list of sources is unique.
-       list='$(SOURCES) $(HEADERS) %CONFIG% $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-## Handle VPATH correctly.
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-             END { if (nonempty) { for (i in files) print i; }; }'`; \
+AM_RECURSIVE_TARGETS += CTAGS
+RECURSIVE_TARGETS += ctags-recursive
+ctags: ctags-recursive
+else !%?SUBDIRS%
+ctags: ctags-am
+endif !%?SUBDIRS%
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+       $(am__define_uniq_tagged_files); \
 ## Make sure we have something to run ctags on.
        test -z "$(CTAGS_ARGS)$$unique" \
          || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
@@ -136,25 +136,26 @@ GTAGS:
 ## ------- ##
 
 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
-
+cscope.files: clean-cscope cscopelist
 endif %?TOPDIR_P%
 
-.PHONY: cscopelist
-cscopelist: %CSCOPEDIRS% $(HEADERS) $(SOURCES) $(LISP)
-       list='$(SOURCES) $(HEADERS) $(LISP)'; \
+if %?SUBDIRS%
+RECURSIVE_TARGETS += cscopelist-recursive
+cscopelist: cscopelist-recursive
+else !%?SUBDIRS%
+cscopelist: cscopelist-am
+endif !%?SUBDIRS%
+
+cscopelist-am: $(am__tagged_files)
+       list='$(am__tagged_files)'; \
        case "$(srcdir)" in \
          [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
          *) sdir=$(subdir)/$(srcdir) ;; \
diff --git a/lib/am/texibuild.am b/lib/am/texibuild.am
index f77748a..0fe09b1 100644
--- a/lib/am/texibuild.am
+++ b/lib/am/texibuild.am
@@ -65,14 +65,18 @@ INFO_DEPS += %DEST_INFO_PREFIX%%DEST_SUFFIX%
 ## 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.
 ## texi2dvi doesn't silence everything with -q, redirect to /dev/null instead.
 ## We still want -q (%TEXIQUIET%) because it turns on batch mode.
-## Use '--clean' to avoid leaving auxiliary files behind cluttering the build
-## directory (see automake bug#11146).  We should start using '--tidy' when we
-## can assume Texinf 4.9 or later.
-?GENERIC?      $(TEXI2DVI) %TEXIQUIET% --clean %SOURCE% %TEXIDEVNULL%
-?!GENERIC?     $(TEXI2DVI) %TEXIQUIET% --clean -o $@ `test -f '%SOURCE%' || 
echo '$(srcdir)/'`%SOURCE% %TEXIDEVNULL%
+## Use '--build-dir' so that TeX and Texinfo auxiliary files and build
+## by-products are left in there, instead of cluttering the current
+## directory (see automake bug#11146).  Use a different build-dir for
+## each file (and distinct from that of the corresponding PDF file) to
+## avoid hitting a Texinfop bug that could cause low-probability racy
+## failure when doing parallel builds; see:
+## http://lists.gnu.org/archive/html/automake-patches/2012-06/msg00073.html
+       $(TEXI2DVI) %TEXIQUIET% --build-dir=$(@:.dvi=.t2d) -o $@ %TEXIDEVNULL% \
+?GENERIC?      %SOURCE%
+?!GENERIC?     `test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE%
 
 ?GENERIC?%SOURCE_SUFFIX%.pdf:
 ?!GENERIC?%DEST_PREFIX%.pdf: %SOURCE% %DEPS% %DIRSTAMP%
@@ -80,14 +84,18 @@ INFO_DEPS += %DEST_INFO_PREFIX%%DEST_SUFFIX%
 ## 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.
 ## texi2pdf doesn't silence everything with -q, redirect to /dev/null instead.
 ## We still want -q (%TEXIQUIET%) because it turns on batch mode.
-## Use '--clean' to avoid leaving auxiliary files behind cluttering the build
-## directory (see automake bug#11146).  We should start using '--tidy' when we
-## can assume Texinf 4.9 or later.
-?GENERIC?      $(TEXI2PDF) %TEXIQUIET% --clean %SOURCE% %TEXIDEVNULL%
-?!GENERIC?     $(TEXI2PDF) %TEXIQUIET% --clean -o $@ `test -f '%SOURCE%' || 
echo '$(srcdir)/'`%SOURCE% %TEXIDEVNULL%
+## Use '--build-dir' so that TeX and Texinfo auxiliary files and build
+## by-products are left in there, instead of cluttering the current
+## directory (see automake bug#11146).  Use a different build-dir for
+## each file (and distinct from that of the corresponding DVI file) to
+## avoid hitting a Texinfop bug that could cause low-probability racy
+## failure when doing parallel builds; see:
+## http://lists.gnu.org/archive/html/automake-patches/2012-06/msg00073.html
+       $(TEXI2PDF) %TEXIQUIET% --build-dir=$(@:.pdf=.t2p) -o $@ %TEXIDEVNULL% \
+?GENERIC?      %SOURCE%
+?!GENERIC?     `test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE%
 
 ?GENERIC?%SOURCE_SUFFIX%.html:
 ?!GENERIC?%DEST_PREFIX%.html: %SOURCE% %DEPS% %DIRSTAMP%
diff --git a/lib/am/texinfos.am b/lib/am/texinfos.am
index 42787c7..6d45c95 100644
--- a/lib/am/texinfos.am
+++ b/lib/am/texinfos.am
@@ -20,26 +20,7 @@
 ## ----------- ##
 
 if %?LOCAL-TEXIS%
-if ! %?CYGNUS%
 TEXI2DVI = texi2dvi
-
-else %?CYGNUS%
-
-## Find these programs wherever they may lie.  Yes, this has
-## intimate knowledge of the structure of the texinfo distribution.
-MAKEINFO = `if test -f $(top_builddir)/../texinfo/makeinfo/makeinfo; then \
-            echo $(top_builddir)/../texinfo/makeinfo/makeinfo; \
-          else \
-            echo makeinfo; \
-          fi`
-
-TEXI2DVI = `if test -f $(top_srcdir)/../texinfo/util/texi2dvi; then \
-             echo $(top_srcdir)/../texinfo/util/texi2dvi; \
-           else \
-             echo texi2dvi; \
-           fi`
-endif %?CYGNUS%
-
 TEXI2PDF = $(TEXI2DVI) --pdf --batch
 MAKEINFOHTML = $(MAKEINFO) --html
 AM_MAKEINFOHTMLFLAGS = $(AM_MAKEINFOFLAGS)
@@ -405,13 +386,14 @@ if %?LOCAL-TEXIS%
 .PHONY: mostlyclean-aminfo
 mostlyclean-aminfo:
 ## Use '-rf', not just '-f', because the %*CLEAN% substitutions can also
-## contain any directory created by "makeinfo --html".
+## contain any directory created by "makeinfo --html", as well as the
+## '*.t2d' and '*.t2p' directories used by texi2dvi and texi2pdf.
        -rm -rf %MOSTLYCLEAN%
 
 .PHONY clean-am: clean-aminfo
 clean-aminfo:
-## Use '-rf', not just '-f', because the %*CLEAN% substitutions can also
-## contain any directory created by "makeinfo --html".
+## Use '-rf', not just '-f'; see comments in 'mostlyclean-aminfo'
+## above for details.
 ?TEXICLEAN?    -test -z "%TEXICLEAN%" \
 ?TEXICLEAN?    || rm -rf %TEXICLEAN%
 
@@ -423,11 +405,9 @@ maintainer-clean-aminfo:
          echo " rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] 
$$i_i[0-9][0-9]"; \
          rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]; \
        done
-## Use '-rf', not just '-f', because the %*CLEAN% substitutions can also
-## contain any directory created by "makeinfo --html".
+## Use '-rf', not just '-f'; see comments in 'mostlyclean-aminfo'
+## above for details.
 ?MAINTCLEAN?   -test -z "%MAINTCLEAN%" \
 ?MAINTCLEAN?   || rm -rf %MAINTCLEAN%
 
-?CYGNUS?.PHONY: clean-info
-?CYGNUS?clean-info: mostlyclean-aminfo clean-aminfo
 endif %?LOCAL-TEXIS%
diff --git a/lib/depcomp b/lib/depcomp
index e1f51f4..3f02f5d 100755
--- a/lib/depcomp
+++ b/lib/depcomp
@@ -1,7 +1,7 @@
 #! /bin/sh
 # depcomp - compile a program generating dependencies as side-effects
 
-scriptversion=2012-07-12.20; # UTC
+scriptversion=2012-10-18.11; # UTC
 
 # Copyright (C) 1999-2012 Free Software Foundation, Inc.
 
@@ -27,9 +27,9 @@ scriptversion=2012-07-12.20; # UTC
 
 case $1 in
   '')
-     echo "$0: No command.  Try '$0 --help' for more information." 1>&2
-     exit 1;
-     ;;
+    echo "$0: No command.  Try '$0 --help' for more information." 1>&2
+    exit 1;
+    ;;
   -h | --h*)
     cat <<\EOF
 Usage: depcomp [--help] [--version] PROGRAM [ARGS]
@@ -56,11 +56,65 @@ EOF
     ;;
 esac
 
+# Get the directory component of the given path, and save it in the
+# global variables '$dir'.  Note that this directory component will
+# be either empty or ending with a '/' character.  This is deliberate.
+set_dir_from ()
+{
+  case $1 in
+    */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;;
+      *) dir=;;
+  esac
+}
+
+# Get the suffix-stripped basename of the given path, and save it the
+# global variable '$base'.
+set_base_from ()
+{
+  base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'`
+}
+
+# If no dependency file was actually created by the compiler invocation,
+# we still have to create a dummy depfile, to avoid errors with the
+# Makefile "include basename.Plo" scheme.
+make_dummy_depfile ()
+{
+  echo "#dummy" > "$depfile"
+}
+
+# Factor out some common post-processing of the generated depfile.
+# Requires the auxiliary global variable '$tmpdepfile' to be set.
+aix_post_process_depfile ()
+{
+  # If the compiler actually managed to produce a dependency file,
+  # post-process it.
+  if test -f "$tmpdepfile"; then
+    # Each line is of the form 'foo.o: dependency.h'.
+    # Do two passes, one to just change these to
+    #   $object: dependency.h
+    # and one to simply output
+    #   dependency.h:
+    # which is needed to avoid the deleted-header problem.
+    { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile"
+      sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile"
+    } > "$depfile"
+    rm -f "$tmpdepfile"
+  else
+    make_dummy_depfile
+  fi
+}
+
 # A tabulation character.
 tab='  '
 # A newline character.
 nl='
 '
+# Character ranges might be problematic outside the C locale.
+# These definitions help.
+upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ
+lower=abcdefghijklmnopqrstuvwxyz
+digits=0123456789
+alpha=${upper}${lower}
 
 if test -z "$depmode" || test -z "$source" || test -z "$object"; then
   echo "depcomp: Variables source, object and depmode must be set" 1>&2
@@ -88,32 +142,32 @@ if test "$depmode" = hp; then
 fi
 
 if test "$depmode" = dashXmstdout; then
-   # This is just like dashmstdout with a different argument.
-   dashmflag=-xM
-   depmode=dashmstdout
+  # This is just like dashmstdout with a different argument.
+  dashmflag=-xM
+  depmode=dashmstdout
 fi
 
 cygpath_u="cygpath -u -f -"
 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'
-   depmode=msvisualcpp
+  # 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'
+  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
+  # 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
 
 if test "$depmode" = xlc; then
-   # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information.
-   gccflag=-qmakedep=gcc,-MF
-   depmode=gcc
+  # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information.
+  gccflag=-qmakedep=gcc,-MF
+  depmode=gcc
 fi
 
 case "$depmode" in
@@ -136,8 +190,7 @@ gcc3)
   done
   "$@"
   stat=$?
-  if test $stat -eq 0; then :
-  else
+  if test $stat -ne 0; then
     rm -f "$tmpdepfile"
     exit $stat
   fi
@@ -163,15 +216,14 @@ gcc)
   fi
   "$@" -Wp,"$gccflag$tmpdepfile"
   stat=$?
-  if test $stat -eq 0; then :
-  else
+  if test $stat -ne 0; then
     rm -f "$tmpdepfile"
     exit $stat
   fi
   rm -f "$depfile"
   echo "$object : \\" > "$depfile"
-  alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
-## The second -e expression handles DOS-style file names with drive letters.
+  # The second -e expression handles DOS-style file names with drive
+  # letters.
   sed -e 's/^[^:]*: / /' \
       -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
 ## This next piece of magic avoids the "deleted header file" problem.
@@ -180,15 +232,15 @@ gcc)
 ## typically no way to rebuild the header).  We avoid this by adding
 ## dummy dependencies for each header file.  Too bad gcc doesn't do
 ## this for us directly.
-  tr ' ' "$nl" < "$tmpdepfile" |
 ## Some versions of gcc put a space before the ':'.  On the theory
 ## that the space means something, we add a space to the output as
 ## well.  hp depmode also adds that space, but also prefixes the VPATH
 ## to the object.  Take care to not repeat it in the output.
 ## Some versions of the HPUX 10.20 sed can't process this invocation
 ## correctly.  Breaking it into two sed invocations is a workaround.
-    sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
-      | sed -e 's/$/ :/' >> "$depfile"
+  tr ' ' "$nl" < "$tmpdepfile" \
+    | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
+    | sed -e 's/$/ :/' >> "$depfile"
   rm -f "$tmpdepfile"
   ;;
 
@@ -206,8 +258,7 @@ sgi)
     "$@" -MDupdate "$tmpdepfile"
   fi
   stat=$?
-  if test $stat -eq 0; then :
-  else
+  if test $stat -ne 0; then
     rm -f "$tmpdepfile"
     exit $stat
   fi
@@ -215,7 +266,6 @@ sgi)
 
   if test -f "$tmpdepfile"; then  # yes, the sourcefile depend on other files
     echo "$object : \\" > "$depfile"
-
     # Clip off the initial element (the dependent).  Don't try to be
     # clever and replace this with sed code, as IRIX sed won't handle
     # lines with more than a fixed number of characters (4096 in
@@ -223,19 +273,15 @@ sgi)
     # the IRIX cc adds comments like '#:fec' to the end of the
     # dependency line.
     tr ' ' "$nl" < "$tmpdepfile" \
-    | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
-    tr "$nl" ' ' >> "$depfile"
+      | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \
+      | tr "$nl" ' ' >> "$depfile"
     echo >> "$depfile"
-
     # The second pass generates a dummy entry for each header file.
     tr ' ' "$nl" < "$tmpdepfile" \
-   | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
-   >> "$depfile"
+      | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
+      >> "$depfile"
   else
-    # The sourcefile does not contain any dependencies, so just
-    # store a dummy comment line, to avoid errors with the Makefile
-    # "include basename.Plo" scheme.
-    echo "#dummy" > "$depfile"
+    make_dummy_depfile
   fi
   rm -f "$tmpdepfile"
   ;;
@@ -253,9 +299,8 @@ aix)
   # current directory.  Also, the AIX compiler puts '$object:' at the
   # start of each line; $object doesn't have directory information.
   # Version 6 uses the directory in both cases.
-  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
-  test "x$dir" = "x$object" && dir=
-  base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+  set_dir_from "$object"
+  set_base_from "$object"
   if test "$libtool" = yes; then
     tmpdepfile1=$dir$base.u
     tmpdepfile2=$base.u
@@ -268,9 +313,7 @@ aix)
     "$@" -M
   fi
   stat=$?
-
-  if test $stat -eq 0; then :
-  else
+  if test $stat -ne 0; then
     rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
     exit $stat
   fi
@@ -279,65 +322,37 @@ aix)
   do
     test -f "$tmpdepfile" && break
   done
-  if test -f "$tmpdepfile"; then
-    # Each line is of the form 'foo.o: dependent.h'.
-    # Do two passes, one to just change these to
-    # '$object: dependent.h' and one to simply 'dependent.h:'.
-    sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
-    sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> 
"$depfile"
-  else
-    # The sourcefile does not contain any dependencies, so just
-    # store a dummy comment line, to avoid errors with the Makefile
-    # "include basename.Plo" scheme.
-    echo "#dummy" > "$depfile"
-  fi
-  rm -f "$tmpdepfile"
+  aix_post_process_depfile
   ;;
 
-icc)
-  # Intel's C compiler anf tcc (Tiny C Compiler) understand '-MD -MF file'.
-  # However on
-  #    $CC -MD -MF foo.d -c -o sub/foo.o sub/foo.c
-  # ICC 7.0 will fill foo.d with something like
-  #    foo.o: sub/foo.c
-  #    foo.o: sub/foo.h
-  # which is wrong.  We want
-  #    sub/foo.o: sub/foo.c
-  #    sub/foo.o: sub/foo.h
-  #    sub/foo.c:
-  #    sub/foo.h:
-  # ICC 7.1 will output
-  #    foo.o: sub/foo.c sub/foo.h
-  # and will wrap long lines using '\':
-  #    foo.o: sub/foo.c ... \
-  #     sub/foo.h ... \
-  #     ...
-  # tcc 0.9.26 (FIXME still under development at the moment of writing)
-  # will emit a similar output, but also prepend the continuation lines
-  # with horizontal tabulation characters.
+tcc)
+  # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26
+  # FIXME: That version still under development at the moment of writing.
+  #        Make that this statement remains true also for stable, released
+  #        versions.
+  # It will wrap lines (doesn't matter whether long or short) with a
+  # trailing '\', as in:
+  #
+  #   foo.o : \
+  #    foo.c \
+  #    foo.h \
+  #
+  # It will put a trailing '\' even on the last line, and will use leading
+  # spaces rather than leading tabs (at least since its commit 0394caf7
+  # "Emit spaces for -MD").
   "$@" -MD -MF "$tmpdepfile"
   stat=$?
-  if test $stat -eq 0; then :
-  else
+  if test $stat -ne 0; then
     rm -f "$tmpdepfile"
     exit $stat
   fi
   rm -f "$depfile"
-  # Each line is of the form 'foo.o: dependent.h',
-  # or 'foo.o: dep1.h dep2.h \', or ' dep3.h dep4.h \'.
-  # Do two passes, one to just change these to
-  # '$object: dependent.h' and one to simply 'dependent.h:'.
-  sed -e "s/^[ $tab][ $tab]*/  /" -e "s,^[^:]*:,$object :," \
-    < "$tmpdepfile" > "$depfile"
-  sed '
-    s/[ '"$tab"'][ '"$tab"']*/ /g
-    s/^ *//
-    s/ *\\*$//
-    s/^[^:]*: *//
-    /^$/d
-    /:$/d
-    s/$/ :/
-  ' < "$tmpdepfile" >> "$depfile"
+  # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'.
+  # We have to change lines of the first kind to '$object: \'.
+  sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile"
+  # And for each line of the second kind, we have to emit a 'dep.h:'
+  # dummy dependency, to avoid the deleted-header problem.
+  sed -n -e 's|^  *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile"
   rm -f "$tmpdepfile"
   ;;
 
@@ -356,34 +371,37 @@ pgcc)
   #    foo.o: sub/foo.c ... \
   #     sub/foo.h ... \
   #     ...
-  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
-  test "x$dir" = "x$object" && dir=
+  set_dir_from "$object"
   # Use the source, not the object, to determine the base name, since
   # that's sadly what pgcc will do too.
-  base=`echo "$source" | sed -e 's|^.*/||' -e 's/\.[-_a-zA-Z0-9]*$//'`
-  tmpdepfile="$base.d"
+  set_base_from "$source"
+  tmpdepfile=$base.d
 
   # For projects that build the same source file twice into different object
   # files, the pgcc approach of using the *source* file root name can cause
   # problems in parallel builds.  Use a locking strategy to avoid stomping on
   # the same $tmpdepfile.
-  lockdir="$base.d-lock"
-  trap "echo '$0: caught signal, cleaning up...' >&2; rm -rf $lockdir" 1 2 13 
15
+  lockdir=$base.d-lock
+  trap "
+    echo '$0: caught signal, cleaning up...' >&2
+    rmdir '$lockdir'
+    exit 1
+  " 1 2 13 15
   numtries=100
   i=$numtries
-  while test $i -gt 0 ; do
+  while test $i -gt 0; do
     # mkdir is a portable test-and-set.
-    if mkdir $lockdir 2>/dev/null; then
+    if mkdir "$lockdir" 2>/dev/null; then
       # This process acquired the lock.
       "$@" -MD
       stat=$?
       # Release the lock.
-      rm -rf $lockdir
+      rmdir "$lockdir"
       break
     else
-      ## the lock is being held by a different process,
-      ## wait until the winning process is done or we timeout
-      while test -d $lockdir && test $i -gt 0; do
+      # If the lock is being held by a different process, wait
+      # until the winning process is done or we timeout.
+      while test -d "$lockdir" && test $i -gt 0; do
         sleep 1
         i=`expr $i - 1`
       done
@@ -409,8 +427,8 @@ pgcc)
   sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
   # Some versions of the HPUX 10.20 sed can't process this invocation
   # correctly.  Breaking it into two sed invocations is a workaround.
-  sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
-    sed -e 's/$/ :/' >> "$depfile"
+  sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \
+    | sed -e 's/$/ :/' >> "$depfile"
   rm -f "$tmpdepfile"
   ;;
 
@@ -421,9 +439,8 @@ hp2)
   # 'foo.d', which lands next to the object file, wherever that
   # happens to be.
   # Much of this is similar to the tru64 case; see comments there.
-  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
-  test "x$dir" = "x$object" && dir=
-  base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+  set_dir_from  "$object"
+  set_base_from "$object"
   if test "$libtool" = yes; then
     tmpdepfile1=$dir$base.d
     tmpdepfile2=$dir.libs/$base.d
@@ -434,8 +451,7 @@ hp2)
     "$@" +Maked
   fi
   stat=$?
-  if test $stat -eq 0; then :
-  else
+  if test $stat -ne 0; then
      rm -f "$tmpdepfile1" "$tmpdepfile2"
      exit $stat
   fi
@@ -445,76 +461,61 @@ hp2)
     test -f "$tmpdepfile" && break
   done
   if test -f "$tmpdepfile"; then
-    sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
+    sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile"
     # Add 'dependent.h:' lines.
     sed -ne '2,${
-              s/^ *//
-              s/ \\*$//
-              s/$/:/
-              p
-            }' "$tmpdepfile" >> "$depfile"
+               s/^ *//
+               s/ \\*$//
+               s/$/:/
+               p
+             }' "$tmpdepfile" >> "$depfile"
   else
-    echo "#dummy" > "$depfile"
+    make_dummy_depfile
   fi
   rm -f "$tmpdepfile" "$tmpdepfile2"
   ;;
 
 tru64)
-   # The Tru64 compiler uses -MD to generate dependencies as a side
-   # effect.  'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
-   # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
-   # dependencies in 'foo.d' instead, so we check for that too.
-   # Subdirectories are respected.
-   dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
-   test "x$dir" = "x$object" && dir=
-   base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
-
-   if test "$libtool" = yes; then
-      # With Tru64 cc, shared objects can also be used to make a
-      # static library.  This mechanism is used in libtool 1.4 series to
-      # handle both shared and static libraries in a single compilation.
-      # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
-      #
-      # With libtool 1.5 this exception was removed, and libtool now
-      # generates 2 separate objects for the 2 libraries.  These two
-      # compilations output dependencies in $dir.libs/$base.o.d and
-      # in $dir$base.o.d.  We have to check for both files, because
-      # one of the two compilations can be disabled.  We should prefer
-      # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
-      # automatically cleaned when .libs/ is deleted, while ignoring
-      # the former would cause a distcleancheck panic.
-      tmpdepfile1=$dir.libs/$base.lo.d   # libtool 1.4
-      tmpdepfile2=$dir$base.o.d          # libtool 1.5
-      tmpdepfile3=$dir.libs/$base.o.d    # libtool 1.5
-      tmpdepfile4=$dir.libs/$base.d      # Compaq CCC V6.2-504
-      "$@" -Wc,-MD
-   else
-      tmpdepfile1=$dir$base.o.d
-      tmpdepfile2=$dir$base.d
-      tmpdepfile3=$dir$base.d
-      tmpdepfile4=$dir$base.d
-      "$@" -MD
-   fi
-
-   stat=$?
-   if test $stat -eq 0; then :
-   else
-      rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
-      exit $stat
-   fi
-
-   for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" 
"$tmpdepfile4"
-   do
-     test -f "$tmpdepfile" && break
-   done
-   if test -f "$tmpdepfile"; then
-      sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
-      sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> 
"$depfile"
-   else
-      echo "#dummy" > "$depfile"
-   fi
-   rm -f "$tmpdepfile"
-   ;;
+  # The Tru64 compiler uses -MD to generate dependencies as a side
+  # effect.  'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
+  # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
+  # dependencies in 'foo.d' instead, so we check for that too.
+  # Subdirectories are respected.
+  set_dir_from  "$object"
+  set_base_from "$object"
+
+  if test "$libtool" = yes; then
+    # Libtool generates 2 separate objects for the 2 libraries.  These
+    # two compilations output dependencies in $dir.libs/$base.o.d and
+    # in $dir$base.o.d.  We have to check for both files, because
+    # one of the two compilations can be disabled.  We should prefer
+    # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
+    # automatically cleaned when .libs/ is deleted, while ignoring
+    # the former would cause a distcleancheck panic.
+    tmpdepfile1=$dir$base.o.d          # libtool 1.5
+    tmpdepfile2=$dir.libs/$base.o.d    # Likewise.
+    tmpdepfile3=$dir.libs/$base.d      # Compaq CCC V6.2-504
+    "$@" -Wc,-MD
+  else
+    tmpdepfile1=$dir$base.d
+    tmpdepfile2=$dir$base.d
+    tmpdepfile3=$dir$base.d
+    "$@" -MD
+  fi
+
+  stat=$?
+  if test $stat -ne 0; then
+    rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+    exit $stat
+  fi
+
+  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+  do
+    test -f "$tmpdepfile" && break
+  done
+  # Same post-processing that is required for AIX mode.
+  aix_post_process_depfile
+  ;;
 
 msvc7)
   if test "$libtool" = yes; then
@@ -525,8 +526,7 @@ msvc7)
   "$@" $showIncludes > "$tmpdepfile"
   stat=$?
   grep -v '^Note: including file: ' "$tmpdepfile"
-  if test "$stat" = 0; then :
-  else
+  if test $stat -ne 0; then
     rm -f "$tmpdepfile"
     exit $stat
   fi
@@ -603,13 +603,14 @@ dashmstdout)
   # in the target name.  This is to cope with DOS-style filenames:
   # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.
   "$@" $dashmflag |
-    sed 's:^['"$tab"' ]*[^:'"$tab"' ][^:][^:]*\:['"$tab"' ]*:'"$object"'\: :' 
> "$tmpdepfile"
+    sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile"
   rm -f "$depfile"
   cat < "$tmpdepfile" > "$depfile"
-  tr ' ' "$nl" < "$tmpdepfile" | \
-## Some versions of the HPUX 10.20 sed can't process this invocation
-## correctly.  Breaking it into two sed invocations is a workaround.
-    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+  # Some versions of the HPUX 10.20 sed can't process this sed invocation
+  # correctly.  Breaking it into two sed invocations is a workaround.
+  tr ' ' "$nl" < "$tmpdepfile" \
+    | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
+    | sed -e 's/$/ :/' >> "$depfile"
   rm -f "$tmpdepfile"
   ;;
 
@@ -662,10 +663,12 @@ makedepend)
   # makedepend may prepend the VPATH from the source file name to the object.
   # No need to regex-escape $object, excess matching of '.' is harmless.
   sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
-  sed '1,2d' "$tmpdepfile" | tr ' ' "$nl" | \
-## Some versions of the HPUX 10.20 sed can't process this invocation
-## correctly.  Breaking it into two sed invocations is a workaround.
-    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+  # Some versions of the HPUX 10.20 sed can't process the last invocation
+  # correctly.  Breaking it into two sed invocations is a workaround.
+  sed '1,2d' "$tmpdepfile" \
+    | tr ' ' "$nl" \
+    | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
+    | sed -e 's/$/ :/' >> "$depfile"
   rm -f "$tmpdepfile" "$tmpdepfile".bak
   ;;
 
@@ -701,10 +704,10 @@ cpp)
     esac
   done
 
-  "$@" -E |
-    sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
-       -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
-    sed '$ s: \\$::' > "$tmpdepfile"
+  "$@" -E \
+    | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
+             -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
+    | sed '$ s: \\$::' > "$tmpdepfile"
   rm -f "$depfile"
   echo "$object : \\" > "$depfile"
   cat < "$tmpdepfile" >> "$depfile"
@@ -736,15 +739,15 @@ msvisualcpp)
       shift
       ;;
     "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
-       set fnord "$@"
-       shift
-       shift
-       ;;
+        set fnord "$@"
+        shift
+        shift
+        ;;
     *)
-       set fnord "$@" "$arg"
-       shift
-       shift
-       ;;
+        set fnord "$@" "$arg"
+        shift
+        shift
+        ;;
     esac
   done
   "$@" -E 2>/dev/null |
diff --git a/lib/elisp-comp b/lib/elisp-comp
deleted file mode 100755
index 5e888bd..0000000
--- a/lib/elisp-comp
+++ /dev/null
@@ -1,93 +0,0 @@
-#!/bin/sh
-# Copyright (C) 1995-2012 Free Software Foundation, Inc.
-
-scriptversion=2012-07-05.17; # UTC
-
-# Franc,ois Pinard <address@hidden>, 1995.
-#
-# 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 <address@hidden> or send patches to
-# <address@hidden>.
-
-case $1 in
-  '')
-     echo "$0: No files.  Try '$0 --help' for more information." 1>&2
-     exit 1;
-     ;;
-  -h | --h*)
-    cat <<\EOF
-Usage: elisp-comp [--help] [--version] FILES...
-
-This script byte-compiles all '.el' files listed as FILES using GNU
-Emacs, and put the resulting '.elc' files into the current directory,
-so disregarding the original directories used in '.el' arguments.
-
-This script manages in such a way that all Emacs LISP files to
-be compiled are made visible between themselves, in the event
-they require or load-library one another.
-
-Report bugs to <address@hidden>.
-EOF
-    exit $?
-    ;;
-  -v | --v*)
-    echo "elisp-comp $scriptversion"
-    exit $?
-    ;;
-esac
-
-if test -z "$EMACS" || test "$EMACS" = "t"; then
-  # Value of "t" means we are running in a shell under Emacs.
-  # Just assume Emacs is called "emacs".
-  EMACS=emacs
-fi
-
-tempdir=elc.$$
-
-# Cleanup the temporary directory on exit.
-trap 'ret=$?; rm -rf "$tempdir" && exit $ret' 0
-do_exit='(exit $ret); exit $ret'
-trap "ret=129; $do_exit" 1
-trap "ret=130; $do_exit" 2
-trap "ret=141; $do_exit" 13
-trap "ret=143; $do_exit" 15
-
-mkdir $tempdir
-cp "$@" $tempdir
-
-(
-  cd $tempdir
-  echo "(setq load-path (cons nil (cons \"$abs_srcdir\" load-path)))" > script
-  $EMACS -batch -q -l script -f batch-byte-compile *.el || exit $?
-  mv *.elc ..
-) || exit $?
-
-(exit 0); exit 0
-
-# Local Variables:
-# mode: shell-script
-# sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "scriptversion="
-# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
-# time-stamp-end: "; # UTC"
-# End:
diff --git a/lib/missing b/lib/missing
index 9a55648..ed429b4 100755
--- a/lib/missing
+++ b/lib/missing
@@ -1,10 +1,10 @@
 #! /bin/sh
-# Common stub for a few missing GNU programs while installing.
+# Common wrapper for a few potentially missing GNU programs.
 
-scriptversion=2012-01-06.18; # UTC
+scriptversion=2012-06-26.16; # UTC
 
 # Copyright (C) 1996-2012 Free Software Foundation, Inc.
-# Originally by Fran,cois Pinard <address@hidden>, 1996.
+# Originally written by Fran,cois Pinard <address@hidden>, 1996.
 
 # 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
@@ -29,61 +29,33 @@ if test $# -eq 0; then
   exit 1
 fi
 
-run=:
-sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
-sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
-
-# In the cases where this matters, 'missing' is being run in the
-# srcdir already.
-if test -f configure.ac; then
-  configure_ac=configure.ac
-else
-  configure_ac=configure.in
-fi
+case $1 in
 
-msg="missing on your system"
+  --is-lightweight)
+    # Used by our autoconf macros to check whether the available missing
+    # script is modern enough.
+    exit 0
+    ;;
 
-case $1 in
---run)
-  # Try to run requested program, and just exit if it succeeds.
-  run=
-  shift
-  "$@" && exit 0
-  # Exit code 63 means version mismatch.  This often happens
-  # when the user try to use an ancient version of a tool on
-  # a file that requires a minimum version.  In this case we
-  # we should proceed has if the program had been absent, or
-  # if --run hadn't been passed.
-  if test $? = 63; then
-    run=:
-    msg="probably too old"
-  fi
-  ;;
+  --run)
+    # Back-compat with the calling convention used by older automake.
+    shift
+    ;;
 
   -h|--h|--he|--hel|--help)
     echo "\
 $0 [OPTION]... PROGRAM [ARGUMENT]...
 
-Handle 'PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
-error status if there is no known handling for PROGRAM.
+Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due
+to PROGRAM being missing or too old.
 
 Options:
   -h, --help      display this help and exit
   -v, --version   output version information and exit
-  --run           try to run the given command, and emulate it if it fails
 
 Supported PROGRAM values:
-  aclocal      touch file 'aclocal.m4'
-  autoconf     touch file 'configure'
-  autoheader   touch file 'config.h.in'
-  autom4te     touch the output file, or create a stub one
-  automake     touch all 'Makefile.in' files
-  bison        create 'y.tab.[ch]', if possible, from existing .[ch]
-  flex         create 'lex.yy.c', if possible, from existing .c
-  help2man     touch the output file
-  lex          create 'lex.yy.c', if possible, from existing .c
-  makeinfo     touch the output file
-  yacc         create 'y.tab.[ch]', if possible, from existing .[ch]
+  aclocal   autoconf  autoheader   autom4te  automake  makeinfo
+  bison     yacc      flex         lex       help2man
 
 Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and
 'g' are ignored when checking the name.
@@ -98,228 +70,141 @@ Send bug reports to <address@hidden>."
     ;;
 
   -*)
-    echo 1>&2 "$0: Unknown '$1' option"
+    echo 1>&2 "$0: unknown '$1' option"
     echo 1>&2 "Try '$0 --help' for more information"
     exit 1
     ;;
 
 esac
 
-# normalize program name to check for.
-program=`echo "$1" | sed '
-  s/^gnu-//; t
-  s/^gnu//; t
-  s/^g//; t'`
-
-# Now exit if we have it, but it failed.  Also exit now if we
-# don't have it and --version was passed (most likely to detect
-# the program).  This is about non-GNU programs, so use $1 not
-# $program.
-case $1 in
-  lex*|yacc*)
-    # Not GNU programs, they don't have --version.
-    ;;
-
-  *)
-    if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
-       # We have it, but it failed.
-       exit 1
-    elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
-       # Could not run --version or --help.  This is probably someone
-       # running '$TOOL --version' or '$TOOL --help' to check whether
-       # $TOOL exists and not knowing $TOOL uses missing.
-       exit 1
-    fi
-    ;;
-esac
-
-# If it does not exist, or fails to run (possibly an outdated version),
-# try to emulate it.
-case $program in
-  aclocal*)
-    echo 1>&2 "\
-WARNING: '$1' is $msg.  You should only need it if
-         you modified 'acinclude.m4' or '${configure_ac}'.  You might want
-         to install the Automake and Perl packages.  Grab them from
-         any GNU archive site."
-    touch aclocal.m4
-    ;;
-
-  autoconf*)
-    echo 1>&2 "\
-WARNING: '$1' is $msg.  You should only need it if
-         you modified '${configure_ac}'.  You might want to install the
-         Autoconf and GNU m4 packages.  Grab them from any GNU
-         archive site."
-    touch configure
-    ;;
-
-  autoheader*)
-    echo 1>&2 "\
-WARNING: '$1' is $msg.  You should only need it if
-         you modified 'acconfig.h' or '${configure_ac}'.  You might want
-         to install the Autoconf and GNU m4 packages.  Grab them
-         from any GNU archive site."
-    files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' 
${configure_ac}`
-    test -z "$files" && files="config.h"
-    touch_files=
-    for f in $files; do
-      case $f in
-      *:*) touch_files="$touch_files "`echo "$f" |
-                                      sed -e 's/^[^:]*://' -e 's/:.*//'`;;
-      *) touch_files="$touch_files $f.in";;
-      esac
-    done
-    touch $touch_files
-    ;;
-
-  automake*)
-    echo 1>&2 "\
-WARNING: '$1' is $msg.  You should only need it if
-         you modified 'Makefile.am', 'acinclude.m4' or '${configure_ac}'.
-         You might want to install the Automake and Perl packages.
-         Grab them from any GNU archive site."
-    find . -type f -name Makefile.am -print |
-          sed 's/\.am$/.in/' |
-          while read f; do touch "$f"; done
-    ;;
-
-  autom4te*)
-    echo 1>&2 "\
-WARNING: '$1' is needed, but is $msg.
-         You might have modified some files without having the
-         proper tools for further handling them.
-         You can get '$1' as part of Autoconf from any GNU
-         archive site."
-
-    file=`echo "$*" | sed -n "$sed_output"`
-    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
-    if test -f "$file"; then
-       touch $file
-    else
-       test -z "$file" || exec >$file
-       echo "#! /bin/sh"
-       echo "# Created by GNU Automake missing as a replacement of"
-       echo "#  $ $@"
-       echo "exit 0"
-       chmod +x $file
-       exit 1
-    fi
-    ;;
-
-  bison*|yacc*)
-    echo 1>&2 "\
-WARNING: '$1' $msg.  You should only need it if
-         you modified a '.y' file.  You may need the Bison package
-         in order for those modifications to take effect.  You can get
-         Bison from any GNU archive site."
-    rm -f y.tab.c y.tab.h
-    if test $# -ne 1; then
-        eval LASTARG=\${$#}
-       case $LASTARG in
-       *.y)
-           SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
-           if test -f "$SRCFILE"; then
-                cp "$SRCFILE" y.tab.c
-           fi
-           SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
-           if test -f "$SRCFILE"; then
-                cp "$SRCFILE" y.tab.h
-           fi
-         ;;
-       esac
-    fi
-    if test ! -f y.tab.h; then
-       echo >y.tab.h
-    fi
-    if test ! -f y.tab.c; then
-       echo 'main() { return 0; }' >y.tab.c
-    fi
-    ;;
-
-  lex*|flex*)
-    echo 1>&2 "\
-WARNING: '$1' is $msg.  You should only need it if
-         you modified a '.l' file.  You may need the Flex package
-         in order for those modifications to take effect.  You can get
-         Flex from any GNU archive site."
-    rm -f lex.yy.c
-    if test $# -ne 1; then
-        eval LASTARG=\${$#}
-       case $LASTARG in
-       *.l)
-           SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
-           if test -f "$SRCFILE"; then
-                cp "$SRCFILE" lex.yy.c
-           fi
-         ;;
-       esac
-    fi
-    if test ! -f lex.yy.c; then
-       echo 'main() { return 0; }' >lex.yy.c
-    fi
-    ;;
-
-  help2man*)
-    echo 1>&2 "\
-WARNING: '$1' is $msg.  You should only need it if
-        you modified a dependency of a manual page.  You may need the
-        Help2man package in order for those modifications to take
-        effect.  You can get Help2man from any GNU archive site."
-
-    file=`echo "$*" | sed -n "$sed_output"`
-    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
-    if test -f "$file"; then
-       touch $file
-    else
-       test -z "$file" || exec >$file
-       echo ".ab help2man is required to generate this page"
-       exit $?
-    fi
-    ;;
-
-  makeinfo*)
-    echo 1>&2 "\
-WARNING: '$1' is $msg.  You should only need it if
-         you modified a '.texi' or '.texinfo' file, or any other file
-         indirectly affecting the aspect of the manual.  The spurious
-         call might also be the consequence of using a buggy 'make' (AIX,
-         DU, IRIX).  You might want to install the Texinfo package or
-         the GNU make package.  Grab either from any GNU archive site."
-    # The file to touch is that specified with -o ...
-    file=`echo "$*" | sed -n "$sed_output"`
-    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
-    if test -z "$file"; then
-      # ... or it is the one specified with @setfilename ...
-      infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
-      file=`sed -n '
-       /address@hidden/{
-         s/.* \([^ ]*\) *$/\1/
-         p
-         q
-       }' $infile`
-      # ... or it is derived from the source name (dir/f.texi becomes f.info)
-      test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
-    fi
-    # If the file does not exist, the user really needs makeinfo;
-    # let's fail without touching anything.
-    test -f $file || exit 1
-    touch $file
-    ;;
+# Run the given program, remember its exit status.
+"$@"; st=$?
+
+# If it succeeded, we are done.
+test $st -eq 0 && exit 0
+
+# Also exit now if we it failed (or wasn't found), and '--version' was
+# passed; such an option is passed most likely to detect whether the
+# program is present and works.
+case $2 in --version|--help) exit $st;; esac
+
+# Exit code 63 means version mismatch.  This often happens when the user
+# tries to use an ancient version of a tool on a file that requires a
+# minimum version.
+if test $st -eq 63; then
+  msg="probably too old"
+elif test $st -eq 127; then
+  # Program was missing.
+  msg="missing on your system"
+else
+  # Program was found and executed, but failed.  Give up.
+  exit $st
+fi
 
-  *)
-    echo 1>&2 "\
-WARNING: '$1' is needed, and is $msg.
-         You might have modified some files without having the
-         proper tools for further handling them.  Check the 'README' file,
-         it often tells you about the needed prerequisites for installing
-         this package.  You may also peek at any GNU archive site, in case
-         some other package would contain this missing '$1' program."
-    exit 1
+perl_URL=http://www.perl.org/
+flex_URL=http://flex.sourceforge.net/
+gnu_software_URL=http://www.gnu.org/software
+
+program_details ()
+{
+  case $1 in
+    aclocal|automake)
+      echo "The '$1' program is part of the GNU Automake package:"
+      echo "<$gnu_software_URL/automake>"
+      echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:"
+      echo "<$gnu_software_URL/autoconf>"
+      echo "<$gnu_software_URL/m4/>"
+      echo "<$perl_URL>"
+      ;;
+    autoconf|autom4te|autoheader)
+      echo "The '$1' program is part of the GNU Autoconf package:"
+      echo "<$gnu_software_URL/autoconf/>"
+      echo "It also requires GNU m4 and Perl in order to run:"
+      echo "<$gnu_software_URL/m4/>"
+      echo "<$perl_URL>"
+      ;;
+  esac
+}
+
+give_advice ()
+{
+  # Normalize program name to check for.
+  normalized_program=`echo "$1" | sed '
+    s/^gnu-//; t
+    s/^gnu//; t
+    s/^g//; t'`
+
+  printf '%s\n' "'$1' is $msg."
+
+  configure_deps="'configure.ac' or m4 files included by 'configure.ac'"
+  case $normalized_program in
+    autoconf*)
+      echo "You should only need it if you modified 'configure.ac',"
+      echo "or m4 files included by it."
+      program_details 'autoconf'
+      ;;
+    autoheader*)
+      echo "You should only need it if you modified 'acconfig.h' or"
+      echo "$configure_deps."
+      program_details 'autoheader'
+      ;;
+    automake*)
+      echo "You should only need it if you modified 'Makefile.am' or"
+      echo "$configure_deps."
+      program_details 'automake'
+      ;;
+    aclocal*)
+      echo "You should only need it if you modified 'acinclude.m4' or"
+      echo "$configure_deps."
+      program_details 'aclocal'
+      ;;
+   autom4te*)
+      echo "You might have modified some maintainer files that require"
+      echo "the 'automa4te' program to be rebuilt."
+      program_details 'autom4te'
+      ;;
+    bison*|yacc*)
+      echo "You should only need it if you modified a '.y' file."
+      echo "You may want to install the GNU Bison package:"
+      echo "<$gnu_software_URL/bison/>"
+      ;;
+    lex*|flex*)
+      echo "You should only need it if you modified a '.l' file."
+      echo "You may want to install the Fast Lexical Analyzer package:"
+      echo "<$flex_URL>"
+      ;;
+    help2man*)
+      echo "You should only need it if you modified a dependency" \
+           "of a man page."
+      echo "You may want to install the GNU Help2man package:"
+      echo "<$gnu_software_URL/help2man/>"
     ;;
-esac
-
-exit 0
+    makeinfo*)
+      echo "You should only need it if you modified a '.texi' file, or"
+      echo "any other file indirectly affecting the aspect of the manual."
+      echo "You might want to install the Texinfo package:"
+      echo "<$gnu_software_URL/texinfo/>"
+      echo "The spurious makeinfo call might also be the consequence of"
+      echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might"
+      echo "want to install GNU make:"
+      echo "<$gnu_software_URL/make/>"
+      ;;
+    *)
+      echo "You might have modified some files without having the proper"
+      echo "tools for further handling them.  Check the 'README' file, it"
+      echo "often tells you about the needed prerequisites for installing"
+      echo "this package.  You may also peek at any GNU archive site, in"
+      echo "case some other package contains this missing '$1' program."
+      ;;
+  esac
+}
+
+give_advice "$1" | sed -e '1s/^/WARNING: /' \
+                       -e '2,$s/^/         /' >&2
+
+# Propagate the correct exit status (expected to be 127 for a program
+# not found, 63 for a program that failed due to version mismatch).
+exit $st
 
 # Local variables:
 # eval: (add-hook 'write-file-hooks 'time-stamp)
diff --git a/lib/test-driver b/lib/test-driver
index aba4d1d..53e19b8 100755
--- a/lib/test-driver
+++ b/lib/test-driver
@@ -1,5 +1,5 @@
 #! /bin/sh
-# test-driver - basic driver script for the 'parallel-tests' mode.
+# test-driver - basic testsuite driver script.
 
 scriptversion=2012-06-27.10; # UTC
 
diff --git a/lib/ylwrap b/lib/ylwrap
index 7befa46..b5c673d 100755
--- a/lib/ylwrap
+++ b/lib/ylwrap
@@ -1,7 +1,7 @@
 #! /bin/sh
 # ylwrap - wrapper for lex/yacc invocations.
 
-scriptversion=2012-07-14.08; # UTC
+scriptversion=2012-12-21.17; # UTC
 
 # Copyright (C) 1996-2012 Free Software Foundation, Inc.
 #
@@ -42,10 +42,11 @@ get_dirname ()
 # The CPP macro used to guard inclusion of FILE.
 guard()
 {
-  printf '%s\n' "$from" \
-    | sed \
-        -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\
-        -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'
+  printf '%s\n' "$1"                                                    \
+    | sed                                                               \
+        -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'   \
+        -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'                        \
+        -e 's/__*/_/g'
 }
 
 # quote_for_sed [STRING]
@@ -121,10 +122,16 @@ fi
 # The parser itself, the first file, is the destination of the .y.c
 # rule in the Makefile.
 parser=$1
+
 # A sed program to s/FROM/TO/g for all the FROM/TO so that, for
 # instance, we rename #include "y.tab.h" into #include "parse.h"
 # during the conversion from y.tab.c to parse.c.
-rename_sed=
+sed_fix_filenames=
+
+# Also rename header guards, as Bison 2.7 for instance uses its header
+# guard in its implementation file.
+sed_fix_header_guards=
+
 while test "$#" -ne 0; do
   if test "$1" = "--"; then
     shift
@@ -141,7 +148,8 @@ while test "$#" -ne 0; do
   shift
   to=$1
   shift
-  rename_sed="${rename_sed}s|"`quote_for_sed "$from"`"|$to|g;"
+  sed_fix_filenames="${sed_fix_filenames}s|"`quote_for_sed "$from"`"|$to|g;"
+  sed_fix_header_guards="${sed_fix_header_guards}s|"`guard "$from"`"|"`guard 
"$to"`"|g;"
 done
 
 # The program to run.
@@ -174,7 +182,7 @@ ret=$?
 if test $ret -eq 0; then
   for from in *
   do
-    to=`printf '%s\n' "$from" | sed "$rename_sed"`
+    to=`printf '%s\n' "$from" | sed "$sed_fix_filenames"`
     if test -f "$from"; then
       # If $2 is an absolute path name, then just use that,
       # otherwise prepend '../'.
@@ -197,10 +205,11 @@ if test $ret -eq 0; then
       # debug information point at an absolute srcdir.  Use the real
       # output file name, not yy.lex.c for instance.  Adjust the
       # include guards too.
-      FROM=`guard "$from"`
-      TARGET=`guard "$to"`
-      sed -e "/^#/!b" -e "s|$input_rx|$input_sub_rx|" -e "$rename_sed" \
-          -e "s|$FROM|$TARGET|" "$from" >"$target" || ret=$?
+      sed -e "/^#/!b"                           \
+          -e "s|$input_rx|$input_sub_rx|"       \
+          -e "$sed_fix_filenames"               \
+          -e "$sed_fix_header_guards"           \
+        "$from" >"$target" || ret=$?
 
       # Check whether files must be updated.
       if test "$from" != "$parser"; then
diff --git a/m4/amversion.m4 b/m4/amversion.m4
index 5526895..86db2ef 100644
--- a/m4/amversion.m4
+++ b/m4/amversion.m4
@@ -12,10 +12,10 @@
 # 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.12'
+[am__api_version='1.13'
 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.12.6a], [],
+m4_if([$1], [1.13.0a], [],
       [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.12.6a])dnl
+[AM_AUTOMAKE_VERSION([1.13.0a])dnl
 m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
diff --git a/m4/ccstdc.m4 b/m4/ccstdc.m4
deleted file mode 100644
index 66060d9..0000000
--- a/m4/ccstdc.m4
+++ /dev/null
@@ -1,23 +0,0 @@
-## ----------------------------------------- ##             -*- Autoconf -*-
-## ANSIfy the C compiler whenever possible.  ##
-## From Franc,ois Pinard                     ##
-## ----------------------------------------- ##
-
-# Copyright (C) 1996-2012 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.
-
-# This was merged into AC_PROG_CC in Autoconf.
-
-AU_DEFUN([AM_PROG_CC_STDC],
-[AC_PROG_CC
-AC_DIAGNOSE([obsolete], [$0:
-       your code should no longer depend upon 'am_cv_prog_cc_stdc', but upon
-       'ac_cv_prog_cc_stdc'.  Remove this warning and the assignment when
-       you adjust the code.  You can also remove the above call to
-       AC_PROG_CC if you already called it elsewhere.])
-am_cv_prog_cc_stdc=$ac_cv_prog_cc_stdc
-])
-AU_DEFUN([fp_PROG_CC_STDC])
diff --git a/m4/depout.m4 b/m4/depout.m4
index f592b00..835c32b 100644
--- a/m4/depout.m4
+++ b/m4/depout.m4
@@ -11,7 +11,7 @@
 # ------------------------------
 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
 [{
-  # Autoconf 2.62 quotes --file arguments for eval, but not when files
+  # Older Autoconf quotes --file arguments for eval, but not when files
   # are listed without --file.  Let's play safe and only enable the eval
   # if we detect the quoting.
   case $CONFIG_FILES in
diff --git a/m4/dmalloc.m4 b/m4/dmalloc.m4
index f9d600f..3e7fdb7 100644
--- a/m4/dmalloc.m4
+++ b/m4/dmalloc.m4
@@ -24,5 +24,3 @@ else
   AC_MSG_RESULT([no])
 fi], [AC_MSG_RESULT([no])])
 ])
-
-AU_DEFUN([fp_WITH_DMALLOC], [AM_WITH_DMALLOC])
diff --git a/m4/extra-recurs.m4 b/m4/extra-recurs.m4
new file mode 100644
index 0000000..68d575a
--- /dev/null
+++ b/m4/extra-recurs.m4
@@ -0,0 +1,16 @@
+# AM_EXTRA_RECURSIVE_TARGETS                                -*- Autoconf -*-
+
+# Copyright (C) 2012 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.
+
+# AM_EXTRA_RECURSIVE_TARGETS
+# --------------------------
+# Define the list of user recursive targets.  This macro exists only to
+# be traced by Automake, which will ensure that a proper definition of
+# user-defined recursive targets (and associated rules) is propagated
+# into all the generated Makefiles.
+# TODO: We should really reject non-literal arguments here...
+AC_DEFUN([AM_EXTRA_RECURSIVE_TARGETS], [])
diff --git a/m4/header.m4 b/m4/header.m4
deleted file mode 100644
index e649ba4..0000000
--- a/m4/header.m4
+++ /dev/null
@@ -1,9 +0,0 @@
-##                                                          -*- Autoconf -*-
-# Copyright (C) 1996-2012 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.
-
-# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
-AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
diff --git a/m4/init.m4 b/m4/init.m4
index 5e1bbe3..fc05148 100644
--- a/m4/init.m4
+++ b/m4/init.m4
@@ -21,7 +21,7 @@
 # arguments mandatory, and then we can depend on a new Autoconf
 # release and drop the old call support.
 AC_DEFUN([AM_INIT_AUTOMAKE],
-[AC_PREREQ([2.62])dnl
+[AC_PREREQ([2.65])dnl
 dnl Autoconf wants to disallow AM_ names.  We explicitly allow
 dnl the ones we care about.
 m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
@@ -51,8 +51,7 @@ AC_SUBST([CYGPATH_W])
 dnl Distinguish between old-style and new-style calls.
 m4_ifval([$2],
 [AC_DIAGNOSE([obsolete],
-[$0: two- and three-arguments forms are deprecated.  For more info, see:
-http://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_INIT_AUTOMAKE-invocation])
+             [$0: two- and three-arguments forms are deprecated.])
 m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
  AC_SUBST([PACKAGE], [$1])dnl
  AC_SUBST([VERSION], [$2])],
@@ -106,18 +105,15 @@ AC_PROVIDE_IFELSE([AC_PROG_OBJC],
                  [_AM_DEPENDENCIES([OBJC])],
                  [m4_define([AC_PROG_OBJC],
                             
m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
-dnl Support for Objective C++ was only introduced in Autoconf 2.65,
-dnl but we still cater to Autoconf 2.62.
-m4_ifdef([AC_PROG_OBJCXX],
-[AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
+AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
                  [_AM_DEPENDENCIES([OBJCXX])],
                  [m4_define([AC_PROG_OBJCXX],
-                            
m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])])dnl
+                            
m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
 ])
-_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
-dnl The 'parallel-tests' driver may need to know about EXEEXT, so add the
-dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
-dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
+AC_REQUIRE([AM_SILENT_RULES])dnl
+dnl The testsuite driver may need to know about EXEEXT, so add the
+dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This
+dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
 AC_CONFIG_COMMANDS_PRE(dnl
 [m4_provide_if([_AM_COMPILER_EXEEXT],
   [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
diff --git a/m4/internal/ac-config-macro-dirs.m4 
b/m4/internal/ac-config-macro-dirs.m4
new file mode 100644
index 0000000..530e655
--- /dev/null
+++ b/m4/internal/ac-config-macro-dirs.m4
@@ -0,0 +1,15 @@
+# Support AC_CONFIG_MACRO_DIRS with older autoconf.     -*- Autoconf -*-
+# FIXME: To be removed in Automake 1.14, once we can assume autoconf
+#        2.70 or later.
+# FIXME: keep in sync with the contents of the variable
+#        '$ac_config_macro_dirs_fallback' in aclocal.in.
+
+# Copyright (C) 2012 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.
+
+m4_ifndef([AC_CONFIG_MACRO_DIRS],
+[m4_defun([_AM_CONFIG_MACRO_DIRS],[])]dnl
+[m4_defun([AC_CONFIG_MACRO_DIRS],[_AM_CONFIG_MACRO_DIRS($@)])])
diff --git a/m4/lispdir.m4 b/m4/lispdir.m4
index 6dca47e..72dcd84 100644
--- a/m4/lispdir.m4
+++ b/m4/lispdir.m4
@@ -49,5 +49,3 @@ AC_DEFUN([AM_PATH_LISPDIR],
 ])
 AC_SUBST([lispdir])
 ])# AM_PATH_LISPDIR
-
-AU_DEFUN([ud_PATH_LISPDIR], [AM_PATH_LISPDIR])
diff --git a/m4/maintainer.m4 b/m4/maintainer.m4
index 604eb89..62eef9c 100644
--- a/m4/maintainer.m4
+++ b/m4/maintainer.m4
@@ -33,5 +33,3 @@ AC_MSG_CHECKING([whether to enable maintainer-specific 
portions of Makefiles])
   AC_SUBST([MAINT])dnl
 ]
 )
-
-AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
diff --git a/m4/missing.m4 b/m4/missing.m4
index 6c2a55d..a246a9c 100644
--- a/m4/missing.m4
+++ b/m4/missing.m4
@@ -15,8 +15,8 @@ AC_SUBST($1)])
 
 # AM_MISSING_HAS_RUN
 # ------------------
-# Define MISSING if not defined so far and test if it supports --run.
-# If it does, set am_missing_run to use it, otherwise, to nothing.
+# Define MISSING if not defined so far and test if it is modern enough.
+# If it is, set am_missing_run to use it, otherwise, to nothing.
 AC_DEFUN([AM_MISSING_HAS_RUN],
 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
 AC_REQUIRE_AUX_FILE([missing])dnl
@@ -29,8 +29,8 @@ if test x"${MISSING+set}" != xset; then
   esac
 fi
 # Use eval to expand $SHELL
-if eval "$MISSING --run true"; then
-  am_missing_run="$MISSING --run "
+if eval "$MISSING --is-lightweight"; then
+  am_missing_run="$MISSING "
 else
   am_missing_run=
   AC_MSG_WARN(['missing' script is too old or missing])
diff --git a/m4/mkdirp.m4 b/m4/mkdirp.m4
index 9155ace..93c12b0 100644
--- a/m4/mkdirp.m4
+++ b/m4/mkdirp.m4
@@ -11,7 +11,7 @@
 AC_DEFUN([AM_PROG_MKDIR_P],
 [AC_PREREQ([2.60])dnl
 AC_REQUIRE([AC_PROG_MKDIR_P])dnl
-dnl FIXME to be removed in Automake 1.13.
+dnl FIXME to be removed in Automake 1.14.
 AC_DIAGNOSE([obsolete],
 [$0: this macro is deprecated, and will soon be removed.
 You should use the Autoconf-provided 'AC][_PROG_MKDIR_P' macro instead,
diff --git a/m4/obsol-gt.m4 b/m4/obsol-gt.m4
deleted file mode 100644
index 66721d3..0000000
--- a/m4/obsol-gt.m4
+++ /dev/null
@@ -1,10 +0,0 @@
-# Support for obsolete Gettext macro.                       -*- Autoconf -*-
-
-# Copyright (C) 2002-2012 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.
-
-# See comment in obsolete.m4.
-AU_DEFUN([ud_GNU_GETTEXT], [AM_GNU_GETTEXT])
diff --git a/m4/obsol-lt.m4 b/m4/obsol-lt.m4
deleted file mode 100644
index 1fcc211..0000000
--- a/m4/obsol-lt.m4
+++ /dev/null
@@ -1,10 +0,0 @@
-# Support for obsolete Libtool macro.                       -*- Autoconf -*-
-
-# Copyright (C) 2002-2012 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.
-
-# See comment in obsolete.m4.
-AU_DEFUN([gm_PROG_LIBTOOL], [AM_PROG_LIBTOOL])
diff --git a/m4/obsolete.m4 b/m4/obsolete.m4
deleted file mode 100644
index c77c452..0000000
--- a/m4/obsolete.m4
+++ /dev/null
@@ -1,35 +0,0 @@
-##                                                          -*- Autoconf -*-
-# Copyright (C) 2002-2012 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.
-
-# Obsolete Automake macros.
-
-# We put here only the macros whose substitution is not an Automake
-# macro; otherwise including this file would trigger dependencies for
-# all the substitutions.  Generally, obsolete Automake macros are
-# better AU_DEFUNed in the same file as their replacement, or alone in
-# a separate file (see obsol-gt.m4 or obsol-lt.m4 for instance).
-
-AU_DEFUN([AC_FEATURE_CTYPE],     [AC_HEADER_STDC])
-AU_DEFUN([AC_FEATURE_ERRNO],     [AC_REPLACE_FUNCS([strerror])])
-AU_DEFUN([AM_CYGWIN32],                 [AC_CYGWIN])
-AU_DEFUN([AM_EXEEXT],            [AC_EXEEXT])
-AU_DEFUN([AM_FUNC_MKTIME],       [AC_FUNC_MKTIME])
-AU_DEFUN([AM_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL],
-                                [AC_HEADER_TIOCGWINSZ])
-AU_DEFUN([AM_MINGW32],           [AC_MINGW32])
-AU_DEFUN([AM_PROG_INSTALL],      [AC_PROG_INSTALL])
-AU_DEFUN([AM_SANITY_CHECK_CC],   [AC_PROG_CC])
-AU_DEFUN([AM_SYS_POSIX_TERMIOS], [AC_SYS_POSIX_TERMIOS])
-AU_DEFUN([fp_FUNC_FNMATCH],      [AC_FUNC_FNMATCH])
-AU_DEFUN([fp_PROG_INSTALL],      [AC_PROG_INSTALL])
-AU_DEFUN([md_TYPE_PTRDIFF_T],    [AC_CHECK_TYPES([ptrdiff_t])])
-
-# Don't know how to translate these.
-# If used, Autoconf will complain that they are possibly unexpended;
-# this seems a good enough error message.
-# AC_FEATURE_EXIT
-# AC_SYSTEM_HEADER
diff --git a/maint.mk b/maint.mk
index 9853e6d..97bbf9b 100644
--- a/maint.mk
+++ b/maint.mk
@@ -156,13 +156,13 @@ git-tag-release: maintainer-check
        $$run $(GIT) tag -s "v$(VERSION)" -m "$$release_type $(VERSION)"
 
 git-upload-release:
-       @# Check this a version we can cut a release release from the
-       @# current repository: we must have a beta version, and the
-       @# repository must be clean.
+       @# Check this is a version we can cut a release (either test
+       @# or stable) from.
        @$(determine_release_type)
+       @# The repository must be clean.
        @$(git_must_have_clean_workdir)
        @# Check that we are releasing from a valid tag.
-       tag=`$(GIT) describe` \
+       @tag=`$(GIT) describe` \
          && case $$tag in "v$(VERSION)") true;; *) false;; esac \
          || { echo "$@: you can only create a release from a tagged" \
                    "version" >&2; \
diff --git a/syntax-checks.mk b/syntax-checks.mk
index 204a128..042e092 100644
--- a/syntax-checks.mk
+++ b/syntax-checks.mk
@@ -34,8 +34,7 @@ xtests := $(shell \
 xdefs = \
   $(srcdir)/t/ax/am-test-lib.sh \
   $(srcdir)/t/ax/test-lib.sh \
-  $(srcdir)/t/ax/test-defs.in \
-  $(srcdir)/defs
+  $(srcdir)/t/ax/test-defs.in
 
 ams := $(shell find $(srcdir) -name '*.dir' -prune -o -name '*.am' -print)
 
@@ -58,10 +57,12 @@ sc_perl_at_uscore_in_scalar_context \
 sc_perl_local \
 sc_AMDEP_TRUE_in_automake_in \
 sc_tests_make_without_am_makeflags \
+$(sc_obsolete_requirements_rules) \
+sc_tests_no_source_defs \
 sc_tests_obsolete_variables \
 sc_tests_here_document_format \
 sc_tests_command_subst \
-sc_tests_Exit_not_exit \
+sc_tests_exit_not_Exit \
 sc_tests_automake_fails \
 sc_tests_required_after_defs \
 sc_tests_overriding_macros_on_cmdline \
@@ -242,6 +243,19 @@ sc_tests_obsolete_variables:
          exit 1; \
        else :; fi
 
+## Look out for obsolete requirements specified in the test cases.
+sc_obsolete_requirements_rules = sc_no_texi2dvi-o sc_no_makeinfo-html
+modern-requirement.texi2dvi-o = texi2dvi
+modern-requirement.makeinfo-html = makeinfo
+
+$(sc_obsolete_requirements_rules): sc_no_% :
+       @if grep -E 'required=.*\b$*\b' $(xtests); then \
+         echo "Requirement '$*' is obsolete and shouldn't" \
+              "be used anymore." >&2; \
+         echo "You should use '$(modern-requirement.$*)' instead." >&2; \
+         exit 1; \
+       fi
+
 ## Tests should never call some programs directly, but only through the
 ## corresponding variable (e.g., '$MAKE', not 'make').  This will allow
 ## the programs to be overridden at configure time (for less brittleness)
@@ -309,15 +323,23 @@ sc_tests_command_subst:
          exit 1; \
        fi
 
-## Tests should no more call 'Exit', just 'exit'.  That's because we
+## Tests should no longer call 'Exit', just 'exit'.  That's because we
 ## now have in place a better workaround to ensure the exit status is
 ## transported correctly across the exit trap.
-sc_tests_Exit_not_exit:
+sc_tests_exit_not_Exit:
        @if grep 'Exit' $(xtests) $(xdefs) | grep -Ev '^[^:]+: *#' | grep .; 
then \
          echo "Use 'exit', not 'Exit'; it's obsolete now." 1>&2; \
          exit 1; \
        fi
 
+## Guard against obsolescent uses of ./defs in tests.  Now,
+## 'test-init.sh' should be used instead.
+sc_tests_no_source_defs:
+       @if grep -E '\. .*defs($$| )' $(xtests); then \
+         echo "Source 'test-init.sh', not './defs'." 1>&2; \
+         exit 1; \
+       fi
+
 ## Use AUTOMAKE_fails when appropriate
 sc_tests_automake_fails:
        @if grep -v '^#' $(xtests) | grep '\$$AUTOMAKE.*&&.*exit'; then \
diff --git a/t/ac-output-old.tap b/t/ac-output-old.tap
index e45fb5f..a19691a 100755
--- a/t/ac-output-old.tap
+++ b/t/ac-output-old.tap
@@ -24,8 +24,6 @@ plan_ 22
 
 rm -f configure.ac depcomp # Not required.
 
-AUTOMAKE="$AUTOMAKE -Wno-obsolete"
-
 # -----------------------------------------------------------------------
 
 # Test for bug reported by François Pinard.
@@ -54,18 +52,15 @@ acoutbs_check ()
 }
 
 acoutbs_check 1 << 'END'
-AC_INIT
-AM_INIT_AUTOMAKE(nonesuch, nonesuch)
+AC_INIT([acoutbs1], [1.0])
+AM_INIT_AUTOMAKE
 AC_OUTPUT(Makefile \
 zot)
 END
 
 acoutbs_check 2 << 'END'
-AC_INIT
-AM_INIT_AUTOMAKE(nonesuch, nonesuch)
-AC_ARG_PROGRAM
-AC_PROG_INSTALL
-AC_PROG_MAKE_SET
+AC_INIT([acoutbs2], [1.0])
+AM_INIT_AUTOMAKE
 AC_OUTPUT(\
    Makefile \
    zot
@@ -85,8 +80,8 @@ mkdir acoutnoq
 cd acoutnoq
 
 cat > configure.ac << 'END'
-AC_INIT
-AM_INIT_AUTOMAKE(nonesuch, nonesuch)
+AC_INIT([acoutnoq], [1.0])
+AM_INIT_AUTOMAKE
 AC_OUTPUT(Makefile, [true])
 END
 
@@ -107,8 +102,8 @@ mkdir acoutpt
 cd acoutpt
 
 cat > configure.ac << 'END'
-AC_INIT
-AM_INIT_AUTOMAKE(nonesuch, nonesuch)
+AC_INIT([acoutpt], [1.0])
+AM_INIT_AUTOMAKE
 AC_OUTPUT([Makefile], [true])
 END
 
@@ -163,8 +158,8 @@ mkdir acoutqnl
 cd acoutqnl
 
 cat > configure.ac << 'END'
-AC_INIT
-AM_INIT_AUTOMAKE(nonesuch, nonesuch)
+AC_INIT([acoutqnl], [1.0])
+AM_INIT_AUTOMAKE
 AC_OUTPUT([Makefile],
 [echo zardoz has spoken])
 END
diff --git a/t/acloca10.sh b/t/acloca10.sh
index d120352..b7d350b 100755
--- a/t/acloca10.sh
+++ b/t/acloca10.sh
@@ -24,7 +24,7 @@
 # TODO: puts third-party macros directly into 'acdir'.
 
 am_create_testdir=empty
-. ./defs || exit 1
+. test-init.sh
 
 cat > configure.ac << 'END'
 AC_INIT
diff --git a/t/acloca11.sh b/t/acloca11.sh
deleted file mode 100755
index 3db8508..0000000
--- a/t/acloca11.sh
+++ /dev/null
@@ -1,45 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2003-2012 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 when two files define the same macro in the same
-# directory, the macro from the lexically greatest file is used.
-
-am_create_testdir=empty
-. ./defs || exit 1
-
-cat > configure.ac << 'END'
-AC_INIT
-MACRO2
-MACRO1
-END
-
-mkdir m4
-
-cat >m4/version1.m4 <<EOF
-AC_DEFUN([MACRO1], [:macro11:])
-AC_DEFUN([MACRO2], [:macro21:])
-EOF
-
-cat >m4/version2.m4 <<EOF
-AC_DEFUN([MACRO1], [:macro12:])
-EOF
-
-$ACLOCAL -I m4
-$AUTOCONF
-$FGREP ':macro12:' configure
-$FGREP ':macro21:' configure
-
-:
diff --git a/t/acloca12.sh b/t/acloca12.sh
deleted file mode 100755
index 01acb02..0000000
--- a/t/acloca12.sh
+++ /dev/null
@@ -1,46 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2003-2012 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 when two files define the same macro in the same
-# directory, the macro from the lexically greatest file is used.
-# Same as acloca11.sh, but without calling MACRO2.
-
-am_create_testdir=empty
-. ./defs || exit 1
-
-cat > configure.ac <<END
-AC_INIT([$me], [1.0])
-MACRO1
-END
-
-mkdir m4
-
-cat >m4/version1.m4 <<EOF
-AC_DEFUN([MACRO1], [:macro11:])
-AC_DEFUN([MACRO2], [:macro21:])
-EOF
-
-cat >m4/version2.m4 <<EOF
-AC_DEFUN([MACRO1], [:macro12:])
-EOF
-
-$ACLOCAL --verbose -I m4
-$AUTOCONF
-$FGREP ':macro11:' configure && exit 1
-$FGREP ':macro21:' configure && exit 1
-$FGREP ':macro12:' configure
-
-:
diff --git a/t/acloca13.sh b/t/acloca13.sh
deleted file mode 100755
index bffd4f1..0000000
--- a/t/acloca13.sh
+++ /dev/null
@@ -1,70 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2003-2012 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 changes to m4_included files also cause aclocal.m4 to change.
-
-. ./defs || exit 1
-
-cat >> configure.ac << 'END'
-m4_include([somefile.m4])
-AC_OUTPUT
-END
-
-cat >Makefile.am <<'EOF'
-check-local:
-       test -f "$(srcdir)/somefile.m4"
-       test -f "$(srcdir)/m4/version1.m4"
-       test -f "$(srcdir)/m4/otherfile.m4"
-EOF
-
-mkdir m4
-
-echo MACRO1 >somefile.m4
-echo 'AC_PREREQ([2.58])' >m4/otherfile.m4
-
-cat >m4/version1.m4 <<EOF
-AC_DEFUN([MACRO1])
-AC_DEFUN([MACRO2])
-m4_sinclude(m4/otherfile.m4)
-EOF
-
-cat >m4/version2.m4 <<EOF
-AC_DEFUN([MACRO1])
-EOF
-
-$ACLOCAL -I m4
-grep version2 aclocal.m4
-grep version1 aclocal.m4 && exit 1
-
-$sleep
-echo MACRO2 >somefile.m4
-
-$ACLOCAL -I m4
-grep version2 aclocal.m4 && exit 1
-grep version1 aclocal.m4
-
-$sleep
-# aclocal.m4 should change if we touch otherfile.m4
-touch m4/otherfile.m4
-$ACLOCAL -I m4
-is_newest aclocal.m4 m4/otherfile.m4
-
-$AUTOCONF
-$AUTOMAKE
-./configure
-$MAKE distcheck
-
-:
diff --git a/t/acloca14.sh b/t/acloca14.sh
deleted file mode 100755
index eb9105d..0000000
--- a/t/acloca14.sh
+++ /dev/null
@@ -1,108 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2004-2012 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 m4_included files are also scanned for definitions.
-# Report from Phil Edwards.
-
-. ./defs || exit 1
-
-cat >> configure.ac << 'END'
-AM_PROG_LIBTOOL
-AC_OUTPUT
-END
-
-echo 'm4_include([a.m4])' > acinclude.m4
-echo 'm4_include([b.m4])' > a.m4
-
-cat >b.m4 <<EOF
-m4_include([c.m4])
-AC_DEFUN([AM_PROG_LIBTOOL],
-[AC_REQUIRE([SOMETHING])dnl
-AC_REQUIRE([SOMETHING_ELSE])dnl
-])
-
-AC_DEFUN([SOMETHING])
-EOF
-
-echo 'm4_include([d.m4])' > c.m4
-echo 'AC_DEFUN([SOMETHING_ELSE])' >d.m4
-
-mkdir defs
-echo 'AC_DEFUN([SOMETHING_ELSE])' >defs/e.m4
-echo 'AC_DEFUN([ANOTHER_MACRO])' >defs/f.m4
-
-cat >>Makefile.am<<\EOF
-ACLOCAL_AMFLAGS = -I defs
-testdist1: distdir
-       test -f $(distdir)/acinclude.m4
-       test -f $(distdir)/a.m4
-       test -f $(distdir)/b.m4
-       test -f $(distdir)/c.m4
-       test -f $(distdir)/d.m4
-       test ! -d $(distdir)/defs
-testdist2: distdir
-       test -f $(distdir)/acinclude.m4
-       test -f $(distdir)/a.m4
-       test -f $(distdir)/b.m4
-       test -f $(distdir)/c.m4
-       test -f $(distdir)/d.m4
-       test ! -f $(distdir)/defs/e.m4
-       test -f $(distdir)/defs/f.m4
-EOF
-
-$ACLOCAL -I defs
-
-$FGREP acinclude.m4 aclocal.m4
-# None of the following macro should be included.  acinclude.m4
-# includes the first four, and the last two are not needed at all.
-$FGREP a.m4 aclocal.m4 && exit 1
-$FGREP b.m4 aclocal.m4 && exit 1
-$FGREP c.m4 aclocal.m4 && exit 1
-$FGREP d.m4 aclocal.m4 && exit 1
-$FGREP defs/e.m4 aclocal.m4 && exit 1
-$FGREP defs/f.m4 aclocal.m4 && exit 1
-
-$AUTOCONF
-$AUTOMAKE
-
-./configure
-$MAKE testdist1
-
-cp aclocal.m4 aclocal.old
-$sleep
-echo 'AC_DEFUN([FOO], [ANOTHER_MACRO])' >> c.m4
-$MAKE
-# Because c.m4 has changed, aclocal.m4 must have been rebuilt.
-is_newest aclocal.m4 aclocal.old
-# However, since FOO is not used, f.m4 should not be included
-# and the contents of aclocal.m4 should remain the same
-diff aclocal.m4 aclocal.old
-
-# If FOO where to be used, that would be another story, of course:
-# f.m4 should be included
-$sleep
-echo FOO >> configure.ac
-$MAKE
-$FGREP defs/f.m4 aclocal.m4
-$MAKE testdist2
-
-# Make sure aclocal diagnose missing included files with correct 'file:line:'.
-rm -f b.m4
-$ACLOCAL 2>stderr && { cat stderr >&2; exit 1; }
-cat stderr >&2
-grep 'a\.m4:1: .*b\.m4.*does not exist' stderr
-
-:
diff --git a/t/acloca15.sh b/t/acloca15.sh
deleted file mode 100755
index 38c6e3e..0000000
--- a/t/acloca15.sh
+++ /dev/null
@@ -1,47 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2004-2012 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 aclocal scans configure.ac for macro definitions.
-# PR/319.
-
-am_create_testdir=empty
-. ./defs || exit 1
-
-# Start macros with AM_ because that causes aclocal to complain if it
-# cannot find them.
-
-cat > configure.ac << 'END'
-AC_INIT
-m4_include([somedef.m4])
-AC_DEFUN([AM_SOME_MACRO])
-AC_DEFUN([AM_SOME_OTHER_MACRO])
-AM_SOME_MACRO
-AM_SOME_OTHER_MACRO
-AM_MORE_MACRO
-END
-
-mkdir m4
-echo 'AC_DEFUN([AM_SOME_MACRO])' > m4/some.m4
-echo 'AC_DEFUN([AM_SOME_DEF])' > somedef.m4
-echo 'AC_DEFUN([AM_MORE_MACRO], [AC_REQUIRE([AM_SOME_DEF])])' > m4/more.m4
-
-$ACLOCAL -I m4
-$FGREP AM_SOME_MACRO aclocal.m4 && exit 1
-$FGREP AM_MORE_MACRO aclocal.m4 && exit 1
-$FGREP 'm4_include([m4/more.m4])' aclocal.m4
-test 1 = $(grep m4_include aclocal.m4 | wc -l)
-
-:
diff --git a/t/acloca16.sh b/t/acloca16.sh
deleted file mode 100755
index a702f27..0000000
--- a/t/acloca16.sh
+++ /dev/null
@@ -1,36 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2004-2012 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 aclocal does not include definitions that are not actually
-# evaluated.
-
-am_create_testdir=empty
-. ./defs || exit 1
-
-cat > configure.ac << 'END'
-AC_SUBST([POM])
-END
-
-mkdir m4
-cat >m4/some.m4 <<'EOF'
-AC_DEFUN([AM_SOME_MACRO],
-[AC_DEFUN([AC_SUBST], [GREPME])])
-EOF
-
-$ACLOCAL -I m4
-grep m4/some.m4 aclocal.m4 && exit 1
-
-:
diff --git a/t/acloca17.sh b/t/acloca17.sh
deleted file mode 100755
index a15cd57..0000000
--- a/t/acloca17.sh
+++ /dev/null
@@ -1,41 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2004-2012 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 aclocal report unused required macros.
-
-am_create_testdir=empty
-. ./defs || exit 1
-
-cat > configure.ac << 'END'
-AC_INIT
-SOME_DEFS
-END
-
-mkdir m4
-cat >m4/somedefs.m4 <<EOF
-AC_DEFUN([SOME_DEFS], [
-  AC_REQUIRE([UNDEFINED_MACRO])
-])
-EOF
-
-# FIXME: We want autom4te's 'undefined required macro' warning to be fatal,
-# but have no means to say so to aclocal.  We use WARNINGS=error instead.
-
-WARNINGS=error $ACLOCAL -I m4 2>stderr && { cat stderr >&2; exit 1; }
-cat stderr >&2
-grep '^configure\.ac:2:.*UNDEFINED_MACRO' stderr
-
-:
diff --git a/t/acloca18.sh b/t/acloca18.sh
deleted file mode 100755
index 8bdbd56..0000000
--- a/t/acloca18.sh
+++ /dev/null
@@ -1,137 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2005-2012 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 --install with #serial numbers.
-
-am_create_testdir=empty
-. ./defs || exit 1
-
-cat > configure.ac << 'END'
-AC_INIT
-AM_MACRO1
-AM_MACRO2
-END
-
-mkdir 1 2 3 4 5 6
-
-cat >1/m1.m4 <<EOF
-#serial 1.8.1230.9
-AC_DEFUN([AM_MACRO1], [:macro11:])
-AC_DEFUN([AM_MACRO2], [:macro21:])
-EOF
-
-cat >2/m1.m4 <<EOF
-#serial 1.8.1231.9
-AC_DEFUN([AM_MACRO1], [:macro12:])
-EOF
-
-cat >3/m2.m4 <<EOF
-#serial 13
-AC_DEFUN([AM_MACRO2], [:macro23:])
-EOF
-
-cat >3/m1.m4 <<EOF
-#serial 1.8.1230.1
-AC_DEFUN([AM_MACRO1], [:macro13:])
-EOF
-
-cat >4/mumble.m4 <<EOF
-#serial 0
-AC_DEFUN([AM_MACRO1], [:macro14:])
-EOF
-
-cat >5/ill-formed.m4 <<EOF
-#serial bla
-#serial .2
-#serial
-AC_DEFUN([AM_MACRO1], [:macro15:])
-EOF
-
-cat >6/after-def.m4 <<EOF
-AC_DEFUN([AM_MACRO1], [:macro16:])
-#serial 1
-EOF
-
-clean_stale ()
-{
-  rm -rf aclocal.m4 configure autom4te*.cache
-}
-
-$ACLOCAL -I 1 -I 2 -I 3 -I 4
-$AUTOCONF
-$FGREP ':macro11:' configure
-$FGREP ':macro21:' configure
-
-clean_stale
-$ACLOCAL  -I 1 -I 2 -I 3 -I 4 --install
-$AUTOCONF
-$FGREP ':macro12:' configure
-$FGREP ':macro23:' configure
-
-cp -f aclocal.m4 aclocal-m4.sav
-clean_stale
-mv -f aclocal-m4.sav aclocal.m4
-$ACLOCAL -I 4 -I 1 -I 2 -I 3 --install --dry-run
-$AUTOCONF
-$FGREP ':macro12:' configure
-$FGREP ':macro23:' configure
-
-clean_stale
-$ACLOCAL -I 4 -I 1 -I 2 -I 3 --install
-$AUTOCONF
-$FGREP ':macro14:' configure
-$FGREP ':macro23:' configure
-
-clean_stale
-$ACLOCAL -I 4 -I 1 -I 2 --install 2>stderr && { cat stderr >&2; exit 1; }
-cat stderr >&2
-grep 'macro.*AM_MACRO2.*not found' stderr
-
-clean_stale
-$ACLOCAL -I 4 -I 1 --install
-$AUTOCONF
-$FGREP ':macro14:' configure
-$FGREP ':macro21:' configure
-
-mkdir acdir
-ACLOCAL="$ACLOCAL --system-acdir acdir"
-
-cat >acdir/m1.m4 <<EOF
-#serial 456
-AC_DEFUN([AM_MACRO1], [:macro1d:])
-AC_DEFUN([AM_MACRO2], [:macro2d:])
-EOF
-clean_stale
-$ACLOCAL -I 4 -I 1 --diff=diff >stdout 2>stderr || {
-  cat stderr >&2
-  cat stdout
-  exit 1
-}
-cat stderr >&2
-cat stdout
-grep '#serial 456' stdout
-test ! -e 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/t/acloca19.sh b/t/acloca19.sh
deleted file mode 100755
index c6d2352..0000000
--- a/t/acloca19.sh
+++ /dev/null
@@ -1,49 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2005-2012 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 aclocal does not fail on configure.ac inclusions that do
-# more than just variable definitions.
-# Report from Peter Breitenlohner (PR/450).
-
-. ./defs || exit 1
-
-cat >configure.ac <<'END'
-AC_INIT([acloca19], [1.0])
-m4_include([aconfig.ac])
-FOO
-AC_OUTPUT
-END
-
-cat >aconfig.ac <<'END'
-AM_INIT_AUTOMAKE
-AC_DEFUN([FOO], [echo GREPME])
-sinclude([bconfig.ac])
-END
-
-cat >bconfig.ac <<'END'
-AC_ARG_WITH([grepme], [string])
-END
-
-$ACLOCAL
-$AUTOCONF
-./configure >stdout || { cat stdout; exit 1; }
-cat stdout
-grep GREPME stdout
-grep 'aconfig\.ac' aclocal.m4 && exit 1
-grep 'bconfig\.ac' aclocal.m4 && exit 1
-grep with-grepme configure
-
-:
diff --git a/t/acloca20.sh b/t/acloca20.sh
deleted file mode 100755
index b5881d6..0000000
--- a/t/acloca20.sh
+++ /dev/null
@@ -1,41 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2006-2012 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 aclocal does not write into symlinked aclocal.m4.
-
-am_create_testdir=empty
-. ./defs || exit 1
-
-echo 'm4_define([FOO], [wrong foo])' > foo.m4
-echo 'm4_define([FOO], [right foo])' > acinclude.m4
-echo 'AC_INIT FOO' > configure.ac
-
-chmod a-w foo.m4
-
-# Setup.
-ln -s foo.m4 aclocal.m4 && test -h aclocal.m4 \
-  || skip_ "cannot create symlinks to files"
-
-# Sanity check.
-grep 'wrong foo' aclocal.m4 \
-  || fatal_ "weird error symlinking aclocal.m4 -> foo.m4"
-
-$ACLOCAL
-$AUTOCONF
-grep 'right foo' configure
-grep 'wrong foo' foo.m4
-
-:
diff --git a/t/acloca21.sh b/t/acloca21.sh
deleted file mode 100755
index 2aca3f9..0000000
--- a/t/acloca21.sh
+++ /dev/null
@@ -1,31 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2006-2012 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 aclocal ignores include() commands in comments.
-# Report from Mike Frysinger.
-# Also make sure aclocal does not think 'include' is
-# an Autoconf macro.
-
-am_create_testdir=empty
-. ./defs || exit 1
-
-cat >>configure.ac <<EOF
-dnl m4_include(__some_really_bogus_nonexistent_file__.m4)
-  # m4_include(__some_really_bogus_nonexistent_file__.m4)
-##  m4_include(__some_really_bogus_nonexistent_file__.m4)
-echo 'include(foobar)' is OK
-EOF
-$ACLOCAL
diff --git a/t/acloca22.sh b/t/acloca22.sh
deleted file mode 100755
index 159fbcd..0000000
--- a/t/acloca22.sh
+++ /dev/null
@@ -1,53 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2007-2012 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 "deleted header file" issue is fixed w.r.t. aclocal.m4
-# dependencies.  See also related the tests 'remake-deleted-m4-file.sh'
-# and 'remake-renamed-m4-macro-and-file.sh'.
-
-. ./defs || exit 1
-
-cat >>configure.ac <<EOF
-FOO
-AC_OUTPUT
-EOF
-cat >foo.m4 <<EOF
-AC_DEFUN([FOO], [AC_SUBST([GREPFOO])])
-EOF
-cat >bar.m4 <<EOF
-AC_DEFUN([BAR], [AC_SUBST([GREPBAR])])
-EOF
-cat >Makefile.am <<EOF
-ACLOCAL_AMFLAGS = -I .
-EOF
-
-$ACLOCAL -I .
-$AUTOMAKE
-$AUTOCONF
-
-./configure
-$MAKE
-grep GREPFOO Makefile
-grep GREPBAR Makefile && exit 1
-
-sed 's/FOO/BAR/' < configure.ac > t
-mv -f t configure.ac
-rm -f foo.m4
-$MAKE
-grep GREPFOO Makefile && exit 1
-grep GREPBAR Makefile
-
-:
diff --git a/t/acloca23.sh b/t/acloca23.sh
deleted file mode 100755
index 2366fc4..0000000
--- a/t/acloca23.sh
+++ /dev/null
@@ -1,37 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2010-2012 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.
-
-am_create_testdir=empty
-. ./defs || exit 1
-
-cat > configure.ac << 'END'
-AC_INIT
-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
-
-:
diff --git a/t/aclocal-I-order-1.sh b/t/aclocal-I-order-1.sh
new file mode 100755
index 0000000..bcdecb0
--- /dev/null
+++ b/t/aclocal-I-order-1.sh
@@ -0,0 +1,49 @@
+#! /bin/sh
+# Copyright (C) 2003-2012 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 aclocal define macros in the same order as -I's.
+
+am_create_testdir=empty
+. test-init.sh
+
+cat > configure.ac << 'END'
+AC_INIT
+MACRO1
+MACRO2
+END
+
+mkdir m4_1 m4_2
+
+cat >m4_1/somedefs.m4 <<EOF
+AC_DEFUN([MACRO1], [:macro11:])
+AC_DEFUN([MACRO2], [:macro21:])
+EOF
+
+cat >m4_2/somedefs.m4 <<EOF
+AC_DEFUN([MACRO1], [:macro12:])
+EOF
+
+$ACLOCAL -I m4_1 -I m4_2
+$AUTOCONF
+$FGREP ':macro11:' configure
+$FGREP ':macro21:' configure
+
+$ACLOCAL --force -I m4_2 -I m4_1
+$AUTOCONF --force
+$FGREP ':macro12:' configure
+$FGREP ':macro21:' configure
+
+:
diff --git a/t/aclocal-I-order-2.sh b/t/aclocal-I-order-2.sh
new file mode 100755
index 0000000..721b8ec
--- /dev/null
+++ b/t/aclocal-I-order-2.sh
@@ -0,0 +1,46 @@
+#! /bin/sh
+# Copyright (C) 2003-2012 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 when two files define the same macro in the same
+# directory, the macro from the lexically greatest file is used.
+# See also sister test 'aclocal-I-ordering-2.sh'.
+
+am_create_testdir=empty
+. test-init.sh
+
+cat > configure.ac << 'END'
+AC_INIT
+MACRO2
+MACRO1
+END
+
+mkdir m4
+
+cat >m4/version1.m4 <<EOF
+AC_DEFUN([MACRO1], [:macro11:])
+AC_DEFUN([MACRO2], [:macro21:])
+EOF
+
+cat >m4/version2.m4 <<EOF
+AC_DEFUN([MACRO1], [:macro12:])
+EOF
+
+$ACLOCAL -I m4
+$AUTOCONF
+$FGREP ':macro12:' configure
+$FGREP ':macro21:' configure
+
+:
diff --git a/t/aclocal-I-order-3.sh b/t/aclocal-I-order-3.sh
new file mode 100755
index 0000000..c98841b
--- /dev/null
+++ b/t/aclocal-I-order-3.sh
@@ -0,0 +1,46 @@
+#! /bin/sh
+# Copyright (C) 2003-2012 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 when two files define the same macro in the same
+# directory, the macro from the lexically greatest file is used.
+# Same as acloca-I-ordering.sh, but without calling MACRO2.
+
+am_create_testdir=empty
+. test-init.sh
+
+cat > configure.ac <<END
+AC_INIT([$me], [1.0])
+MACRO1
+END
+
+mkdir m4
+
+cat >m4/version1.m4 <<EOF
+AC_DEFUN([MACRO1], [:macro11:])
+AC_DEFUN([MACRO2], [:macro21:])
+EOF
+
+cat >m4/version2.m4 <<EOF
+AC_DEFUN([MACRO1], [:macro12:])
+EOF
+
+$ACLOCAL --verbose -I m4
+$AUTOCONF
+$FGREP ':macro11:' configure && exit 1
+$FGREP ':macro21:' configure && exit 1
+$FGREP ':macro12:' configure
+
+:
diff --git a/t/aclocal-acdir.sh b/t/aclocal-acdir.sh
index abd7857..944604b 100755
--- a/t/aclocal-acdir.sh
+++ b/t/aclocal-acdir.sh
@@ -14,13 +14,16 @@
 # 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 aclocal's '--acdir', '--automake-acdir' and '--system-acdir'
-# options.  Also check that stuff in the automake acdir takes precedence
-# over stuff in the system acdir.
+# Test aclocal's '--automake-acdir' and '--system-acdir' options.  Also
+# check that stuff in the automake acdir takes precedence over stuff in
+# the system acdir.
 
-. ./defs || exit 1
+. test-init.sh
 
 mkdir am sys
+# FIXME: remove in Automake 1.14.
+mkdir am/internal
+: > am/internal/ac-config-macro-dirs.m4
 
 cat >> configure.ac <<'END'
 MY_MACRO
@@ -72,24 +75,4 @@ $FGREP 'fake--init--automake' configure
 $FGREP 'am--macro' configure
 $FGREP 'my--macro' configure && exit 1 # Just to be sure.
 
-rm -rf autom4te*.cache
-
-# Obsolescent '--acdir' option.
-$ACLOCAL -Wobsolete --acdir am 2>stderr && { cat stderr >&2; exit 1; }
-cat stderr >&2
-grep '.*--acdir.*deprecated' stderr
-
-rm -rf autom4te*.cache
-
-$ACLOCAL -Wno-obsolete --acdir am
-$AUTOCONF --force
-$FGREP 'fake--init--automake' configure
-$FGREP 'am--macro' configure
-
-rm -rf autom4te*.cache
-
-$ACLOCAL -Wno-obsolete --acdir sys 2>stderr && { cat stderr >&2; exit 1; }
-cat stderr >&2
-grep 'macro .*AM_INIT_AUTOMAKE.* not found' stderr
-
 :
diff --git a/t/aclocal-amflags.sh b/t/aclocal-amflags.sh
new file mode 100755
index 0000000..49bcf5f
--- /dev/null
+++ b/t/aclocal-amflags.sh
@@ -0,0 +1,69 @@
+#! /bin/sh
+# Copyright (C) 2012 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 obsolescent idiom of setting $(ACLOCAL_AMFLAGS) in
+# Makefile.am still works.  Remove this test once support for this
+# obsolescent idiom is removed.
+
+. test-init.sh
+
+cat >> configure.ac <<'END'
+MACRO_FOO || AS_EXIT([1])
+AC_OUTPUT
+END
+
+mkdir m4_1 m4_2
+cat > m4_1/foo.m4 <<'END'
+AC_DEFUN([MACRO_FOO], [: > foo])
+END
+cat > m4_2/bar.m4 <<'END'
+AC_DEFUN([MACRO_BAR], [: > bar])
+END
+
+cat > Makefile.am <<'END'
+ACLOCAL_AMFLAGS = -I m4_2 --verbose
+check-local:
+       test ! -r foo
+       test -f bar
+DISTCLEANFILES = bar
+END
+
+$ACLOCAL -I m4_1 >output 2>&1 || { cat output; exit 1; }
+cat output
+grep 'found macro' output && exit 1 # Sanity check.
+$AUTOCONF
+$AUTOMAKE
+
+./configure
+test -f foo
+rm -f foo
+
+# ACLOCAL_AMFLAGS is used in rebuild rules, so trigger them.
+$sleep
+
+sed 's/MACRO_FOO/MACRO_BAR/' configure.ac > t
+mv -f t configure.ac
+
+$MAKE Makefile >output 2>&1 || { cat output; exit 1; }
+cat output
+grep "^aclocal.*:.*found macro.*MACRO_BAR.*m4_2/bar\.m4" output
+grep "macro.*MACRO_FOO" output && exit 1
+test ! -r foo
+test -f bar
+
+$MAKE distcheck
+
+:
diff --git a/t/aclocal-autoconf-version-check.sh 
b/t/aclocal-autoconf-version-check.sh
new file mode 100755
index 0000000..f5d8101
--- /dev/null
+++ b/t/aclocal-autoconf-version-check.sh
@@ -0,0 +1,51 @@
+#! /bin/sh
+# Copyright (C) 2008-2012 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 autoconf version checks in aclocal.m4 are robust.
+
+am_create_testdirs=empty
+. test-init.sh
+
+cat > configure.ac <<END
+m4_define([AC_AUTOCONF_VERSION], [9999a])
+dnl!! m4_define([a], [oops])
+AC_INIT([$me], [1.0])
+AM_INIT_AUTOMAKE
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
+END
+
+: > Makefile.am
+
+$ACLOCAL
+$AUTOCONF 2>stderr || { cat stderr >&2; exit 1; }
+cat stderr >&2
+grep 'You have another version of autoconf' stderr
+grep 'aclocal.m4:.*this file was generated for' stderr
+$AUTOMAKE -a
+./configure
+$MAKE
+
+sed 's/^dnl!! //' < configure.ac > configure.tmp
+cmp configure.ac configure.tmp && fatal_ 'failed to edit configure.ac'
+mv -f configure.tmp configure.ac
+
+$MAKE 2>stderr || { cat stderr >&2; exit 1; }
+cat stderr >&2
+grep 'You have another version of autoconf' stderr
+grep 'aclocal.m4:.*this file was generated for autoconf 9999a' stderr
+
+:
diff --git a/t/aclocal-comments-respected.sh b/t/aclocal-comments-respected.sh
new file mode 100755
index 0000000..812f99b
--- /dev/null
+++ b/t/aclocal-comments-respected.sh
@@ -0,0 +1,31 @@
+#! /bin/sh
+# Copyright (C) 2006-2012 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 aclocal ignores include() commands in comments.
+# Report from Mike Frysinger.
+# Also make sure aclocal does not think 'include' is
+# an Autoconf macro.
+
+am_create_testdir=empty
+. test-init.sh
+
+cat >>configure.ac <<EOF
+dnl m4_include(__some_really_bogus_nonexistent_file__.m4)
+  # m4_include(__some_really_bogus_nonexistent_file__.m4)
+##  m4_include(__some_really_bogus_nonexistent_file__.m4)
+echo 'include(foobar)' is OK
+EOF
+$ACLOCAL
diff --git a/t/aclocal-deleted-header-aclocal-amflags.sh 
b/t/aclocal-deleted-header-aclocal-amflags.sh
new file mode 100755
index 0000000..ea47635
--- /dev/null
+++ b/t/aclocal-deleted-header-aclocal-amflags.sh
@@ -0,0 +1,60 @@
+#! /bin/sh
+# Copyright (C) 2007-2012 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 "deleted header file" issue is fixed wrt. aclocal.m4
+# dependencies.
+# NOTE: this test works by using the obsolete 'ACLOCAL_AMFLAGS' make
+# variable; see sister test 'aclocal-deleted-header.sh' for a modern
+# equivalent.
+
+. test-init.sh
+
+cat >>configure.ac <<EOF
+FOO
+AC_OUTPUT
+EOF
+
+cat >foo.m4 <<EOF
+AC_DEFUN([FOO], [AC_SUBST([GREPFOO])])
+EOF
+
+cat >bar.m4 <<EOF
+AC_DEFUN([BAR], [AC_SUBST([GREPBAR])])
+EOF
+
+cat >Makefile.am <<EOF
+ACLOCAL_AMFLAGS = -I .
+EOF
+
+$ACLOCAL -I .
+$AUTOMAKE
+$AUTOCONF
+
+./configure
+
+$MAKE
+grep GREPFOO Makefile
+grep GREPBAR Makefile && exit 1
+
+sed 's/FOO/BAR/' < configure.ac > t
+mv -f t configure.ac
+rm -f foo.m4
+
+$MAKE
+grep GREPFOO Makefile && exit 1
+grep GREPBAR Makefile
+
+:
diff --git a/t/aclocal-deleted-header.sh b/t/aclocal-deleted-header.sh
new file mode 100755
index 0000000..1faf212
--- /dev/null
+++ b/t/aclocal-deleted-header.sh
@@ -0,0 +1,57 @@
+#! /bin/sh
+# Copyright (C) 2007-2012 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 "deleted header file" issue is fixed w.r.t. aclocal.m4
+# dependencies.  See also related the tests 'remake-deleted-m4-file.sh'
+# and 'remake-renamed-m4-macro-and-file.sh'.
+
+. test-init.sh
+
+cat >>configure.ac <<EOF
+AC_CONFIG_MACRO_DIR([.])
+FOO
+AC_OUTPUT
+EOF
+
+cat >foo.m4 <<EOF
+AC_DEFUN([FOO], [AC_SUBST([GREPFOO])])
+EOF
+
+cat >bar.m4 <<EOF
+AC_DEFUN([BAR], [AC_SUBST([GREPBAR])])
+EOF
+
+: >Makefile.am
+
+$ACLOCAL
+$AUTOMAKE
+$AUTOCONF
+
+./configure
+
+$MAKE
+grep GREPFOO Makefile
+grep GREPBAR Makefile && exit 1
+
+sed 's/FOO/BAR/' < configure.ac > t
+mv -f t configure.ac
+rm -f foo.m4
+
+$MAKE
+grep GREPFOO Makefile && exit 1
+grep GREPBAR Makefile
+
+:
diff --git a/t/aclocal-deps-subdir.sh b/t/aclocal-deps-subdir.sh
new file mode 100755
index 0000000..9473114
--- /dev/null
+++ b/t/aclocal-deps-subdir.sh
@@ -0,0 +1,69 @@
+#! /bin/sh
+# Copyright (C) 2003-2012 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 that aclocal.m4's dependencies are honored in
+# sub-directories.  See also related tests 'remake-subdir*.sh'.
+
+. test-init.sh
+
+cat >> configure.ac << 'END'
+AC_CONFIG_MACRO_DIR([m4])
+FOO_TEST([GREPME])
+AC_CONFIG_FILES([sub/Makefile])
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+SUBDIRS = sub
+END
+
+mkdir sub
+: > sub/Makefile.am
+
+mkdir m4
+echo 'AC_DEFUN([FOO_TEST], [echo address@hidden)' > m4/moredefs.m4
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE --copy --add-missing
+./configure
+$MAKE
+
+# Update an aclocal.m4 dependency, then make sure all Makefiles are
+# updated, even from a sub-directory.  Check that AU_ALIAS is
+# recognized. Change the definition of FOO_TEST to check that its new
+# definition is used.
+$sleep # Modified configure dependencies must be newer than config.status.
+echo 'AU_ALIAS([FOO_TEST], [AC_SUBST])' > m4/moredefs.m4
+cd sub
+$MAKE
+cd ..
+grep GREPME Makefile
+grep GREPME sub/Makefile
+
+# Make sure configure dependencies are distributed.
+$MAKE distdir
+test -f $me-1.0/m4/moredefs.m4
+
+# Change the definition of FOO_TEST to check that its new definition is
+# used.  Check that AC_DEFUN_ONCE is caught.
+$sleep # Modified configure dependencies must be newer than config.status.
+echo 'AC_DEFUN_ONCE([FOO_TEST], [AC_SUBST(__$1__)])' > m4/moredefs.m4
+$MAKE
+grep 'm4/moredefs\.m4' aclocal.m4
+grep '__GREPME__' configure
+
+:
diff --git a/t/aclocal-deps.sh b/t/aclocal-deps.sh
new file mode 100755
index 0000000..3e77d9e
--- /dev/null
+++ b/t/aclocal-deps.sh
@@ -0,0 +1,75 @@
+#! /bin/sh
+# Copyright (C) 2003-2012 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 dependencies on aclocal.m4 are set correctly.
+# Report from Jim Meyering.
+
+required=cc
+. test-init.sh
+
+cat >>configure.ac <<EOF
+AC_CONFIG_MACRO_DIR([m4])
+AC_PROG_RANLIB
+AM_PROG_AR
+AC_PROG_CC
+MY_MACRO
+AC_CONFIG_FILES([lib/Makefile])
+AC_OUTPUT
+EOF
+
+mkdir m4
+cat >m4/mymacro.m4 <<EOF
+AC_DEFUN([MY_MACRO], [])
+EOF
+
+mkdir lib
+: > lib/foo.c
+: > lib/bar.c
+cat >lib/Makefile.am <<'EOF'
+noinst_LIBRARIES = liberi.a
+liberi_a_SOURCES = bar.c
+liberi_a_LIBADD = $(LIBOBJS)
+EOF
+
+cat >Makefile.am <<'EOF'
+SUBDIRS = lib
+EXTRA_DIST = m4/mymacro.m4
+check-foo: distdir
+       test -f $(distdir)/lib/foo.c
+       test -f $(distdir)/lib/bar.c
+
+check-not-foo: distdir
+       test ! -f $(distdir)/lib/foo.c
+       test -f $(distdir)/lib/bar.c
+EOF
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE --add-missing
+./configure
+$MAKE check-not-foo
+
+# Update one of the macros.  This should cause ./configure, Makefile.in,
+# Makefile, lib/Makefile.in, and lib/Makefile to be updated.
+
+cat >m4/mymacro.m4 <<'EOF'
+AC_DEFUN([MY_MACRO], [AC_LIBOBJ([foo])])
+EOF
+
+using_gmake || $MAKE
+$MAKE check-foo
+
+:
diff --git a/t/aclocal-dirlist-abspath.sh b/t/aclocal-dirlist-abspath.sh
new file mode 100755
index 0000000..d90c1dc
--- /dev/null
+++ b/t/aclocal-dirlist-abspath.sh
@@ -0,0 +1,42 @@
+#! /bin/sh
+# Copyright (C) 2002-2012 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 use of absolute paths in dirlist.
+
+am_create_testdir=empty
+. test-init.sh
+
+mkdir acdir-more sub sub/acdir
+echo "$(pwd)/acdir-more" > sub/acdir/dirlist
+
+echo 'AC_DEFUN([AM_FOO], [foo-foo--foo])' > acdir-more/foo.m4
+
+cd sub
+
+cat > configure.ac <<EOF
+AC_INIT([$me], [1.0])
+AM_FOO
+EOF
+
+$ACLOCAL --system-acdir acdir
+$AUTOCONF
+
+# Only -I directories are subject to file inclusion.
+grep m4_include aclocal.m4 && exit 1
+
+grep 'foo-foo--foo' configure
+
+:
diff --git a/t/aclocal-dirlist-globbing.sh b/t/aclocal-dirlist-globbing.sh
new file mode 100755
index 0000000..a678252
--- /dev/null
+++ b/t/aclocal-dirlist-globbing.sh
@@ -0,0 +1,55 @@
+#! /bin/sh
+# Copyright (C) 2002-2012 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 dirlist globbing support.
+
+. test-init.sh
+
+cat > configure.ac <<EOF
+AC_INIT([$me], [1.0])
+AM_INIT_GUILE_MODULE
+AM_FOO_BAR
+EOF
+
+mkdir dirlist21-test dirlist22-test
+
+cat >dirlist21-test/dirlist21-check.m4 <<'END'
+AC_DEFUN([AM_INIT_GUILE_MODULE],[. $srcdir/../GUILE-VERSION])
+END
+
+cat >dirlist22-test/dirlist22-check.m4 <<'END'
+AC_DEFUN([AM_FOO_BAR],[
+: foo bar baz
+])
+END
+
+mkdir my-acdir
+cat > my-acdir/dirlist <<'END'
+dirlist2*-test
+END
+
+$ACLOCAL --system-acdir my-acdir
+$AUTOCONF
+
+# There should be no m4_include in aclocal.m4, even though m4/dirlist
+# contains './dirlist-test' as a relative directory.  Only -I directories
+# are subject to file inclusion.
+grep m4_include aclocal.m4 && exit 1
+
+grep 'GUILE-VERSION' configure
+grep 'foo bar baz' configure
+
+:
diff --git a/t/aclocal-dirlist.sh b/t/aclocal-dirlist.sh
new file mode 100755
index 0000000..2dc9038
--- /dev/null
+++ b/t/aclocal-dirlist.sh
@@ -0,0 +1,56 @@
+#! /bin/sh
+# Copyright (C) 2002-2012 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 dirlist support.
+
+. test-init.sh
+
+cat > configure.ac <<EOF
+AC_INIT([$me], [1.0])
+AM_INIT_GUILE_MODULE
+EOF
+
+mkdir acdir dirlist-test
+echo ./dirlist-test > acdir/dirlist
+
+cat >dirlist-test/dirlist-check.m4 <<'END'
+AC_DEFUN([AM_INIT_GUILE_MODULE],[
+. $srcdir/../GUILE-VERSION
+AM_INIT_AUTOMAKE(foreign)
+AC_CONFIG_AUX_DIR(..)
+module=[$1]
+AC_SUBST(module)])
+END
+
+cat >dirlist-test/init.m4 <<EOF
+AC_DEFUN([AM_INIT_AUTOMAKE], [I should not be included])
+EOF
+
+$ACLOCAL --system-acdir acdir
+$AUTOCONF
+
+# There should be no m4_include in aclocal.m4, even though m4/dirlist
+# contains './dirlist-test' as a relative directory.  Only -I directories
+# are subject to file inclusion.
+grep m4_include aclocal.m4 && exit 1
+
+grep 'GUILE-VERSION' configure
+
+# This bug can occur only when we do a VPATH build of Automake
+# but it's OK because VPATH builds are done by 'make distcheck'.
+grep 'I should not be included' configure && exit 1
+
+:
diff --git a/t/aclocal-install-absdir.sh b/t/aclocal-install-absdir.sh
index ada83c2..450bc74 100755
--- a/t/aclocal-install-absdir.sh
+++ b/t/aclocal-install-absdir.sh
@@ -19,7 +19,7 @@
 # ACLOCAL_PATH variable, it is clear that this is the right thing
 # to do.  See also automake bug#8407.
 
-. ./defs || exit 1
+. test-init.sh
 
 mkdir loc sys
 
diff --git a/t/aclocal-install-fail.sh b/t/aclocal-install-fail.sh
index 99fa77a..f0cb573 100755
--- a/t/aclocal-install-fail.sh
+++ b/t/aclocal-install-fail.sh
@@ -19,7 +19,7 @@
 
 am_create_testdir=empty
 required=ro-dir
-. ./defs || exit 1
+. test-init.sh
 
 cat > configure.ac <<END
 AC_INIT([$me], [1.0])
diff --git a/t/aclocal-install-mkdir.sh b/t/aclocal-install-mkdir.sh
index 43eec37..57bfd69 100755
--- a/t/aclocal-install-mkdir.sh
+++ b/t/aclocal-install-mkdir.sh
@@ -19,7 +19,7 @@
 # FIXME: this is a good candidate for a conversion to TAP.
 
 am_create_testdir=empty
-. ./defs || exit 1
+. test-init.sh
 
 cat > configure.ac <<END
 AC_INIT([$me], [1.0])
diff --git a/t/aclocal-m4-include-are-scanned-aclocal-amflags.sh 
b/t/aclocal-m4-include-are-scanned-aclocal-amflags.sh
new file mode 100755
index 0000000..31a0540
--- /dev/null
+++ b/t/aclocal-m4-include-are-scanned-aclocal-amflags.sh
@@ -0,0 +1,108 @@
+#! /bin/sh
+# Copyright (C) 2004-2012 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 m4_included files are also scanned for definitions.
+# Report from Phil Edwards.
+
+. test-init.sh
+
+cat >> configure.ac << 'END'
+AM_PROG_LIBTOOL
+AC_OUTPUT
+END
+
+echo 'm4_include([a.m4])' > acinclude.m4
+echo 'm4_include([b.m4])' > a.m4
+
+cat >b.m4 <<EOF
+m4_include([c.m4])
+AC_DEFUN([AM_PROG_LIBTOOL],
+[AC_REQUIRE([SOMETHING])dnl
+AC_REQUIRE([SOMETHING_ELSE])dnl
+])
+
+AC_DEFUN([SOMETHING])
+EOF
+
+echo 'm4_include([d.m4])' > c.m4
+echo 'AC_DEFUN([SOMETHING_ELSE])' >d.m4
+
+mkdir defs
+echo 'AC_DEFUN([SOMETHING_ELSE])' >defs/e.m4
+echo 'AC_DEFUN([ANOTHER_MACRO])' >defs/f.m4
+
+cat >>Makefile.am<<\EOF
+ACLOCAL_AMFLAGS = -I defs
+testdist1: distdir
+       test -f $(distdir)/acinclude.m4
+       test -f $(distdir)/a.m4
+       test -f $(distdir)/b.m4
+       test -f $(distdir)/c.m4
+       test -f $(distdir)/d.m4
+       test ! -d $(distdir)/defs
+testdist2: distdir
+       test -f $(distdir)/acinclude.m4
+       test -f $(distdir)/a.m4
+       test -f $(distdir)/b.m4
+       test -f $(distdir)/c.m4
+       test -f $(distdir)/d.m4
+       test ! -f $(distdir)/defs/e.m4
+       test -f $(distdir)/defs/f.m4
+EOF
+
+$ACLOCAL -I defs
+
+$FGREP acinclude.m4 aclocal.m4
+# None of the following macro should be included.  acinclude.m4
+# includes the first four, and the last two are not needed at all.
+$FGREP a.m4 aclocal.m4 && exit 1
+$FGREP b.m4 aclocal.m4 && exit 1
+$FGREP c.m4 aclocal.m4 && exit 1
+$FGREP d.m4 aclocal.m4 && exit 1
+$FGREP defs/e.m4 aclocal.m4 && exit 1
+$FGREP defs/f.m4 aclocal.m4 && exit 1
+
+$AUTOCONF
+$AUTOMAKE
+
+./configure
+$MAKE testdist1
+
+cp aclocal.m4 aclocal.old
+$sleep
+echo 'AC_DEFUN([FOO], [ANOTHER_MACRO])' >> c.m4
+$MAKE
+# Because c.m4 has changed, aclocal.m4 must have been rebuilt.
+is_newest aclocal.m4 aclocal.old
+# However, since FOO is not used, f.m4 should not be included
+# and the contents of aclocal.m4 should remain the same
+diff aclocal.m4 aclocal.old
+
+# If FOO where to be used, that would be another story, of course:
+# f.m4 should be included
+$sleep
+echo FOO >> configure.ac
+$MAKE
+$FGREP defs/f.m4 aclocal.m4
+$MAKE testdist2
+
+# Make sure aclocal diagnose missing included files with correct 'file:line:'.
+rm -f b.m4
+$ACLOCAL 2>stderr && { cat stderr >&2; exit 1; }
+cat stderr >&2
+grep 'a\.m4:1: .*b\.m4.*does not exist' stderr
+
+:
diff --git a/t/aclocal-m4-include-are-scanned.sh 
b/t/aclocal-m4-include-are-scanned.sh
new file mode 100755
index 0000000..c84023d
--- /dev/null
+++ b/t/aclocal-m4-include-are-scanned.sh
@@ -0,0 +1,108 @@
+#! /bin/sh
+# Copyright (C) 2004-2012 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 m4_included files are also scanned for definitions.
+# Report from Phil Edwards.
+
+. test-init.sh
+
+cat >> configure.ac << 'END'
+AC_CONFIG_MACRO_DIR([defs])
+AM_PROG_LIBTOOL
+AC_OUTPUT
+END
+
+echo 'm4_include([a.m4])' > acinclude.m4
+echo 'm4_include([b.m4])' > a.m4
+
+cat >b.m4 <<EOF
+m4_include([c.m4])
+AC_DEFUN([AM_PROG_LIBTOOL],
+[AC_REQUIRE([SOMETHING])dnl
+AC_REQUIRE([SOMETHING_ELSE])dnl
+])
+
+AC_DEFUN([SOMETHING])
+EOF
+
+echo 'm4_include([d.m4])' > c.m4
+echo 'AC_DEFUN([SOMETHING_ELSE])' >d.m4
+
+mkdir defs
+echo 'AC_DEFUN([SOMETHING_ELSE])' >defs/e.m4
+echo 'AC_DEFUN([ANOTHER_MACRO])' >defs/f.m4
+
+cat >>Makefile.am<<\EOF
+testdist1: distdir
+       test -f $(distdir)/acinclude.m4
+       test -f $(distdir)/a.m4
+       test -f $(distdir)/b.m4
+       test -f $(distdir)/c.m4
+       test -f $(distdir)/d.m4
+       test ! -d $(distdir)/defs
+testdist2: distdir
+       test -f $(distdir)/acinclude.m4
+       test -f $(distdir)/a.m4
+       test -f $(distdir)/b.m4
+       test -f $(distdir)/c.m4
+       test -f $(distdir)/d.m4
+       test ! -f $(distdir)/defs/e.m4
+       test -f $(distdir)/defs/f.m4
+EOF
+
+$ACLOCAL -I defs
+
+$FGREP acinclude.m4 aclocal.m4
+# None of the following macro should be included.  acinclude.m4
+# includes the first four, and the last two are not needed at all.
+$FGREP a.m4 aclocal.m4 && exit 1
+$FGREP b.m4 aclocal.m4 && exit 1
+$FGREP c.m4 aclocal.m4 && exit 1
+$FGREP d.m4 aclocal.m4 && exit 1
+$FGREP defs/e.m4 aclocal.m4 && exit 1
+$FGREP defs/f.m4 aclocal.m4 && exit 1
+
+$AUTOCONF
+$AUTOMAKE
+
+./configure
+$MAKE testdist1
+
+cp aclocal.m4 aclocal.old
+$sleep
+echo 'AC_DEFUN([FOO], [ANOTHER_MACRO])' >> c.m4
+$MAKE
+# Because c.m4 has changed, aclocal.m4 must have been rebuilt.
+is_newest aclocal.m4 aclocal.old
+# However, since FOO is not used, f.m4 should not be included
+# and the contents of aclocal.m4 should remain the same
+diff aclocal.m4 aclocal.old
+
+# If FOO where to be used, that would be another story, of course:
+# f.m4 should be included
+$sleep
+echo FOO >> configure.ac
+$MAKE
+$FGREP defs/f.m4 aclocal.m4
+$MAKE testdist2
+
+# Make sure aclocal diagnose missing included files with correct 'file:line:'.
+rm -f b.m4
+$ACLOCAL 2>stderr && { cat stderr >&2; exit 1; }
+cat stderr >&2
+grep 'a\.m4:1: .*b\.m4.*does not exist' stderr
+
+:
diff --git a/t/aclocal-m4-sinclude.sh b/t/aclocal-m4-sinclude.sh
new file mode 100755
index 0000000..e7e7e96
--- /dev/null
+++ b/t/aclocal-m4-sinclude.sh
@@ -0,0 +1,73 @@
+#! /bin/sh
+# Copyright (C) 2003-2012 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 changes to m4_included files also cause aclocal.m4 to change.
+
+. test-init.sh
+
+cat > configure.ac << 'END'
+AC_INIT([m4sinclude], [1.0])
+AM_INIT_AUTOMAKE
+m4_include([somefile.m4])
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
+END
+
+cat >Makefile.am <<'EOF'
+check-local:
+       test -f "$(srcdir)/somefile.m4"
+       test -f "$(srcdir)/m4/version1.m4"
+       test -f "$(srcdir)/m4/otherfile.m4"
+EOF
+
+mkdir m4
+
+echo MACRO1 >somefile.m4
+echo 'AC_PREREQ([2.58])' >m4/otherfile.m4
+
+cat >m4/version1.m4 <<EOF
+AC_DEFUN([MACRO1])
+AC_DEFUN([MACRO2])
+m4_sinclude(m4/otherfile.m4)
+EOF
+
+cat >m4/version2.m4 <<EOF
+AC_DEFUN([MACRO1])
+EOF
+
+$ACLOCAL -I m4
+grep version2 aclocal.m4
+grep version1 aclocal.m4 && exit 1
+
+$sleep
+echo MACRO2 >somefile.m4
+
+$ACLOCAL -I m4
+grep version2 aclocal.m4 && exit 1
+grep version1 aclocal.m4
+
+$sleep
+# aclocal.m4 should change if we touch otherfile.m4
+touch m4/otherfile.m4
+$ACLOCAL -I m4
+is_newest aclocal.m4 m4/otherfile.m4
+
+$AUTOCONF
+$AUTOMAKE
+./configure
+$MAKE distcheck
+
+:
diff --git a/t/aclocal-macrodir.tap b/t/aclocal-macrodir.tap
new file mode 100755
index 0000000..2d3b0d6
--- /dev/null
+++ b/t/aclocal-macrodir.tap
@@ -0,0 +1,211 @@
+#! /bin/sh
+# Copyright (C) 2012 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/>.
+
+# Several tests on the use of the m4 macro AC_CONFIG_MACRO_DIR with
+# aclocal.  See also related test 'aclocal-macrodir.tap'.
+
+am_create_testdir=empty
+. test-init.sh
+
+plan_ 6
+
+ocwd=$(pwd) || fatal_ "getting current working directory"
+ACLOCAL_PATH=; unset ACLOCAL_PATH
+
+#
+# General utility functions and variables.
+#
+# TODO: These should maybe be refactored, generalized and
+#       moved into 't/ax/tap-functions.sh' ...
+#
+
+tcount=0
+r=invalid
+description=''
+directive=''
+
+test_begin ()
+{
+  if test -n "$description"; then
+    fatal_ "'test_begin' called, but another test seems active already"
+  else
+    r=ok
+    description=$1
+    directive=${2-}
+    echo "$description" > README.txt
+    shift
+  fi
+  tcount=$(($tcount + 1)) && test $tcount -gt 0 \
+    || fatal_ "failed to bump the test count"
+  mkdir $tcount.d
+  cd $tcount.d
+}
+
+test_end ()
+{
+  if test -z "$description"; then
+    fatal_ "'test_end' called, but no test seems active"
+  else
+    cd "$ocwd" || fatal_ "cannot chdir back to top-level directory"
+    result_ "$r" -D "$directive" -- "$description"
+    # Don't leave directories for successful subtests hanging around.
+    if test -z "$directive" && test "$r" = ok; then
+      rm -rf "$tcount.d" || fatal_ "removing subdir $tcount.d"
+    fi
+    r=invalid directive= description=
+  fi
+}
+
+#---------------------------------------------------------------------------
+
+test_begin "AC_CONFIG_MACRO_DIR is honored"
+
+cat > configure.ac <<'END'
+AC_INIT([md], [10.0])
+AC_CONFIG_MACRO_DIR([macro-dir])
+MY_FOO
+END
+
+mkdir macro-dir
+echo 'AC_DEFUN([MY_FOO], [::my::foo::])' > macro-dir/foo.m4
+
+$ACLOCAL \
+  && $FGREP 'm4_include([macro-dir/foo.m4])' aclocal.m4 \
+  && $AUTOCONF \
+  && not $FGREP 'MY_FOO' configure \
+  && $FGREP '::my::foo::' configure \
+  || r='not ok'
+
+test_end
+
+#---------------------------------------------------------------------------
+
+test_begin "AC_CONFIG_MACRO_DIR([foo]) interaction with --install"
+
+cat > configure.ac << 'END'
+AC_INIT([inst], [1.0])
+AC_CONFIG_MACRO_DIR([the-dir])
+THE_MACRO
+END
+
+mkdir sys-dir the-dir
+echo 'AC_DEFUN([THE_MACRO], [:])' > sys-dir/my.m4
+
+test ! -r the-dir/my.m4 \
+  && $ACLOCAL --install --system-acdir ./sys-dir \
+  && diff sys-dir/my.m4 the-dir/my.m4 \
+  || r='not ok'
+
+test_end
+
+#---------------------------------------------------------------------------
+
+test_begin "'-I' option wins over AC_CONFIG_MACRO_DIR"
+
+cat > configure.ac <<'END'
+AC_INIT([md], [4.6])
+AC_CONFIG_MACRO_DIR([dir1])
+MY_FOO
+END
+
+mkdir dir1 dir2
+echo 'AC_DEFUN([MY_FOO], [::ko::ko::])' > dir1/1.m4
+echo 'AC_DEFUN([MY_FOO], [::ok::ok::])' > dir2/2.m4
+
+$ACLOCAL -I dir2 \
+  && $FGREP 'm4_include([dir2/2.m4])' aclocal.m4 \
+  && not $FGREP 'm4_include([dir1/1.m4])' aclocal.m4 \
+  && $AUTOCONF \
+  && not $FGREP '::ko::ko::' configure \
+  && $FGREP '::ok::ok::' configure \
+  || r='not ok'
+
+test_end
+
+#---------------------------------------------------------------------------
+
+test_begin "AC_CONFIG_MACRO_DIR([foo]) can create directory 'foo'"
+
+cat > configure.ac << 'END'
+AC_INIT([x], [1.0])
+AC_CONFIG_MACRO_DIR([foo])
+MY_MACRO
+END
+
+mkdir acdir
+echo 'AC_DEFUN([MY_MACRO], [:])' > acdir/bar.m4
+
+test ! -d foo \
+  && $ACLOCAL --install --system-acdir ./acdir \
+  && diff acdir/bar.m4 foo/bar.m4 \
+  || r='not ok'
+
+test_end
+
+#---------------------------------------------------------------------------
+
+test_begin "AC_CONFIG_MACRO_DIR([non-existent]) errors out (1)"
+
+cat > configure.ac << 'END'
+AC_INIT([oops], [1.0])
+AC_CONFIG_MACRO_DIR([non-existent])
+END
+
+not $ACLOCAL -Wnone 2>stderr \
+  && cat stderr >&2 \
+  && grep "couldn't open directory 'non-existent'" stderr \
+  || r='not ok'
+
+test_end
+
+#---------------------------------------------------------------------------
+
+# Avoid spurious failures with pre-2.70 autoconf.
+# FIXME: remove this in automake 1.14, once we require Autoconf 2.70.
+if echo 'AC_INIT AC_CONFIG_MACRO_DIRS' | $AUTOCONF -o/dev/null -; then
+
+  test_begin "AC_CONFIG_MACRO_DIR interaction with AC_REQUIRE"
+
+  unindent > configure.ac <<'END'
+  AC_INIT([req], [1.0])
+  AC_CONFIG_MACRO_DIR([macro-dir])
+  AC_DEFUN([MY_FOO], [AC_REQUIRE([MY_BAR])])
+  MY_FOO
+END
+
+  mkdir macro-dir
+  echo 'AC_DEFUN([MY_BAR], [//my//bar//])' > macro-dir/x.m4
+
+  st=0; $ACLOCAL 2>stderr || st=$?
+  cat stderr >&2
+
+  test $st -eq 0 \
+    && test ! -s stderr \
+    && $FGREP 'm4_include([macro-dir/x.m4])' aclocal.m4 \
+    && $AUTOCONF \
+    && not $EGREP 'MY_(FOO|BAR)' configure \
+    && $FGREP '//my//bar//' configure \
+    || r='not ok'
+
+  test_end
+
+else
+
+  skip_ -r "autoconf is too old (AC_CONFIG_MACRO_DIRS not defined)"
+
+fi
+
+:
diff --git a/t/aclocal-macrodirs.tap b/t/aclocal-macrodirs.tap
new file mode 100755
index 0000000..10256fd
--- /dev/null
+++ b/t/aclocal-macrodirs.tap
@@ -0,0 +1,416 @@
+#! /bin/sh
+# Copyright (C) 2012 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/>.
+
+# Several tests on the use of the m4 macro AC_CONFIG_MACRO_DIRS with
+# aclocal.  See also related test 'aclocal-macrodir.tap'.
+
+am_create_testdir=empty
+. test-init.sh
+
+plan_ 14
+
+ocwd=$(pwd) || fatal_ "getting current working directory"
+ACLOCAL_PATH=; unset ACLOCAL_PATH
+
+#
+# General utility functions and variables.
+#
+# TODO: These should maybe be refactored, generalized and
+#       moved into 't/ax/tap-functions.sh' ...
+#
+
+tcount=0
+r=invalid
+description=''
+directive=''
+
+test_begin ()
+{
+  if test -n "$description"; then
+    fatal_ "'test_begin' called, but another test seems active already"
+  else
+    r=ok
+    description=$1
+    directive=${2-}
+    echo "$description" > README.txt
+    shift
+  fi
+  tcount=$(($tcount + 1)) && test $tcount -gt 0 \
+    || fatal_ "failed to bump the test count"
+  mkdir $tcount.d
+  cd $tcount.d
+}
+
+test_end ()
+{
+  if test -z "$description"; then
+    fatal_ "'test_end' called, but no test seems active"
+  else
+    cd "$ocwd" || fatal_ "cannot chdir back to top-level directory"
+    result_ "$r" -D "$directive" -- "$description"
+    # Don't leave directories for successful subtests hanging around.
+    if test -z "$directive" && test "$r" = ok; then
+      rm -rf "$tcount.d" || fatal_ "removing subdir $tcount.d"
+    fi
+    r=invalid directive= description=
+  fi
+}
+
+#---------------------------------------------------------------------------
+
+test_begin "AC_CONFIG_MACRO_DIRS is honored"
+
+cat > configure.ac <<'END'
+AC_INIT([md], [10.0])
+AC_CONFIG_MACRO_DIRS([macro-dir])
+MY_FOO
+END
+
+mkdir macro-dir
+echo 'AC_DEFUN([MY_FOO], [::my::foo::])' > macro-dir/foo.m4
+
+$ACLOCAL \
+  && $FGREP 'm4_include([macro-dir/foo.m4])' aclocal.m4 \
+  && $AUTOCONF \
+  && not $FGREP 'MY_FOO' configure \
+  && $FGREP '::my::foo::' configure \
+  || r='not ok'
+
+test_end
+
+#---------------------------------------------------------------------------
+
+three_dirs_check ()
+{
+  mkdir dir1 dir2 dir3
+  echo 'AC_DEFUN([MY_FOO], [::my::foo::])' > dir1/foo.m4
+  echo 'AC_DEFUN([MY_BAR], [!!my!!bar!!])' > dir2/zap.m4
+  echo 'AC_DEFUN([MY_BAZ], [==my==baz==])' > dir3/0.m4
+  $ACLOCAL \
+    && $FGREP 'm4_include([dir1/foo.m4])' aclocal.m4 \
+    && $FGREP 'm4_include([dir2/zap.m4])' aclocal.m4 \
+    && $FGREP 'm4_include([dir3/0.m4])'   aclocal.m4 \
+    && $AUTOCONF \
+    && not $EGREP 'MY_(FOO|BAR|BAZ)' configure \
+    && $FGREP '::my::foo::' configure \
+    && $FGREP '!!my!!bar!!' configure \
+    && $FGREP '==my==baz==' configure \
+    || r='not ok'
+}
+
+#---------------------------------------------------------------------------
+
+test_begin "AC_CONFIG_MACRO_DIRS several arguments"
+
+cat > configure.ac <<'END'
+AC_INIT([more-args], [0.2])
+AC_CONFIG_MACRO_DIRS([dir1 dir2 dir3])
+MY_FOO
+MY_BAR
+MY_BAZ
+END
+
+three_dirs_check
+
+test_end
+
+#---------------------------------------------------------------------------
+
+test_begin "AC_CONFIG_MACRO_DIRS several calls"
+
+cat > configure.ac <<'END'
+AC_INIT([more-calls], [2.0])
+AC_CONFIG_MACRO_DIRS([dir1])
+AC_CONFIG_MACRO_DIRS([dir2 dir3])
+MY_FOO
+MY_BAR
+MY_BAZ
+END
+
+three_dirs_check
+
+test_end
+
+#---------------------------------------------------------------------------
+
+test_begin "AC_CONFIG_MACRO_DIRS extra whitespace"
+
+bslash=\\
+
+cat > configure.ac <<END
+AC_INIT([more-args], [0.2])
+AC_CONFIG_MACRO_DIRS([   dir1${bslash}
+${tab} dir2   ${tab}${tab}dir3
+${bslash}
+
+])
+MY_FOO
+MY_BAR
+MY_BAZ
+END
+
+three_dirs_check
+
+test_end
+
+#---------------------------------------------------------------------------
+
+test_begin "AC_CONFIG_MACRO_DIRS precedence"
+
+cat > configure.ac <<'END'
+AC_INIT([more-calls], [2.0])
+AC_CONFIG_MACRO_DIRS([dir1])
+AC_CONFIG_MACRO_DIRS([dir2 dir3])
+MY_FOO
+MY_BAR
+MY_BAZ
+END
+
+mkdir dir1 dir2 dir3
+echo 'AC_DEFUN([MY_FOO], [OK-Foo])' > dir1/b.m4
+echo 'AC_DEFUN([MY_FOO], [KO-Foo])' > dir2/a.m4
+echo 'AC_DEFUN([MY_BAR], [OK-Bar])' > dir2/1.m4
+echo 'AC_DEFUN([MY_BAR], [KO-Bar])' > dir3/0.m4
+echo 'AC_DEFUN([MY_BAZ], [OK-Baz])' > dir3/x.m4
+
+$ACLOCAL \
+  && $FGREP 'm4_include([dir1/b.m4])' aclocal.m4 \
+  && $FGREP 'm4_include([dir2/1.m4])' aclocal.m4 \
+  && $FGREP 'm4_include([dir3/x.m4])' aclocal.m4 \
+  && test $($FGREP -c 'm4_include([dir1' aclocal.m4) -eq 1 \
+  && test $($FGREP -c 'm4_include([dir2' aclocal.m4) -eq 1 \
+  && test $($FGREP -c 'm4_include([dir3' aclocal.m4) -eq 1 \
+  && $AUTOCONF \
+  && not $EGREP 'MY_(FOO|BAR|BAZ)' configure \
+  && $FGREP 'OK-Foo' configure \
+  && $FGREP 'OK-Bar' configure \
+  && $FGREP 'OK-Baz' configure \
+  && not $FGREP 'KO-' configure \
+  || r='not ok'
+
+test_end
+
+#---------------------------------------------------------------------------
+
+test_begin "AC_CONFIG_MACRO_DIRS interaction with --install"
+
+cat > configure.ac << 'END'
+AC_INIT([inst], [1.0])
+AC_CONFIG_MACRO_DIRS([the-dir])
+THE_MACRO
+END
+
+mkdir sys-dir the-dir
+echo 'AC_DEFUN([THE_MACRO], [:])' > sys-dir/my.m4
+
+test ! -r the-dir/my.m4 \
+  && $ACLOCAL --install --system-acdir ./sys-dir \
+  && diff sys-dir/my.m4 the-dir/my.m4 \
+  || r='not ok'
+
+test_end
+
+#---------------------------------------------------------------------------
+
+two_dirs_install_check ()
+{
+  mkdir sys-dir dir1 dir2
+  echo 'AC_DEFUN([THE_MACRO], [:])' > sys-dir/my.m4
+  echo 'AC_DEFUN([AX_FOO], [:])' > dir2/zap.m4
+  test ! -r dir1/my.m4 \
+    && $ACLOCAL --install --system-acdir ./sys-dir \
+    && diff sys-dir/my.m4 dir1/my.m4 \
+    && test ! -e dir2/my.m4 \
+    && $FGREP 'm4_include([dir1/my.m4])' aclocal.m4 \
+    && $FGREP 'm4_include([dir2/zap.m4])' aclocal.m4 \
+    || r='not ok'
+}
+
+#---------------------------------------------------------------------------
+
+test_begin "several AC_CONFIG_MACRO_DIRS arguments and --install"
+
+cat > configure.ac << 'END'
+AC_INIT([inst2a], [1.0])
+AC_CONFIG_MACRO_DIRS([dir1 dir2])
+THE_MACRO
+AX_FOO
+END
+
+two_dirs_install_check
+
+test_end
+
+#---------------------------------------------------------------------------
+
+
+test_begin "several AC_CONFIG_MACRO_DIRS calls and --install"
+
+cat > configure.ac << 'END'
+AC_INIT([inst2b], [1.0])
+AC_CONFIG_MACRO_DIRS([dir1])
+AC_CONFIG_MACRO_DIRS([dir2])
+THE_MACRO
+AX_FOO
+END
+
+two_dirs_install_check
+
+test_end
+
+#---------------------------------------------------------------------------
+
+test_begin "'-I' option wins over AC_CONFIG_MACRO_DIRS"
+
+cat > configure.ac <<'END'
+AC_INIT([md], [4.6])
+AC_CONFIG_MACRO_DIRS([dir1])
+MY_FOO
+END
+
+mkdir dir1 dir2
+echo 'AC_DEFUN([MY_FOO], [::ko::ko::])' > dir1/1.m4
+echo 'AC_DEFUN([MY_FOO], [::ok::ok::])' > dir2/2.m4
+
+$ACLOCAL -I dir2 \
+  && $FGREP 'm4_include([dir2/2.m4])' aclocal.m4 \
+  && not $FGREP 'm4_include([dir1/1.m4])' aclocal.m4 \
+  && $AUTOCONF \
+  && not $FGREP '::ko::ko::' configure \
+  && $FGREP '::ok::ok::' configure \
+  || r='not ok'
+
+test_end
+
+#---------------------------------------------------------------------------
+
+test_begin "AC_CONFIG_MACRO_DIRS([foo]) can create directory 'foo'"
+
+cat > configure.ac << 'END'
+AC_INIT([x], [1.0])
+AC_CONFIG_MACRO_DIRS([foo])
+MY_MACRO
+END
+
+mkdir acdir
+echo 'AC_DEFUN([MY_MACRO], [:])' > acdir/bar.m4
+
+test ! -d foo \
+  && $ACLOCAL --install --system-acdir ./acdir \
+  && diff acdir/bar.m4 foo/bar.m4 \
+  || r='not ok'
+
+test_end
+
+#---------------------------------------------------------------------------
+
+test_begin "AC_CONFIG_MACRO_DIRS([non-existent]) errors out (1)"
+
+cat > configure.ac << 'END'
+AC_INIT([oops], [1.0])
+AC_CONFIG_MACRO_DIRS([non-existent])
+END
+
+not $ACLOCAL 2>stderr \
+  && cat stderr >&2 \
+  && grep "couldn't open directory 'non-existent'" stderr \
+  || r='not ok'
+
+test_end
+
+#---------------------------------------------------------------------------
+
+test_begin "AC_CONFIG_MACRO_DIRS([non-existent]) errors out (2)"
+
+cat > configure.ac << 'END'
+AC_INIT([oops], [1.0])
+AC_CONFIG_MACRO_DIRS([dir-ok])
+AC_CONFIG_MACRO_DIRS([dir-ko])
+END
+
+mkdir dir-ok
+not $ACLOCAL 2>stderr \
+  && cat stderr >&2 \
+  && grep "couldn't open directory 'dir-ko'" stderr \
+  && not grep "dir-ok" stderr \
+  || r='not ok'
+
+test_end
+
+#---------------------------------------------------------------------------
+
+test_begin "AC_CONFIG_MACRO_DIRS([non-existent]) errors out (tricky setup)"
+
+cat > configure.ac << 'END'
+AC_INIT([oops], [1.0])
+AC_CONFIG_MACRO_DIRS([dir-ok])
+AC_CONFIG_MACRO_DIRS([dir-ko])
+END
+
+mkdir dir-ok
+
+not $ACLOCAL -Wnone --install 2>stderr \
+  && cat stderr >&2 \
+  && grep "couldn't open directory 'dir-ko'" stderr \
+  && test ! -e dir-ko \
+  || r='not ok'
+
+test_end
+
+#---------------------------------------------------------------------------
+
+# Avoid spurious failures with pre-2.70 autoconf.
+# FIXME: remove this in automake 1.14, once we require Autoconf 2.70.
+if echo 'AC_INIT AC_CONFIG_MACRO_DIRS' | $AUTOCONF -o/dev/null -; then
+
+  test_begin "AC_CONFIG_MACRO_DIRS interaction with AC_REQUIRE"
+
+  unindent > configure.ac <<'END'
+  AC_INIT([req], [1.0])
+  AC_CONFIG_MACRO_DIRS([m1 m2])
+  AC_DEFUN([MY_FOO], [
+    AC_REQUIRE([MY_BAR])
+    AC_REQUIRE([MY_BAZ])
+  ])
+  MY_FOO
+END
+
+  mkdir m1 m2
+  echo 'AC_DEFUN([MY_BAR], [^^my^^bar^^])' > m1/x.m4
+  echo 'AC_DEFUN([MY_BAZ], [~~my~~baz~~])' > m2/x.m4
+
+  st=0; $ACLOCAL 2>stderr || st=$?
+  cat stderr >&2
+
+  test $st -eq 0 \
+    && test ! -s stderr \
+    && $FGREP 'm4_include([m1/x.m4])' aclocal.m4 \
+    && $FGREP 'm4_include([m2/x.m4])' aclocal.m4 \
+    && $AUTOCONF \
+    && not $EGREP 'MY_(FOO|BAR|BAZ)' configure \
+    && $FGREP '^^my^^bar^^' configure \
+    && $FGREP '~~my~~baz~~' configure \
+    || r='not ok'
+
+  test_end
+
+else
+
+  skip_ -r "autoconf is too old (AC_CONFIG_MACRO_DIRS not defined)"
+
+fi
+
+:
diff --git a/t/aclocal-missing-macros.sh b/t/aclocal-missing-macros.sh
new file mode 100755
index 0000000..ce93251
--- /dev/null
+++ b/t/aclocal-missing-macros.sh
@@ -0,0 +1,41 @@
+#! /bin/sh
+# Copyright (C) 1998-2012 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 include of include detects missing macros
+
+am_create_testdir=empty
+. test-init.sh
+
+cat >> configure.ac <<END
+AC_INIT([$me], [1.0])
+GNOME_X_CHECKS
+END
+
+mkdir macros
+
+cat > macros/gnome.m4 << 'END'
+AC_DEFUN([GNOME_X_CHECKS], [
+# Use a macro that cannot be installed in a third-party system-wide m4
+# file; otherwise, this test might fail under "make installcheck".
+       AM__PATH__GTK(0.99.5,,AC_MSG_ERROR(GTK not installed, or gtk-config not 
in path))
+])
+END
+
+$ACLOCAL -I macros 2>stderr && { cat stderr >&2; exit 1; }
+cat stderr
+grep '^macros/gnome\.m4:4:.*AM__PATH__GTK.*not found' stderr
+
+:
diff --git a/t/aclocal-no-extra-scan.sh b/t/aclocal-no-extra-scan.sh
new file mode 100755
index 0000000..34f66b1
--- /dev/null
+++ b/t/aclocal-no-extra-scan.sh
@@ -0,0 +1,37 @@
+#! /bin/sh
+# Copyright (C) 2004-2012 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 aclocal does not include definitions that are not actually
+# evaluated.
+
+am_create_testdir=empty
+. test-init.sh
+
+cat > configure.ac << 'END'
+AC_INIT([x], [0])
+AC_SUBST([POM])
+END
+
+mkdir m4
+cat >m4/some.m4 <<'EOF'
+AC_DEFUN([AM_SOME_MACRO],
+[AC_DEFUN([AC_SUBST], [GREPME])])
+EOF
+
+$ACLOCAL -I m4
+$EGREP 'some.m4|GREPME' aclocal.m4 && exit 1
+
+:
diff --git a/t/aclocal-no-force.sh b/t/aclocal-no-force.sh
new file mode 100755
index 0000000..9f24614
--- /dev/null
+++ b/t/aclocal-no-force.sh
@@ -0,0 +1,117 @@
+#! /bin/sh
+# Copyright (C) 2003-2012 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 aclocal does not overwrite aclocal.m4 needlessly.
+# Also make sure automake --no-force does not overwrite Makefile.in needlessly.
+
+. test-init.sh
+
+cat >> configure.ac << 'END'
+SOME_DEFS
+AC_CONFIG_FILES([sub/Makefile])
+END
+
+mkdir sub
+: > sub/Makefile.am
+
+cat >> Makefile.am << 'END'
+SUBDIRS = sub
+include fragment.inc
+END
+
+: > fragment.inc
+
+mkdir m4
+echo 'AC_DEFUN([SOME_DEFS], [])' > m4/somedefs.m4
+
+# Automake will take aclocal.m4 to be newer if it has the same timestamp
+# as Makefile.in.  Avoid the confusing by sleeping.
+AUTOMAKE_after_aclocal ()
+{
+  $sleep
+  $AUTOMAKE --no-force
+}
+
+# aclocal will rewrite aclocal.m4 unless the input files are all older than the
+# existing aclocal.m4 -- sleep to ensure somedefs.m4 has an older timestamp
+# than the aclocal.m4 that the next aclocal call will generate.
+$sleep
+
+$ACLOCAL -I m4
+AUTOMAKE_after_aclocal
+
+touch foo
+$sleep
+$ACLOCAL -I m4
+AUTOMAKE_after_aclocal
+# aclocal.m4 and Makefile.in should not have been updated, so 'foo'
+# should be younger
+is_newest foo aclocal.m4 Makefile.in sub/Makefile.in
+
+$sleep
+$ACLOCAL -I m4 --force
+is_newest aclocal.m4 foo
+# We still use --no-force for automake, but since aclocal.m4 has
+# changed all Makefile.ins should be updated.
+AUTOMAKE_after_aclocal
+is_newest Makefile.in aclocal.m4 foo
+is_newest sub/Makefile.in aclocal.m4 foo
+
+$sleep
+touch m4/somedefs.m4
+$sleep
+$ACLOCAL -I m4
+AUTOMAKE_after_aclocal
+# aclocal.m4 should have been updated, although its contents haven't
+# changed.
+is_newest aclocal.m4 m4/somedefs.m4
+is_newest Makefile.in m4/somedefs.m4
+is_newest sub/Makefile.in m4/somedefs.m4
+
+$sleep
+touch fragment.inc
+$sleep
+$ACLOCAL -I m4
+AUTOMAKE_after_aclocal
+# Only ./Makefile.in should change.
+is_newest Makefile.in fragment.inc
+is_newest fragment.inc aclocal.m4
+is_newest fragment.inc sub/Makefile.in
+
+grep README Makefile.in && exit 1
+
+$sleep
+: > README
+$sleep
+$AUTOMAKE --no-force
+# Even if no dependency change, the content changed.
+is_newest Makefile.in README
+is_newest README sub/Makefile.in
+
+grep README Makefile.in
+
+: > sub/Makefile.in
+$sleep
+touch foo
+$sleep
+$ACLOCAL -I m4
+$AUTOMAKE --no-force
+# Only sub/Makefile.in should change.
+is_newest foo aclocal.m4
+is_newest foo Makefile.in
+is_newest sub/Makefile.in foo
+
+:
diff --git a/t/aclocal-no-install-no-mkdir.sh b/t/aclocal-no-install-no-mkdir.sh
index 5b47768..58dafb9 100755
--- a/t/aclocal-no-install-no-mkdir.sh
+++ b/t/aclocal-no-install-no-mkdir.sh
@@ -18,7 +18,7 @@
 # if the '--install' option is not given.
 
 am_create_testdir=empty
-. ./defs || exit 1
+. test-init.sh
 
 cat > configure.ac <<END
 AC_INIT([$me], [1.0])
diff --git a/t/aclocal-no-symlinked-overwrite.sh 
b/t/aclocal-no-symlinked-overwrite.sh
new file mode 100755
index 0000000..c381dd7
--- /dev/null
+++ b/t/aclocal-no-symlinked-overwrite.sh
@@ -0,0 +1,41 @@
+#! /bin/sh
+# Copyright (C) 2006-2012 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 aclocal does not write into symlinked aclocal.m4.
+
+am_create_testdir=empty
+. test-init.sh
+
+echo 'm4_define([FOO], [wrong foo])' > foo.m4
+echo 'm4_define([FOO], [right foo])' > acinclude.m4
+echo 'AC_INIT FOO' > configure.ac
+
+chmod a-w foo.m4
+
+# Setup.
+ln -s foo.m4 aclocal.m4 && test -h aclocal.m4 \
+  || skip_ "cannot create symlinks to files"
+
+# Sanity check.
+grep 'wrong foo' aclocal.m4 \
+  || fatal_ "weird error symlinking aclocal.m4 -> foo.m4"
+
+$ACLOCAL
+$AUTOCONF
+grep 'right foo' configure
+grep 'wrong foo' foo.m4
+
+:
diff --git a/t/aclocal-no-unused-required.sh b/t/aclocal-no-unused-required.sh
new file mode 100755
index 0000000..9f2d1db
--- /dev/null
+++ b/t/aclocal-no-unused-required.sh
@@ -0,0 +1,42 @@
+#! /bin/sh
+# Copyright (C) 2003-2012 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 aclocal does not require unused macros.
+
+am_create_testdir=empty
+. test-init.sh
+
+cat > configure.ac << 'END'
+AC_INIT
+SOME_DEFS
+END
+
+mkdir m4
+cat >m4/somedefs.m4 <<EOF
+AC_DEFUN([SOME_DEFS], [
+  m4_if([a], [a], [MACRO1], [MACRO2])
+])
+EOF
+
+echo 'AC_DEFUN([MACRO1],)' >m4/macro1.m4
+echo 'AC_DEFUN([MACRO2], [AC_REQUIRE([AM_UNUSED_MACRO])])' >m4/macro2.m4
+
+$ACLOCAL -I m4 >output 2>&1 || { cat output; exit 1; }
+test 0 -eq $(wc -l <output)
+grep macro1.m4 aclocal.m4
+grep macro2.m4 aclocal.m4 && exit 1
+
+:
diff --git a/t/aclocal-path-install-serial.sh b/t/aclocal-path-install-serial.sh
index 683845c..c3f0c8a 100755
--- a/t/aclocal-path-install-serial.sh
+++ b/t/aclocal-path-install-serial.sh
@@ -18,7 +18,7 @@
 # are involved.
 
 am_create_testdir=empty
-. ./defs || exit 1
+. test-init.sh
 
 cat > configure.ac << 'END'
 AC_INIT
diff --git a/t/aclocal-path-install.sh b/t/aclocal-path-install.sh
index 4ed1a2c..eb10f99 100755
--- a/t/aclocal-path-install.sh
+++ b/t/aclocal-path-install.sh
@@ -17,7 +17,7 @@
 # ACLOCAL_PATH and '--install' interactions.
 
 am_create_testdir=empty
-. ./defs || exit 1
+. test-init.sh
 
 cat > configure.ac << 'END'
 AC_INIT
@@ -41,7 +41,7 @@ END
 # in a directory specified in ACLOCAL_PATH.
 $ACLOCAL --install 2>stderr && { cat stderr >&2; exit 1; }
 cat stderr >&2
-grep ' no -I was supplied' stderr
+grep 'impossible without -I .* nor AC_CONFIG_MACRO_DIR' stderr
 test ! -e pdir/foo.m4
 
 # The '--install' option should cause a required macro found in a
diff --git a/t/aclocal-path-nonexistent.sh b/t/aclocal-path-nonexistent.sh
index ad8d5b7..df1bae1 100755
--- a/t/aclocal-path-nonexistent.sh
+++ b/t/aclocal-path-nonexistent.sh
@@ -17,7 +17,7 @@
 # Non-existent directories in ACLOCAL_PATH are ok.
 
 am_create_testdir=empty
-. ./defs || exit 1
+. test-init.sh
 
 cat > configure.ac << 'END'
 AC_INIT
diff --git a/t/aclocal-path-precedence.sh b/t/aclocal-path-precedence.sh
index 81eee98..0545231 100755
--- a/t/aclocal-path-precedence.sh
+++ b/t/aclocal-path-precedence.sh
@@ -17,11 +17,11 @@
 # Check precedence rules for ACLOCAL_PATH.
 
 am_create_testdir=empty
-. ./defs || exit 1
+. test-init.sh
 
 cat > configure.ac << 'END'
 AC_INIT([foo], [1.0])
-AM_INIT_AUTOMAKE([parallel-tests])
+AM_INIT_AUTOMAKE
 FOO_MACRO
 BAR_MACRO
 AC_PROG_LIBTOOL
diff --git a/t/aclocal-path.sh b/t/aclocal-path.sh
index c22a7c4..a4ee3ee 100755
--- a/t/aclocal-path.sh
+++ b/t/aclocal-path.sh
@@ -17,7 +17,7 @@
 # Check basic ACLOCAL_PATH support.
 
 am_create_testdir=empty
-. ./defs || exit 1
+. test-init.sh
 
 cat > configure.ac << 'END'
 AC_INIT
diff --git a/t/aclocal-pr450.sh b/t/aclocal-pr450.sh
new file mode 100755
index 0000000..502bc69
--- /dev/null
+++ b/t/aclocal-pr450.sh
@@ -0,0 +1,49 @@
+#! /bin/sh
+# Copyright (C) 2005-2012 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 aclocal does not fail on configure.ac inclusions that do
+# more than just variable definitions.
+# Report from Peter Breitenlohner (PR/450).
+
+. test-init.sh
+
+cat >configure.ac <<'END'
+AC_INIT([acloca19], [1.0])
+m4_include([aconfig.ac])
+FOO
+AC_OUTPUT
+END
+
+cat >aconfig.ac <<'END'
+AM_INIT_AUTOMAKE
+AC_DEFUN([FOO], [echo GREPME])
+sinclude([bconfig.ac])
+END
+
+cat >bconfig.ac <<'END'
+AC_ARG_WITH([grepme], [string])
+END
+
+$ACLOCAL
+$AUTOCONF
+./configure >stdout || { cat stdout; exit 1; }
+cat stdout
+grep GREPME stdout
+grep 'aconfig\.ac' aclocal.m4 && exit 1
+grep 'bconfig\.ac' aclocal.m4 && exit 1
+grep with-grepme configure
+
+:
diff --git a/t/aclocal-print-acdir.sh b/t/aclocal-print-acdir.sh
index d057d82..440bb72 100755
--- a/t/aclocal-print-acdir.sh
+++ b/t/aclocal-print-acdir.sh
@@ -17,14 +17,11 @@
 # Test on aclocal's '--print-ac-dir' option.
 
 am_create_testdir=empty
-. ./defs || exit 1
+. test-init.sh
 
 $ACLOCAL --print-ac-dir
 test "$($ACLOCAL --print-ac-dir)" = "$am_system_acdir"
 
-$ACLOCAL -Wno-obsolete --acdir foo --print-ac-dir
-test "$($ACLOCAL -Wno-obsolete --acdir foo --print-ac-dir)" = foo
-
 $ACLOCAL --system-acdir /bar --print-ac-dir
 test "$($ACLOCAL --system-acdir /bar --print-ac-dir)" = /bar
 
diff --git a/t/aclocal-remake-misc.sh b/t/aclocal-remake-misc.sh
new file mode 100755
index 0000000..97b7482
--- /dev/null
+++ b/t/aclocal-remake-misc.sh
@@ -0,0 +1,74 @@
+#! /bin/sh
+# Copyright (C) 2003-2012 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 aclocal.m4 is rebuilt whenever a configure
+# dependency changes.  Test for acinclude.m4 and VPATH too.
+
+. test-init.sh
+
+cat >> configure.ac << 'END'
+SOME_DEFS
+AC_CONFIG_FILES([sub/Makefile])
+AC_CONFIG_MACRO_DIR([m4])
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+SUBDIRS = sub
+END
+
+mkdir sub
+: > sub/Makefile.am
+
+mkdir m4
+echo 'AC_DEFUN([SOME_DEFS], [])' > m4/somedefs.m4
+echo 'AC_DEFUN([MORE_DEFS], [AC_SUBST([GREPME])])' > m4/moredefs.m4
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE --copy --add-missing
+
+mkdir build
+cd build
+
+../configure
+$MAKE
+
+# Modified configure dependencies must be newer than config.status.
+$sleep
+# Update an aclocal.m4 dependency, then make sure all Makefiles
+# are updated, even from a sub-directory.
+echo 'AC_DEFUN([SOME_DEFS], [MORE_DEFS])' > ../m4/somedefs.m4
+# Because aclocal will run again, it should also pick up acinclude.m4.
+echo 'AC_SUBST([METOO])' > ../acinclude.m4
+
+cd sub
+$MAKE
+cd ..
+grep GREPME Makefile
+grep GREPME sub/Makefile
+grep GREPME sub/Makefile
+grep METOO Makefile
+grep METOO sub/Makefile
+grep METOO sub/Makefile
+
+# Make sure configure dependencies are distributed.
+$MAKE distdir
+test -f $me-1.0/m4/moredefs.m4
+test -f $me-1.0/m4/somedefs.m4
+test -f $me-1.0/acinclude.m4
+
+:
diff --git a/t/aclocal-req.sh b/t/aclocal-req.sh
new file mode 100755
index 0000000..e68db0c
--- /dev/null
+++ b/t/aclocal-req.sh
@@ -0,0 +1,34 @@
+#! /bin/sh
+# Copyright (C) 1996-2012 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 macro used in m4 file is included.
+
+. test-init.sh
+
+cat > configure.ac <<EOF
+AC_INIT([$me], [1.0])
+AM_INIT_GUILE_MODULE
+EOF
+
+cat > acinclude.m4 << 'END'
+AC_DEFUN([AM_INIT_GUILE_MODULE], [AM_INIT_AUTOMAKE([whocares])])
+END
+
+$ACLOCAL
+
+grep 'DEFUN.*INIT_AUTOMAKE' aclocal.m4
+
+:
diff --git a/t/aclocal-scan-configure-ac-pr319.sh 
b/t/aclocal-scan-configure-ac-pr319.sh
new file mode 100755
index 0000000..4ce34ab
--- /dev/null
+++ b/t/aclocal-scan-configure-ac-pr319.sh
@@ -0,0 +1,47 @@
+#! /bin/sh
+# Copyright (C) 2004-2012 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 aclocal scans configure.ac for macro definitions.
+# PR/319.
+
+am_create_testdir=empty
+. test-init.sh
+
+# Start macros with AM_ because that causes aclocal to complain if it
+# cannot find them.
+
+cat > configure.ac << 'END'
+AC_INIT
+m4_include([somedef.m4])
+AC_DEFUN([AM_SOME_MACRO])
+AC_DEFUN([AM_SOME_OTHER_MACRO])
+AM_SOME_MACRO
+AM_SOME_OTHER_MACRO
+AM_MORE_MACRO
+END
+
+mkdir m4
+echo 'AC_DEFUN([AM_SOME_MACRO])' > m4/some.m4
+echo 'AC_DEFUN([AM_SOME_DEF])' > somedef.m4
+echo 'AC_DEFUN([AM_MORE_MACRO], [AC_REQUIRE([AM_SOME_DEF])])' > m4/more.m4
+
+$ACLOCAL -I m4
+$FGREP AM_SOME_MACRO aclocal.m4 && exit 1
+$FGREP AM_MORE_MACRO aclocal.m4 && exit 1
+$FGREP 'm4_include([m4/more.m4])' aclocal.m4
+test 1 = $(grep m4_include aclocal.m4 | wc -l)
+
+:
diff --git a/t/aclocal-serial.sh b/t/aclocal-serial.sh
new file mode 100755
index 0000000..2e1cbb5
--- /dev/null
+++ b/t/aclocal-serial.sh
@@ -0,0 +1,137 @@
+#! /bin/sh
+# Copyright (C) 2005-2012 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 --install with #serial numbers.
+
+am_create_testdir=empty
+. test-init.sh
+
+cat > configure.ac << 'END'
+AC_INIT
+AM_MACRO1
+AM_MACRO2
+END
+
+mkdir 1 2 3 4 5 6
+
+cat >1/m1.m4 <<EOF
+#serial 1.8.1230.9
+AC_DEFUN([AM_MACRO1], [:macro11:])
+AC_DEFUN([AM_MACRO2], [:macro21:])
+EOF
+
+cat >2/m1.m4 <<EOF
+#serial 1.8.1231.9
+AC_DEFUN([AM_MACRO1], [:macro12:])
+EOF
+
+cat >3/m2.m4 <<EOF
+#serial 13
+AC_DEFUN([AM_MACRO2], [:macro23:])
+EOF
+
+cat >3/m1.m4 <<EOF
+#serial 1.8.1230.1
+AC_DEFUN([AM_MACRO1], [:macro13:])
+EOF
+
+cat >4/mumble.m4 <<EOF
+#serial 0
+AC_DEFUN([AM_MACRO1], [:macro14:])
+EOF
+
+cat >5/ill-formed.m4 <<EOF
+#serial bla
+#serial .2
+#serial
+AC_DEFUN([AM_MACRO1], [:macro15:])
+EOF
+
+cat >6/after-def.m4 <<EOF
+AC_DEFUN([AM_MACRO1], [:macro16:])
+#serial 1
+EOF
+
+clean_stale ()
+{
+  rm -rf aclocal.m4 configure autom4te*.cache
+}
+
+$ACLOCAL -I 1 -I 2 -I 3 -I 4
+$AUTOCONF
+$FGREP ':macro11:' configure
+$FGREP ':macro21:' configure
+
+clean_stale
+$ACLOCAL  -I 1 -I 2 -I 3 -I 4 --install
+$AUTOCONF
+$FGREP ':macro12:' configure
+$FGREP ':macro23:' configure
+
+cp -f aclocal.m4 aclocal-m4.sav
+clean_stale
+mv -f aclocal-m4.sav aclocal.m4
+$ACLOCAL -I 4 -I 1 -I 2 -I 3 --install --dry-run
+$AUTOCONF
+$FGREP ':macro12:' configure
+$FGREP ':macro23:' configure
+
+clean_stale
+$ACLOCAL -I 4 -I 1 -I 2 -I 3 --install
+$AUTOCONF
+$FGREP ':macro14:' configure
+$FGREP ':macro23:' configure
+
+clean_stale
+$ACLOCAL -I 4 -I 1 -I 2 --install 2>stderr && { cat stderr >&2; exit 1; }
+cat stderr >&2
+grep 'macro.*AM_MACRO2.*not found' stderr
+
+clean_stale
+$ACLOCAL -I 4 -I 1 --install
+$AUTOCONF
+$FGREP ':macro14:' configure
+$FGREP ':macro21:' configure
+
+mkdir acdir
+ACLOCAL="$ACLOCAL --system-acdir acdir"
+
+cat >acdir/m1.m4 <<EOF
+#serial 456
+AC_DEFUN([AM_MACRO1], [:macro1d:])
+AC_DEFUN([AM_MACRO2], [:macro2d:])
+EOF
+clean_stale
+$ACLOCAL -I 4 -I 1 --diff=diff >stdout 2>stderr || {
+  cat stderr >&2
+  cat stdout
+  exit 1
+}
+cat stderr >&2
+cat stdout
+grep '#serial 456' stdout
+test ! -e 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/t/aclocal-underquoted-defun.sh b/t/aclocal-underquoted-defun.sh
new file mode 100755
index 0000000..071ddae
--- /dev/null
+++ b/t/aclocal-underquoted-defun.sh
@@ -0,0 +1,37 @@
+#! /bin/sh
+# Copyright (C) 2010-2012 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.
+
+am_create_testdir=empty
+. test-init.sh
+
+cat > configure.ac << 'END'
+AC_INIT
+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
+
+:
diff --git a/t/aclocal-verbose-install.sh b/t/aclocal-verbose-install.sh
index 27fa0c5..b598bb8 100755
--- a/t/aclocal-verbose-install.sh
+++ b/t/aclocal-verbose-install.sh
@@ -17,7 +17,7 @@
 # Check verbose messages by 'aclocal --install'.
 
 am_create_testdir=empty
-. ./defs || exit 1
+. test-init.sh
 
 cat > configure.ac <<END
 AC_INIT([$me], [1.0])
diff --git a/t/aclocal.sh b/t/aclocal.sh
index d99da5f..3234496 100755
--- a/t/aclocal.sh
+++ b/t/aclocal.sh
@@ -17,7 +17,7 @@
 # Test on some aclocal options.  Report from Alexandre Oliva.
 
 am_create_testdir=empty
-. ./defs || exit 1
+. test-init.sh
 
 echo "AC_INIT([$me], [0]) AM_INIT_AUTOMAKE" > configure.ac
 
diff --git a/t/aclocal3.sh b/t/aclocal3.sh
deleted file mode 100755
index 03aa42d..0000000
--- a/t/aclocal3.sh
+++ /dev/null
@@ -1,41 +0,0 @@
-#! /bin/sh
-# Copyright (C) 1998-2012 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 include of include detects missing macros
-
-am_create_testdir=empty
-. ./defs || exit 1
-
-cat >> configure.ac <<END
-AC_INIT([$me], [1.0])
-GNOME_X_CHECKS
-END
-
-mkdir macros
-
-cat > macros/gnome.m4 << 'END'
-AC_DEFUN([GNOME_X_CHECKS], [
-# Use a macro that cannot be installed in a third-party system-wide m4
-# file; otherwise, this test might fail under "make installcheck".
-       AM__PATH__GTK(0.99.5,,AC_MSG_ERROR(GTK not installed, or gtk-config not 
in path))
-])
-END
-
-$ACLOCAL -I macros 2>stderr && { cat stderr >&2; exit 1; }
-cat stderr
-grep '^macros/gnome\.m4:4:.*AM__PATH__GTK.*not found' stderr
-
-:
diff --git a/t/aclocal4.sh b/t/aclocal4.sh
deleted file mode 100755
index feae3ec..0000000
--- a/t/aclocal4.sh
+++ /dev/null
@@ -1,75 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2003-2012 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 dependencies on aclocal.m4 are set correctly.
-# Report from Jim Meyering.
-
-required=cc
-. ./defs || exit 1
-
-cat >>configure.ac <<EOF
-AC_PROG_RANLIB
-AM_PROG_AR
-AC_PROG_CC
-MY_MACRO
-AC_CONFIG_FILES([lib/Makefile])
-AC_OUTPUT
-EOF
-
-mkdir m4
-cat >m4/mymacro.m4 <<EOF
-AC_DEFUN([MY_MACRO], [])
-EOF
-
-mkdir lib
-: > lib/foo.c
-: > lib/bar.c
-cat >lib/Makefile.am <<'EOF'
-noinst_LIBRARIES = liberi.a
-liberi_a_SOURCES = bar.c
-liberi_a_LIBADD = $(LIBOBJS)
-EOF
-
-cat >Makefile.am <<'EOF'
-SUBDIRS = lib
-EXTRA_DIST = m4/mymacro.m4
-ACLOCAL_AMFLAGS = -I m4
-check-foo: distdir
-       test -f $(distdir)/lib/foo.c
-       test -f $(distdir)/lib/bar.c
-
-check-not-foo: distdir
-       test ! -f $(distdir)/lib/foo.c
-       test -f $(distdir)/lib/bar.c
-EOF
-
-$ACLOCAL -I m4
-$AUTOCONF
-$AUTOMAKE --add-missing
-./configure
-$MAKE check-not-foo
-
-# Update one of the macros.  This should cause ./configure, Makefile.in,
-# Makefile, lib/Makefile.in, and lib/Makefile to be updated.
-
-cat >m4/mymacro.m4 <<'EOF'
-AC_DEFUN([MY_MACRO], [AC_LIBOBJ([foo])])
-EOF
-
-using_gmake || $MAKE
-$MAKE check-foo
-
-:
diff --git a/t/aclocal5.sh b/t/aclocal5.sh
deleted file mode 100755
index 0406661..0000000
--- a/t/aclocal5.sh
+++ /dev/null
@@ -1,69 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2003-2012 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 that aclocal.m4's dependencies are honored in
-# sub-directories.  See also related tests 'remake-subdir*.sh'.
-
-. ./defs || exit 1
-
-cat >> configure.ac << 'END'
-AM_TEST([GREPME])
-AC_CONFIG_FILES([sub/Makefile])
-AC_OUTPUT
-END
-
-cat > Makefile.am << 'END'
-SUBDIRS = sub
-ACLOCAL_AMFLAGS = -I m4
-END
-
-mkdir sub
-: > sub/Makefile.am
-
-mkdir m4
-echo 'AC_DEFUN([AM_TEST], [echo address@hidden)' > m4/moredefs.m4
-
-$ACLOCAL -I m4
-$AUTOCONF
-$AUTOMAKE --copy --add-missing
-./configure
-$MAKE
-
-# Update an aclocal.m4 dependency, then make sure all Makefiles are
-# updated, even from a sub-directory.  Check that AU_ALIAS is
-# recognized. Change the definition of AM_TEST to check that its new
-# definition is used.
-$sleep # Modified configure dependencies must be newer than config.status.
-echo 'AU_ALIAS([AM_TEST], [AC_SUBST])' > m4/moredefs.m4
-cd sub
-$MAKE
-cd ..
-grep GREPME Makefile
-grep GREPME sub/Makefile
-
-# Make sure configure dependencies are distributed.
-$MAKE distdir
-test -f $me-1.0/m4/moredefs.m4
-
-# Change the definition of AM_TEST to check that its new definition is
-# used.  Check that AC_DEFUN_ONCE is caught.
-$sleep # Modified configure dependencies must be newer than config.status.
-echo 'AC_DEFUN_ONCE([AM_TEST], [AC_SUBST(__$1__)])' > m4/moredefs.m4
-$MAKE
-grep 'm4/moredefs\.m4' aclocal.m4
-grep '__GREPME__' configure
-
-:
diff --git a/t/aclocal6.sh b/t/aclocal6.sh
deleted file mode 100755
index dc6b38d..0000000
--- a/t/aclocal6.sh
+++ /dev/null
@@ -1,74 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2003-2012 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 aclocal.m4 is rebuilt whenever a configure
-# dependency changes.  Test for acinclude.m4 and VPATH too.
-
-. ./defs || exit 1
-
-cat >> configure.ac << 'END'
-SOME_DEFS
-AC_CONFIG_FILES([sub/Makefile])
-AC_OUTPUT
-END
-
-cat > Makefile.am << 'END'
-SUBDIRS = sub
-ACLOCAL_AMFLAGS = -I m4
-END
-
-mkdir sub
-: > sub/Makefile.am
-
-mkdir m4
-echo 'AC_DEFUN([SOME_DEFS], [])' > m4/somedefs.m4
-echo 'AC_DEFUN([MORE_DEFS], [AC_SUBST([GREPME])])' > m4/moredefs.m4
-
-$ACLOCAL -I m4
-$AUTOCONF
-$AUTOMAKE --copy --add-missing
-
-mkdir build
-cd build
-
-../configure
-$MAKE
-
-# Modified configure dependencies must be newer than config.status.
-$sleep
-# Update an aclocal.m4 dependency, then make sure all Makefiles
-# are updated, even from a sub-directory.
-echo 'AC_DEFUN([SOME_DEFS], [MORE_DEFS])' > ../m4/somedefs.m4
-# Because aclocal will run again, it should also pick up acinclude.m4.
-echo 'AC_SUBST([METOO])' > ../acinclude.m4
-
-cd sub
-$MAKE
-cd ..
-grep GREPME Makefile
-grep GREPME sub/Makefile
-grep GREPME sub/Makefile
-grep METOO Makefile
-grep METOO sub/Makefile
-grep METOO sub/Makefile
-
-# Make sure configure dependencies are distributed.
-$MAKE distdir
-test -f $me-1.0/m4/moredefs.m4
-test -f $me-1.0/m4/somedefs.m4
-test -f $me-1.0/acinclude.m4
-
-:
diff --git a/t/aclocal7.sh b/t/aclocal7.sh
deleted file mode 100755
index c050b07..0000000
--- a/t/aclocal7.sh
+++ /dev/null
@@ -1,117 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2003-2012 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 aclocal does not overwrite aclocal.m4 needlessly.
-# Also make sure automake --no-force does not overwrite Makefile.in needlessly.
-
-. ./defs || exit 1
-
-cat >> configure.ac << 'END'
-SOME_DEFS
-AC_CONFIG_FILES([sub/Makefile])
-END
-
-mkdir sub
-: > sub/Makefile.am
-
-cat >> Makefile.am << 'END'
-SUBDIRS = sub
-include fragment.inc
-END
-
-: > fragment.inc
-
-mkdir m4
-echo 'AC_DEFUN([SOME_DEFS], [])' > m4/somedefs.m4
-
-# Automake will take aclocal.m4 to be newer if it has the same timestamp
-# as Makefile.in.  Avoid the confusing by sleeping.
-AUTOMAKE_after_aclocal ()
-{
-  $sleep
-  $AUTOMAKE --no-force
-}
-
-# aclocal will rewrite aclocal.m4 unless the input files are all older than the
-# existing aclocal.m4 -- sleep to ensure somedefs.m4 has an older timestamp
-# than the aclocal.m4 that the next aclocal call will generate.
-$sleep
-
-$ACLOCAL -I m4
-AUTOMAKE_after_aclocal
-
-touch foo
-$sleep
-$ACLOCAL -I m4
-AUTOMAKE_after_aclocal
-# aclocal.m4 and Makefile.in should not have been updated, so 'foo'
-# should be younger
-is_newest foo aclocal.m4 Makefile.in sub/Makefile.in
-
-$sleep
-$ACLOCAL -I m4 --force
-is_newest aclocal.m4 foo
-# We still use --no-force for automake, but since aclocal.m4 has
-# changed all Makefile.ins should be updated.
-AUTOMAKE_after_aclocal
-is_newest Makefile.in aclocal.m4 foo
-is_newest sub/Makefile.in aclocal.m4 foo
-
-$sleep
-touch m4/somedefs.m4
-$sleep
-$ACLOCAL -I m4
-AUTOMAKE_after_aclocal
-# aclocal.m4 should have been updated, although its contents haven't
-# changed.
-is_newest aclocal.m4 m4/somedefs.m4
-is_newest Makefile.in m4/somedefs.m4
-is_newest sub/Makefile.in m4/somedefs.m4
-
-$sleep
-touch fragment.inc
-$sleep
-$ACLOCAL -I m4
-AUTOMAKE_after_aclocal
-# Only ./Makefile.in should change.
-is_newest Makefile.in fragment.inc
-is_newest fragment.inc aclocal.m4
-is_newest fragment.inc sub/Makefile.in
-
-grep README Makefile.in && exit 1
-
-$sleep
-: > README
-$sleep
-$AUTOMAKE --no-force
-# Even if no dependency change, the content changed.
-is_newest Makefile.in README
-is_newest README sub/Makefile.in
-
-grep README Makefile.in
-
-: > sub/Makefile.in
-$sleep
-touch foo
-$sleep
-$ACLOCAL -I m4
-$AUTOMAKE --no-force
-# Only sub/Makefile.in should change.
-is_newest foo aclocal.m4
-is_newest foo Makefile.in
-is_newest sub/Makefile.in foo
-
-:
diff --git a/t/aclocal8.sh b/t/aclocal8.sh
deleted file mode 100755
index a242fca..0000000
--- a/t/aclocal8.sh
+++ /dev/null
@@ -1,42 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2003-2012 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 aclocal does not require unused macros.
-
-am_create_testdir=empty
-. ./defs || exit 1
-
-cat > configure.ac << 'END'
-AC_INIT
-SOME_DEFS
-END
-
-mkdir m4
-cat >m4/somedefs.m4 <<EOF
-AC_DEFUN([SOME_DEFS], [
-  m4_if([a], [a], [MACRO1], [MACRO2])
-])
-EOF
-
-echo 'AC_DEFUN([MACRO1],)' >m4/macro1.m4
-echo 'AC_DEFUN([MACRO2], [AC_REQUIRE([AM_UNUSED_MACRO])])' >m4/macro2.m4
-
-$ACLOCAL -I m4 >output 2>&1 || { cat output; exit 1; }
-test 0 -eq $(wc -l <output)
-grep macro1.m4 aclocal.m4
-grep macro2.m4 aclocal.m4 && exit 1
-
-:
diff --git a/t/aclocal9.sh b/t/aclocal9.sh
deleted file mode 100755
index bcdd6f4..0000000
--- a/t/aclocal9.sh
+++ /dev/null
@@ -1,49 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2003-2012 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 aclocal define macros in the same order as -I's.
-
-am_create_testdir=empty
-. ./defs || exit 1
-
-cat > configure.ac << 'END'
-AC_INIT
-MACRO1
-MACRO2
-END
-
-mkdir m4_1 m4_2
-
-cat >m4_1/somedefs.m4 <<EOF
-AC_DEFUN([MACRO1], [:macro11:])
-AC_DEFUN([MACRO2], [:macro21:])
-EOF
-
-cat >m4_2/somedefs.m4 <<EOF
-AC_DEFUN([MACRO1], [:macro12:])
-EOF
-
-$ACLOCAL -I m4_1 -I m4_2
-$AUTOCONF
-$FGREP ':macro11:' configure
-$FGREP ':macro21:' configure
-
-$ACLOCAL --force -I m4_2 -I m4_1
-$AUTOCONF --force
-$FGREP ':macro12:' configure
-$FGREP ':macro21:' configure
-
-:
diff --git a/t/acsilent.sh b/t/acsilent.sh
index 18f18ff..2200d7d 100755
--- a/t/acsilent.sh
+++ b/t/acsilent.sh
@@ -16,17 +16,16 @@
 
 # Test to make sure there are no spurious acinclude warnings.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >configure.ac <<EOF
-AC_INIT
+AC_INIT([$me], [1.0])
 AM_INIT_GUILE_MODULE
 EOF
 
 cat > acinclude.m4 << 'END'
-AC_DEFUN([AM_INIT_GUILE_MODULE],[
-. $srcdir/../GUILE-VERSION
-AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
+AC_DEFUN([AM_INIT_GUILE_MODULE], [
+AM_INIT_AUTOMAKE([dist-xz])
 AC_CONFIG_AUX_DIR(..)
 module=[$1]
 AC_SUBST(module)])
diff --git a/t/acsubst.sh b/t/acsubst.sh
index 19dfbdf..4081f66 100755
--- a/t/acsubst.sh
+++ b/t/acsubst.sh
@@ -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/>.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/acsubst2.sh b/t/acsubst2.sh
index ea7749c..da858fd 100755
--- a/t/acsubst2.sh
+++ b/t/acsubst2.sh
@@ -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/>.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/add-missing-multiple.sh b/t/add-missing-multiple.sh
new file mode 100755
index 0000000..a817d5b
--- /dev/null
+++ b/t/add-missing-multiple.sh
@@ -0,0 +1,47 @@
+#! /bin/sh
+# Copyright (C) 2002-2012 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 Automake will install several copies of required files if needed.
+# Reported by Marius Vollmer.
+
+. test-init.sh
+
+cat >> configure.ac <<EOF
+AC_CONFIG_FILES([one/Makefile two/Makefile])
+AC_OUTPUT
+EOF
+
+mkdir one
+mkdir two
+
+echo 'SUBDIRS = one two' > Makefile.am
+echo 'info_TEXINFOS = mumble.texi' > one/Makefile.am
+cat >one/mumble.texi <<'END'
address@hidden mumble.info
address@hidden version.texi
+END
+
+cp one/Makefile.am one/mumble.texi two
+
+$ACLOCAL
+$AUTOMAKE --add-missing --copy
+
+test -f one/mdate-sh
+test -f one/texinfo.tex
+test -f two/mdate-sh
+test -f two/texinfo.tex
+
+:
diff --git a/t/add-missing.tap b/t/add-missing.tap
index c47382b..ac8c763 100755
--- a/t/add-missing.tap
+++ b/t/add-missing.tap
@@ -20,7 +20,7 @@
 # default, but copied if the '--copy' option is used.
 
 am_create_testdir=empty
-. ./defs || exit 1
+. test-init.sh
 
 plan_ "later"
 
@@ -343,17 +343,6 @@ rm -f foo.texi
 
 check_ <<'END'
 == Name ==
-elisp-comp
-== Files ==
-elisp-comp
-== configure.ac ==
-AM_PATH_LISPDIR
-== Makefile.am ==
-lisp_LISP = foo.el
-END
-
-check_ <<'END'
-== Name ==
 py-compile
 == Files ==
 py-compile
diff --git a/t/all.sh b/t/all.sh
index 3797acf..0a0216c 100755
--- a/t/all.sh
+++ b/t/all.sh
@@ -16,7 +16,7 @@
 
 # Test to make sure several *-local's in a single rule work.
 
-. ./defs || exit 1
+. test-init.sh
 
 targets='all install-exec install-data uninstall'
 echo "$targets:" | sed -e 's/[ :]/-local&/g' > Makefile.am
diff --git a/t/all2.sh b/t/all2.sh
index 879cdfc..7c9ab32 100755
--- a/t/all2.sh
+++ b/t/all2.sh
@@ -16,7 +16,7 @@
 
 # Test to make sure all-local and other -local targets work correctly.
 
-. ./defs || exit 1
+. test-init.sh
 
 $ACLOCAL
 
diff --git a/t/alloca.sh b/t/alloca.sh
index e054dd4..aa436ff 100755
--- a/t/alloca.sh
+++ b/t/alloca.sh
@@ -16,7 +16,7 @@
 
 # Make sure we complain if @ALLOCA@ is used without being set in configure.ac
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac <<'END'
 AM_PROG_AR
diff --git a/t/alloca2.sh b/t/alloca2.sh
index 38d2cf8..6410344 100755
--- a/t/alloca2.sh
+++ b/t/alloca2.sh
@@ -16,7 +16,7 @@
 
 # Make sure we complain if @LTALLOCA@ is used without being set in configure.ac
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac <<'END'
 AC_PROG_CC
diff --git a/t/alpha.sh b/t/alpha.sh
index b1315f0..d8dc30a 100755
--- a/t/alpha.sh
+++ b/t/alpha.sh
@@ -16,7 +16,7 @@
 
 # Make sure README-alpha is distributed when appropriate.  Report from
 # Jim Meyering.
-. ./defs || exit 1
+. test-init.sh
 
 cat > configure.ac << 'END'
 AC_INIT([alpha], [1.0a])
diff --git a/t/alpha2.sh b/t/alpha2.sh
index 86f60b9..318b1c9 100755
--- a/t/alpha2.sh
+++ b/t/alpha2.sh
@@ -17,7 +17,7 @@
 # Another check for README-alpha support.  This time it is requested
 # from configure.ac.  Report from Akim Demaille.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > configure.ac << 'END'
 AC_INIT([alpha], [1.0b])
diff --git a/t/am-default-source-ext.sh b/t/am-default-source-ext.sh
index 4e0fed8..ec91a19 100755
--- a/t/am-default-source-ext.sh
+++ b/t/am-default-source-ext.sh
@@ -17,7 +17,7 @@
 # AM_DEFAULT_SOURCE_EXT
 
 required='cc c++'
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/am-macro-not-found.sh b/t/am-macro-not-found.sh
index 038dabf..37e6959 100755
--- a/t/am-macro-not-found.sh
+++ b/t/am-macro-not-found.sh
@@ -16,7 +16,7 @@
 
 # Test to see if aclocal correctly reports missing AM_ macro.
 
-. ./defs || exit 1
+. test-init.sh
 
 echo AM_ZARDOZ >> configure.ac
 
diff --git a/t/am-missing-prog.sh b/t/am-missing-prog.sh
index 6368db5..08fc455 100755
--- a/t/am-missing-prog.sh
+++ b/t/am-missing-prog.sh
@@ -16,7 +16,7 @@
 
 # Test AM_MISSING_PROG.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac <<'END'
 AM_MISSING_PROG([NO_SUCH_COMMAND],    [am-none-none])
@@ -51,13 +51,11 @@ o = address@hidden
 e = address@hidden
 
 debug_info = grep . address@hidden address@hidden
-status_is = $(debug_info); echo $@: st=$$st; : test $$st -eq
+status_is = $(debug_info); echo $@: st=$$st; test $$st -eq
 
 w_mis = 'am-none-none' is needed, and is missing on your system
 w_old = 'am-exit-63' is needed, and is probably too old
 
-# FIXME: make this test stricter w.r.t. the exit statuses once
-# FIXME: we are merged to master!
 test1:
        st=0; $(NO_SUCH_COMMAND) >$o 2>$e || st=$$?; $(status_is) 127
         grep "^WARNING: $(w_mis)" $e
diff --git a/t/am-tests-environment.sh b/t/am-tests-environment.sh
index e8fbbe3..eff7850 100755
--- a/t/am-tests-environment.sh
+++ b/t/am-tests-environment.sh
@@ -17,7 +17,7 @@
 # parallel-tests: check AM_TESTS_ENVIRONMENT support, and its
 # interactions with TESTS_ENVIRONMENT.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_MKDIR_P
diff --git a/t/amassign.sh b/t/amassign.sh
index 555e3f4..96ec96d 100755
--- a/t/amassign.sh
+++ b/t/amassign.sh
@@ -17,7 +17,7 @@
 # Test to see if AM_ name can be assigned to in configure.ac.
 # Report from Steve Robbins.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AM_CFLAGS=foo
diff --git a/t/amhello-binpkg.sh b/t/amhello-binpkg.sh
index f6988ce..58d0fdd 100755
--- a/t/amhello-binpkg.sh
+++ b/t/amhello-binpkg.sh
@@ -18,7 +18,7 @@
 # using DESTDIR to build simple, no-frills binary packages.
 
 am_create_testdir=empty
-. ./defs || exit 1
+. test-init.sh
 
 cp "$am_docdir"/amhello-1.0.tar.gz . \
   || fatal_ "cannot get amhello tarball"
diff --git a/t/amhello-cflags.sh b/t/amhello-cflags.sh
index a120d81..6013789 100755
--- a/t/amhello-cflags.sh
+++ b/t/amhello-cflags.sh
@@ -20,7 +20,7 @@
 
 am_create_testdir=empty
 required=gcc
-. ./defs || exit 1
+. test-init.sh
 
 cp "$am_docdir"/amhello-1.0.tar.gz . \
   || fatal_ "cannot get amhello tarball"
diff --git a/t/amhello-cross-compile.sh b/t/amhello-cross-compile.sh
index d447657..c4992d4 100755
--- a/t/amhello-cross-compile.sh
+++ b/t/amhello-cross-compile.sh
@@ -19,7 +19,7 @@
 
 am_create_testdir=empty
 required=i586-mingw32msvc-gcc
-. ./defs || exit 1
+. test-init.sh
 
 cp "$am_docdir"/amhello-1.0.tar.gz . \
   || fatal_ "cannot get amhello tarball"
diff --git a/t/aminit-moreargs-deprecation.sh b/t/aminit-moreargs-deprecation.sh
index a8d4605..99ac969 100755
--- a/t/aminit-moreargs-deprecation.sh
+++ b/t/aminit-moreargs-deprecation.sh
@@ -17,7 +17,7 @@
 # Check that automake warns against old-style usages of AM_INIT_AUTOMAKE
 # (i.e., calls with two or three arguments).
 
-. ./defs || exit 1
+. test-init.sh
 
 warn_rx='AM_INIT_AUTOMAKE.* two-.* three-arguments form.*deprecated'
 
diff --git a/t/amopt.sh b/t/amopt.sh
index 5d6005d..7b4a933 100755
--- a/t/amopt.sh
+++ b/t/amopt.sh
@@ -17,7 +17,7 @@
 # Make Automake diagnose a conditional AUTOMAKE_OPTIONS.
 # Report from Bas Wijnen.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac <<END
 AM_CONDITIONAL([COND], [true])
diff --git a/t/amopts-location.sh b/t/amopts-location.sh
index c0d471a..0f489a4 100755
--- a/t/amopts-location.sh
+++ b/t/amopts-location.sh
@@ -17,7 +17,7 @@
 # Check that errors about AUTOMAKE_OPTIONS refers to correct
 # locations.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am <<'END'
 # comment \
diff --git a/t/amopts-variable-expansion.sh b/t/amopts-variable-expansion.sh
index bc0daea..d63b5f0 100755
--- a/t/amopts-variable-expansion.sh
+++ b/t/amopts-variable-expansion.sh
@@ -16,7 +16,7 @@
 
 # Check that AUTOMAKE_OPTIONS support variable expansion.
 
-. ./defs || exit 1
+. test-init.sh
 
 # We want complete control over automake options.
 AUTOMAKE=$am_original_AUTOMAKE
diff --git a/t/amsubst.sh b/t/amsubst.sh
index 49d50c1..c229924 100755
--- a/t/amsubst.sh
+++ b/t/amsubst.sh
@@ -16,7 +16,7 @@
 
 # Check for _AM_SUBST_NOTMAKE.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_SUBST([backslash], "\\")
diff --git a/t/ansi2knr-no-more.sh b/t/ansi2knr-no-more.sh
index 5387d20..e28e651 100755
--- a/t/ansi2knr-no-more.sh
+++ b/t/ansi2knr-no-more.sh
@@ -17,7 +17,7 @@
 # Check that any attempt to use the obsolete de-ANSI-fication support
 # is diagnosed.
 
-. ./defs || exit 1
+. test-init.sh
 
 warn_rx='automatic de-ANSI-fication.*removed'
 
diff --git a/t/ar-lib.sh b/t/ar-lib.sh
index c6f6a3c..e7ca34c 100755
--- a/t/ar-lib.sh
+++ b/t/ar-lib.sh
@@ -18,7 +18,7 @@
 
 am_create_testdir=empty
 required=xsi-lib-shell
-. ./defs || exit 1
+. test-init.sh
 
 get_shell_script ar-lib
 
diff --git a/t/ar-lib2.sh b/t/ar-lib2.sh
index da2b5ca..df5332d 100755
--- a/t/ar-lib2.sh
+++ b/t/ar-lib2.sh
@@ -16,7 +16,7 @@
 
 # Test if AM_PROG_AR installs ar-lib.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/ar-lib3.sh b/t/ar-lib3.sh
index 513808a..77a8db9 100755
--- a/t/ar-lib3.sh
+++ b/t/ar-lib3.sh
@@ -16,7 +16,7 @@
 
 # Test if lib_LIBRARIES requests AM_PROG_AR.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/ar-lib4.sh b/t/ar-lib4.sh
index 2bd93aa..0bd5149 100755
--- a/t/ar-lib4.sh
+++ b/t/ar-lib4.sh
@@ -17,7 +17,7 @@
 # Test if lib_LTLIBRARIES requests AM_PROG_AR.
 
 required=libtoolize
-. ./defs || exit 1
+. test-init.sh
 
 cp configure.ac X
 
diff --git a/t/ar-lib5a.sh b/t/ar-lib5a.sh
index a11e218..6f800e6 100755
--- a/t/ar-lib5a.sh
+++ b/t/ar-lib5a.sh
@@ -19,7 +19,7 @@
 # Keep this test in sync with sister test 'ar-lib5b.sh'.
 
 required=lib
-. ./defs || exit 1
+. test-init.sh
 
 cat > configure.ac << END
 AC_INIT([$me], [1.0])
diff --git a/t/ar-lib5b.sh b/t/ar-lib5b.sh
index a300760..fcf45b9 100755
--- a/t/ar-lib5b.sh
+++ b/t/ar-lib5b.sh
@@ -18,7 +18,7 @@
 # This test does not require Microsoft lib.
 # Keep this test in sync with sister test 'ar-lib5a.sh'.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > configure.ac << END
 AC_INIT([$me], [1.0])
diff --git a/t/ar-lib6a.sh b/t/ar-lib6a.sh
index 7ee5257..86b8c99 100755
--- a/t/ar-lib6a.sh
+++ b/t/ar-lib6a.sh
@@ -18,7 +18,7 @@
 # Keep this test in sync with sister test 'ar-lib6b.sh'.
 
 required=libtoolize
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/ar-lib6b.sh b/t/ar-lib6b.sh
index 92709f8..e402b63 100755
--- a/t/ar-lib6b.sh
+++ b/t/ar-lib6b.sh
@@ -18,7 +18,7 @@
 # Keep this test in sync with sister test 'ar-lib6a.sh'.
 
 required=libtoolize
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/ar-lib7.sh b/t/ar-lib7.sh
index c27cabf..dd7d4a7 100755
--- a/t/ar-lib7.sh
+++ b/t/ar-lib7.sh
@@ -16,7 +16,7 @@
 
 # Test if automake warns if ar-lib is missing when AM_PROG_AR is used.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AM_PROG_AR
diff --git a/t/ar.sh b/t/ar.sh
index da01d75..5aa1681 100755
--- a/t/ar.sh
+++ b/t/ar.sh
@@ -16,7 +16,7 @@
 
 # Make sure that AR, ARFLAGS, and RANLIB can be substituted from configure.ac.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AM_PROG_AR
diff --git a/t/ar2.sh b/t/ar2.sh
index 88e90ca..bcda001 100755
--- a/t/ar2.sh
+++ b/t/ar2.sh
@@ -17,7 +17,7 @@
 # Make sure AR and ARFLAGS are defined for EXTRA_LIBRARIES.
 # Report from Kevin Ryde.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/ar3.sh b/t/ar3.sh
index f8bf855..3b3ab4e 100755
--- a/t/ar3.sh
+++ b/t/ar3.sh
@@ -17,7 +17,7 @@
 # Make sure that AR, ARFLAGS, etc. works also when the macro AM_PROG_AR
 # is used.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/ar4.sh b/t/ar4.sh
index dc82605..15c5913 100755
--- a/t/ar4.sh
+++ b/t/ar4.sh
@@ -16,7 +16,7 @@
 
 # Test if configure bails out if $AR does not work and AM_PROG_AR is used.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AM_PROG_AR
diff --git a/t/ar5.sh b/t/ar5.sh
index 50cf2b0..90c4f96 100755
--- a/t/ar5.sh
+++ b/t/ar5.sh
@@ -16,7 +16,7 @@
 
 # Test the optional argument of AM_PROG_AR.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AM_PROG_AR([
diff --git a/t/asm.sh b/t/asm.sh
index 48df68b..0ce4d07 100755
--- a/t/asm.sh
+++ b/t/asm.sh
@@ -17,7 +17,7 @@
 # Test of basic assembly functionality.
 # Keep this in sync with sister tests 'asm2.sh' and 'asm3.sh'.
 
-. ./defs || exit 1
+. test-init.sh
 
 mv configure.ac configure.stub
 
diff --git a/t/asm2.sh b/t/asm2.sh
index d62cb60..29ab10b 100755
--- a/t/asm2.sh
+++ b/t/asm2.sh
@@ -17,7 +17,7 @@
 # Test of basic preprocessed assembly functionality.
 # Keep this in sync with sister tests 'asm.sh' and 'asm3.sh'.
 
-. ./defs || exit 1
+. test-init.sh
 
 mv configure.ac configure.stub
 
diff --git a/t/asm3.sh b/t/asm3.sh
index 67bb876..8044c08 100755
--- a/t/asm3.sh
+++ b/t/asm3.sh
@@ -17,7 +17,7 @@
 # Test of basic preprocessed assembly functionality with extension '.sx'.
 # Keep this in sync with sister tests 'asm.sh' and 'asm2.sh'.
 
-. ./defs || exit 1
+. test-init.sh
 
 mv configure.ac configure.stub
 
diff --git a/t/autodist-acconfig-no-subdir.sh b/t/autodist-acconfig-no-subdir.sh
index 474e05f..835d53e 100755
--- a/t/autodist-acconfig-no-subdir.sh
+++ b/t/autodist-acconfig-no-subdir.sh
@@ -18,7 +18,7 @@
 # placed in a subdirectory.
 # Related to automake bug#7819.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac <<END
 AC_CONFIG_FILES([sub/Makefile])
diff --git a/t/autodist-acconfig.sh b/t/autodist-acconfig.sh
index 98db0a6..3dc417a 100755
--- a/t/autodist-acconfig.sh
+++ b/t/autodist-acconfig.sh
@@ -18,7 +18,7 @@
 # (at automake runtime).
 # Related to automake bug#7819.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac <<END
 AC_OUTPUT
diff --git a/t/autodist-aclocal-m4.sh b/t/autodist-aclocal-m4.sh
index a61d804..582171d 100755
--- a/t/autodist-aclocal-m4.sh
+++ b/t/autodist-aclocal-m4.sh
@@ -21,7 +21,7 @@
 # remove this test.
 # Related to automake bug#7819.
 
-. ./defs || exit 1
+. test-init.sh
 
 { echo 'm4_include([defs.m4])'
   cat configure.ac
diff --git a/t/autodist-config-headers.sh b/t/autodist-config-headers.sh
index ad61fd6..ab86e8b 100755
--- a/t/autodist-config-headers.sh
+++ b/t/autodist-config-headers.sh
@@ -19,7 +19,7 @@
 # exist at automake runtime.
 # Related to automake bug#7819.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac <<END
 AC_CONFIG_HEADERS([config.h sub/config.h cfg2.h:conf2.hin])
diff --git a/t/autodist-configure-no-subdir.sh 
b/t/autodist-configure-no-subdir.sh
index a48a0a7..8fd325b 100755
--- a/t/autodist-configure-no-subdir.sh
+++ b/t/autodist-configure-no-subdir.sh
@@ -18,7 +18,7 @@
 # automatically distributed when placed in a subdirectory.
 # Related to automake bug#7819.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac <<END
 AC_CONFIG_FILES([sub/Makefile])
diff --git a/t/autodist-no-duplicate.sh b/t/autodist-no-duplicate.sh
index 58742ce..20b3caf 100755
--- a/t/autodist-no-duplicate.sh
+++ b/t/autodist-no-duplicate.sh
@@ -17,7 +17,7 @@
 # Check that there are no duplicates in the list of files automatically
 # distributed by automake.
 
-. ./defs || exit 1
+. test-init.sh
 
 re='Files .*automatically distributed.*if found'
 
diff --git a/t/autodist-stamp-vti.sh b/t/autodist-stamp-vti.sh
index 6d8b02d..d8e2efd 100755
--- a/t/autodist-stamp-vti.sh
+++ b/t/autodist-stamp-vti.sh
@@ -19,7 +19,7 @@
 # Related to automake bug#7819.
 
 required=makeinfo
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << END
 AC_OUTPUT
diff --git a/t/autodist-subdir.sh b/t/autodist-subdir.sh
index 9af7128..0ca57dc 100755
--- a/t/autodist-subdir.sh
+++ b/t/autodist-subdir.sh
@@ -24,7 +24,7 @@
 #
 # Keep this test in sync with sister test 'autodist.sh'.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac <<'END'
 AC_CONFIG_FILES([sub/Makefile])
diff --git a/t/autodist.sh b/t/autodist.sh
index 2e591de..9834508 100755
--- a/t/autodist.sh
+++ b/t/autodist.sh
@@ -20,7 +20,7 @@
 # Keep this test in sync with sister test 'autodist-subdir.sh'.
 
 am_create_testdir=empty
-. ./defs || exit 1
+. test-init.sh
 
 cat > configure.ac <<END
 AC_INIT([$me], [1.0])
diff --git a/t/autohdr-subdir-pr12495.sh b/t/autohdr-subdir-pr12495.sh
index 77d2522..7517fd5 100755
--- a/t/autohdr-subdir-pr12495.sh
+++ b/t/autohdr-subdir-pr12495.sh
@@ -18,7 +18,7 @@
 # remake rules for AC_CONFIG_HEADERS arguments after the first one,
 # not even when subdirs are involved.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_CONFIG_HEADERS([a.h b.h sub/c.h])
diff --git a/t/autohdr.sh b/t/autohdr.sh
index 19daabe..4079c7c 100755
--- a/t/autohdr.sh
+++ b/t/autohdr.sh
@@ -16,7 +16,7 @@
 
 # Check that autoheaders works, despite our AC_CONFIG_HEADERS hack.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac <<EOF
 AC_CONFIG_HEADERS([thisfile.h])
diff --git a/t/autohdr2.sh b/t/autohdr2.sh
deleted file mode 100755
index 292a800..0000000
--- a/t/autohdr2.sh
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/sh
-# Copyright (C) 2002-2012 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 autoheaders works, despite our AC_CONFIG_HEADERS hack.
-
-. ./defs || exit 1
-
-cat >>configure.ac <<EOF
-AM_CONFIG_HEADER([thisfile.h])
-EOF
-
-: > Makefile.am
-
-$ACLOCAL
-$AUTOHEADER
-
-test -f thisfile.h.in
diff --git a/t/autohdr3.sh b/t/autohdr3.sh
index 0fccc53..93ef52e 100755
--- a/t/autohdr3.sh
+++ b/t/autohdr3.sh
@@ -16,7 +16,7 @@
 
 # Check rebuild rules for autoheader.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac <<EOF
 m4_include([foo.m4])
diff --git a/t/autohdr4.sh b/t/autohdr4.sh
index fa1f8f0..6f46aaf 100755
--- a/t/autohdr4.sh
+++ b/t/autohdr4.sh
@@ -18,7 +18,7 @@
 # (This should also work without GNU Make.)
 
 required=cc
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac <<'EOF'
 AC_PROG_CC
diff --git a/t/autohdrdry.sh b/t/autohdrdry.sh
index 3bd474e..0a9acd3 100755
--- a/t/autohdrdry.sh
+++ b/t/autohdrdry.sh
@@ -17,7 +17,7 @@
 # Removal recovery rules for AC_CONFIG_HEADERS should not remove files
 # with 'make -n'.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac <<'EOF'
 AC_CONFIG_HEADERS([config.h])
@@ -37,6 +37,6 @@ $MAKE
 rm -f config.h
 $MAKE -n
 test -f stamp-h1
-test ! -r config.h
+test ! -e config.h
 
 :
diff --git a/t/automake-cmdline.tap b/t/automake-cmdline.tap
index dd8b30a..eb8bf78 100755
--- a/t/automake-cmdline.tap
+++ b/t/automake-cmdline.tap
@@ -16,7 +16,7 @@
 
 # Test Automake's command-line options.
 
-. ./defs || exit 1
+. test-init.sh
 
 plan_ 17
 
diff --git a/t/auxdir-autodetect.sh b/t/auxdir-autodetect.sh
index 654a303..580f631 100755
--- a/t/auxdir-autodetect.sh
+++ b/t/auxdir-autodetect.sh
@@ -17,7 +17,7 @@
 # Make sure that, if AC_CONFIG_AUX_DIR is not specified, Automake tries
 # to use '.', '..' and '../..', in precisely that order.
 
-. ./defs || exit 1
+. test-init.sh
 
 nil=__no_such_program
 
diff --git a/t/auxdir-computed.tap b/t/auxdir-computed.tap
index 95d1003..324d825 100755
--- a/t/auxdir-computed.tap
+++ b/t/auxdir-computed.tap
@@ -17,7 +17,7 @@
 # It should be possible to use a computed auxdir.  This might seem
 # bizarre, but it is actually used in multilib builds.
 
-. ./defs || exit 1
+. test-init.sh
 
 plan_ 3
 
diff --git a/t/auxdir-misplaced.sh b/t/auxdir-misplaced.sh
index 87259b2..98e0591 100755
--- a/t/auxdir-misplaced.sh
+++ b/t/auxdir-misplaced.sh
@@ -16,7 +16,7 @@
 
 # Test to make sure we diagnose misplaced AC_CONFIG_AUX_DIR.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_CONFIG_AUX_DIR([.]) dnl this will appear after AM_INIT_AUTOMAKE
diff --git a/t/auxdir-nonexistent.sh b/t/auxdir-nonexistent.sh
index 43eeed2..82c46b0 100755
--- a/t/auxdir-nonexistent.sh
+++ b/t/auxdir-nonexistent.sh
@@ -16,7 +16,7 @@
 
 # Make sure we diagnose non-existent AC_CONFIG_AUX_DIR names.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > configure.ac <<END
 AC_INIT([$me], [1.0])
diff --git a/t/auxdir-unportable.tap b/t/auxdir-unportable.tap
index 8f06999..c687406 100755
--- a/t/auxdir-unportable.tap
+++ b/t/auxdir-unportable.tap
@@ -16,7 +16,7 @@
 
 # Make sure we diagnose unportable AC_CONFIG_AUX_DIR names.
 
-. ./defs || exit 1
+. test-init.sh
 
 plan_ 4
 
diff --git a/t/auxdir.sh b/t/auxdir.sh
index c7f7d73..ea16e44 100755
--- a/t/auxdir.sh
+++ b/t/auxdir.sh
@@ -16,7 +16,7 @@
 
 # Test to make sure AC_CONFIG_AUX_DIR works correctly.
 
-. ./defs || exit 1
+. test-init.sh
 
 # The "./." is here so we don't have to mess with subdirs.
 cat > configure.ac <<END
diff --git a/t/auxdir6.sh b/t/auxdir6.sh
index b07cd13..2f81b83 100755
--- a/t/auxdir6.sh
+++ b/t/auxdir6.sh
@@ -20,7 +20,7 @@
 # config auxdir.
 # Keep this in sync with sister tests 'auxdir7.sh' and 'auxdir8.sh'.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > configure.ac <<END
 AC_INIT([$me], [1.0])
diff --git a/t/auxdir7.sh b/t/auxdir7.sh
index 2c82bcb..ed4cb1e 100755
--- a/t/auxdir7.sh
+++ b/t/auxdir7.sh
@@ -19,7 +19,7 @@
 # making the top-level directory the config auxdir.
 # Keep this in sync with sister tests 'auxdir6.sh' and 'auxdir8.sh'.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > configure.ac <<END
 AC_INIT([$me], [1.0])
diff --git a/t/auxdir8.sh b/t/auxdir8.sh
index c404329..55c0afd 100755
--- a/t/auxdir8.sh
+++ b/t/auxdir8.sh
@@ -21,7 +21,7 @@
 # directory.
 # Keep this in sync with sister tests 'auxdir6.sh' and 'auxdir7.sh'.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_CONFIG_FILES([subdir/Makefile])
diff --git a/t/ax/am-test-lib.sh b/t/ax/am-test-lib.sh
index 29ed61a..ba21012 100644
--- a/t/ax/am-test-lib.sh
+++ b/t/ax/am-test-lib.sh
@@ -675,13 +675,6 @@ require_tool ()
       makedepend -f- \
         || skip_all_ "required program 'makedepend' not available"
       ;;
-    makeinfo-html)
-      # Make sure we have makeinfo, and it understands '--html'.
-      echo "$me: running makeinfo --html --version"
-      makeinfo --html --version \
-        || skip_all_ "cannot find a makeinfo program that groks" \
-                     "the '--html' option"
-      ;;
     mingw)
       uname_s=$(uname -s || echo UNKNOWN)
       echo "$me: system name: $uname_s"
@@ -756,12 +749,6 @@ require_tool ()
         skip_all_ "TeX is required, but it wasn't found by configure"
       fi
       ;;
-    texi2dvi-o)
-      # Texi2dvi supports '-o' since Texinfo 4.1.
-      echo "$me: running texi2dvi -o /dev/null --version"
-      texi2dvi -o /dev/null --version \
-        || skip_all_ "required program 'texi2dvi' not available"
-      ;;
     lex)
       test x"$LEX" = x"false" && skip_all_ "lex not found or disabled"
       export LEX
@@ -843,9 +830,9 @@ am_setup_testdir ()
     {
       echo "AC_INIT([$me], [1.0])"
       if test x"$am_serial_tests" = x"yes"; then
-        echo "AM_INIT_AUTOMAKE"
+        echo "AM_INIT_AUTOMAKE([serial-tests])"
       else
-        echo "AM_INIT_AUTOMAKE([parallel-tests])"
+        echo "AM_INIT_AUTOMAKE"
       fi
       echo "AC_CONFIG_FILES([Makefile])"
     } >configure.ac || framework_failure_ "creating configure.ac skeleton"
diff --git a/t/ax/depcomp.sh b/t/ax/depcomp.sh
index f8e372f..4094a37 100644
--- a/t/ax/depcomp.sh
+++ b/t/ax/depcomp.sh
@@ -67,7 +67,7 @@
 
 # -------------------------------------------------------------------------
 
-# This expects ./defs has already been included has already been included..
+# This code expects test-init.sh has already been included in advance.
 
 ocwd=$(pwd) || fatal_ "getting current working directory"
 longpath=this-is/a-path/which-has/quite-a/definitely/truly/long_long_name
diff --git a/t/ax/extract-testsuite-summary.pl 
b/t/ax/extract-testsuite-summary.pl
index 28a9c35..a8b6343 100644
--- a/t/ax/extract-testsuite-summary.pl
+++ b/t/ax/extract-testsuite-summary.pl
@@ -1,6 +1,6 @@
 #! /usr/bin/env perl
-# Extract the testsuite summary generated by the parallel-tests harness
-# from the output of "make check".
+# Extract the testsuite summary generated by the parallel testsuite
+# harness from the output of "make check".
 
 # Copyright (C) 2012 Free Software Foundation, Inc.
 
diff --git a/t/ax/tap-setup.sh b/t/ax/tap-setup.sh
index 952a49d..bd7efe3 100644
--- a/t/ax/tap-setup.sh
+++ b/t/ax/tap-setup.sh
@@ -22,7 +22,7 @@
 
 # Check that we are running from a proper directory: last thing we want
 # is to overwrite some random user files.
-test -f ../../automake && test -f ../../defs && test -d ../../t \
+test -f ../../automake && test -f ../../runtest && test -d ../../t \
   || fatal_ "running from a wrong directory"
 
 test ! -f Makefile.am || mv Makefile.am Makefile.am~ \
diff --git a/t/ax/tap-summary-aux.sh b/t/ax/tap-summary-aux.sh
index 3918830..d86981f 100644
--- a/t/ax/tap-summary-aux.sh
+++ b/t/ax/tap-summary-aux.sh
@@ -16,7 +16,7 @@
 
 # Auxiliary script for tests on TAP support: checking testsuite summary.
 
-. ./defs || exit 1
+. test-init.sh
 
 
br='============================================================================'
 
@@ -29,7 +29,7 @@ fetch_tap_driver
 
 cat > configure.ac <<END
 AC_INIT([GNU AutoTAP], [5.12], address@hidden)
-AM_INIT_AUTOMAKE([parallel-tests])
+AM_INIT_AUTOMAKE
 AC_CONFIG_FILES([Makefile])
 AC_OUTPUT
 END
@@ -89,7 +89,6 @@ if test $use_colors = yes; then
   mgn="$esc[0;35m"
   brg="$esc[1m"
   std="$esc[m"
-  echo AUTOMAKE_OPTIONS = color-tests >> Makefile.am
 else
   red= grn= lgn= blu= mgn= brg= std=
 fi
diff --git a/t/ax/testsuite-summary-checks.sh b/t/ax/testsuite-summary-checks.sh
index fd74a7f..6478705 100644
--- a/t/ax/testsuite-summary-checks.sh
+++ b/t/ax/testsuite-summary-checks.sh
@@ -14,13 +14,13 @@
 # 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 the testsuite summary with the parallel-tests harness.  This
+# Check the testsuite summary with the parallel test harness.  This
 # script is meant to be sourced by other test script, so that it can
 # be used to check different scenarios (colorized and non-colorized
 # testsuite output, packages with and without bug-report addresses,
 # testsuites in subdirectories, ...)
 
-. ./defs || exit 1
+. test-init.sh
 
 case $use_colors in
   yes)
@@ -28,10 +28,8 @@ case $use_colors in
     # Forced colorization should take place also with non-ANSI
     # terminals; hence this setting.
     TERM=dumb; export TERM
-    am_opts='parallel-tests color-tests'
     ;;
   no)
-    am_opts='parallel-tests'
     ;;
   *)
     fatal_ "invalid use_colors='$use_colors'";;
@@ -39,7 +37,7 @@ esac
 
 cat > configure.ac <<END
 AC_INIT([GNU AutoFoo], [7.1], address@hidden)
-AM_INIT_AUTOMAKE([$am_opts])
+AM_INIT_AUTOMAKE
 AC_CONFIG_FILES([Makefile])
 AC_OUTPUT
 END
diff --git a/t/backcompat-acout.sh b/t/backcompat-acout.sh
new file mode 100755
index 0000000..c483be5
--- /dev/null
+++ b/t/backcompat-acout.sh
@@ -0,0 +1,66 @@
+#! /bin/sh
+# Copyright (C) 2010-2012 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.
+
+. test-init.sh
+
+mkdir sub
+: > Makefile.am
+: > zardoz
+: > foo.in
+: > foo1.in
+: > foo2.in
+: > foo3.in
+: > sub/bar.in
+
+ls -l # 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
+  unindent >configure.ac <<END
+    AC_INIT([$me], [1.0])
+    AM_INIT_AUTOMAKE
+    AC_CONFIG_FILES([$args])
+    AC_OUTPUT
+END
+  cat configure.ac # For debugging.
+  $ACLOCAL
+  $AUTOMAKE Makefile
+  mv -f Makefile.in Makefile.acf
+  rm -rf autom4te*.cache aclocal.m4
+  unindent >configure.ac <<END
+    AC_INIT([$me], [1.0])
+    AM_INIT_AUTOMAKE
+    AC_OUTPUT([$args])
+END
+  cat configure.ac # For debugging.
+  $ACLOCAL
+  $AUTOMAKE Makefile
+  mv -f Makefile.in Makefile.aco
+  diff Makefile.acf Makefile.aco
+done
+
+:
diff --git a/t/backcompat.sh b/t/backcompat.sh
index 214515d..ee7906e 100755
--- a/t/backcompat.sh
+++ b/t/backcompat.sh
@@ -17,7 +17,7 @@
 # Test usage of AM_INIT_AUTOMAKE with two or three arguments, for
 # backward-compatibility.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am <<'END'
 .PHONY: test display
diff --git a/t/backcompat2.sh b/t/backcompat2.sh
index 109483b..fe3bb07 100755
--- a/t/backcompat2.sh
+++ b/t/backcompat2.sh
@@ -19,7 +19,7 @@
 # third argument is empty or non-existent.
 
 am_create_testdir=empty
-. ./defs || exit 1
+. test-init.sh
 
 # A trick to make the test run muuuch faster, by avoiding repeated
 # runs of aclocal (one order of magnitude improvement in speed!).
diff --git a/t/backcompat3.sh b/t/backcompat3.sh
index f25bd57..b245e36 100755
--- a/t/backcompat3.sh
+++ b/t/backcompat3.sh
@@ -18,7 +18,7 @@
 # AM_INIT_AUTOMAKE are both given two or more arguments.
 
 am_create_testdir=empty
-. ./defs || exit 1
+. test-init.sh
 
 empty=''
 
@@ -76,15 +76,8 @@ diff exp got
 ### Run 2 ###
 
 cat > configure.ac <<'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])])
+AC_INIT([ac_name], [ac_version], [ac_bugreport], [ac_tarname],
+        [ac_url])],
 AM_INIT_AUTOMAKE([am_name], [am_version])
 AC_CONFIG_FILES([Makefile])
 AC_OUTPUT
diff --git a/t/backcompat4.sh b/t/backcompat4.sh
deleted file mode 100755
index f2e552b..0000000
--- a/t/backcompat4.sh
+++ /dev/null
@@ -1,66 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2010-2012 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
-
-mkdir sub
-: > Makefile.am
-: > zardoz
-: > foo.in
-: > foo1.in
-: > foo2.in
-: > foo3.in
-: > sub/bar.in
-
-ls -l # 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
-  unindent >configure.ac <<END
-    AC_INIT([$me], [1.0])
-    AM_INIT_AUTOMAKE
-    AC_CONFIG_FILES([$args])
-    AC_OUTPUT
-END
-  cat configure.ac # For debugging.
-  $ACLOCAL
-  $AUTOMAKE Makefile
-  mv -f Makefile.in Makefile.acf
-  rm -rf autom4te*.cache aclocal.m4
-  unindent >configure.ac <<END
-    AC_INIT([$me], [1.0])
-    AM_INIT_AUTOMAKE
-    AC_OUTPUT([$args])
-END
-  cat configure.ac # For debugging.
-  $ACLOCAL
-  $AUTOMAKE Makefile
-  mv -f Makefile.in Makefile.aco
-  diff Makefile.acf Makefile.aco
-done
-
-:
diff --git a/t/backcompat5.sh b/t/backcompat5.sh
deleted file mode 100755
index caeac07..0000000
--- a/t/backcompat5.sh
+++ /dev/null
@@ -1,126 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2010-2012 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,
-# and configure.in as autoconf input file.
-# This script can also serve as mild stress-testing for Automake.
-# See also the similar test 'backcompat6.sh'.
-
-am_serial_tests=yes
-am_create_testdir=empty
-. ./defs || exit 1
-
-makefiles='hacky/Makefile src/Makefile data/Makefile tests/Makefile'
-
-# 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($makefiles)
-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 -Wno-obsolete
-$AUTOCONF
-$AUTOMAKE -a -Wno-obsolete
-test -f install-sh
-for f in $makefiles; do mv -f $f.in $f.sav; done
-$AUTOMAKE -Wno-obsolete
-for f in $makefiles; do diff $f.sav $f.in; done
-
-./configure
-ls -l . hacky src data tests # For debugging.
-test ! -e mkfile
-$MAKE
-$MAKE distdir
-test ! -e $distdir/Makefile.in
-test ! -e $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/t/backcompat6.sh b/t/backcompat6.sh
index ee86e36..b99321a 100755
--- a/t/backcompat6.sh
+++ b/t/backcompat6.sh
@@ -18,15 +18,15 @@
 # using obsoleted forms of AC_INIT, AM_INIT_AUTOMAKE and AC_OUTPUT,
 # and 'configure.in' as autconf input file.
 # This script can also serve as mild stress-testing for Automake.
-# See also the similar test 'backcompat5.sh'.
+# See also the similar test 'backcompat5.test'.
 
 required=cc
 am_create_testdir=empty
-. ./defs || exit 1
+. test-init.sh
 
 # Anyone doing something like this in a real-life package probably
 # deserves to be killed.
-cat > configure.in <<'END'
+cat > configure.ac <<'END'
 dnl: Everything here is *deliberately* underquoted!
 AC_INIT(quux.c)
 PACKAGE=nonesuch-zardoz
@@ -98,7 +98,7 @@ $MAKE check
 distdir=nonesuch-zardoz-nonesuch-0.1
 $MAKE distdir
 test -f $distdir/quux.c
-test ! -e $distdir/foo.got
+test ! -f $distdir/foo.got
 
 $MAKE distcheck
 
diff --git a/t/backsl.sh b/t/backsl.sh
index fb34ee1..a781e80 100755
--- a/t/backsl.sh
+++ b/t/backsl.sh
@@ -16,7 +16,7 @@
 
 # Test for "\" problems.  Bug report from Joerg-Martin Schwarz.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/backsl2.sh b/t/backsl2.sh
index 5d9d6d1..10046f9 100755
--- a/t/backsl2.sh
+++ b/t/backsl2.sh
@@ -17,7 +17,7 @@
 # We must skip the backslash, not complain about './\' not existing.
 # Reported by Rick Scott <address@hidden>
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am << 'END'
 SUBDIRS = \
diff --git a/t/backsl3.sh b/t/backsl3.sh
index 7891753..b17631d 100755
--- a/t/backsl3.sh
+++ b/t/backsl3.sh
@@ -17,7 +17,7 @@
 # Make sure we diagnose trailing backslash at the end of a file.
 # Report from Akim Demaile <address@hidden>.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am << 'END'
 foo = \
diff --git a/t/backsl4.sh b/t/backsl4.sh
index 707d358..7ac4c86 100755
--- a/t/backsl4.sh
+++ b/t/backsl4.sh
@@ -17,7 +17,7 @@
 # Make sure we diagnose and fix white spaces following backslash.
 # Report from Peter Muir.
 
-. ./defs || exit 1
+. test-init.sh
 
 echo AC_OUTPUT >>configure.ac
 
diff --git a/t/badline.sh b/t/badline.sh
index 3d71425..e6eb5c8 100755
--- a/t/badline.sh
+++ b/t/badline.sh
@@ -17,7 +17,7 @@
 # Test to make sure that line number and file name in error message
 # referring to variable is always correct.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > configure.ac << END
 AC_INIT([$me], [1.0])
diff --git a/t/badopt.sh b/t/badopt.sh
index b548a4f..927a10d 100755
--- a/t/badopt.sh
+++ b/t/badopt.sh
@@ -16,7 +16,7 @@
 
 # Test to make sure bad options cause error.
 
-. ./defs || exit 1
+. test-init.sh
 
 echo 'AUTOMAKE_OPTIONS = zardoz' > Makefile.am
 
diff --git a/t/badprog.sh b/t/badprog.sh
index 6134e3e..e8df06a 100755
--- a/t/badprog.sh
+++ b/t/badprog.sh
@@ -17,7 +17,7 @@
 # Test to make sure that programs with bad names are properly
 # transformed.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/block.sh b/t/block.sh
deleted file mode 100755
index 7cdb5ff..0000000
--- a/t/block.sh
+++ /dev/null
@@ -1,34 +0,0 @@
-#! /bin/sh
-# Copyright (C) 1996-2012 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 block comments are not double-spaced.
-# Report from François Pinard.
-
-. ./defs || exit 1
-
-cat > Makefile.am << 'END'
-#START
-#a
-#b
-#c
-#END
-END
-
-$ACLOCAL
-$AUTOMAKE
-
-(sed -e '/^#START/,/^#END/ !d' Makefile.in | grep -v '^#') && exit 1
-exit 0
diff --git a/t/built-sources-check.sh b/t/built-sources-check.sh
index d4d3c51..3e0204c 100755
--- a/t/built-sources-check.sh
+++ b/t/built-sources-check.sh
@@ -18,7 +18,7 @@
 # PR/359.
 
 # For gen-testsuite-part: ==> try-with-serial-tests <==
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_CONFIG_FILES([dir/Makefile])
diff --git a/t/built-sources-cond.sh b/t/built-sources-cond.sh
index ac78a97..a09334f 100755
--- a/t/built-sources-cond.sh
+++ b/t/built-sources-cond.sh
@@ -16,7 +16,7 @@
 
 # Interaction of BUILT_SOURCES with conditionals.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac <<'END'
 AM_CONDITIONAL([COND1], [test $cond1 = yes])
diff --git a/t/built-sources-fork-bomb.sh b/t/built-sources-fork-bomb.sh
index fac3750..bfb1b42 100755
--- a/t/built-sources-fork-bomb.sh
+++ b/t/built-sources-fork-bomb.sh
@@ -24,7 +24,7 @@
 # Backported to improve coverage of mainline Automake.
 
 required=GNUmake
-. ./defs || exit 1
+. test-init.sh
 
 echo AC_OUTPUT >> configure.ac
 
diff --git a/t/built-sources-install.sh b/t/built-sources-install.sh
index 2f53bb5..e1c0bbc 100755
--- a/t/built-sources-install.sh
+++ b/t/built-sources-install.sh
@@ -17,7 +17,7 @@
 # Make sure 'install:' honors $(BUILT_SOURCES).
 # PR/359.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_CONFIG_FILES([dir/Makefile])
diff --git a/t/built-sources-subdir.sh b/t/built-sources-subdir.sh
index cc162bb..b1c7764 100755
--- a/t/built-sources-subdir.sh
+++ b/t/built-sources-subdir.sh
@@ -19,7 +19,7 @@
 # all-recursive-am which depended on BUILT_SOURCES.
 
 required=cc
-. ./defs || exit 1
+. test-init.sh
 
 mkdir lib
 
diff --git a/t/built-sources.sh b/t/built-sources.sh
index 5173136..2f960b0 100755
--- a/t/built-sources.sh
+++ b/t/built-sources.sh
@@ -17,7 +17,7 @@
 # Basic test on BUILT_SOURCES.
 
 required=cc
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac <<'END'
 AC_PROG_CC
diff --git a/t/candist.sh b/t/candist.sh
index d87836a..4c84164 100755
--- a/t/candist.sh
+++ b/t/candist.sh
@@ -16,7 +16,7 @@
 
 # Test to make sure things that cannot be dist_'ed are diagnosed.
 
-. ./defs || exit 1
+. test-init.sh
 
 echo AC_OUTPUT >>configure.ac
 
diff --git a/t/canon-name.sh b/t/canon-name.sh
index 59f8d8d..460fb89 100755
--- a/t/canon-name.sh
+++ b/t/canon-name.sh
@@ -17,7 +17,7 @@
 # PR 511: Make sure we warn about e.g. AC_CONFIG_FILES([./gmakefile]),
 # as not all make implementations treat 'file' and './file' equally.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > configure.ac <<END
 AC_INIT([$me], [1.0])
diff --git a/t/canon.sh b/t/canon.sh
index 8b3c756..5b22948 100755
--- a/t/canon.sh
+++ b/t/canon.sh
@@ -16,7 +16,7 @@
 
 # Test to make sure that name canonicalization error works.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/canon2.sh b/t/canon2.sh
index d9869e8..f79c2a5 100755
--- a/t/canon2.sh
+++ b/t/canon2.sh
@@ -16,7 +16,7 @@
 
 # Test to make sure name canonicalization happens for texinfo.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am << 'END'
 info_TEXINFOS = zar-doz.texi
diff --git a/t/canon3.sh b/t/canon3.sh
index 4a95cb5..2efdd4c 100755
--- a/t/canon3.sh
+++ b/t/canon3.sh
@@ -16,7 +16,7 @@
 
 # Yet another canonicalization test.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/canon4.sh b/t/canon4.sh
index c79b151..eea87aa 100755
--- a/t/canon4.sh
+++ b/t/canon4.sh
@@ -17,7 +17,7 @@
 # Test to make sure name canonicalization happens for static libraries.
 # Keep this in sync with sister test 'canon6.sh'.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/canon5.sh b/t/canon5.sh
index 124da02..dd66ec0 100755
--- a/t/canon5.sh
+++ b/t/canon5.sh
@@ -17,7 +17,7 @@
 # Test to make sure that we allow variable names starting in
 # non-letters.  Whatever that might mean.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/canon6.sh b/t/canon6.sh
index 9c7fd94..aa1be20 100755
--- a/t/canon6.sh
+++ b/t/canon6.sh
@@ -18,7 +18,7 @@
 # Keep this in sync with sister test 'canon4.sh'.
 
 required='libtoolize'
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/canon7.sh b/t/canon7.sh
index 8ffeffb..853db0a 100755
--- a/t/canon7.sh
+++ b/t/canon7.sh
@@ -17,7 +17,7 @@
 # Stress test on canonicalization.
 
 required='cc libtool libtoolize'
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/canon8.sh b/t/canon8.sh
index bb5e7f9..4c29f6d 100755
--- a/t/canon8.sh
+++ b/t/canon8.sh
@@ -16,7 +16,7 @@
 
 # Check that canonicalization does not transliterate the '@' charactrer.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/ccnoco.sh b/t/ccnoco.sh
index 2e5bd4f..960860c 100755
--- a/t/ccnoco.sh
+++ b/t/ccnoco.sh
@@ -18,7 +18,7 @@
 # understand '-c -o'.
 
 required=gcc
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
@@ -53,7 +53,8 @@ case " \$* " in
     ;;
 esac
 
-# Use '$CC', not 'gcc', to honour the compiler chosen by 't/defs'.
+# Use '$CC', not 'gcc', to honour the compiler chosen
+# by the testsuite setup.
 exec $CC "\$@"
 END
 
diff --git a/t/ccnoco2.sh b/t/ccnoco2.sh
index dcb6fa7..5230182 100755
--- a/t/ccnoco2.sh
+++ b/t/ccnoco2.sh
@@ -17,7 +17,7 @@
 # Make sure Automake requires AM_PROG_CC_C_O when either per-targets
 # flags or subdir-objects are used.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac <<EOF
 AC_PROG_CC
diff --git a/t/ccnoco3.sh b/t/ccnoco3.sh
index ff773f4..417f0c1 100755
--- a/t/ccnoco3.sh
+++ b/t/ccnoco3.sh
@@ -17,7 +17,7 @@
 # Test to make sure 'compile' doesn't call 'mv SRC SRC'.
 
 required=gcc
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
@@ -52,7 +52,8 @@ case " \$* " in
     ;;
 esac
 
-# Use '$CC', not 'gcc', to honour the compiler chosen by 't/defs'.
+# Use '$CC', not 'gcc', to honour the compiler chosen
+# by the testsuite setup.
 exec $CC "\$@"
 END
 
diff --git a/t/check-concurrency-bug9245.sh b/t/check-concurrency-bug9245.sh
index 79e8ffc..ac0e66b 100755
--- a/t/check-concurrency-bug9245.sh
+++ b/t/check-concurrency-bug9245.sh
@@ -18,7 +18,7 @@
 # even when the Automake-generated parallel testsuite harness failed.
 # See automake bug#9245.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_OUTPUT
diff --git a/t/check-exported-srcdir.sh b/t/check-exported-srcdir.sh
index baa8c40..26d481f 100755
--- a/t/check-exported-srcdir.sh
+++ b/t/check-exported-srcdir.sh
@@ -15,11 +15,11 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # Check that the testsuite driver (either with or without the
-# parallel-tests option enabled) exports the 'srcdir' value in the
+# serial-tests option enabled) exports the 'srcdir' value in the
 # environment of the tests.  This is documented in the manual.
 
 # For gen-testsuite-part: ==> try-with-serial-tests <==
-. ./defs || exit 1
+. test-init.sh
 
 show_info ()
 {
diff --git a/t/check-fd-redirect.sh b/t/check-fd-redirect.sh
index a11d0cd..3eeb52c 100755
--- a/t/check-fd-redirect.sh
+++ b/t/check-fd-redirect.sh
@@ -19,7 +19,7 @@
 # See also related test 'parallel-tests-fd-redirect.sh'.
 
 # For gen-testsuite-part: ==> try-with-serial-tests <==
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_OUTPUT
diff --git a/t/check-no-test-driver.sh b/t/check-no-test-driver.sh
index 7df5251..9632e8e 100755
--- a/t/check-no-test-driver.sh
+++ b/t/check-no-test-driver.sh
@@ -15,13 +15,15 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # Check that auxiliary script 'test-driver' doesn't get needlessly
-# installed or referenced when the 'parallel-tests' option is not
-# used.
+# installed or referenced when the 'serial-tests' option is used.
 
 am_serial_tests=yes
-. ./defs || exit 1
+. test-init.sh
 
-echo 'TESTS = foo.test' > Makefile.am
+cat > Makefile.am <<'END'
+AUTOMAKE_OPTIONS = serial-tests
+TESTS = foo.test
+END
 
 $ACLOCAL
 
diff --git a/t/check-subst-prog.sh b/t/check-subst-prog.sh
index 77538cd..5400220 100755
--- a/t/check-subst-prog.sh
+++ b/t/check-subst-prog.sh
@@ -19,7 +19,7 @@
 
 # For gen-testsuite-part: ==> try-with-serial-tests <==
 required='cc native'
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/check-subst.sh b/t/check-subst.sh
index b84762e..47d6359 100755
--- a/t/check-subst.sh
+++ b/t/check-subst.sh
@@ -16,11 +16,11 @@
 
 # Check @substituted@ TESTS.
 # Note that in this test, we rely on the .test extension for the
-# substituted names: this is necessary for parallel-tests.
+# substituted names: this is necessary for the parallel harness.
 # See also sister test 'check-subst-prog.sh'.
 
 # For gen-testsuite-part: ==> try-with-serial-tests <==
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_SUBST([script_tests], ['subst-pass-script.sh subst-xfail-script.sh'])
diff --git a/t/check-tests-in-builddir.sh b/t/check-tests-in-builddir.sh
index de453d2..2421b2a 100755
--- a/t/check-tests-in-builddir.sh
+++ b/t/check-tests-in-builddir.sh
@@ -18,7 +18,7 @@
 # well as in builddir, and that is prefers those in the builddir.
 
 # For gen-testsuite-part: ==> try-with-serial-tests <==
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_OUTPUT
@@ -54,8 +54,8 @@ chmod a+x bar.test
 
 $MAKE check >out 2>&1 || { cat out; exit 1; }
 cat out
-# The simple-tests driver does not strip VPATH components from
-# the name of the test, but the parallel-tests driver should.
+# The serial test driver does not strip VPATH components from
+# the name of the test, but the parallel driver should.
 if test x"$am_serial_tests" = x"yes"; then
   grep '^PASS: .*foo\.test *$' out
 else
@@ -68,8 +68,8 @@ rm -f test-suite.log foo.log bar.log
 
 FOO_EXIT_STATUS=1 $MAKE check >out 2>&1 && { cat out; exit 1; }
 cat out
-# The simple-tests driver does not strip VPATH components from
-# the name of the test, but the parallel-tests driver should.
+# The serial test driver does not strip VPATH components from
+# the name of the test, but the parallel driver should.
 if test x"$am_serial_tests" = x"yes"; then
   grep '^FAIL: .*foo\.test *$' out
 else
diff --git a/t/check.sh b/t/check.sh
index 1717e3b..74fdaa3 100755
--- a/t/check.sh
+++ b/t/check.sh
@@ -17,7 +17,7 @@
 # Test Automake style tests.
 
 # For gen-testsuite-part: ==> try-with-serial-tests <==
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am << 'END'
 TESTS = frob.test
diff --git a/t/check10.sh b/t/check10.sh
index e76773c..1751b60 100755
--- a/t/check10.sh
+++ b/t/check10.sh
@@ -18,7 +18,7 @@
 
 # This test only makes sense for the older serial testsuite driver.
 am_serial_tests=yes
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_OUTPUT
diff --git a/t/check11.sh b/t/check11.sh
index 2fa489a..90a5676 100755
--- a/t/check11.sh
+++ b/t/check11.sh
@@ -17,7 +17,7 @@
 # Check skip summary.
 
 # For gen-testsuite-part: ==> try-with-serial-tests <==
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_OUTPUT
diff --git a/t/check12.sh b/t/check12.sh
index 53cc4e6..0294d25 100755
--- a/t/check12.sh
+++ b/t/check12.sh
@@ -19,7 +19,7 @@
 
 # For gen-testsuite-part: ==> try-with-serial-tests <==
 required=runtest
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_OUTPUT
diff --git a/t/check2.sh b/t/check2.sh
index 2332fd6..8b79024 100755
--- a/t/check2.sh
+++ b/t/check2.sh
@@ -17,7 +17,7 @@
 # Test Automake style tests.
 
 # For gen-testsuite-part: ==> try-with-serial-tests <==
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_CONFIG_FILES([dir/Makefile])
diff --git a/t/check4.sh b/t/check4.sh
index 946290f..f351c0c 100755
--- a/t/check4.sh
+++ b/t/check4.sh
@@ -17,7 +17,7 @@
 # Make sure 'make -k check' processes all directories.
 
 # For gen-testsuite-part: ==> try-with-serial-tests <==
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_CONFIG_FILES([dir/Makefile])
diff --git a/t/check5.sh b/t/check5.sh
index 50113b9..2f57e56 100755
--- a/t/check5.sh
+++ b/t/check5.sh
@@ -18,7 +18,7 @@
 
 # For gen-testsuite-part: ==> try-with-serial-tests <==
 required='cc native'
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/check6.sh b/t/check6.sh
index d885713..d0965b1 100755
--- a/t/check6.sh
+++ b/t/check6.sh
@@ -18,7 +18,7 @@
 # Also test that Solaris make VPATH rewriting is honored
 
 # For gen-testsuite-part: ==> try-with-serial-tests <==
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_OUTPUT
diff --git a/t/check7.sh b/t/check7.sh
index e77249f..52a52bc 100755
--- a/t/check7.sh
+++ b/t/check7.sh
@@ -18,7 +18,7 @@
 
 # For gen-testsuite-part: ==> try-with-serial-tests <==
 required=cc
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/check8.sh b/t/check8.sh
index b968c3a..9651c0d 100755
--- a/t/check8.sh
+++ b/t/check8.sh
@@ -18,7 +18,7 @@
 
 # For gen-testsuite-part: ==> try-with-serial-tests <==
 required='cc native'
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
@@ -75,7 +75,7 @@ grep '^[^X]*PASS.* bar' stdout
 grep '^[^X]*PASS.* sub/bar' stdout
 grep '^[^X]*FAIL.* baz' stdout
 grep 'XFAIL.* sub/baz' stdout
-# 'parallel-tests' should not add circular dependencies.
+# The parallel test driver should cause circular dependencies.
 # Look for known warnings from a couple of 'make' implementations.
 grep -i 'circular.*dependency' stderr && exit 1
 grep -i 'graph cycles' stderr && exit 1
diff --git a/t/checkall.sh b/t/checkall.sh
index 4320574..d030738 100755
--- a/t/checkall.sh
+++ b/t/checkall.sh
@@ -16,7 +16,7 @@
 
 # Test for bug where check target doesn't depend on all.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am << 'END'
 bin_SCRIPTS = derived
diff --git a/t/clean.sh b/t/clean.sh
index 80f56df..683629c 100755
--- a/t/clean.sh
+++ b/t/clean.sh
@@ -16,7 +16,7 @@
 
 # Test to make sure a clean target depends on previous one.
 
-. ./defs || exit 1
+. test-init.sh
 
 : > Makefile.am
 
diff --git a/t/clean2.sh b/t/clean2.sh
deleted file mode 100755
index ce5e9bf..0000000
--- a/t/clean2.sh
+++ /dev/null
@@ -1,68 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2004-2012 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 distclean works in cygnus mode.
-# Report from Daniel Jacobowitz.
-
-. ./defs || exit 1
-
-cat >> configure.ac << 'END'
-AM_MAINTAINER_MODE
-AC_CONFIG_FILES([sub/Makefile])
-AC_OUTPUT
-END
-
-cat > Makefile.am << 'END'
-SUBDIRS = sub
-
-data_DATA = bar
-
-bar:
-       touch $@
-
-DISTCLEANFILES = bar
-END
-
-mkdir sub
-
-cat > sub/Makefile.am << 'END'
-data_DATA = foo
-
-foo:
-       touch $@
-
-CLEANFILES = $(data_DATA)
-END
-
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE --cygnus -Wno-obsolete
-
-./configure
-$MAKE
-ls -l
-test -f bar
-test -f sub/foo
-$MAKE distclean
-ls -l
-test ! -e bar
-test ! -e sub/foo
-test ! -e Makefile
-test ! -e config.status
-test -f Makefile.in
-test -f configure
-
-:
diff --git a/t/colneq.sh b/t/colneq.sh
index 6df427f..1db536a 100755
--- a/t/colneq.sh
+++ b/t/colneq.sh
@@ -16,7 +16,7 @@
 
 # Test that := definitions produce warnings, but otherwise work.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am << 'END'
 ICONS := $(wildcard *.xbm)
diff --git a/t/colneq2.sh b/t/colneq2.sh
index 124b6d2..7d5d121 100755
--- a/t/colneq2.sh
+++ b/t/colneq2.sh
@@ -16,7 +16,7 @@
 
 # Test that := in var substitutions works.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_OUTPUT
diff --git a/t/colneq3.sh b/t/colneq3.sh
index 4211131..dd1adaa 100755
--- a/t/colneq3.sh
+++ b/t/colneq3.sh
@@ -17,7 +17,7 @@
 # Test that := definitions work as expected at make time.
 
 required=GNUmake
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_OUTPUT
diff --git a/t/colon.sh b/t/colon.sh
index f3e95a6..33cf35b 100755
--- a/t/colon.sh
+++ b/t/colon.sh
@@ -17,7 +17,7 @@
 # Test for bug reported by Nyul Laszlo.  When using the ":" syntax in
 # AC_OUTPUT, Automake fails to find the correct file.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac <<'END'
 AC_CONFIG_FILES([foo.h:foo.hin])
diff --git a/t/colon2.sh b/t/colon2.sh
index febf20a..fde3523 100755
--- a/t/colon2.sh
+++ b/t/colon2.sh
@@ -17,7 +17,7 @@
 # Make sure ":" works with files automake generates.
 # See also sister test 'colon3.sh'.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > configure.ac <<END
 AC_INIT([$me], [1.0])
diff --git a/t/colon3.sh b/t/colon3.sh
index e594d6f..49a6191 100755
--- a/t/colon3.sh
+++ b/t/colon3.sh
@@ -18,7 +18,7 @@
 # This test is for multiple ":"s.
 # See also sister test 'colon2.sh'.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > configure.ac <<END
 AC_INIT([$me], [1.0])
diff --git a/t/colon4.sh b/t/colon4.sh
index 34f0571..fa4b675 100755
--- a/t/colon4.sh
+++ b/t/colon4.sh
@@ -18,7 +18,7 @@
 # rebuild rules.
 # Test from Maciej W. Rozycki.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac <<END
 AC_CONFIG_FILES([zardoz:one:two:three])
diff --git a/t/colon5.sh b/t/colon5.sh
index c600679..2b7d55b 100755
--- a/t/colon5.sh
+++ b/t/colon5.sh
@@ -16,7 +16,7 @@
 
 # Another multi-":" test, this time from Doug Evans.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > configure.ac <<END
 AC_INIT([$me], [1.0])
diff --git a/t/colon6.sh b/t/colon6.sh
index d89deaa..8bfb146 100755
--- a/t/colon6.sh
+++ b/t/colon6.sh
@@ -16,7 +16,7 @@
 
 # Yet another multi-":" test, this time from Ken Pizzini.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > configure.ac <<END
 AC_INIT([$me], [1.0])
diff --git a/t/colon7.sh b/t/colon7.sh
index 51607c6..b2183d7 100755
--- a/t/colon7.sh
+++ b/t/colon7.sh
@@ -17,7 +17,7 @@
 # Another test for a failing ":" in AC_OUTPUT.
 # Report from Maciej Stachowiak.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > configure.ac << 'END'
 AC_INIT([colon7], [1.0])
diff --git a/t/color-tests-opt.sh b/t/color-tests-opt.sh
new file mode 100755
index 0000000..ac26ab7
--- /dev/null
+++ b/t/color-tests-opt.sh
@@ -0,0 +1,39 @@
+#! /bin/sh
+# Copyright (C) 2007-2012 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 'color-tests' option, now active by default, is
+# nonetheless still silently accepted, for backward compatibility.
+
+. test-init.sh
+
+cat >configure.ac <<END
+AC_INIT([$me], [1.0])
+AM_INIT_AUTOMAKE([color-tests])
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
+END
+
+cat >Makefile.am <<END
+AUTOMAKE_OPTIONS = color-tests
+TESTS = foo.test
+END
+
+: > test-driver
+
+$ACLOCAL
+$AUTOMAKE
+
+:
diff --git a/t/color-tests.sh b/t/color-tests.sh
new file mode 100755
index 0000000..b90446e
--- /dev/null
+++ b/t/color-tests.sh
@@ -0,0 +1,151 @@
+#! /bin/sh
+# Copyright (C) 2007-2012 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 Automake TESTS color output, by forcing it.
+# Keep this in sync with the sister test 'color2.sh'.
+
+required='grep-nonprint'
+# For gen-testsuite-part: ==> try-with-serial-tests <==
+. test-init.sh
+
+# Escape '[' for grep, below.
+red="$esc\[0;31m"
+grn="$esc\[0;32m"
+lgn="$esc\[1;32m"
+blu="$esc\[1;34m"
+mgn="$esc\[0;35m"
+std="$esc\[m"
+
+cat >>configure.ac <<END
+AC_OUTPUT
+END
+
+cat >Makefile.am <<'END'
+TESTS = $(check_SCRIPTS)
+check_SCRIPTS = pass fail skip xpass xfail error
+XFAIL_TESTS = xpass xfail
+END
+
+cat >pass <<END
+#! /bin/sh
+exit 0
+END
+
+cat >fail <<END
+#! /bin/sh
+exit 1
+END
+
+cat >skip <<END
+#! /bin/sh
+exit 77
+END
+
+cat >error <<END
+#! /bin/sh
+exit 99
+END
+
+cp fail xfail
+cp pass xpass
+chmod +x pass fail skip xpass xfail error
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE --add-missing
+
+test_color ()
+{
+  # Not a useless use of cat; see above comments "grep-nonprinting"
+  # requirement in 'test-init.sh'.
+  cat stdout | grep "^${grn}PASS${std}: .*pass"
+  cat stdout | grep "^${red}FAIL${std}: .*fail"
+  cat stdout | grep "^${blu}SKIP${std}: .*skip"
+  cat stdout | grep "^${lgn}XFAIL${std}: .*xfail"
+  cat stdout | grep "^${red}XPASS${std}: .*xpass"
+  # The old serial testsuite driver doesn't distinguish between failures
+  # and hard errors.
+  if test x"$am_serial_tests" = x"yes"; then
+    cat stdout | grep "^${red}FAIL${std}: .*error"
+  else
+    cat stdout | grep "^${mgn}ERROR${std}: .*error"
+  fi
+  :
+}
+
+test_no_color ()
+{
+  # With make implementations that, like Solaris make, in case of errors
+  # print the whole failing recipe on standard output, we should content
+  # ourselves with a laxer check, to avoid false positives.
+  # Keep this in sync with lib/am/check.am:$(am__color_tests).
+  if $FGREP '= Xalways; then' stdout; then
+    # Extra verbose make, resort to laxer checks.
+    # Note that we also want to check that the testsuite summary is
+    # not unduly colorized.
+    (
+      set +e # In case some grepped regex below isn't matched.
+      # Not a useless use of cat; see above comments "grep-nonprinting"
+      # requirement in 'test-init.sh'.
+      cat stdout | grep "TOTAL.*:"
+      cat stdout | grep "PASS.*:"
+      cat stdout | grep "FAIL.*:"
+      cat stdout | grep "SKIP.*:"
+      cat stdout | grep "XFAIL.*:"
+      cat stdout | grep "XPASS.*:"
+      cat stdout | grep "ERROR.*:"
+      cat stdout | grep 'test.*expected'
+      cat stdout | grep 'test.*not run'
+      cat stdout | grep '===='
+      cat stdout | grep '[Ss]ee .*test-suite\.log'
+      cat stdout | grep '[Tt]estsuite summary'
+    ) | grep "$esc" && exit 1
+    : For shells with broken 'set -e'
+  else
+    cat stdout | grep "$esc" && exit 1
+    : For shells with broken 'set -e'
+  fi
+}
+
+for vpath in false :; do
+
+  if $vpath; then
+    mkdir build
+    cd build
+    srcdir=..
+  else
+    srcdir=.
+  fi
+
+  $srcdir/configure
+
+  # Forced colorization should take place also with non-ANSI terminals;
+  # hence the "TERM=dumb" definition.
+  TERM=dumb AM_COLOR_TESTS=always $MAKE -e check >stdout \
+    && { cat stdout; exit 1; }
+  cat stdout
+  test_color
+
+  TERM=ansi $MAKE -e check >stdout && { cat stdout; exit 1; }
+  cat stdout
+  test_no_color
+
+  $MAKE distclean
+  cd $srcdir
+
+done
+
+:
diff --git a/t/color-tests2.sh b/t/color-tests2.sh
new file mode 100755
index 0000000..174d734
--- /dev/null
+++ b/t/color-tests2.sh
@@ -0,0 +1,204 @@
+#! /bin/sh
+# Copyright (C) 2007-2012 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 Automake TESTS color output, using the expect(1) program.
+# Keep this in sync with the sister test 'color.sh'.
+
+required='grep-nonprint'
+# For gen-testsuite-part: ==> try-with-serial-tests <==
+. test-init.sh
+
+# Escape '[' for grep, below.
+red="$esc\[0;31m"
+grn="$esc\[0;32m"
+lgn="$esc\[1;32m"
+blu="$esc\[1;34m"
+mgn="$esc\[0;35m"
+std="$esc\[m"
+
+# This test requires a working a working 'expect' program.
+(set +e; expect -c 'exit 77'; test $? -eq 77) \
+  || skip_ "requires a working expect program"
+
+# Also, if the $MAKE program fails to consider the standard output as a
+# tty (this happens with e.g., BSD make and Solaris dmake when they're
+# run in parallel mode; see the autoconf manual), there is little point
+# in proceeding.
+cat > Makefile <<'END'
+all:
+## Creative quoting in the 'echo' below to avoid risk of spurious output
+## matches by 'expect', below.
+       @test -t 1 && echo "stdout" "is" "a" "tty"
+END
+
+cat > expect-check <<'END'
+eval spawn $env(MAKE)
+expect {
+  "stdout is a tty" { exit 0 }
+  default { exit 1 }
+}
+exit 1
+END
+MAKE=$MAKE expect -f expect-check \
+  || skip_ "make spawned by expect should have a tty stdout"
+rm -f expect-check Makefile
+
+# Do the tests.
+
+cat >>configure.ac << 'END'
+if $testsuite_colorized; then :; else
+  AC_SUBST([AM_COLOR_TESTS], [no])
+fi
+AC_OUTPUT
+END
+
+cat >Makefile.am <<'END'
+TESTS = $(check_SCRIPTS)
+check_SCRIPTS = pass fail skip xpass xfail error
+XFAIL_TESTS = xpass xfail
+END
+
+cat >pass <<END
+#! /bin/sh
+exit 0
+END
+
+cat >fail <<END
+#! /bin/sh
+exit 1
+END
+
+cat >skip <<END
+#! /bin/sh
+exit 77
+END
+
+cat >error <<END
+#! /bin/sh
+exit 99
+END
+
+cp fail xfail
+cp pass xpass
+chmod +x pass fail skip xpass xfail error
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE --add-missing
+
+test_color ()
+{
+  # Not a useless use of cat; see above comments "grep-nonprinting"
+  # requirement in 'test-init.sh'.
+  cat stdout | grep "^${grn}PASS${std}: .*pass"
+  cat stdout | grep "^${red}FAIL${std}: .*fail"
+  cat stdout | grep "^${blu}SKIP${std}: .*skip"
+  cat stdout | grep "^${lgn}XFAIL${std}: .*xfail"
+  cat stdout | grep "^${red}XPASS${std}: .*xpass"
+  # The old serial testsuite driver doesn't distinguish between failures
+  # and hard errors.
+  if test x"$am_serial_tests" = x"yes"; then
+    cat stdout | grep "^${red}FAIL${std}: .*error"
+  else
+    cat stdout | grep "^${mgn}ERROR${std}: .*error"
+  fi
+  :
+}
+
+test_no_color ()
+{
+  # With make implementations that, like Solaris make, in case of errors
+  # print the whole failing recipe on standard output, we should content
+  # ourselves with a laxer check, to avoid false positives.
+  # Keep this in sync with lib/am/check.am:$(am__color_tests).
+  if $FGREP '= Xalways; then' stdout; then
+    # Extra verbose make, resort to laxer checks.
+    # Note that we also want to check that the testsuite summary is
+    # not unduly colorized.
+    (
+      set +e # In case some grepped regex below isn't matched.
+      # Not a useless use of cat; see above comments "grep-nonprinting"
+      # requirement in 'test-init.sh'.
+      cat stdout | grep "TOTAL.*:"
+      cat stdout | grep "PASS.*:"
+      cat stdout | grep "FAIL.*:"
+      cat stdout | grep "SKIP.*:"
+      cat stdout | grep "XFAIL.*:"
+      cat stdout | grep "XPASS.*:"
+      cat stdout | grep "ERROR.*:"
+      cat stdout | grep 'test.*expected'
+      cat stdout | grep 'test.*not run'
+      cat stdout | grep '===='
+      cat stdout | grep '[Ss]ee .*test-suite\.log'
+      cat stdout | grep '[Tt]estsuite summary'
+    ) | grep "$esc" && exit 1
+    : For shells with broken 'set -e'
+  else
+    cat stdout | grep "$esc" && exit 1
+    : For shells with broken 'set -e'
+  fi
+}
+
+cat >expect-make <<'END'
+eval spawn $env(MAKE) -e check
+expect eof
+END
+
+for vpath in false :; do
+
+  if $vpath; then
+    mkdir build
+    cd build
+    srcdir=..
+  else
+    srcdir=.
+  fi
+
+  $srcdir/configure
+
+  TERM=ansi MAKE=$MAKE expect -f $srcdir/expect-make >stdout \
+    || { cat stdout; exit 1; }
+  cat stdout
+  test_color
+
+  TERM=dumb MAKE=$MAKE expect -f $srcdir/expect-make >stdout \
+    || { cat stdout; exit 1; }
+  cat stdout
+  test_no_color
+
+  AM_COLOR_TESTS=no MAKE=$MAKE expect -f $srcdir/expect-make >stdout \
+    || { cat stdout; exit 1; }
+  cat stdout
+  test_no_color
+
+  $srcdir/configure testsuite_colorized=false
+
+  TERM=ansi MAKE=$MAKE expect -f $srcdir/expect-make >stdout \
+    || { cat stdout; exit 1; }
+  cat stdout
+  test_no_color
+
+  TERM=ansi MAKE="env AM_COLOR_TESTS=always $MAKE" \
+    expect -f $srcdir/expect-make >stdout || { cat stdout; exit 1; }
+  cat stdout
+  test_color
+
+  $MAKE distclean
+  cd $srcdir
+
+done
+
+:
diff --git a/t/color.sh b/t/color.sh
deleted file mode 100755
index 97063d7..0000000
--- a/t/color.sh
+++ /dev/null
@@ -1,152 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2007-2012 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 Automake TESTS color output, by forcing it.
-# Keep this in sync with the sister test 'color2.sh'.
-
-required='grep-nonprint'
-# For gen-testsuite-part: ==> try-with-serial-tests <==
-. ./defs || exit 1
-
-# Escape '[' for grep, below.
-red="$esc\[0;31m"
-grn="$esc\[0;32m"
-lgn="$esc\[1;32m"
-blu="$esc\[1;34m"
-mgn="$esc\[0;35m"
-std="$esc\[m"
-
-cat >>configure.ac <<END
-AC_OUTPUT
-END
-
-cat >Makefile.am <<'END'
-AUTOMAKE_OPTIONS = color-tests
-TESTS = $(check_SCRIPTS)
-check_SCRIPTS = pass fail skip xpass xfail error
-XFAIL_TESTS = xpass xfail
-END
-
-cat >pass <<END
-#! /bin/sh
-exit 0
-END
-
-cat >fail <<END
-#! /bin/sh
-exit 1
-END
-
-cat >skip <<END
-#! /bin/sh
-exit 77
-END
-
-cat >error <<END
-#! /bin/sh
-exit 99
-END
-
-cp fail xfail
-cp pass xpass
-chmod +x pass fail skip xpass xfail error
-
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE --add-missing
-
-test_color ()
-{
-  # Not a useless use of cat; see above comments "grep-nonprinting"
-  # requirement in 'test-init.sh'.
-  cat stdout | grep "^${grn}PASS${std}: .*pass"
-  cat stdout | grep "^${red}FAIL${std}: .*fail"
-  cat stdout | grep "^${blu}SKIP${std}: .*skip"
-  cat stdout | grep "^${lgn}XFAIL${std}: .*xfail"
-  cat stdout | grep "^${red}XPASS${std}: .*xpass"
-  # The old serial testsuite driver doesn't distinguish between failures
-  # and hard errors.
-  if test x"$am_serial_tests" = x"yes"; then
-    cat stdout | grep "^${red}FAIL${std}: .*error"
-  else
-    cat stdout | grep "^${mgn}ERROR${std}: .*error"
-  fi
-  :
-}
-
-test_no_color ()
-{
-  # With make implementations that, like Solaris make, in case of errors
-  # print the whole failing recipe on standard output, we should content
-  # ourselves with a laxer check, to avoid false positives.
-  # Keep this in sync with lib/am/check.am:$(am__color_tests).
-  if $FGREP '= Xalways; then' stdout; then
-    # Extra verbose make, resort to laxer checks.
-    # Note that we also want to check that the testsuite summary is
-    # not unduly colorized.
-    (
-      set +e # In case some grepped regex below isn't matched.
-      # Not a useless use of cat; see above comments "grep-nonprinting"
-      # requirement in 'test-init.sh'.
-      cat stdout | grep "TOTAL.*:"
-      cat stdout | grep "PASS.*:"
-      cat stdout | grep "FAIL.*:"
-      cat stdout | grep "SKIP.*:"
-      cat stdout | grep "XFAIL.*:"
-      cat stdout | grep "XPASS.*:"
-      cat stdout | grep "ERROR.*:"
-      cat stdout | grep 'test.*expected'
-      cat stdout | grep 'test.*not run'
-      cat stdout | grep '===='
-      cat stdout | grep '[Ss]ee .*test-suite\.log'
-      cat stdout | grep '[Tt]estsuite summary'
-    ) | grep "$esc" && exit 1
-    : For shells with broken 'set -e'
-  else
-    cat stdout | grep "$esc" && exit 1
-    : For shells with broken 'set -e'
-  fi
-}
-
-for vpath in false :; do
-
-  if $vpath; then
-    mkdir build
-    cd build
-    srcdir=..
-  else
-    srcdir=.
-  fi
-
-  $srcdir/configure
-
-  # Forced colorization should take place also with non-ANSI terminals;
-  # hence the "TERM=dumb" definition.
-  TERM=dumb AM_COLOR_TESTS=always $MAKE -e check >stdout \
-    && { cat stdout; exit 1; }
-  cat stdout
-  test_color
-
-  TERM=ansi $MAKE -e check >stdout && { cat stdout; exit 1; }
-  cat stdout
-  test_no_color
-
-  $MAKE distclean
-  cd $srcdir
-
-done
-
-:
diff --git a/t/color2.sh b/t/color2.sh
deleted file mode 100755
index 96b6447..0000000
--- a/t/color2.sh
+++ /dev/null
@@ -1,190 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2007-2012 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 Automake TESTS color output, using the expect(1) program.
-# Keep this in sync with the sister test 'color.sh'.
-
-required='grep-nonprint'
-# For gen-testsuite-part: ==> try-with-serial-tests <==
-. ./defs || exit 1
-
-# Escape '[' for grep, below.
-red="$esc\[0;31m"
-grn="$esc\[0;32m"
-lgn="$esc\[1;32m"
-blu="$esc\[1;34m"
-mgn="$esc\[0;35m"
-std="$esc\[m"
-
-# This test requires a working a working 'expect' program.
-(set +e; expect -c 'exit 77'; test $? -eq 77) \
-  || skip_ "requires a working expect program"
-
-# Also, if the $MAKE program fails to consider the standard output as a
-# tty (this happens with e.g., BSD make and Solaris dmake when they're
-# run in parallel mode; see the autoconf manual), there is little point
-# in proceeding.
-cat > Makefile <<'END'
-all:
-## Creative quoting in the 'echo' below to avoid risk of spurious output
-## matches by 'expect', below.
-       @test -t 1 && echo "stdout" "is" "a" "tty"
-END
-
-cat > expect-check <<'END'
-eval spawn $env(MAKE)
-expect {
-  "stdout is a tty" { exit 0 }
-  default { exit 1 }
-}
-exit 1
-END
-MAKE=$MAKE expect -f expect-check \
-  || skip_ "make spawned by expect should have a tty stdout"
-rm -f expect-check Makefile
-
-# Do the tests.
-
-cat >>configure.ac <<END
-AC_OUTPUT
-END
-
-cat >Makefile.am <<'END'
-AUTOMAKE_OPTIONS = color-tests
-TESTS = $(check_SCRIPTS)
-check_SCRIPTS = pass fail skip xpass xfail error
-XFAIL_TESTS = xpass xfail
-END
-
-cat >pass <<END
-#! /bin/sh
-exit 0
-END
-
-cat >fail <<END
-#! /bin/sh
-exit 1
-END
-
-cat >skip <<END
-#! /bin/sh
-exit 77
-END
-
-cat >error <<END
-#! /bin/sh
-exit 99
-END
-
-cp fail xfail
-cp pass xpass
-chmod +x pass fail skip xpass xfail error
-
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE --add-missing
-
-test_color ()
-{
-  # Not a useless use of cat; see above comments "grep-nonprinting"
-  # requirement in 'test-init.sh'.
-  cat stdout | grep "^${grn}PASS${std}: .*pass"
-  cat stdout | grep "^${red}FAIL${std}: .*fail"
-  cat stdout | grep "^${blu}SKIP${std}: .*skip"
-  cat stdout | grep "^${lgn}XFAIL${std}: .*xfail"
-  cat stdout | grep "^${red}XPASS${std}: .*xpass"
-  # The old serial testsuite driver doesn't distinguish between failures
-  # and hard errors.
-  if test x"$am_serial_tests" = x"yes"; then
-    cat stdout | grep "^${red}FAIL${std}: .*error"
-  else
-    cat stdout | grep "^${mgn}ERROR${std}: .*error"
-  fi
-  :
-}
-
-test_no_color ()
-{
-  # With make implementations that, like Solaris make, in case of errors
-  # print the whole failing recipe on standard output, we should content
-  # ourselves with a laxer check, to avoid false positives.
-  # Keep this in sync with lib/am/check.am:$(am__color_tests).
-  if $FGREP '= Xalways; then' stdout; then
-    # Extra verbose make, resort to laxer checks.
-    # Note that we also want to check that the testsuite summary is
-    # not unduly colorized.
-    (
-      set +e # In case some grepped regex below isn't matched.
-      # Not a useless use of cat; see above comments "grep-nonprinting"
-      # requirement in 'test-init.sh'.
-      cat stdout | grep "TOTAL.*:"
-      cat stdout | grep "PASS.*:"
-      cat stdout | grep "FAIL.*:"
-      cat stdout | grep "SKIP.*:"
-      cat stdout | grep "XFAIL.*:"
-      cat stdout | grep "XPASS.*:"
-      cat stdout | grep "ERROR.*:"
-      cat stdout | grep 'test.*expected'
-      cat stdout | grep 'test.*not run'
-      cat stdout | grep '===='
-      cat stdout | grep '[Ss]ee .*test-suite\.log'
-      cat stdout | grep '[Tt]estsuite summary'
-    ) | grep "$esc" && exit 1
-    : For shells with broken 'set -e'
-  else
-    cat stdout | grep "$esc" && exit 1
-    : For shells with broken 'set -e'
-  fi
-}
-
-cat >expect-make <<'END'
-eval spawn $env(MAKE) -e check
-expect eof
-END
-
-for vpath in false :; do
-
-  if $vpath; then
-    mkdir build
-    cd build
-    srcdir=..
-  else
-    srcdir=.
-  fi
-
-  $srcdir/configure
-
-  TERM=ansi MAKE=$MAKE expect -f $srcdir/expect-make >stdout \
-    || { cat stdout; exit 1; }
-  cat stdout
-  test_color
-
-  TERM=dumb MAKE=$MAKE expect -f $srcdir/expect-make >stdout \
-    || { cat stdout; exit 1; }
-  cat stdout
-  test_no_color
-
-  AM_COLOR_TESTS=no MAKE=$MAKE expect -f $srcdir/expect-make >stdout \
-    || { cat stdout; exit 1; }
-  cat stdout
-  test_no_color
-
-  $MAKE distclean
-  cd $srcdir
-
-done
-
-:
diff --git a/t/commen10.sh b/t/commen10.sh
index 1bc60f0..ea51447 100755
--- a/t/commen10.sh
+++ b/t/commen10.sh
@@ -17,7 +17,7 @@
 # Make sure comments following trailing backslashes are diagnosed.
 # Report from Harald Dunkel.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am << 'END'
 SUBDIRS = foo \
diff --git a/t/commen11.sh b/t/commen11.sh
index 139545d..c7ea312 100755
--- a/t/commen11.sh
+++ b/t/commen11.sh
@@ -18,7 +18,7 @@
 # comments following a trailing backslash, even when the combination
 # follows a variable assignment that is preceded by a comment.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am << 'END'
 # initial comment
diff --git a/t/comment-block.sh b/t/comment-block.sh
new file mode 100755
index 0000000..a50b9d3
--- /dev/null
+++ b/t/comment-block.sh
@@ -0,0 +1,34 @@
+#! /bin/sh
+# Copyright (C) 1996-2012 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 block comments are not double-spaced.
+# Report from François Pinard.
+
+. test-init.sh
+
+cat > Makefile.am << 'END'
+#START
+#a
+#b
+#c
+#END
+END
+
+$ACLOCAL
+$AUTOMAKE
+
+(sed -e '/^#START/,/^#END/ !d' Makefile.in | grep -v '^#') && exit 1
+exit 0
diff --git a/t/comment.sh b/t/comment.sh
index 3508bed..79f6cb6 100755
--- a/t/comment.sh
+++ b/t/comment.sh
@@ -17,7 +17,7 @@
 # Make sure that '#' as start of word in AUTOMAKE_OPTIONS means
 # comment.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am << 'END'
 AUTOMAKE_OPTIONS = #no such option
diff --git a/t/comment2.sh b/t/comment2.sh
index 124e273..402296d 100755
--- a/t/comment2.sh
+++ b/t/comment2.sh
@@ -17,7 +17,7 @@
 # Make sure comment recognition works in PROGRAMS.  Report from Mark
 # Galassi.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/comment3.sh b/t/comment3.sh
index e1f1583..b7a698b 100755
--- a/t/comment3.sh
+++ b/t/comment3.sh
@@ -19,7 +19,7 @@
 # shell, which in turn can't find '#' as a command.
 # Sigh.  Some vendors must be destroyed.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am << 'END'
 install-data-local:
diff --git a/t/comment4.sh b/t/comment4.sh
index 8a0ab45..83413ec 100755
--- a/t/comment4.sh
+++ b/t/comment4.sh
@@ -16,7 +16,7 @@
 
 # Make sure commented variables are output near their comments.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac <<'EOF'
 AC_OUTPUT
diff --git a/t/comment5.sh b/t/comment5.sh
index 06478e0..fcf5650 100755
--- a/t/comment5.sh
+++ b/t/comment5.sh
@@ -17,7 +17,7 @@
 # Test for PR/280.
 # (Automake should complain about trailing backslashes in comments.)
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac <<'EOF'
 AC_OUTPUT
diff --git a/t/comment6.sh b/t/comment6.sh
index 496dfdd..0a3a066 100755
--- a/t/comment6.sh
+++ b/t/comment6.sh
@@ -18,7 +18,7 @@
 # Automake 1.6.1 seems to have a problem parsing comments that use
 # '\' to span multiple lines.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac <<'EOF'
 AC_OUTPUT
diff --git a/t/comment7.sh b/t/comment7.sh
index a4f8d88..26520e7 100755
--- a/t/comment7.sh
+++ b/t/comment7.sh
@@ -17,7 +17,7 @@
 # Make sure comment for conditional variables are output near the
 # corresponding conditional definitions.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac <<'EOF'
 AM_CONDITIONAL([COND], [true])
@@ -54,4 +54,4 @@ sed -n '/^#.*VAR.*COND_FALSE/ {
         }' Makefile.in |
   grep '@address@hidden = bar'
 
-: 
+:
diff --git a/t/comment8.sh b/t/comment8.sh
index b4e871b..61f780a 100755
--- a/t/comment8.sh
+++ b/t/comment8.sh
@@ -17,7 +17,7 @@
 # Make sure += does not append to a comment.
 # Report from Stepan Kasal.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac <<'EOF'
 AM_CONDITIONAL([COND1], [true])
diff --git a/t/comment9.sh b/t/comment9.sh
index 49a9f6f..1c2551b 100755
--- a/t/comment9.sh
+++ b/t/comment9.sh
@@ -17,7 +17,7 @@
 # Make sure ##-comments are ignored in variable definitions.
 # Report from Julien Sopena.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am << 'EOF'
 TESTS = \
diff --git a/t/comments-in-var-def.sh b/t/comments-in-var-def.sh
index dbb3b14..dad568d 100755
--- a/t/comments-in-var-def.sh
+++ b/t/comments-in-var-def.sh
@@ -17,7 +17,7 @@
 # Make sure Automake ignores in-line comments when using variables,
 # but preserve them in the output.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac <<'END'
 AC_OUTPUT
diff --git a/t/compile.sh b/t/compile.sh
index 1da1cde..4e44206 100755
--- a/t/compile.sh
+++ b/t/compile.sh
@@ -17,7 +17,7 @@
 # Make sure 'compile' preserves spaces in its arguments.
 
 am_create_testdir=empty
-. ./defs || exit 1
+. test-init.sh
 
 get_shell_script compile
 
diff --git a/t/compile2.sh b/t/compile2.sh
index 5f38775..8c22ed5 100755
--- a/t/compile2.sh
+++ b/t/compile2.sh
@@ -17,7 +17,7 @@
 # Make sure 'compile' deals correctly with Windows-style paths.
 
 am_create_testdir=empty
-. ./defs || exit 1
+. test-init.sh
 
 get_shell_script compile
 
diff --git a/t/compile3.sh b/t/compile3.sh
index e8bf8a4..db715b3 100755
--- a/t/compile3.sh
+++ b/t/compile3.sh
@@ -18,7 +18,7 @@
 
 am_create_testdir=empty
 required=xsi-lib-shell
-. ./defs || exit 1
+. test-init.sh
 
 get_shell_script compile
 
diff --git a/t/compile4.sh b/t/compile4.sh
index e5b5c57..80ce861 100755
--- a/t/compile4.sh
+++ b/t/compile4.sh
@@ -18,7 +18,7 @@
 # with respect to absolute paths.
 
 required='cl'
-. ./defs || exit 1
+. test-init.sh
 
 get_shell_script compile
 
diff --git a/t/compile5.sh b/t/compile5.sh
index 89c5be3..3661fb1 100755
--- a/t/compile5.sh
+++ b/t/compile5.sh
@@ -17,7 +17,7 @@
 # Make sure the file name translation in the 'compile' script works
 # correctly
 
-. ./defs || exit 1
+. test-init.sh
 
 get_shell_script compile
 
diff --git a/t/compile6.sh b/t/compile6.sh
index 529f22c..c4fb22d 100755
--- a/t/compile6.sh
+++ b/t/compile6.sh
@@ -18,7 +18,7 @@
 
 am_create_testdir=empty
 required=xsi-lib-shell
-. ./defs || exit 1
+. test-init.sh
 
 get_shell_script compile
 
diff --git a/t/compile_f90_c_cxx.sh b/t/compile_f90_c_cxx.sh
index 27998dc..0bef8be 100755
--- a/t/compile_f90_c_cxx.sh
+++ b/t/compile_f90_c_cxx.sh
@@ -18,7 +18,7 @@
 # mixed source objects.
 # (copied from compile_f_c_cxx.sh) Mike Nolta <address@hidden>
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/compile_f_c_cxx.sh b/t/compile_f_c_cxx.sh
index 97f8d84..7c1a2a2 100755
--- a/t/compile_f_c_cxx.sh
+++ b/t/compile_f_c_cxx.sh
@@ -18,7 +18,7 @@
 # mixed source objects.
 # Matthew D. Langston <address@hidden>
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
@@ -39,8 +39,8 @@ $ACLOCAL
 $AUTOMAKE
 
 # Look for the macros at the beginning of rules.
-$FGREP "$tab\$(COMPILE)"    Makefile.in
-$FGREP "$tab\$(CXXCOMPILE)" Makefile.in
-$FGREP "$tab\$(F77COMPILE)" Makefile.in
+$FGREP "$tab\$(AM_V_CC)\$(COMPILE)"     Makefile.in
+$FGREP "$tab\$(AM_V_CXX)\$(CXXCOMPILE)" Makefile.in
+$FGREP "$tab\$(AM_V_F77)\$(F77COMPILE)" Makefile.in
 
 :
diff --git a/t/cond-basic.sh b/t/cond-basic.sh
index 0b79032..f01c558 100755
--- a/t/cond-basic.sh
+++ b/t/cond-basic.sh
@@ -16,7 +16,7 @@
 
 # Check basic use of conditionals.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AM_CONDITIONAL([TEST], [true])
diff --git a/t/cond.sh b/t/cond.sh
index 04fb9fa..2fd6a66 100755
--- a/t/cond.sh
+++ b/t/cond.sh
@@ -16,7 +16,7 @@
 
 # Check basic use of conditionals.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AM_CONDITIONAL([TEST], [true])
diff --git a/t/cond10.sh b/t/cond10.sh
index a556a99..89f0263 100755
--- a/t/cond10.sh
+++ b/t/cond10.sh
@@ -16,7 +16,7 @@
 
 # Test for bug in conditionals.  From Raja R Harinath.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/cond11.sh b/t/cond11.sh
index 95073d1..c4beffc 100755
--- a/t/cond11.sh
+++ b/t/cond11.sh
@@ -18,7 +18,7 @@
 # This checks that, if LDADD is set from a conditional variable
 # and an AC_SUBST, the _DEPENDENCIES variable is set correctly.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_SUBST([CC], [false])
diff --git a/t/cond13.sh b/t/cond13.sh
index c23df15..c522932 100755
--- a/t/cond13.sh
+++ b/t/cond13.sh
@@ -17,7 +17,7 @@
 # Test for bug in conditionals.
 # Report from Lars J. Aas.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/cond14.sh b/t/cond14.sh
index 345171e..67aa625 100755
--- a/t/cond14.sh
+++ b/t/cond14.sh
@@ -17,7 +17,7 @@
 # Test for bug in conditionals.
 # Report from Robert Boehne.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/cond15.sh b/t/cond15.sh
index 6ce37d7..e21f729 100755
--- a/t/cond15.sh
+++ b/t/cond15.sh
@@ -16,7 +16,7 @@
 
 # Regression test for conditionally defined overriding of automatic rules.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/cond16.sh b/t/cond16.sh
index ded3370..8e771e6 100755
--- a/t/cond16.sh
+++ b/t/cond16.sh
@@ -18,7 +18,7 @@
 # references.
 # Report from Richard Boulton.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AM_CONDITIONAL([COND1], [true])
diff --git a/t/cond17.sh b/t/cond17.sh
index 837fa02..6726d2e 100755
--- a/t/cond17.sh
+++ b/t/cond17.sh
@@ -18,7 +18,7 @@
 # according to a conditional.
 # Report from Richard Boulton.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/cond18.sh b/t/cond18.sh
index 22bbfcf..353cad6 100755
--- a/t/cond18.sh
+++ b/t/cond18.sh
@@ -17,7 +17,7 @@
 # Regression test for substitution references to conditional variables.
 # Report from Richard Boulton.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AM_CONDITIONAL([COND1], [true])
diff --git a/t/cond19.sh b/t/cond19.sh
index b0dd05c..6187c4c 100755
--- a/t/cond19.sh
+++ b/t/cond19.sh
@@ -17,7 +17,7 @@
 # Regression test for substitution references to conditional variables.
 # Report from Richard Boulton.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_SUBST([CC], [false])
diff --git a/t/cond20.sh b/t/cond20.sh
index 403c609..0a590d5 100755
--- a/t/cond20.sh
+++ b/t/cond20.sh
@@ -17,7 +17,7 @@
 # Regression test for recursion handling in substitution references to
 # conditional variables.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/cond21.sh b/t/cond21.sh
index f5c748c..8df1232 100755
--- a/t/cond21.sh
+++ b/t/cond21.sh
@@ -16,7 +16,7 @@
 
 # Check for use of = and += in different conditions.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AM_CONDITIONAL([COND1], [true])
diff --git a/t/cond22.sh b/t/cond22.sh
index 10e1d4d..a28c847 100755
--- a/t/cond22.sh
+++ b/t/cond22.sh
@@ -17,7 +17,7 @@
 # Regression test for bug when sources listed in conditional.
 # Report from Richard Boulton.  PR/326.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 CC=false; AC_SUBST([CC])
diff --git a/t/cond23.sh b/t/cond23.sh
index 522cffa..d7a01eb 100755
--- a/t/cond23.sh
+++ b/t/cond23.sh
@@ -17,7 +17,7 @@
 # Check that conditional redefinitions of AC_SUBST'ed variables are detected.
 # Report from Patrik Weiskircher.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac <<EOF
 AM_CONDITIONAL([COND], [true])
diff --git a/t/cond24.sh b/t/cond24.sh
index eaaf3d7..3a98a4e 100755
--- a/t/cond24.sh
+++ b/t/cond24.sh
@@ -17,7 +17,7 @@
 # Check that conditional redefinitions of AC_SUBST'ed variables are detected.
 # Report from Patrik Weiskircher.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac <<EOF
 AC_SUBST([foo], [bar])
diff --git a/t/cond25.sh b/t/cond25.sh
index 2119a8a..7177faf 100755
--- a/t/cond25.sh
+++ b/t/cond25.sh
@@ -17,7 +17,7 @@
 # Check that conditional primaries can use non-conditional directories.
 # From Pavel Roskin.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac << 'EOF'
 AM_CONDITIONAL([USE_FOO], [true])
diff --git a/t/cond26.sh b/t/cond26.sh
index 74cc7cc..275b32d 100755
--- a/t/cond26.sh
+++ b/t/cond26.sh
@@ -17,7 +17,7 @@
 # Check that non-conditional primaries can use conditional directories.
 # Reported by Juergen Keil.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac << 'EOF'
 AM_CONDITIONAL([USE_FOO], [true])
diff --git a/t/cond27.sh b/t/cond27.sh
index fa4aa94..b1a140a 100755
--- a/t/cond27.sh
+++ b/t/cond27.sh
@@ -17,7 +17,7 @@
 # Check that non-conditional primaries cannot use directories defined
 # in some conditions (but not others).
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac << 'EOF'
 AM_CONDITIONAL([USE_FOO], [true])
diff --git a/t/cond28.sh b/t/cond28.sh
index 4df7446..a93e6fd 100755
--- a/t/cond28.sh
+++ b/t/cond28.sh
@@ -17,7 +17,7 @@
 # Check that conditional primaries can use directories defined
 # in the same conditions (but not others).
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac << 'EOF'
 AM_CONDITIONAL([USE_FOO], [true])
diff --git a/t/cond3.sh b/t/cond3.sh
index 4a348d1..d31b943 100755
--- a/t/cond3.sh
+++ b/t/cond3.sh
@@ -17,7 +17,7 @@
 # Test sources listed in conditional.
 # Report from Rob Savoye <address@hidden>, and Lars J. Aas.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/cond30.sh b/t/cond30.sh
index cf505d9..09ea343 100755
--- a/t/cond30.sh
+++ b/t/cond30.sh
@@ -16,7 +16,7 @@
 
 # For PR/352: make sure we support bin_PROGRAMS being defined conditionally.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac <<'EOF'
 AM_CONDITIONAL([C1], [test -z "$two"])
diff --git a/t/cond31.sh b/t/cond31.sh
index b849a1a..d66305f 100755
--- a/t/cond31.sh
+++ b/t/cond31.sh
@@ -16,7 +16,7 @@
 
 # Make sure we define conditional _DEPENDENCIES correctly.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac <<'EOF'
 AC_SUBST([CC], [false])
diff --git a/t/cond32.sh b/t/cond32.sh
index 07b7814..842704c 100755
--- a/t/cond32.sh
+++ b/t/cond32.sh
@@ -16,7 +16,7 @@
 
 # Make sure the user can override a conditional _DEPENDENCIES.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac <<'EOF'
 AM_CONDITIONAL([C1], [test -z "$two"])
diff --git a/t/cond33.sh b/t/cond33.sh
index 53225cb..9ea45f1 100755
--- a/t/cond33.sh
+++ b/t/cond33.sh
@@ -18,7 +18,7 @@
 # correctly.
 # Report from Ralf Corsepius.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac <<'EOF'
 AM_CONDITIONAL([INC], [test -z "$two"])
diff --git a/t/cond34.sh b/t/cond34.sh
index 3d37a2b..b4a50bb 100755
--- a/t/cond34.sh
+++ b/t/cond34.sh
@@ -17,7 +17,7 @@
 # Check for _DEPENDENCIES definition with conditional _LDADD.
 # Report from Elena A. Vengerova.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac <<'EOF'
 AM_CONDITIONAL([TWO], [test -n "$two"])
diff --git a/t/cond35.sh b/t/cond35.sh
index ea663ce..fc371f5 100755
--- a/t/cond35.sh
+++ b/t/cond35.sh
@@ -18,7 +18,7 @@
 # Report from Roman Fietze.
 
 required='cc lex yacc'
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac <<'EOF'
 AM_CONDITIONAL([CASE_A], [test -z "$case_B"])
diff --git a/t/cond36.sh b/t/cond36.sh
index 2b8e584..a65343f 100755
--- a/t/cond36.sh
+++ b/t/cond36.sh
@@ -16,7 +16,7 @@
 
 # Check rules output for parser defined conditionally.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac <<'EOF'
 AM_CONDITIONAL([CASE_A], [test -z "$case_B"])
diff --git a/t/cond37.sh b/t/cond37.sh
index 31a1f40..12a2ac7 100755
--- a/t/cond37.sh
+++ b/t/cond37.sh
@@ -17,7 +17,7 @@
 # Check conditional local rules.
 # Report from Simon Josefsson.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac <<'EOF'
 AM_CONDITIONAL([CASE_A], [test -n "$case_A"])
diff --git a/t/cond38.sh b/t/cond38.sh
index 887aa03..96aefa9 100755
--- a/t/cond38.sh
+++ b/t/cond38.sh
@@ -17,7 +17,7 @@
 # Check conditional variable ordering.
 # Report from Ed Hartnett.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac <<'EOF'
 AM_CONDITIONAL([CASE_A], :)
diff --git a/t/cond39.sh b/t/cond39.sh
index 4cbda48..0bea420 100755
--- a/t/cond39.sh
+++ b/t/cond39.sh
@@ -17,7 +17,7 @@
 # Build either as CONFIG_FILE or as PROGRAM.
 
 required=cc
-. ./defs || exit 1
+. test-init.sh
 
 mkdir sub
 
diff --git a/t/cond4.sh b/t/cond4.sh
index 72d98c9..cc580c6 100755
--- a/t/cond4.sh
+++ b/t/cond4.sh
@@ -16,7 +16,7 @@
 
 # Another sources-in-conditional test.  Report from Tim Goodwin.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_SUBST([CC], [false])
diff --git a/t/cond40.sh b/t/cond40.sh
index 8725a03..2d7ba0d 100755
--- a/t/cond40.sh
+++ b/t/cond40.sh
@@ -16,7 +16,7 @@
 
 # Test AM_COND_IF.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac <<'END'
 AC_DEFUN([FOO],
diff --git a/t/cond41.sh b/t/cond41.sh
index 9f4cc53..3f9c3f4 100755
--- a/t/cond41.sh
+++ b/t/cond41.sh
@@ -16,7 +16,7 @@
 
 # AM_COND_IF with an undefined condition should fail.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac <<'END'
 AM_COND_IF([BAD_COND], [AC_CONFIG_FILES([file1])])
diff --git a/t/cond42.sh b/t/cond42.sh
index d7f885e..b3d0305 100755
--- a/t/cond42.sh
+++ b/t/cond42.sh
@@ -18,7 +18,7 @@
 # This shouldn't happen with user input, as _AM_COND_* are not documented,
 # but better to be safe.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac <<'END'
 AM_CONDITIONAL([COND], [:])
diff --git a/t/cond43.sh b/t/cond43.sh
index a6c7545..ff33675 100755
--- a/t/cond43.sh
+++ b/t/cond43.sh
@@ -16,7 +16,7 @@
 
 # Ensure an error with underquoted usage of AM_COND_IF in configure.ac.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac <<'END'
 AM_CONDITIONAL([COND1], [:])
diff --git a/t/cond44.sh b/t/cond44.sh
index 8d4d7d5..b79892b 100755
--- a/t/cond44.sh
+++ b/t/cond44.sh
@@ -17,7 +17,7 @@
 # Check that redefinitions of AC_SUBST'ed AM_SUBST_NOTMAKE'd variables
 # are not diagnosed.  See 'cond23.sh'.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac <<EOF
 AM_CONDITIONAL([COND], [true])
diff --git a/t/cond45.sh b/t/cond45.sh
index 5e010cf..0db9d8c 100755
--- a/t/cond45.sh
+++ b/t/cond45.sh
@@ -17,7 +17,7 @@
 # Check that redefinitions of AC_SUBST'ed AM_SUBST_NOTMAKE'd variables
 # are not diagnosed.  See 'cond24.sh'.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac <<EOF
 AC_SUBST([foo], [bar])
diff --git a/t/cond46.sh b/t/cond46.sh
index 59820c4..18d0f9e 100755
--- a/t/cond46.sh
+++ b/t/cond46.sh
@@ -16,7 +16,7 @@
 
 # Ensure the right condition is listed after 'else' and 'endif'.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AM_CONDITIONAL([USE_A], [test x = y])
diff --git a/t/cond5.sh b/t/cond5.sh
index fb5c920..b0f1194 100755
--- a/t/cond5.sh
+++ b/t/cond5.sh
@@ -16,7 +16,7 @@
 
 # Yet another sources-in-conditional test.  Report from Tim Goodwin.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/cond6.sh b/t/cond6.sh
index 640f496..3754d08 100755
--- a/t/cond6.sh
+++ b/t/cond6.sh
@@ -16,7 +16,7 @@
 
 # Test for an odd conditional bug.  Report from Matt Leach.
 
-. ./defs || exit 1
+. test-init.sh
 
 echo 'AM_CONDITIONAL([FOO], [true])' >> configure.ac
 
diff --git a/t/cond7.sh b/t/cond7.sh
index 19cd12e..4f90bde 100755
--- a/t/cond7.sh
+++ b/t/cond7.sh
@@ -16,7 +16,7 @@
 
 # Test for an odd conditional bug.  Report from Pavel Roskin.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 compat=yes
diff --git a/t/cond8.sh b/t/cond8.sh
index 1eab707..f19ede5 100755
--- a/t/cond8.sh
+++ b/t/cond8.sh
@@ -17,7 +17,7 @@
 # Test to make sure _PROGRAMS conditionals can be written in a useful
 # way.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/cond9.sh b/t/cond9.sh
index 9422748..80f13d1 100755
--- a/t/cond9.sh
+++ b/t/cond9.sh
@@ -16,7 +16,7 @@
 
 # Test for bug in conditionals.  From Raja R Harinath.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AM_CONDITIONAL([WRONG], [test x = y])
diff --git a/t/condd.sh b/t/condd.sh
index 81fd015..cb88994 100755
--- a/t/condd.sh
+++ b/t/condd.sh
@@ -16,7 +16,7 @@
 
 # Test for bug in conditionals.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 dnl Define a macro with the same name as the conditional to exhibit
diff --git a/t/condhook.sh b/t/condhook.sh
index 18ebcb3..8cfc94c 100755
--- a/t/condhook.sh
+++ b/t/condhook.sh
@@ -18,7 +18,7 @@
 # Keep this in sync with sister test 'condhook2.sh'.
 # Report by Nik A. Melchior (PR/428).
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AM_CONDITIONAL([TEST], [false])
diff --git a/t/condhook2.sh b/t/condhook2.sh
index a6ec7ff..e41a24d 100755
--- a/t/condhook2.sh
+++ b/t/condhook2.sh
@@ -17,7 +17,7 @@
 # Test install when a conditional install-*-hook is defined.
 # Keep this in sync with sister test 'condhook.sh'.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AM_CONDITIONAL([TEST], [true])
diff --git a/t/condinc.sh b/t/condinc.sh
index d826f96..d61766d 100755
--- a/t/condinc.sh
+++ b/t/condinc.sh
@@ -16,7 +16,7 @@
 
 # Make sure a conditional include statement is handled properly.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AM_CONDITIONAL([TOBE], [false])
diff --git a/t/condinc2.sh b/t/condinc2.sh
index 1763a6d..57f92ea 100755
--- a/t/condinc2.sh
+++ b/t/condinc2.sh
@@ -16,7 +16,7 @@
 
 # Another test of conditional include statements.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AM_CONDITIONAL([TOBE], [false])
diff --git a/t/condlib.sh b/t/condlib.sh
index 3c88226..6751386 100755
--- a/t/condlib.sh
+++ b/t/condlib.sh
@@ -17,7 +17,7 @@
 # Test for bug with conditional library.
 # From Harlan Stenn.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_RANLIB
diff --git a/t/condman2.sh b/t/condman2.sh
index ad97abc..8f79e0e 100755
--- a/t/condman2.sh
+++ b/t/condman2.sh
@@ -16,7 +16,7 @@
 
 # Make sure appropriate man install targets generated in all cases.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am << 'END'
 man_MANS = foo.1 foo.2
diff --git a/t/condman3.sh b/t/condman3.sh
index 094a66c..8f0f658 100755
--- a/t/condman3.sh
+++ b/t/condman3.sh
@@ -16,7 +16,7 @@
 
 # Make sure conditionals work with man pages.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AM_CONDITIONAL([COND], [test x"$FOO" = x"true"])
diff --git a/t/confdeps.sh b/t/confdeps.sh
index 95e60f9..c2dccf2 100755
--- a/t/confdeps.sh
+++ b/t/confdeps.sh
@@ -16,7 +16,7 @@
 
 # Make sure that config* files are properly regenerated.
 
-. ./defs || exit 1
+. test-init.sh
 
 echo "FOO = foo" > Makefile.am
 
diff --git a/t/conff.sh b/t/conff.sh
index b6f9081..7456207 100755
--- a/t/conff.sh
+++ b/t/conff.sh
@@ -17,7 +17,7 @@
 # Make sure rebuild rules work even when AC_CONFIG_FILES uses colons.
 # Report from Alexander Turbov.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_CONFIG_FILES([bar/Makefile:bar/Makefile.in:Makefile.bot])
diff --git a/t/conff2.sh b/t/conff2.sh
index 728d78e..9c51849 100755
--- a/t/conff2.sh
+++ b/t/conff2.sh
@@ -16,10 +16,10 @@
 
 # Make sure empty calls to AC_CONFIG_FILES or AC_CONFIG_HEADERS are diagnosed.
 
-. ./defs || exit 1
+. test-init.sh
 
-# We avoid using configure.ac stub initialized by ./defs, since we need
-# to keep track of line numbers (to grep for error messages).
+# We avoid using configure.ac stub initialized by our testsuite setup, as
+# we need to keep track of line numbers (to grep for error messages).
 cat > configure.ac << END
 AC_INIT([$me], [1.0])
 AM_INIT_AUTOMAKE
diff --git a/t/conffile-leading-dot.sh b/t/conffile-leading-dot.sh
index 3eed30b..acdbc1f 100755
--- a/t/conffile-leading-dot.sh
+++ b/t/conffile-leading-dot.sh
@@ -19,7 +19,7 @@
 # broken in that case.
 
 required=GNUmake
-. ./defs || exit 1
+. test-init.sh
 
 cat > configure.ac << END
 AC_INIT([$me], [1.0])
diff --git a/t/confh-subdir-clean.sh b/t/confh-subdir-clean.sh
index 5a942da..0572034 100755
--- a/t/confh-subdir-clean.sh
+++ b/t/confh-subdir-clean.sh
@@ -16,10 +16,10 @@
 
 # Test to make sure config headers in subdirectories are cleaned.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
-AM_CONFIG_HEADER([sub/config.h:sub/config.hin])
+AC_CONFIG_HEADERS([sub/config.h:sub/config.hin])
 AC_OUTPUT
 END
 
diff --git a/t/confh.sh b/t/confh.sh
index c86b63e..81e6743 100755
--- a/t/confh.sh
+++ b/t/confh.sh
@@ -17,10 +17,10 @@
 # Test to make sure config.h works in a subdir.
 # Report from Alexandre Oliva.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
-AM_CONFIG_HEADER([include/config.h])
+AC_CONFIG_HEADERS([include/config.h])
 AC_OUTPUT
 END
 
diff --git a/t/confh4.sh b/t/confh4.sh
index 2f52add..65c03c5 100755
--- a/t/confh4.sh
+++ b/t/confh4.sh
@@ -22,11 +22,11 @@
 #  Use AM_CONFIG_HEADER(subdir/config.h) to place configuration
 #  header in subdirectory and observe that it is not included.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_CONFIG_FILES([include/Makefile])
-AM_CONFIG_HEADER([include/config.h])
+AC_CONFIG_HEADERS([include/config.h])
 AC_PROG_CC
 END
 
diff --git a/t/confh5.sh b/t/confh5.sh
index 354c88c..c6c3e25 100755
--- a/t/confh5.sh
+++ b/t/confh5.sh
@@ -16,7 +16,7 @@
 
 # Make sure we do not distribute header sources when they are built.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_SUBST([FOO], [NameToBeGrepped])
diff --git a/t/confh6.sh b/t/confh6.sh
index 5479491..4db74b5 100755
--- a/t/confh6.sh
+++ b/t/confh6.sh
@@ -18,10 +18,10 @@
 # idea is that if config.h is in a subdir, and there is no Makefile in
 # that subdir, then we want to build config.h as the top level.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
-AM_CONFIG_HEADER([subdir/config.h])
+AC_CONFIG_HEADERS([subdir/config.h])
 AC_OUTPUT
 END
 
diff --git a/t/confh7.sh b/t/confh7.sh
index 86148ac..4d3bbbb 100755
--- a/t/confh7.sh
+++ b/t/confh7.sh
@@ -17,10 +17,10 @@
 # Test to make sure several config headers are allowed.
 # See also sister "semantic" test 'confh8.sh'.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
-AM_CONFIG_HEADER([config.h two.h])
+AC_CONFIG_HEADERS([config.h two.h])
 END
 
 : > Makefile.am
diff --git a/t/confh8.sh b/t/confh8.sh
index 35168e0..e2fc36f 100755
--- a/t/confh8.sh
+++ b/t/confh8.sh
@@ -17,10 +17,10 @@
 # Test to make sure several config headers are allowed.
 # See also sister "minimalistic" test 'confh7.sh'.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
-AM_CONFIG_HEADER([one.h two.h])
+AC_CONFIG_HEADERS([one.h two.h])
 AC_OUTPUT
 END
 
diff --git a/t/configure.sh b/t/configure.sh
index 6ba740e..1a1bb94 100755
--- a/t/configure.sh
+++ b/t/configure.sh
@@ -18,7 +18,7 @@
 # Diagnose if both configure.in and configure.ac are present, prefer
 # configure.ac.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >configure.ac <<EOF
 AC_INIT([$me], [1.0])
diff --git a/t/confincl.sh b/t/confincl.sh
index 4527a14..c106d6b 100755
--- a/t/confincl.sh
+++ b/t/confincl.sh
@@ -18,7 +18,7 @@
 # If config.h is not used, @CONFIG_INCLUDE_SPEC@ should not appear
 # in Makefile.in.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/conflnk.sh b/t/conflnk.sh
index 8446ac8..7b316a7 100755
--- a/t/conflnk.sh
+++ b/t/conflnk.sh
@@ -17,7 +17,7 @@
 # Test to make sure links created by AC_CONFIG_LINKS get removed with
 # 'make distclean'
 
-. ./defs || exit 1
+. test-init.sh
 
 echo 'SUBDIRS = sdir' > Makefile.am
 : > src
diff --git a/t/conflnk2.sh b/t/conflnk2.sh
index fa0b009..66b1a49 100755
--- a/t/conflnk2.sh
+++ b/t/conflnk2.sh
@@ -17,7 +17,7 @@
 # Test to make sure that sources for links created by AC_CONFIG_LINKS
 # are distributed.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am << 'END'
 SUBDIRS = sdir
diff --git a/t/conflnk3.sh b/t/conflnk3.sh
index a0b8842..1f844fd 100755
--- a/t/conflnk3.sh
+++ b/t/conflnk3.sh
@@ -17,7 +17,7 @@
 # Test to make sure that AC_CONFIG_LINKS using a variable source
 # is not broken.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am << 'END'
 SUBDIRS = sdir
diff --git a/t/conflnk4.sh b/t/conflnk4.sh
index 090f809..d879fbf 100755
--- a/t/conflnk4.sh
+++ b/t/conflnk4.sh
@@ -17,7 +17,7 @@
 # Test to make sure links to _identical files_ created by AC_CONFIG_LINKS get
 # removed with 'make distclean' only if doing a VPATH build.
 
-. ./defs || exit 1
+. test-init.sh
 
 mkdir nonmk-subdir sdir sdir/mk-subdir
 : > src
diff --git a/t/confsub.sh b/t/confsub.sh
index 979c665..6ab6a2f 100755
--- a/t/confsub.sh
+++ b/t/confsub.sh
@@ -17,11 +17,11 @@
 # Test to make sure config.h can be in subdir.
 # Also, make sure config.h is properly rebuilt.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_CONFIG_FILES([subdir/Makefile])
-AM_CONFIG_HEADER([subdir/config.h:subdir/config.hin])
+AC_CONFIG_HEADERS([subdir/config.h:subdir/config.hin])
 AC_OUTPUT
 END
 
diff --git a/t/confvar.sh b/t/confvar.sh
index 39739d9..28e9e06 100755
--- a/t/confvar.sh
+++ b/t/confvar.sh
@@ -16,7 +16,7 @@
 
 # Test to make sure configure_vars stuff works.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_SUBST([QBERT])
diff --git a/t/confvar2.sh b/t/confvar2.sh
index fc78f6e..cada470 100755
--- a/t/confvar2.sh
+++ b/t/confvar2.sh
@@ -16,7 +16,7 @@
 
 # Test for bug reported by Jim Meyering.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_SUBST([OTHER_SCRIPTS])
diff --git a/t/copy.sh b/t/copy.sh
index 64a829d..04cb94c 100755
--- a/t/copy.sh
+++ b/t/copy.sh
@@ -17,7 +17,7 @@
 # Test to make sure '-c' works.  Report from Andris Pavenis.
 # See also the much more in-depth test 'add-missing'.
 
-. ./defs || exit 1
+. test-init.sh
 
 # We'll have to cater to systems like MSYS/MinGW where there are no
 # true symlinks ('ln -s' behaves like 'cp -p'); see automake bug#10441.
diff --git a/t/cscope.tap b/t/cscope.tap
index 9db0d8e..213481c 100755
--- a/t/cscope.tap
+++ b/t/cscope.tap
@@ -16,7 +16,7 @@
 
 # Test cscope functionality.
 
-. ./defs || exit 1
+. test-init.sh
 
 plan_ 18
 
diff --git a/t/cscope2.sh b/t/cscope2.sh
index 631642f..16419a7 100755
--- a/t/cscope2.sh
+++ b/t/cscope2.sh
@@ -17,7 +17,7 @@
 # The 'cscope' target should not fail if there are no sources.
 
 required=
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_OUTPUT
diff --git a/t/cscope3.sh b/t/cscope3.sh
index 30e8c0c..a7468f8 100755
--- a/t/cscope3.sh
+++ b/t/cscope3.sh
@@ -19,7 +19,7 @@
 # is empty.
 
 required=cscope
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_CONFIG_FILES([sub/Makefile])
diff --git a/t/cxx-demo.sh b/t/cxx-demo.sh
index 77f7c83..6caae27 100755
--- a/t/cxx-demo.sh
+++ b/t/cxx-demo.sh
@@ -18,7 +18,7 @@
 
 required=c++
 am_create_testdir=empty
-. ./defs || exit 1
+. test-init.sh
 
 cat > configure.ac << 'END'
 AC_INIT([GNU C++ Demo], [1.3], address@hidden)
diff --git a/t/cxx-lt-demo.sh b/t/cxx-lt-demo.sh
index a060fc8..9289196 100755
--- a/t/cxx-lt-demo.sh
+++ b/t/cxx-lt-demo.sh
@@ -18,7 +18,7 @@
 
 required='libtoolize c++'
 am_create_testdir=empty
-. ./defs || exit 1
+. test-init.sh
 
 cat > configure.ac << 'END'
 AC_INIT([GNU C++/Libtool Demo], [0.73], address@hidden)
diff --git a/t/cxx.sh b/t/cxx.sh
index fc7fe96..744cde2 100755
--- a/t/cxx.sh
+++ b/t/cxx.sh
@@ -17,7 +17,7 @@
 # Test that '.c++' extension works.
 # From Ralf Corsepius.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CXX
diff --git a/t/cxx2.sh b/t/cxx2.sh
index 7ffba4e..4abcefc 100755
--- a/t/cxx2.sh
+++ b/t/cxx2.sh
@@ -16,7 +16,7 @@
 
 # Test that Automake suggests using AC_PROG_CXX if C++ sources are used.
 
-. ./defs || exit 1
+. test-init.sh
 
 echo AC_PROG_CC >>configure.ac
 
diff --git a/t/cxxcpp.sh b/t/cxxcpp.sh
index cd5d392..dca17c7 100755
--- a/t/cxxcpp.sh
+++ b/t/cxxcpp.sh
@@ -16,7 +16,7 @@
 
 # Make sure automake sees AC_PROG_CXXCPP.  From Garth Corral.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CXXCPP
diff --git a/t/cxxlibobj.sh b/t/cxxlibobj.sh
index b6d0231..7c95a4f 100755
--- a/t/cxxlibobj.sh
+++ b/t/cxxlibobj.sh
@@ -16,7 +16,7 @@
 
 # Test to make sure LIBOBJS and C++ sources work right.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CXX
diff --git a/t/cxxlink.sh b/t/cxxlink.sh
index ff271c3..734dc75 100755
--- a/t/cxxlink.sh
+++ b/t/cxxlink.sh
@@ -16,7 +16,7 @@
 
 # Test to make sure C++ linker is used when appropriate.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/cxxnoc.sh b/t/cxxnoc.sh
index b3e5631..1cdf58b 100755
--- a/t/cxxnoc.sh
+++ b/t/cxxnoc.sh
@@ -16,7 +16,7 @@
 
 # Test to make sure pure C++ sources don't include C-specific code.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CXX
diff --git a/t/cygnus-check-without-all.sh b/t/cygnus-check-without-all.sh
deleted file mode 100755
index ec87718..0000000
--- a/t/cygnus-check-without-all.sh
+++ /dev/null
@@ -1,50 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2010-2012 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, in cygnus mode, target "check" does not depend target
-# "all".
-
-. ./defs || exit 1
-
-cat >> configure.ac <<'END'
-AM_MAINTAINER_MODE
-AC_OUTPUT
-END
-
-cat > Makefile.am <<'END'
-all-local:
-       : > all-target-has-failed
-       exit 1
-check-local:
-       touch check-target-has-run
-END
-
-$ACLOCAL
-$AUTOMAKE --cygnus -Wno-obsolete
-
-$EGREP '(^| )all.*(:|:.* )check' Makefile.in && exit 1
-
-$AUTOCONF
-./configure
-
-$MAKE check
-test -f check-target-has-run
-test ! -e all-target-has-failed
-# Sanity checks.
-$MAKE && exit 1
-test -f all-target-has-failed
-
-:
diff --git a/t/cygnus-dependency-tracking.sh b/t/cygnus-dependency-tracking.sh
deleted file mode 100755
index 6fe7ede..0000000
--- a/t/cygnus-dependency-tracking.sh
+++ /dev/null
@@ -1,74 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2010-2012 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 cygnus mode disables automatic dependency tracking.
-# And check that this *cannot* be overridden.
-
-required=cc
-. ./defs || exit 1
-
-cat >> configure.ac <<'END'
-AM_MAINTAINER_MODE
-AC_PROG_CC
-AC_OUTPUT
-END
-
-cat > Makefile.am <<'END'
-AUTOMAKE_OPTIONS = -Wno-obsolete
-bin_PROGRAMS = foo
-foo_SOURCES = foo.c
-.PHONY: test-nodeps
-test-nodeps:
-       test ! -d .deps
-       test ! -d _deps
-       test ! -d '$(DEPDIR)'
-END
-
-cat > foo.c <<'END'
-#include "bar.h"
-int main ()
-{
-  GIVE_BACK 0;
-}
-END
-
-cat > bar.sav <<'END'
-#define GIVE_BACK return
-END
-
-cp bar.sav bar.h
-
-$ACLOCAL
-$AUTOMAKE --include-deps --cygnus --include-deps
-$AUTOCONF
-
-# Unknown options should cause just warnings from configure.
-./configure --enable-dependency-tracking
-$MAKE
-$MAKE test-nodeps
-
-: > bar.h
-$MAKE
-$MAKE test-nodeps
-
-# Sanity check.
-$MAKE clean
-$MAKE >out 2>&1 && { cat out; exit 1; }
-cat out
-# Not all compilers mention the undefined symbol in the error message.
-grep GIVE_BACK out || grep main out
-
-:
diff --git a/t/cygnus-deprecation.sh b/t/cygnus-deprecation.sh
deleted file mode 100755
index 551d0e6..0000000
--- a/t/cygnus-deprecation.sh
+++ /dev/null
@@ -1,68 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2012 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 support for Cygnus-style trees is deprecated.
-# That feature will be removed in the next major Automake release.
-# See automake bug#11034.
-
-. ./defs || exit 1
-
-warn_rx='support for Cygnus.*trees.*deprecated'
-
-cat >> configure.ac <<'END'
-AC_PROG_CC
-AM_MAINTAINER_MODE
-END
-
-$ACLOCAL
-$AUTOCONF
-
-: > Makefile.am
-
-# 'cygnus' option from command line
-$AUTOMAKE --cygnus -Wno-obsolete
-AUTOMAKE_fails --cygnus
-grep "^automake.*: .*$warn_rx" stderr
-AUTOMAKE_fails -Wnone -Wobsolete --cygnus
-grep "^automake.*: .*$warn_rx" stderr
-AUTOMAKE_fails --cygnus -Wnone -Wobsolete
-grep "^automake.*: .*$warn_rx" stderr
-
-rm -rf autom4te*.cache
-
-# 'cygnus' option in Makefile.am
-echo "AUTOMAKE_OPTIONS = cygnus" > Makefile.am
-cat Makefile.am # For debugging.
-$AUTOMAKE -Wno-obsolete
-AUTOMAKE_fails
-grep "^Makefile\.am:1:.*$warn_rx" stderr
-AUTOMAKE_fails -Wnone -Wobsolete
-grep "^Makefile\.am:1:.*$warn_rx" stderr
-
-rm -rf autom4te*.cache
-
-# 'cygnus' option in configure.ac
-: > Makefile.am
-sed "s|^\\(AM_INIT_AUTOMAKE\\).*|\1([cygnus])|" configure.ac > t
-diff configure.ac t && fatal_ "failed to edit configure.ac"
-mv -f t configure.ac
-$AUTOMAKE -Wno-obsolete
-AUTOMAKE_fails
-grep "^configure\.ac:2:.*$warn_rx" stderr
-AUTOMAKE_fails -Wnone -Wobsolete
-grep "^configure\.ac:2:.*$warn_rx" stderr
-
-:
diff --git a/t/cygnus-imply-foreign.sh b/t/cygnus-imply-foreign.sh
deleted file mode 100755
index 4612650..0000000
--- a/t/cygnus-imply-foreign.sh
+++ /dev/null
@@ -1,60 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2010-2012 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 'cygnus' mode imply 'foreign' mode.
-
-. ./defs || exit 1
-
-cat >> configure.ac <<'END'
-# This is *required* in cygnus mode
-AM_MAINTAINER_MODE
-END
-
-$ACLOCAL
-
-: > Makefile.am
-
-# We want complete control automake flags, while honouring the
-# user overrides for $AUTOMAKE.
-AUTOMAKE="$am_original_AUTOMAKE -Wno-obsolete"
-
-# Sanity check: gnu mode must complain about missing files and
-# portability problems.
-AUTOMAKE_fails
-grep 'required file.*README' stderr
-
-# But cygnus mode should imply foreign mode, so no complaints.
-# And cygnus mode should by able to override gnu and gnits modes.
-$AUTOMAKE --cygnus -Werror
-$AUTOMAKE --gnu --cygnus -Werror
-$AUTOMAKE --gnits --cygnus -Werror
-
-# Try again, this time enabling cygnus mode from Makefile.am.
-cp Makefile.am Makefile.sav
-echo 'AUTOMAKE_OPTIONS = gnu cygnus' >> Makefile.am
-$AUTOMAKE -Werror
-mv -f Makefile.sav Makefile.am
-
-# Try again, this time enabling cygnus mode from configure.ac.
-cp configure.ac configure.sav
-sed 's/^AM_INIT_AUTOMAKE/&([gnits cygnus])/' configure.sav >configure.ac
-cmp configure.ac configure.sav && fatal_ 'failed to edit configure.ac'
-
-$ACLOCAL --force
-$AUTOMAKE -Werror
-mv -f configure.sav configure.ac
-
-:
diff --git a/t/cygnus-no-dist.sh b/t/cygnus-no-dist.sh
deleted file mode 100755
index af2c45f..0000000
--- a/t/cygnus-no-dist.sh
+++ /dev/null
@@ -1,86 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2010-2012 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 cygnus mode forbids creation of distribution tarball.
-
-. ./defs || exit 1
-
-echo AM_MAINTAINER_MODE >> configure.ac
-mv -f configure.ac configure.stub
-
-cat configure.stub - > configure.ac <<'END'
-AC_OUTPUT
-END
-
-: > Makefile.am
-
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE --cygnus -Wno-obsolete
-
-./configure
-$MAKE
-
-for target in dist distdir distcheck dist-all dist-gzip; do
-  $MAKE -n $target >out 2>&1 && { cat out; exit 1; }
-  cat out
-  grep $target out
-done
-
-# Now check that cygnus mode in a subdirectory disables
-# distribution-building in that subdirectory.
-
-cat > Makefile.am <<'END'
-SUBDIRS = sub1 sub2
-END
-
-mkdir sub1 sub2
-: > sub1/Makefile.am
-cat > sub2/Makefile.am <<'END'
-# The '-Wall' after 'cygnus' should ensure no warning gets
-# unintentionally disabled.  We are particularly interested
-# in override warnings, for when (below) we add the 'distdir'
-# target.
-AUTOMAKE_OPTIONS = cygnus -Wall
-# This is required because the 'cygnus' option is now deprecated.
-AUTOMAKE_OPTIONS += -Wno-obsolete
-END
-
-cat configure.stub - > configure.ac <<'END'
-AC_CONFIG_FILES([sub1/Makefile sub2/Makefile])
-AC_OUTPUT
-END
-
-$AUTOCONF
-$AUTOMAKE
-
-./configure
-$MAKE
-cd sub2
-$MAKE -n distdir >out 2>&1 && { cat out; exit 1; }
-grep distdir out
-cd ..
-
-cat >> sub2/Makefile.am <<'END'
-distdir:
-END
-$AUTOMAKE sub2/Makefile
-./config.status sub2/Makefile
-
-$MAKE distdir
-$MAKE dist
-
-:
diff --git a/t/cygnus-no-installinfo.sh b/t/cygnus-no-installinfo.sh
deleted file mode 100755
index 8fe5195..0000000
--- a/t/cygnus-no-installinfo.sh
+++ /dev/null
@@ -1,55 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2010-2012 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 cygnus mode enables the 'no-installinfo' option.
-
-required=makeinfo
-. ./defs || exit 1
-
-cat >> configure.ac <<'END'
-AM_MAINTAINER_MODE
-AC_OUTPUT
-END
-
-cat > Makefile.am <<'END'
-info_TEXINFOS = foo.texi
-END
-
-cat > foo.texi <<'END'
address@hidden foo.info
-END
-
-$ACLOCAL
-# -Wno-override works around a buglet in definition of $(MAKEINFO)
-# in cygnus mode; see also xfailing test 'txinfo5.test'.
-# -Wno-obsolete accounts for the fact that the cygnus mode is now
-# deprecated.
-$AUTOMAKE --cygnus -Wno-override -Wno-obsolete
-$AUTOCONF
-
-cwd=$(pwd) || exit 1
-./configure --prefix="$cwd"/_inst
-$MAKE
-$MAKE install
-test ! -e _inst
-test ! -e foo.info
-test ! -e _inst/share/info
-$MAKE install-info
-ls -l _inst
-test -f foo.info
-test -f _inst/share/info/foo.info
-
-:
diff --git a/t/cygnus-no-more.sh b/t/cygnus-no-more.sh
new file mode 100755
index 0000000..33803b1
--- /dev/null
+++ b/t/cygnus-no-more.sh
@@ -0,0 +1,46 @@
+#! /bin/sh
+# Copyright (C) 2012 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 support for Cygnus-style trees is deprecated.
+# That feature will be removed in the next major Automake release.
+# See automake bug#11034.
+
+. test-init.sh
+
+warn_rx='support for Cygnus.*trees.*removed'
+
+$ACLOCAL
+
+# Use of 'cygnus' option must raise an unconditional error, not a
+# warning.
+AUTOMAKE="$am_original_AUTOMAKE -Wnone -Wno-error"
+
+# 'cygnus' option in Makefile.am
+echo "AUTOMAKE_OPTIONS = cygnus" > Makefile.am
+AUTOMAKE_fails
+grep "^Makefile\.am:1:.*$warn_rx" stderr
+
+rm -rf autom4te*.cache
+
+# 'cygnus' option in configure.ac
+: > Makefile.am
+sed "s|^\\(AM_INIT_AUTOMAKE\\).*|\1([cygnus])|" configure.ac > t
+diff configure.ac t && fatal_ "failed to edit configure.ac"
+mv -f t configure.ac
+AUTOMAKE_fails
+grep "^configure\.ac:2:.*$warn_rx" stderr
+
+:
diff --git a/t/cygnus-requires-maintainer-mode.sh 
b/t/cygnus-requires-maintainer-mode.sh
deleted file mode 100755
index 978df8c..0000000
--- a/t/cygnus-requires-maintainer-mode.sh
+++ /dev/null
@@ -1,53 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2010-2012 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, in cygnus mode, maintainer mode is required.
-
-. ./defs || exit 1
-
-: > Makefile.am
-
-$ACLOCAL
-AUTOMAKE_fails -Wno-obsolete --cygnus
-grep '^configure\.ac:.*AM_MAINTAINER_MODE.*required.*cygnus' stderr
-
-cat >> configure.ac <<'END'
-AC_CONFIG_FILES([sub/Makefile])
-END
-
-cat > Makefile.am <<'END'
-SUBDIRS = sub
-END
-
-mkdir sub
-cat > sub/Makefile.am <<'END'
-AUTOMAKE_OPTIONS = -Wno-obsolete cygnus
-END
-
-rm -rf autom4te.cache
-$ACLOCAL
-AUTOMAKE_fails
-grep '^configure\.ac:.*AM_MAINTAINER_MODE.*required.*cygnus' stderr
-
-cat >> configure.ac <<'END'
-AM_MAINTAINER_MODE
-END
-
-rm -rf autom4te.cache
-$ACLOCAL
-$AUTOMAKE --cygnus -Wno-obsolete
-
-:
diff --git a/t/cygwin32.sh b/t/cygwin32.sh
index 95b442e..7163884 100755
--- a/t/cygwin32.sh
+++ b/t/cygwin32.sh
@@ -16,7 +16,7 @@
 
 # Test basic Cygwin32 functionality.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/dash.sh b/t/dash.sh
index 6c9c9e0..4cf34f3 100755
--- a/t/dash.sh
+++ b/t/dash.sh
@@ -17,7 +17,7 @@
 # Test to make sure '-' can be used in path.
 # Report from Matthew D. Langston.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am << 'END'
 include Make-lang
diff --git a/t/defun.sh b/t/defun.sh
index 5a4530c..0f6bd0a 100755
--- a/t/defun.sh
+++ b/t/defun.sh
@@ -16,7 +16,7 @@
 
 # Make sure aclocal picks up on all macro definitions.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > acinclude.m4 << 'END'
 AC_DEFUN([AM_FUNC_THREE])
diff --git a/t/defun2.sh b/t/defun2.sh
index 2c74cc4..cb1cee7 100755
--- a/t/defun2.sh
+++ b/t/defun2.sh
@@ -17,7 +17,7 @@
 # Make sure we don't mistake a macro definition for an invocation.
 # From Jim Meyering.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 dnl if buggy this will require getloadavg.c
diff --git a/t/dejagnu-absolute-builddir.sh b/t/dejagnu-absolute-builddir.sh
index 22f7cc5..6b873d0 100755
--- a/t/dejagnu-absolute-builddir.sh
+++ b/t/dejagnu-absolute-builddir.sh
@@ -18,7 +18,7 @@
 # to an absolute path.
 
 required=runtest
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_OUTPUT
diff --git a/t/dejagnu-relative-srcdir.sh b/t/dejagnu-relative-srcdir.sh
index 9fdf179..141f56e 100755
--- a/t/dejagnu-relative-srcdir.sh
+++ b/t/dejagnu-relative-srcdir.sh
@@ -18,7 +18,7 @@
 # (both as TCL variable and as environment variable).
 
 required=runtest
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_OUTPUT
diff --git a/t/dejagnu-siteexp-append.sh b/t/dejagnu-siteexp-append.sh
index c980c85..07254ca 100755
--- a/t/dejagnu-siteexp-append.sh
+++ b/t/dejagnu-siteexp-append.sh
@@ -17,7 +17,7 @@
 # Check that the files in $(EXTRA_DEJAGNU_SITE_CONFIG) get appended to
 # site.exp in the same order in which they're listed in that variable.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_OUTPUT
diff --git a/t/dejagnu-siteexp-extend.sh b/t/dejagnu-siteexp-extend.sh
index 45d8a22..8c16c54 100755
--- a/t/dejagnu-siteexp-extend.sh
+++ b/t/dejagnu-siteexp-extend.sh
@@ -18,7 +18,7 @@
 # automake-generated Makefile.
 
 required=runtest
-. ./defs || exit 1
+. test-init.sh
 
 write_check_for ()
 {
diff --git a/t/dejagnu-siteexp-useredit.sh b/t/dejagnu-siteexp-useredit.sh
index 42f4d44..207d8a1 100755
--- a/t/dejagnu-siteexp-useredit.sh
+++ b/t/dejagnu-siteexp-useredit.sh
@@ -17,7 +17,7 @@
 # Check that the user can edit the Makefile-generated site.exp, and
 # have its edits survive to the remaking of that file.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_OUTPUT
diff --git a/t/dejagnu.sh b/t/dejagnu.sh
index 7583347..0293de5 100755
--- a/t/dejagnu.sh
+++ b/t/dejagnu.sh
@@ -17,7 +17,7 @@
 # Superficial test to check that dejagnu tests and automake-style
 # tests can coexist.  See also related deeper test 'check12.sh'.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am << 'END'
 AUTOMAKE_OPTIONS = dejagnu
diff --git a/t/dejagnu2.sh b/t/dejagnu2.sh
index 5b75bb6..78cfb15 100755
--- a/t/dejagnu2.sh
+++ b/t/dejagnu2.sh
@@ -16,7 +16,7 @@
 
 # Make sure we don't override the user's site.exp rule.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac <<'END'
 AC_OUTPUT
diff --git a/t/dejagnu3.sh b/t/dejagnu3.sh
index 42345be..4b25805 100755
--- a/t/dejagnu3.sh
+++ b/t/dejagnu3.sh
@@ -17,7 +17,7 @@
 # Check that the DejaGnu rules work for a simple program and test case.
 
 required=runtest
-. ./defs || exit 1
+. test-init.sh
 
 cat > hammer << 'END'
 #! /bin/sh
diff --git a/t/dejagnu4.sh b/t/dejagnu4.sh
index 655218b..18119b0 100755
--- a/t/dejagnu4.sh
+++ b/t/dejagnu4.sh
@@ -24,7 +24,7 @@
 #   previous tools, but at first glance "make check" has passed.
 
 required=runtest
-. ./defs || exit 1
+. test-init.sh
 
 cat > hammer << 'END'
 #! /bin/sh
diff --git a/t/dejagnu5.sh b/t/dejagnu5.sh
index d64a7f2..816a652 100755
--- a/t/dejagnu5.sh
+++ b/t/dejagnu5.sh
@@ -18,7 +18,7 @@
 # the package by default.
 
 required=runtest
-. ./defs || exit 1
+. test-init.sh
 
 package=$me
 
diff --git a/t/dejagnu6.sh b/t/dejagnu6.sh
index 80ff027..71998cc 100755
--- a/t/dejagnu6.sh
+++ b/t/dejagnu6.sh
@@ -17,7 +17,7 @@
 # Check that "make check" fails, when a DejaGnu test fails.
 
 required=runtest
-. ./defs || exit 1
+. test-init.sh
 
 cat > faildeja << 'END'
 #! /bin/sh
diff --git a/t/dejagnu7.sh b/t/dejagnu7.sh
index d34931b..17e5a18 100755
--- a/t/dejagnu7.sh
+++ b/t/dejagnu7.sh
@@ -18,7 +18,7 @@
 # (to detect TCL errors) on a file with TCL errors.
 
 required=runtest
-. ./defs || exit 1
+. test-init.sh
 
 runtest --help | grep '.*--status' \
   || skip_ "dejagnu lacks support for '--status'"
diff --git a/t/deleted-am.sh b/t/deleted-am.sh
index 9dc015a..ee17a29 100755
--- a/t/deleted-am.sh
+++ b/t/deleted-am.sh
@@ -19,7 +19,7 @@
 # erroring out when a still-required file is missing.
 # See also discussion about automake bug#9768.
 
-. ./defs || exit 1
+. test-init.sh
 
 echo AC_OUTPUT >> configure.ac
 
diff --git a/t/deleted-m4.sh b/t/deleted-m4.sh
index 296f453..841e30e 100755
--- a/t/deleted-m4.sh
+++ b/t/deleted-m4.sh
@@ -19,7 +19,7 @@
 # erroring out when a still-required file is missing.
 # See also discussion about automake bug#9768.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac <<'END'
 m4_include([foobar.m4])
diff --git a/t/depacl2.sh b/t/depacl2.sh
index 897a5a2..c7fd85e 100755
--- a/t/depacl2.sh
+++ b/t/depacl2.sh
@@ -17,7 +17,7 @@
 # Test to make sure dependencies work when required macro is part of
 # autoconf.
 
-. ./defs || exit 1
+. test-init.sh
 
 echo 'AM_FOO' >> configure.ac
 echo 'AC_DEFUN([AM_FOO], [AC_REQUIRE([AC_HEADER_STDC])])' > AM_FOO.m4
diff --git a/t/depcomp-implicit-auxdir.sh b/t/depcomp-implicit-auxdir.sh
index dc93a85..964b720 100755
--- a/t/depcomp-implicit-auxdir.sh
+++ b/t/depcomp-implicit-auxdir.sh
@@ -17,7 +17,7 @@
 # Make sure a top-level depcomp file is found when
 # AC_CONFIG_AUX_DIR is not specified.
 
-. ./defs || exit 1
+. test-init.sh
 
 mkdir lib src
 
diff --git a/t/depcomp.sh b/t/depcomp.sh
index 63c702f..33c293d 100755
--- a/t/depcomp.sh
+++ b/t/depcomp.sh
@@ -17,7 +17,7 @@
 # Test to make sure depcomp is installed and found properly
 # when required for multiple directories.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > configure.ac << END
 AC_INIT([$me], [1.0])
diff --git a/t/depcomp2.sh b/t/depcomp2.sh
index c29d9cd..a00236f 100755
--- a/t/depcomp2.sh
+++ b/t/depcomp2.sh
@@ -18,7 +18,7 @@
 # From Pavel Roskin.
 
 required=cc
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_CONFIG_FILES([subdir/Makefile])
diff --git a/t/depcomp8a.sh b/t/depcomp8a.sh
index 4e34777..3d58a3e 100755
--- a/t/depcomp8a.sh
+++ b/t/depcomp8a.sh
@@ -20,7 +20,7 @@
 # same thing for libtool objects.
 
 required=cc
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
@@ -37,12 +37,15 @@ mkdir sub
 cat > foo.c << 'END'
 int main (void)
 {
-  extern int bar;
-  return bar;
+  extern int bar (void);
+  return bar ();
 }
 END
 cat > sub/bar.c << 'END'
-extern int bar = 0;
+int bar (void)
+{
+  return 0;
+}
 END
 
 $ACLOCAL
diff --git a/t/depcomp8b.sh b/t/depcomp8b.sh
index 3e26392..6fed215 100755
--- a/t/depcomp8b.sh
+++ b/t/depcomp8b.sh
@@ -20,7 +20,7 @@
 # same thing for non-libtool objects.
 
 required='cc libtoolize'
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
@@ -36,8 +36,8 @@ libzardoz_la_SOURCES = foo.c sub/bar.c
 END
 
 mkdir sub
-echo 'extern int foo = 0;' > foo.c
-echo 'extern int bar = 0;' > sub/bar.c
+echo 'int foo (void) { return 0; }' > foo.c
+echo 'int bar (void) { return 0; }' > sub/bar.c
 
 libtoolize
 
diff --git a/t/depdist.sh b/t/depdist.sh
index 8965cd8..e6b2459 100755
--- a/t/depdist.sh
+++ b/t/depdist.sh
@@ -18,7 +18,7 @@
 # From Eric Magnien.
 
 required=cc
-. ./defs || exit 1
+. test-init.sh
 
 rm -f configure.ac
 
diff --git a/t/depend.sh b/t/depend.sh
index 846a424..9dbbe82 100755
--- a/t/depend.sh
+++ b/t/depend.sh
@@ -18,7 +18,7 @@
 # In some cases the auto-dependency can get confused and try
 # to '-include' a directory (if a backslash-newline appears in _SOURCES).
 
-. ./defs || exit 1
+. test-init.sh
 
 echo AC_PROG_CC >> configure.ac
 
diff --git a/t/depend3.sh b/t/depend3.sh
index 65f83ce..fddc968 100755
--- a/t/depend3.sh
+++ b/t/depend3.sh
@@ -16,7 +16,7 @@
 
 # Test _DEPENDENCIES variable.  From Lee Iverson.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/depend4.sh b/t/depend4.sh
index 3a71741..ddd77eb 100755
--- a/t/depend4.sh
+++ b/t/depend4.sh
@@ -16,7 +16,7 @@
 
 # Check that dependencies are included when there are many header files.
 
-. ./defs || exit 1
+. test-init.sh
 
 echo AC_PROG_CC >> configure.ac
 
diff --git a/t/depend5.sh b/t/depend5.sh
index 2bc6a8f..518e00d 100755
--- a/t/depend5.sh
+++ b/t/depend5.sh
@@ -18,7 +18,7 @@
 # quoting in $CONFIG_FILES, done by newer Autoconf.
 
 required=cc
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac << END
 AC_PROG_CC
@@ -47,9 +47,8 @@ else
   depdir=
 fi
 
-# For the fun of it, we should also cope with makefile
-# names that contain weird characters, with Autoconf 2.62
-# and newer.
+# For the fun of it, we should also cope with Makefile names
+# that contain weird characters and newer.
 # Pick the first name that the file system will accept.
 for name in \
   'weird  name with $ `#() &! characters"' \
diff --git a/t/depend6.sh b/t/depend6.sh
index 0795f93..4878b50 100755
--- a/t/depend6.sh
+++ b/t/depend6.sh
@@ -17,7 +17,7 @@
 # Check for _AM_OUTPUT_DEPENDENCY_COMMANDS grouping bug,
 # reported by Markus Duft.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac << END
 AC_PROG_CC
diff --git a/t/deprecated-acinit.sh b/t/deprecated-acinit.sh
index 516b139..60b3e5a 100755
--- a/t/deprecated-acinit.sh
+++ b/t/deprecated-acinit.sh
@@ -17,7 +17,7 @@
 # Check that automake and autoconf complain about an old-style AC_INIT
 # call used with a new-style AM_AUTOMAKE_INIT call.
 
-. ./defs || exit 1
+. test-init.sh
 
 : > Makefile.am
 
diff --git a/t/destdir.sh b/t/destdir.sh
index f10480b..6b27984 100755
--- a/t/destdir.sh
+++ b/t/destdir.sh
@@ -21,7 +21,7 @@
 # It will only work for non-root users.
 required='ro-dir'
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac <<'EOF'
 AC_OUTPUT
diff --git a/t/dir-named-obj-is-bad.sh b/t/dir-named-obj-is-bad.sh
index d14f8c8..7b77a90 100755
--- a/t/dir-named-obj-is-bad.sh
+++ b/t/dir-named-obj-is-bad.sh
@@ -16,7 +16,7 @@
 
 # Naming a subdirectory 'obj/' is a bad idea.  Automake should say so.
 
-. ./defs || exit 1
+. test-init.sh
 
 mkdir obj
 
diff --git a/t/dirlist-abspath.sh b/t/dirlist-abspath.sh
deleted file mode 100755
index 3c25fba..0000000
--- a/t/dirlist-abspath.sh
+++ /dev/null
@@ -1,42 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2002-2012 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 use of absolute paths in dirlist.
-
-am_create_testdir=empty
-. ./defs || exit 1
-
-mkdir acdir-more sub sub/acdir
-echo "$(pwd)/acdir-more" > sub/acdir/dirlist
-
-echo 'AC_DEFUN([AM_FOO], [foo-foo--foo])' > acdir-more/foo.m4
-
-cd sub
-
-cat > configure.ac <<EOF
-AC_INIT([$me], [1.0])
-AM_FOO
-EOF
-
-$ACLOCAL --system-acdir acdir
-$AUTOCONF
-
-# Only -I directories are subject to file inclusion.
-grep m4_include aclocal.m4 && exit 1
-
-grep 'foo-foo--foo' configure
-
-:
diff --git a/t/dirlist.sh b/t/dirlist.sh
deleted file mode 100755
index e188777..0000000
--- a/t/dirlist.sh
+++ /dev/null
@@ -1,57 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2002-2012 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 dirlist support.
-
-. ./defs || exit 1
-
-cat > configure.ac <<EOF
-AC_INIT
-AM_INIT_GUILE_MODULE
-EOF
-
-mkdir acdir dirlist-test
-echo ./dirlist-test > acdir/dirlist
-
-cat >dirlist-test/dirlist-check.m4 <<'END'
-AC_DEFUN([AM_INIT_GUILE_MODULE],[
-. $srcdir/../GUILE-VERSION
-AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
-AC_CONFIG_AUX_DIR(..)
-module=[$1]
-AC_SUBST(module)])
-END
-
-cat >dirlist-test/init.m4 <<EOF
-AC_DEFUN([AM_INIT_AUTOMAKE], [I should not be included])
-EOF
-
-$ACLOCAL --system-acdir acdir
-$AUTOCONF
-
-# There should be no m4_include in aclocal.m4, even though m4/dirlist
-# contains './dirlist-test' as a relative directory.  Only -I directories
-# are subject to file inclusion.
-grep m4_include aclocal.m4 && exit 1
-
-grep 'GUILE-VERSION' configure
-
-# This bug can occur only when we do a VPATH build of Automake
-# (because of the '-I' passed to aclocal in tests/defs/aclocal.in) but
-# it's OK because VPATH builds are done by 'make distcheck'.
-grep 'I should not be included' configure && exit 1
-
-:
diff --git a/t/dirlist2.sh b/t/dirlist2.sh
deleted file mode 100755
index 5a11769..0000000
--- a/t/dirlist2.sh
+++ /dev/null
@@ -1,60 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2002-2012 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 dirlist globbing support.
-
-. ./defs || exit 1
-
-cat > configure.ac <<EOF
-AC_INIT
-AM_INIT_GUILE_MODULE
-AM_FOO_BAR
-EOF
-
-mkdir dirlist21-test dirlist22-test
-
-cat >dirlist21-test/dirlist21-check.m4 <<'END'
-AC_DEFUN([AM_INIT_GUILE_MODULE],[
-. $srcdir/../GUILE-VERSION
-AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
-AC_CONFIG_AUX_DIR(..)
-module=[$1]
-AC_SUBST(module)])
-END
-
-cat >dirlist22-test/dirlist22-check.m4 <<'END'
-AC_DEFUN([AM_FOO_BAR],[
-: foo bar baz
-])
-END
-
-mkdir my-acdir
-cat > my-acdir/dirlist <<'END'
-dirlist2*-test
-END
-
-$ACLOCAL --system-acdir my-acdir
-$AUTOCONF
-
-# There should be no m4_include in aclocal.m4, even though m4/dirlist
-# contains './dirlist-test' as a relative directory.  Only -I directories
-# are subject to file inclusion.
-grep m4_include aclocal.m4 && exit 1
-
-grep 'GUILE-VERSION' configure
-grep 'foo bar baz' configure
-
-:
diff --git a/t/discover.sh b/t/discover.sh
index 4ecf2ef..df11ca3 100755
--- a/t/discover.sh
+++ b/t/discover.sh
@@ -16,7 +16,7 @@
 
 # Test to make sure LIBOBJS file cannot be mentioned explicitly.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_RANLIB
diff --git a/t/dist-auxdir-many-subdirs.sh b/t/dist-auxdir-many-subdirs.sh
index eb6b98c..334e3bd 100755
--- a/t/dist-auxdir-many-subdirs.sh
+++ b/t/dist-auxdir-many-subdirs.sh
@@ -19,7 +19,7 @@
 
 am_create_testdir=empty
 required=cc
-. ./defs || exit 1
+. test-init.sh
 
 count=0
 ocwd=$(pwd) || fatal_ "cannot get current working directory"
@@ -41,7 +41,7 @@ do_check ()
   unindent > configure.ac << END
     AC_INIT([$me], [$count])
     AC_CONFIG_AUX_DIR([$auxdir])
-    AM_INIT_AUTOMAKE([parallel-tests])
+    AM_INIT_AUTOMAKE
     AC_PROG_CC
     # We don't want to require python or emcas in this test, so
     # the tricks below.
@@ -56,8 +56,6 @@ END
     foo_SOURCES = foo.c
     ## For py-compile.
     python_PYTHON = bar.py
-    ## For elisp-comp.
-    lisp_LISP = baz.el
     ## For test-driver.
     TESTS =
 END
@@ -67,7 +65,6 @@ END
     missing
     depcomp
     py-compile
-    elisp-comp
     test-driver
   '
 
diff --git a/t/dist-auxfile-2.sh b/t/dist-auxfile-2.sh
index c11083a..cd62ef0 100755
--- a/t/dist-auxfile-2.sh
+++ b/t/dist-auxfile-2.sh
@@ -20,7 +20,7 @@
 # Related to automake bug#9651.
 
 am_create_testdir=empty
-. ./defs || exit 1
+. test-init.sh
 
 cat > configure.ac <<END
 AC_INIT([$me], [1.0])
diff --git a/t/dist-auxfile.sh b/t/dist-auxfile.sh
index 21c100c..7769979 100755
--- a/t/dist-auxfile.sh
+++ b/t/dist-auxfile.sh
@@ -20,7 +20,7 @@
 # directory was set to '.' by AC_CONFIG_AUX_DIR.
 
 am_create_testdir=empty
-. ./defs || exit 1
+. test-init.sh
 
 i=0
 for auxdir in build-aux ''; do
diff --git a/t/dist-formats.tap b/t/dist-formats.tap
index 893aa55..6f21713 100755
--- a/t/dist-formats.tap
+++ b/t/dist-formats.tap
@@ -18,7 +18,7 @@
 # archives.
 
 am_create_testdir=empty
-. ./defs || exit 1
+. test-init.sh
 
 plan_ 70
 
diff --git a/t/dist-included-parent-dir.sh b/t/dist-included-parent-dir.sh
index aed1051..6c225a9 100755
--- a/t/dist-included-parent-dir.sh
+++ b/t/dist-included-parent-dir.sh
@@ -16,7 +16,7 @@
 
 # Make sure included files in parent directory are distributed.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_CONFIG_FILES([sub/Makefile])
diff --git a/t/dist-missing-am.sh b/t/dist-missing-am.sh
index 80254c4..2774fa6 100755
--- a/t/dist-missing-am.sh
+++ b/t/dist-missing-am.sh
@@ -19,7 +19,7 @@
 # required '.am' file from a distribution tarball.
 # See discussion about automake bug#9768.
 
-. ./defs || exit 1
+. test-init.sh
 
 echo AC_OUTPUT >> configure.ac
 
diff --git a/t/dist-missing-included-m4.sh b/t/dist-missing-included-m4.sh
index 93d11b7..81fce45 100755
--- a/t/dist-missing-included-m4.sh
+++ b/t/dist-missing-included-m4.sh
@@ -20,7 +20,7 @@
 # See discussion about automake bug#9768.
 # See also sister test 'dist-missing-m4.sh'.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac <<'END'
 m4_include([foobar.m4])
diff --git a/t/dist-missing-m4.sh b/t/dist-missing-m4.sh
index 4ab1e16..e0ed886 100755
--- a/t/dist-missing-m4.sh
+++ b/t/dist-missing-m4.sh
@@ -20,7 +20,7 @@
 # See discussion about automake bug#9768.
 # See also sister test 'dist-missing-included-m4.sh'.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac <<'END'
 m4_pattern_forbid([^MY_])
diff --git a/t/dist-pr109765.sh b/t/dist-pr109765.sh
index 50085a6..5c47669 100755
--- a/t/dist-pr109765.sh
+++ b/t/dist-pr109765.sh
@@ -19,7 +19,7 @@
 # so that the latter ones fail.
 
 required=bzip2
-. ./defs || exit 1
+. test-init.sh
 
 echo AC_OUTPUT >> configure.ac
 : > Makefile.am
diff --git a/t/dist-readonly.sh b/t/dist-readonly.sh
index b7b0e0e..ab000ee 100755
--- a/t/dist-readonly.sh
+++ b/t/dist-readonly.sh
@@ -20,7 +20,7 @@
 # This test expect the user to be unable to write on files lacking
 # write permissions -- so it won't work if the user is 'root'.
 required='non-root cc'
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/dist-repeated.sh b/t/dist-repeated.sh
index 491cf29..edfbc0f 100755
--- a/t/dist-repeated.sh
+++ b/t/dist-repeated.sh
@@ -18,7 +18,7 @@
 # The distdir target should take care of not copying it more than one
 # time anyway.
 
-. ./defs || exit 1
+. test-init.sh
 
 echo AC_OUTPUT >> configure.ac
 
diff --git a/t/distcheck-configure-flags-am.sh 
b/t/distcheck-configure-flags-am.sh
index 11c992c..330fde1 100755
--- a/t/distcheck-configure-flags-am.sh
+++ b/t/distcheck-configure-flags-am.sh
@@ -17,7 +17,7 @@
 # Check support for AM_DISTCHECK_CONFIGURE_FLAGS at "make distcheck"
 # time, and its interactions with DISTCHECK_CONFIGURE_FLAGS.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_ARG_ENABLE([success], [], [success=$enableval], [success=no])
diff --git a/t/distcheck-configure-flags-subpkg.sh 
b/t/distcheck-configure-flags-subpkg.sh
index f5bc15d..480ad44 100755
--- a/t/distcheck-configure-flags-subpkg.sh
+++ b/t/distcheck-configure-flags-subpkg.sh
@@ -20,7 +20,7 @@
 # passed down to the configure script of the subpackage.  This is
 # explicitly documented in the manual.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_CONFIG_SUBDIRS([subpkg])
diff --git a/t/distcheck-configure-flags.sh b/t/distcheck-configure-flags.sh
index e10b2ba..42dda30 100755
--- a/t/distcheck-configure-flags.sh
+++ b/t/distcheck-configure-flags.sh
@@ -16,7 +16,7 @@
 
 # Check support for DISTCHECK_CONFIGURE_FLAGS at "make distcheck" time.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_ARG_ENABLE([success], [], [success=$enableval], [success=no])
diff --git a/t/distcheck-hook.sh b/t/distcheck-hook.sh
index 81a6646..f55918f 100755
--- a/t/distcheck-hook.sh
+++ b/t/distcheck-hook.sh
@@ -16,7 +16,7 @@
 
 # Check basic support for distcheck-hook.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_OUTPUT
diff --git a/t/distcheck-hook2.sh b/t/distcheck-hook2.sh
index ee177ee..6b4d588 100755
--- a/t/distcheck-hook2.sh
+++ b/t/distcheck-hook2.sh
@@ -18,7 +18,7 @@
 # Automake, and that a used-defined 'distcheck-hook' is *not* honored
 # in a subpackage Makefile.am.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_CONFIG_SUBDIRS([subpkg])
diff --git a/t/distcheck-missing-m4.sh b/t/distcheck-missing-m4.sh
index e903cfe..c35da0c 100755
--- a/t/distcheck-missing-m4.sh
+++ b/t/distcheck-missing-m4.sh
@@ -18,7 +18,7 @@
 # missing from the dist tarball (interaction with '--install').
 # See automake bug#9037.
 
-. ./defs || exit 1
+. test-init.sh
 
 cwd=$(pwd) || fatal_ "cannot get current working directory"
 
diff --git a/t/distcheck-outdated-m4.sh b/t/distcheck-outdated-m4.sh
index 449ed0f..fe2fab2 100755
--- a/t/distcheck-outdated-m4.sh
+++ b/t/distcheck-outdated-m4.sh
@@ -18,7 +18,7 @@
 # files in a dist tarball (interaction with '--install').
 # See automake bug#9037.
 
-. ./defs || exit 1
+. test-init.sh
 
 cwd=$(pwd) || fatal_ "cannot get current working directory"
 
diff --git a/t/distcheck-override-infodir.sh b/t/distcheck-override-infodir.sh
index e65078f..607c573 100755
--- a/t/distcheck-override-infodir.sh
+++ b/t/distcheck-override-infodir.sh
@@ -18,7 +18,7 @@
 # working.  Related to automake bug#9579.
 
 required='makeinfo tex texi2dvi install-info'
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_OUTPUT
diff --git a/t/distcheck-pr10470.sh b/t/distcheck-pr10470.sh
index d888a99..89a21fe 100755
--- a/t/distcheck-pr10470.sh
+++ b/t/distcheck-pr10470.sh
@@ -19,7 +19,7 @@
 # by a process (e.g., that is its "current working directory").
 # See automake bug#10470.
 
-. ./defs || exit 1
+. test-init.sh
 
 mkdir foo.d
 sh -c "cd foo.d && sleep '4'" &
diff --git a/t/distcheck-pr9579.sh b/t/distcheck-pr9579.sh
index ae1da2b..8c6b6da 100755
--- a/t/distcheck-pr9579.sh
+++ b/t/distcheck-pr9579.sh
@@ -17,7 +17,7 @@
 # Check against automake bug#9579: distcheck does not always detect
 # incomplete uninstall as advertised.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_OUTPUT
diff --git a/t/distcheck-writable-srcdir.sh b/t/distcheck-writable-srcdir.sh
index 034dc1e..4dfd21f 100755
--- a/t/distcheck-writable-srcdir.sh
+++ b/t/distcheck-writable-srcdir.sh
@@ -21,7 +21,7 @@
 # case too (since it doesn't cost us anything but this test).
 # See automake bug#10878.
 
-. ./defs || exit 1
+. test-init.sh
 
 echo AC_OUTPUT >> configure.ac
 
diff --git a/t/distcleancheck.sh b/t/distcleancheck.sh
index 5cdd6f1..213ee4e 100755
--- a/t/distcleancheck.sh
+++ b/t/distcleancheck.sh
@@ -18,7 +18,7 @@
 # The example Makefile.am we use is from the FAQ entry 'distcleancheck'.
 
 required=cc
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/distcom-subdir.sh b/t/distcom-subdir.sh
index cb4d9c3..b0cbf12 100755
--- a/t/distcom-subdir.sh
+++ b/t/distcom-subdir.sh
@@ -17,7 +17,7 @@
 # Test to make sure that if an auxfile (here depcomp) is required
 # by a subdir Makefile.am, it is distributed by that Makefile.am.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_CONFIG_FILES([subdir/Makefile])
@@ -50,7 +50,7 @@ test -f depcomp
 
 # FIXME: the logic of this check and other similar ones in other
 # FIXME: 'distcom*.sh' files should be factored out in a common
-# FIXME: subroutine in 'defs'...
+# FIXME: subroutine in 'am-test-lib.sh'...
 sed -n -e "
   /^DIST_COMMON =.*\\\\$/ {
     :loop
diff --git a/t/distcom2.sh b/t/distcom2.sh
index 27b7dc9..1fba523 100755
--- a/t/distcom2.sh
+++ b/t/distcom2.sh
@@ -18,7 +18,7 @@
 # Report from Pavel Roskin.  Report of problems with '--no-force' from
 # Scott James Remnant (Debian #206299)
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
@@ -52,7 +52,7 @@ for opt in '' --no-force; do
   for dir in . subdir; do
     # FIXME: the logic of this check and other similar ones in other
     # FIXME: 'distcom*.sh' files should be factored out in a common
-    # FIXME: subroutine in 'defs'...
+    # FIXME: subroutine in 'am-test-lib.sh'...
     sed -n -e "
       /^DIST_COMMON =.*\\\\$/ {
         :loop
diff --git a/t/distcom3.sh b/t/distcom3.sh
index a2ffe0b..35dc739 100755
--- a/t/distcom3.sh
+++ b/t/distcom3.sh
@@ -17,7 +17,7 @@
 # Test to make sure that non-existing common files are distributed
 # if they are buildable.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am << 'END'
 README:
diff --git a/t/distcom4.sh b/t/distcom4.sh
index 8786ca2..04e9cdc 100755
--- a/t/distcom4.sh
+++ b/t/distcom4.sh
@@ -18,9 +18,8 @@
 # This tries to distribute a file from a subdirectory, without
 # Makefile in that directory.  'distcom5.sh' performs the same
 # test with a Makefile in the directory.
-# Also make sure that README appears first in DIST_COMMON.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
    AC_CONFIG_FILES([tests/autoconf:tests/wrapper.in],
@@ -71,7 +70,5 @@ cat dc.txt # For debugging.
 
 test 1 -eq $(grep -c tests dc.txt)
 grep configure dc.txt
-# README must come first.
-grep 'DIST_COMMON = README' Makefile.in
 
 :
diff --git a/t/distcom5.sh b/t/distcom5.sh
index 6a2c736..29ea76c 100755
--- a/t/distcom5.sh
+++ b/t/distcom5.sh
@@ -19,7 +19,7 @@
 # a Makefile in that directory.  'distcom4.sh' performs the same
 # test without Makefile in the directory.
 
-. ./defs || exit 1
+. test-init.sh
 
 extract_distcommon ()
 {
diff --git a/t/distdir.sh b/t/distdir.sh
index 9600746..d4694fb 100755
--- a/t/distdir.sh
+++ b/t/distdir.sh
@@ -21,7 +21,7 @@
 # Also test DISTFILES containing a directory and a file in it,
 # and repeated directories.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_OUTPUT
diff --git a/t/disthook.sh b/t/disthook.sh
index 6fefacb..68e6f10 100755
--- a/t/disthook.sh
+++ b/t/disthook.sh
@@ -16,7 +16,7 @@
 
 # Check that 'dist-hook' works.  See automake bug#10878.
 
-. ./defs || exit 1
+. test-init.sh
 
 echo AC_OUTPUT >> configure.ac
 
diff --git a/t/distlinks.sh b/t/distlinks.sh
index 7d05b6e..35b8f3f 100755
--- a/t/distlinks.sh
+++ b/t/distlinks.sh
@@ -17,7 +17,7 @@
 # Check that distributed symlinks in the source tree will be expanded
 # as regular files in $(distdir).
 
-. ./defs || exit 1
+. test-init.sh
 
 echo text > file
 
diff --git a/t/distlinksbrk.sh b/t/distlinksbrk.sh
index eccfd9c..b549374 100755
--- a/t/distlinksbrk.sh
+++ b/t/distlinksbrk.sh
@@ -17,7 +17,7 @@
 # Check that distributed broken symlinks cause 'make dist' to fail, and
 # to do so with (mostly) meaningful diagnostic.
 
-. ./defs || exit 1
+. test-init.sh
 
 # We need, for our broken symlinks, names that make it hard to get false
 # positives when grepping make output to look for them.
diff --git a/t/distname.sh b/t/distname.sh
index 19806ce..0b1b541 100755
--- a/t/distname.sh
+++ b/t/distname.sh
@@ -18,7 +18,7 @@
 # From Rainer Orth.
 
 required=cc
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_CONFIG_SRCDIR([a.c])
diff --git a/t/dmalloc.sh b/t/dmalloc.sh
index 3f37eb5..ff2d05e 100755
--- a/t/dmalloc.sh
+++ b/t/dmalloc.sh
@@ -16,7 +16,7 @@
 
 # Simple checks on the 'AM_WITH_DMALLOC' macro.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_CONFIG_HEADERS([config.h])
diff --git a/t/doc-parsing-buglets-colneq-subst.sh 
b/t/doc-parsing-buglets-colneq-subst.sh
index f099f02..ddf37d0 100755
--- a/t/doc-parsing-buglets-colneq-subst.sh
+++ b/t/doc-parsing-buglets-colneq-subst.sh
@@ -22,7 +22,7 @@
 # See: <http://lists.gnu.org/archive/html/automake/2010-08/msg00074.html>
 # or: 
<http://thread.gmane.org/gmane.comp.sysutils.automake.general/11943/focus=11962>
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am <<'END'
 $(FOO:=x): bar
diff --git a/t/doc-parsing-buglets-tabs.sh b/t/doc-parsing-buglets-tabs.sh
index 8c9ea4d..eb51431 100755
--- a/t/doc-parsing-buglets-tabs.sh
+++ b/t/doc-parsing-buglets-tabs.sh
@@ -20,7 +20,7 @@
 # If you cause some parts of this test to fail, chances are that you've
 # improved the Automake parser ;-)
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am <<END
 .PHONY: test
diff --git a/t/dollar.sh b/t/dollar.sh
index e62f42b..642c07f 100755
--- a/t/dollar.sh
+++ b/t/dollar.sh
@@ -21,7 +21,7 @@
 # Require GNU make for this test.  SunOS Make does not support
 # '$$' in a target or a dependency (it outputs the empty string instead).
 required=GNUmake
-. ./defs || exit 1
+. test-init.sh
 
 echo AC_OUTPUT >> configure.ac
 
diff --git a/t/dollarvar.sh b/t/dollarvar.sh
index f28ce04..43fc043 100755
--- a/t/dollarvar.sh
+++ b/t/dollarvar.sh
@@ -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 || exit 1
+. test-init.sh
 
 cat >Makefile.am <<'EOF'
 x = 1
@@ -35,6 +35,7 @@ blo = $(foo${x})
 EOF
 
 $ACLOCAL
+
 AUTOMAKE_fails -Wportability
 grep 'Makefile.am:2' stderr
 grep 'Makefile.am:3' stderr
@@ -43,15 +44,7 @@ grep 'Makefile.am:5' stderr
 grep 'Makefile.am:6' stderr
 grep 'Makefile.am:7' stderr
 
-# On the other hand, if we allow 'silent-rules' mode, then we need to
-# allow recursive variable expansion, too.
-
-# This should work with the AM_SILENT_RULES macro.
-$sleep
-echo 'AM_SILENT_RULES' >> configure.ac
-
-$ACLOCAL --force
-AUTOMAKE_fails -Wportability
+AUTOMAKE_fails -Wportability -Wno-portability-recursive
 grep 'Makefile.am:2' stderr
 grep 'Makefile.am:3' stderr
 grep 'Makefile.am:4' stderr
diff --git a/t/dollarvar2.sh b/t/dollarvar2.sh
index 1703ceb..7269ffd 100755
--- a/t/dollarvar2.sh
+++ b/t/dollarvar2.sh
@@ -17,7 +17,7 @@
 # Test to make sure that -Wportability turns on portability-recursive,
 # likewise for -Wno-...
 
-. ./defs || exit 1
+. test-init.sh
 
 #
 # First, try a setup where we have a 'portability-recursive' warning,
diff --git a/t/double.sh b/t/double.sh
index 6e1b96f..403e863 100755
--- a/t/double.sh
+++ b/t/double.sh
@@ -17,7 +17,7 @@
 # Test to make sure listing a program twice is ok.
 # Report from Manu Rouat.
 
-. ./defs || exit 1
+. test-init.sh
 
 echo AC_PROG_CC >> configure.ac
 
diff --git a/t/dup2.sh b/t/dup2.sh
index 82d341c..12419b9 100755
--- a/t/dup2.sh
+++ b/t/dup2.sh
@@ -16,7 +16,7 @@
 
 # Make sure aclocal only warns about definitions overridden by acinclude.m4.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AM_FUNC_STRTOD
diff --git a/t/else.sh b/t/else.sh
index 4bf82f6..072a40b 100755
--- a/t/else.sh
+++ b/t/else.sh
@@ -16,7 +16,7 @@
 
 # Test to make sure line numbers are correct in some error reports.
 
-. ./defs || exit 1
+. test-init.sh
 
 echo 'AM_CONDITIONAL(FOO, true)' >> configure.ac
 
diff --git a/t/empty-data-primary.sh b/t/empty-data-primary.sh
index a8e1b16..dd285f0 100755
--- a/t/empty-data-primary.sh
+++ b/t/empty-data-primary.sh
@@ -17,7 +17,7 @@
 # Test for bug where if the list of installables is empty, invalid sh
 # code is generated.
 
-. ./defs || exit 1
+. test-init.sh
 
 echo AC_OUTPUT >>configure.ac
 echo 'data_DATA =' >Makefile.am
diff --git a/t/empty-sources-primary.tap b/t/empty-sources-primary.tap
index 3e5b3f4..5f09e6f 100755
--- a/t/empty-sources-primary.tap
+++ b/t/empty-sources-primary.tap
@@ -17,7 +17,7 @@
 # A test for missing _SOURCES variable.  Also test to make sure empty
 # _SOURCES suppresses assumption about default name.
 
-. ./defs || exit 1
+. test-init.sh
 
 plan_ 5
 
diff --git a/t/exdir.sh b/t/exdir.sh
index 0c249e4..7ebe056 100755
--- a/t/exdir.sh
+++ b/t/exdir.sh
@@ -16,7 +16,7 @@
 
 # Check to make sure new extended directory mechanism works.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am << 'EOF'
 htmldir = $(prefix)/html
diff --git a/t/exdir2.sh b/t/exdir2.sh
index cf17f58..ac427da 100755
--- a/t/exdir2.sh
+++ b/t/exdir2.sh
@@ -16,7 +16,7 @@
 
 # Test to make sure undefined directories are invalid.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am << 'EOF'
 quuz_DATA = zot.html
diff --git a/t/exdir3.sh b/t/exdir3.sh
index 6d602cb..e4ed095 100755
--- a/t/exdir3.sh
+++ b/t/exdir3.sh
@@ -16,7 +16,7 @@
 
 # Test to make sure pkgdatadir can be overridden via AC_SUBST.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac <<'EOF'
 AC_SUBST([pkgdatadir], ["FOO"])
diff --git a/t/exeext.sh b/t/exeext.sh
index 1eb4256..f0850c6 100755
--- a/t/exeext.sh
+++ b/t/exeext.sh
@@ -22,7 +22,7 @@
 # aren't left around.  Report from Jim Meyering.
 
 required=cc
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/exeext2.sh b/t/exeext2.sh
index 956acff..606d81a 100755
--- a/t/exeext2.sh
+++ b/t/exeext2.sh
@@ -16,7 +16,7 @@
 
 # Make sure no-exeext option works.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/exeext3.sh b/t/exeext3.sh
index e12462a..6d99904 100755
--- a/t/exeext3.sh
+++ b/t/exeext3.sh
@@ -16,7 +16,7 @@
 
 # Make sure we can override a program rule.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/exeext4.sh b/t/exeext4.sh
index 6d8bc88..bd455e0 100755
--- a/t/exeext4.sh
+++ b/t/exeext4.sh
@@ -18,7 +18,7 @@
 # programs, but not to @address@hidden
 
 # For gen-testsuite-part: ==> try-with-serial-tests <==
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AM_CONDITIONAL([COND], [test -n "$cond"])
diff --git a/t/exsource.sh b/t/exsource.sh
index 4a308cf..4494dae 100755
--- a/t/exsource.sh
+++ b/t/exsource.sh
@@ -17,7 +17,7 @@
 # Test to make sure EXTRA_..._SOURCES actually works.
 # Bug report from Henrik Frystyk Nielsen.
 
-. ./defs || exit 1
+. test-init.sh
 
 echo AC_PROG_CC >> configure.ac
 
diff --git a/t/ext.sh b/t/ext.sh
index e1e8903..3e10491 100755
--- a/t/ext.sh
+++ b/t/ext.sh
@@ -16,18 +16,13 @@
 
 # Test to make sure extensions are set correctly for various languages.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_F77
 AC_PROG_FC
 AC_PROG_OBJC
-# FIXME: this is to cater to older autoconf; remove this once we
-# FIXME: automake requires Autoconf 2.65 or later.
-m4_ifdef([AC_PROG_OBJCXX], [AC_PROG_OBJCXX], [
-  AC_SUBST([OBJCXX], [whocares])
-  AM_CONDITIONAL([am__fastdepOBJCXX], [whocares])
-])
+AC_PROG_OBJCXX
 AM_PROG_UPC
 END
 
diff --git a/t/ext2.sh b/t/ext2.sh
index 7b97c85..79114d6 100755
--- a/t/ext2.sh
+++ b/t/ext2.sh
@@ -18,7 +18,7 @@
 # Using different extensions for the same language should not
 # output the build rules several times.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac <<EOF
 AC_PROG_CXX
diff --git a/t/ext3.sh b/t/ext3.sh
index c32a3e3..812d320 100755
--- a/t/ext3.sh
+++ b/t/ext3.sh
@@ -20,7 +20,7 @@
 # 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
+. test-init.sh
 
 cat >> configure.ac << 'END'
 END
diff --git a/t/extra-portability.sh b/t/extra-portability.sh
index fffd6d3..0303ba3 100755
--- a/t/extra-portability.sh
+++ b/t/extra-portability.sh
@@ -20,7 +20,7 @@
 #   2. '-Wno-portability' must imply '-Wno-extra-portability'.
 #   3. '-Wall' must imply '-Wextra-portability'.
 
-. ./defs || exit 1
+. test-init.sh
 
 # We want (almost) complete control over automake options.
 AUTOMAKE="$am_original_AUTOMAKE --foreign -Werror"
diff --git a/t/extra-portability2.sh b/t/extra-portability2.sh
index e87dde0..a82fa47 100755
--- a/t/extra-portability2.sh
+++ b/t/extra-portability2.sh
@@ -17,7 +17,7 @@
 # Make sure that extra-portability warnings are not enabled by --gnits,
 # --gnu and --foreign.
 
-. ./defs || exit 1
+. test-init.sh
 
 # We want complete control over automake options.
 AUTOMAKE=$am_original_AUTOMAKE
diff --git a/t/extra-portability3.sh b/t/extra-portability3.sh
index 2412b4f..4f84422 100755
--- a/t/extra-portability3.sh
+++ b/t/extra-portability3.sh
@@ -17,7 +17,7 @@
 # Check interactions between the 'portability-recursive' and
 # 'extra-portability' warning categories.
 
-. ./defs || exit 1
+. test-init.sh
 
 # We want (almost) complete control over automake options.
 AUTOMAKE="$am_original_AUTOMAKE --foreign -Werror"
diff --git a/t/extra-programs-empty.sh b/t/extra-programs-empty.sh
index 189fac4..2975d7d 100755
--- a/t/extra-programs-empty.sh
+++ b/t/extra-programs-empty.sh
@@ -18,7 +18,7 @@
 # This check has been introduced in commit 'Release-1-9-254-g9d0eaef'
 # into the former test 'subst2.test'.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_CONFIG_FILES([Makefile2 Makefile3])
diff --git a/t/extra.sh b/t/extra.sh
index 0993706..2442faf 100755
--- a/t/extra.sh
+++ b/t/extra.sh
@@ -19,7 +19,7 @@
 # targets should always be generated.  However, they should not be
 # built by default.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/extra10.sh b/t/extra10.sh
index db34e11..bd49d3c 100755
--- a/t/extra10.sh
+++ b/t/extra10.sh
@@ -20,7 +20,7 @@
 # with the involvement of the $(wildcard) GNU make builtin.
 
 required=GNUmake
-. ./defs || exit 1
+. test-init.sh
 
 echo AC_OUTPUT >> configure.ac
 
diff --git a/t/extra11.sh b/t/extra11.sh
index f5319c6..6d42d8d 100755
--- a/t/extra11.sh
+++ b/t/extra11.sh
@@ -18,7 +18,7 @@
 # Suggested by observations from Braden McDaniel.
 
 required=GNUmake
-. ./defs || exit 1
+. test-init.sh
 
 echo AC_OUTPUT >> configure.ac
 
diff --git a/t/extra12.sh b/t/extra12.sh
index a2a797b..0dc817c 100755
--- a/t/extra12.sh
+++ b/t/extra12.sh
@@ -19,7 +19,7 @@
 # Suggested by observations from Braden McDaniel.
 
 required=GNUmake
-. ./defs || exit 1
+. test-init.sh
 
 echo AC_OUTPUT >> configure.ac
 
diff --git a/t/extra2.sh b/t/extra2.sh
index e5576a5..e3eb5a2 100755
--- a/t/extra2.sh
+++ b/t/extra2.sh
@@ -16,7 +16,7 @@
 
 # Check to make sure EXTRA_foo_SOURCES not defined unnecessarily.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/extra3.sh b/t/extra3.sh
index 02ac789..1dd94b5 100755
--- a/t/extra3.sh
+++ b/t/extra3.sh
@@ -16,7 +16,7 @@
 
 # Check to make sure EXTRA_DATA not required.
 
-. ./defs || exit 1
+. test-init.sh
 
 echo 'AC_SUBST(CODICIL)' >> configure.ac
 
diff --git a/t/extra4.sh b/t/extra4.sh
index 286540a..248a25b 100755
--- a/t/extra4.sh
+++ b/t/extra4.sh
@@ -16,7 +16,7 @@
 
 # Check to make sure EXTRA_DATA can be specified.
 
-. ./defs || exit 1
+. test-init.sh
 
 echo 'AC_SUBST(CODICIL)' >> configure.ac
 
diff --git a/t/extra5.sh b/t/extra5.sh
index abe8e13..51bbb50 100755
--- a/t/extra5.sh
+++ b/t/extra5.sh
@@ -17,7 +17,7 @@
 # Check to make sure EXTRA_DIST can contain a directory from $buildir.
 # From Dean Povey.
 
-. ./defs || exit 1
+. test-init.sh
 
 echo AC_OUTPUT >> configure.ac
 
diff --git a/t/extra6.sh b/t/extra6.sh
index b5308af..e3f0a3d 100755
--- a/t/extra6.sh
+++ b/t/extra6.sh
@@ -17,7 +17,7 @@
 # Check to make sure EXTRA_DIST can contain a directory or
 # a subdirectory, in $(builddir) or $(srcdir).
 
-. ./defs || exit 1
+. test-init.sh
 
 echo AC_OUTPUT >> configure.ac
 
diff --git a/t/extra7.sh b/t/extra7.sh
index b75a0a7..1cd5f6f 100755
--- a/t/extra7.sh
+++ b/t/extra7.sh
@@ -19,7 +19,7 @@
 # $(srcdir)/X and ./X, with the files from the later overriding the
 # files from the former.
 
-. ./defs || exit 1
+. test-init.sh
 
 echo AC_OUTPUT >> configure.ac
 
diff --git a/t/extra8.sh b/t/extra8.sh
index 0a4f818..38234a9 100755
--- a/t/extra8.sh
+++ b/t/extra8.sh
@@ -18,7 +18,7 @@
 # and that referring to the same program with inconsistent addition
 # of $(EXEEXT) works, too.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac <<'END'
 AC_PROG_CC
diff --git a/t/extra9.sh b/t/extra9.sh
index c0bb0f3..96c3122 100755
--- a/t/extra9.sh
+++ b/t/extra9.sh
@@ -18,7 +18,7 @@
 # are missing; but only if the former is not AC_SUBSTed itself
 # (lib_LIBRARIES is in the same boat here).
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac <<'END'
 AC_PROG_CC
diff --git a/t/extradep.sh b/t/extradep.sh
index 75daf2e..18879f3 100755
--- a/t/extradep.sh
+++ b/t/extradep.sh
@@ -17,7 +17,7 @@
 # Test EXTRA_*_DEPENDENCIES.  See extradep2 for libtool variant.
 
 required=cc
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/extradep2.sh b/t/extradep2.sh
index eecf74f..72217e7 100755
--- a/t/extradep2.sh
+++ b/t/extradep2.sh
@@ -17,7 +17,7 @@
 # Test EXTRA_*_DEPENDENCIES, libtool version; see 'extradep.sh'.
 
 required='cc libtoolize'
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/f90only.sh b/t/f90only.sh
index 3d23628..7f938af 100755
--- a/t/f90only.sh
+++ b/t/f90only.sh
@@ -17,7 +17,7 @@
 # Make sure programs with only Fortran 90 source are handled properly.
 # (copied from 'fonly.sh') Mike Nolta <address@hidden>
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_FC
diff --git a/t/flavor.sh b/t/flavor.sh
index 8999795..383c5c7 100755
--- a/t/flavor.sh
+++ b/t/flavor.sh
@@ -18,7 +18,7 @@
 # options like '--ignore-deps' and '--silent-rules' are preserved across
 # automake reruns.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AM_MAINTAINER_MODE
@@ -57,21 +57,4 @@ for flavor in --gnits --gnu --foreign --ignore-deps; do
 
 done
 
-# Cygnus mode is deprecated now, and must be handled separately.
-$AUTOMAKE --cygnus -Wno-obsolete
-./configure --enable-maintainer-mode
-grep " --cygnus" Makefile
-$MAKE
-# Two code paths in configure.am:
-# - either a file in $(am__configure_deps) has been updated ...
-$sleep
-touch aclocal.m4
-$MAKE
-grep " --cygnus" Makefile
-# - ... or not; i.e., Makefile.am or an included file has.
-$sleep
-touch Makefile.am
-$MAKE
-grep " --cygnus" Makefile
-
 :
diff --git a/t/flibs.sh b/t/flibs.sh
index d51849f..10b8e8e 100755
--- a/t/flibs.sh
+++ b/t/flibs.sh
@@ -17,7 +17,7 @@
 # Make sure 'AC_F77_LIBRARY_LDFLAGS' works properly.
 # Matthew D. Langston <address@hidden>
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_F77
diff --git a/t/fn99.sh b/t/fn99.sh
index f1351bb..80f9b05 100755
--- a/t/fn99.sh
+++ b/t/fn99.sh
@@ -16,7 +16,7 @@
 
 # Check the filename-length-max=99 option.
 
-. ./defs || exit 1
+. test-init.sh
 
 echo AC_OUTPUT >> configure.ac
 
diff --git a/t/fn99subdir.sh b/t/fn99subdir.sh
index eb289b4..0e73263 100755
--- a/t/fn99subdir.sh
+++ b/t/fn99subdir.sh
@@ -17,7 +17,7 @@
 # PR 507: Check the filename-length-max=99 option
 # in conjunction with AC_CONFIG_SUBDIRS.
 
-. ./defs || exit 1
+. test-init.sh
 
 # The name is so that 99 is exactly hit (including final \0).
 subdirname='cnfsubdir'
diff --git a/t/fnoc.sh b/t/fnoc.sh
index f0b2518..9f7abdd 100755
--- a/t/fnoc.sh
+++ b/t/fnoc.sh
@@ -18,7 +18,7 @@
 # C-specific code.
 # Matthew D. Langston <address@hidden>
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_F77
diff --git a/t/fonly.sh b/t/fonly.sh
index 9854187..796a093 100755
--- a/t/fonly.sh
+++ b/t/fonly.sh
@@ -17,7 +17,7 @@
 # Make sure programs with only Fortran 77 source are handled properly.
 # Matthew D. Langston <address@hidden>
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_F77
diff --git a/t/forcemiss.sh b/t/forcemiss.sh
index 74da2d7..4e00684 100755
--- a/t/forcemiss.sh
+++ b/t/forcemiss.sh
@@ -16,7 +16,7 @@
 
 # Test to make sure that 'automake --force-missing' works.
 
-. ./defs || exit 1
+. test-init.sh
 
 rm -f install-sh
 
diff --git a/t/forcemiss2.sh b/t/forcemiss2.sh
index 8c6369a..17aa06d 100755
--- a/t/forcemiss2.sh
+++ b/t/forcemiss2.sh
@@ -17,7 +17,7 @@
 # Test to make sure that 'automake --force-missing' works, even with
 # symlinked files.
 
-. ./defs || exit 1
+. test-init.sh
 
 rm -f install-sh
 
diff --git a/t/fort1.sh b/t/fort1.sh
index d118e9f..10753e6 100755
--- a/t/fort1.sh
+++ b/t/fort1.sh
@@ -17,7 +17,7 @@
 # Test that Automake suggests using AC_PROG_F77/FC if Fortran sources
 # are used.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >Makefile.am <<END
 bin_PROGRAMS = hello
diff --git a/t/fort2.sh b/t/fort2.sh
index fbe05b7..b6c2ead 100755
--- a/t/fort2.sh
+++ b/t/fort2.sh
@@ -19,7 +19,7 @@
 
 # Cf. 'fort1.sh' and 'link_f90_only.sh'.
 
-. ./defs || exit 1
+. test-init.sh
 
 mkdir sub
 
diff --git a/t/fort4.sh b/t/fort4.sh
index ee83773..7f79256 100755
--- a/t/fort4.sh
+++ b/t/fort4.sh
@@ -19,7 +19,7 @@
 # For now, require the GNU compilers (to avoid some Libtool/Autoconf
 # issues).
 required='g77 gfortran'
-. ./defs || exit 1
+. test-init.sh
 
 mkdir sub
 
diff --git a/t/fort5.sh b/t/fort5.sh
index c5be2ab..3e65a14 100755
--- a/t/fort5.sh
+++ b/t/fort5.sh
@@ -19,7 +19,7 @@
 # For now, require the GNU compilers (to avoid some Libtool/Autoconf
 # issues).
 required='libtoolize g77 gfortran'
-. ./defs || exit 1
+. test-init.sh
 
 mkdir sub
 
diff --git a/t/fortdep.sh b/t/fortdep.sh
index 8eff4e9..99ebb03 100755
--- a/t/fortdep.sh
+++ b/t/fortdep.sh
@@ -17,7 +17,7 @@
 # Test to make sure dependency tracking doesn't interfere with Fortran.
 # For PR 75.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_CONFIG_SRCDIR([foo.f])
diff --git a/t/gcj.sh b/t/gcj.sh
index d069ec7..f0a3897 100755
--- a/t/gcj.sh
+++ b/t/gcj.sh
@@ -16,7 +16,7 @@
 
 # Test of compiled java.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 _AM_DEPENDENCIES([GCJ])
diff --git a/t/gcj2.sh b/t/gcj2.sh
index 8da82a1..3aab7a3 100755
--- a/t/gcj2.sh
+++ b/t/gcj2.sh
@@ -16,7 +16,7 @@
 
 # Make sure '..' invalid in subdir .o's.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 _AM_DEPENDENCIES(GCJ)
diff --git a/t/gcj3.sh b/t/gcj3.sh
index c4b4574..96d0d14 100755
--- a/t/gcj3.sh
+++ b/t/gcj3.sh
@@ -16,7 +16,7 @@
 
 # Make sure dependency tracking works for java.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 _AM_DEPENDENCIES([GCJ])
diff --git a/t/gcj4.sh b/t/gcj4.sh
index 299e1c1..680e59b 100755
--- a/t/gcj4.sh
+++ b/t/gcj4.sh
@@ -17,7 +17,7 @@
 # Make sure dependency tracking works for Java.
 
 required=gcj
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AM_PROG_GCJ
diff --git a/t/gcj5.sh b/t/gcj5.sh
index 4df1059..9409ee8 100755
--- a/t/gcj5.sh
+++ b/t/gcj5.sh
@@ -16,7 +16,7 @@
 
 # Make sure Automake suggests AM_PROG_GCJ when GCJ is needed.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 _AM_DEPENDENCIES(GCJ)
diff --git a/t/gcj6.sh b/t/gcj6.sh
index 60023c2..fc9fbe6 100755
--- a/t/gcj6.sh
+++ b/t/gcj6.sh
@@ -17,7 +17,7 @@
 # AM_PROG_GCJ should cause OBJEXT and EXEEXT to be set.
 
 required='gcj'
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AM_PROG_GCJ
diff --git a/t/get-sysconf.sh b/t/get-sysconf.sh
index 60f62cd..f802665 100755
--- a/t/get-sysconf.sh
+++ b/t/get-sysconf.sh
@@ -20,7 +20,7 @@
 # we won't have to ask him for more information to start analyzing the
 # failure (that had happened too many times in the past!).
 
-. ./defs || exit 1
+. test-init.sh
 
 st=0
 if test -d "$am_top_srcdir"/.git; then
diff --git a/t/gettext-macros.sh b/t/gettext-macros.sh
index a42c031..1c774e7 100755
--- a/t/gettext-macros.sh
+++ b/t/gettext-macros.sh
@@ -18,7 +18,7 @@
 # to the test cases requiring them.
 # See also automake bug#9807.
 
-. ./defs || exit 1
+. test-init.sh
 
 extract_program_version ()
 {
@@ -78,8 +78,6 @@ else
   fi
 fi
 
-. ./get.sh
-
 cat >> get.sh <<'END'
 # Even recent versions of gettext used the now-obsolete 'AM_PROG_MKDIR_P'
 # m4 macro.  So we need the following to avoid spurious errors.
@@ -87,6 +85,8 @@ ACLOCAL="$ACLOCAL -Wno-obsolete"
 AUTOMAKE="$AUTOMAKE -Wno-obsolete"
 END
 
+. ./get.sh
+
 $ACLOCAL --force -I m4 || cat >> get.sh <<'END'
 # We need to use '-Wno-syntax', since we do not want our test suite
 # to fail merely because some third-party '.m4' file is underquoted.
diff --git a/t/gettext.sh b/t/gettext.sh
index a1925f1..7cf62ef 100755
--- a/t/gettext.sh
+++ b/t/gettext.sh
@@ -17,7 +17,7 @@
 # Check gettext support.
 
 required='gettext'
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac <<END
 AM_GNU_GETTEXT
diff --git a/t/gettext2.sh b/t/gettext2.sh
index f3d91b0..39e33bf 100755
--- a/t/gettext2.sh
+++ b/t/gettext2.sh
@@ -18,7 +18,7 @@
 # PR/338, reported by Charles Wilson.
 
 required='gettext'
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac <<END
 AM_GNU_GETTEXT([external])
diff --git a/t/gettext3.sh b/t/gettext3.sh
index bfeb922..fe2fcdc 100755
--- a/t/gettext3.sh
+++ b/t/gettext3.sh
@@ -17,7 +17,7 @@
 # Check gettext 'AM_GNU_GETTEXT_INTL_SUBDIR' support.
 
 required='gettext'
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac <<END
 AM_GNU_GETTEXT([external])
diff --git a/t/gnits.sh b/t/gnits.sh
index f3de3b6..db067b8 100755
--- a/t/gnits.sh
+++ b/t/gnits.sh
@@ -16,7 +16,7 @@
 
 # Test to ensure --gnits version checking is correct.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > configure.ac << END
 AC_INIT([$me], [3.5.3.2])
diff --git a/t/gnits2.sh b/t/gnits2.sh
index 337c0ae..61243f3 100755
--- a/t/gnits2.sh
+++ b/t/gnits2.sh
@@ -17,7 +17,7 @@
 # Test to ensure std-options checking is correct.
 
 required='cc native'
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/gnits3.sh b/t/gnits3.sh
index 0b67253..0fe94d5 100755
--- a/t/gnits3.sh
+++ b/t/gnits3.sh
@@ -17,7 +17,7 @@
 # Check that AM_INSTALLCHECK_STD_OPTIONS_EXEMPT works.
 
 required=cc
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/gnumake.sh b/t/gnumake.sh
index ed660a2..a144755 100755
--- a/t/gnumake.sh
+++ b/t/gnumake.sh
@@ -18,7 +18,7 @@
 # Report from Braden McDaniel.
 
 required=GNUmake
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_CONFIG_FILES([sub/GNUmakefile])
diff --git a/t/gnuwarn.sh b/t/gnuwarn.sh
index 1e468a0..4a1c03b 100755
--- a/t/gnuwarn.sh
+++ b/t/gnuwarn.sh
@@ -16,7 +16,7 @@
 
 # Check that Automake warns about user variables being overridden.
 
-. ./defs || exit 1
+. test-init.sh
 
 # We need (almost) complete control over automake options.
 AUTOMAKE="$am_original_AUTOMAKE -Werror"
diff --git a/t/gnuwarn2.sh b/t/gnuwarn2.sh
index 0cdc710..5667e27 100755
--- a/t/gnuwarn2.sh
+++ b/t/gnuwarn2.sh
@@ -16,7 +16,7 @@
 
 # Check diagnostics about no-installman being disallowed in 'gnu'.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > configure.ac << 'END'
 AC_INIT([gnuwarn2], [1.0])
diff --git a/t/hdr-vars-defined-once.sh b/t/hdr-vars-defined-once.sh
index 92279d7..3380074 100755
--- a/t/hdr-vars-defined-once.sh
+++ b/t/hdr-vars-defined-once.sh
@@ -17,7 +17,7 @@
 # Test to make sure header vars defined only once when including.
 # Report from Marcus G. Daniels.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac <<END
 AC_OUTPUT
diff --git a/t/header.sh b/t/header.sh
index 60d8ed1..a4550f9 100755
--- a/t/header.sh
+++ b/t/header.sh
@@ -23,7 +23,7 @@
 #  in the HEADERS variable for *all* generated Makefile.ins in the
 #  project.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_SUBST([MY_HEADERS])
diff --git a/t/help-depend.sh b/t/help-depend.sh
index 9a27d0b..12e89bb 100755
--- a/t/help-depend.sh
+++ b/t/help-depend.sh
@@ -18,7 +18,7 @@
 # the configure help screen.
 # Keep this in sync with sister test 'help-depend2.sh'
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > configure.ac <<END
 AC_INIT([$me], [1.0])
diff --git a/t/help-depend2.sh b/t/help-depend2.sh
index 5cf1273..838e961 100755
--- a/t/help-depend2.sh
+++ b/t/help-depend2.sh
@@ -18,7 +18,7 @@
 # dependency tracking, it adds proper text to the configure help screen.
 # Keep this in sync with sister test 'help-depend.sh'
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > configure.ac <<END
 AC_INIT([$me], [1.0])
diff --git a/t/help-dmalloc.sh b/t/help-dmalloc.sh
index 7d2f10c..30f3602 100755
--- a/t/help-dmalloc.sh
+++ b/t/help-dmalloc.sh
@@ -17,7 +17,7 @@
 # Make sure that our macro 'AM_WITH_DMALLOC' adds proper text to
 # the configure help screen.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > configure.ac <<END
 AC_INIT([$me], [1.0])
diff --git a/t/help-init.sh b/t/help-init.sh
index 0ae47dd..3398c21 100755
--- a/t/help-init.sh
+++ b/t/help-init.sh
@@ -17,7 +17,7 @@
 # Make sure that our grand macro 'AM_INIT_AUTOMAKE' add proper text
 # to the configure help screen.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > configure.ac <<END
 AC_INIT([$me], [1.0])
diff --git a/t/help-lispdir.sh b/t/help-lispdir.sh
index 2dd9df3..23ad0bd 100755
--- a/t/help-lispdir.sh
+++ b/t/help-lispdir.sh
@@ -17,7 +17,7 @@
 # Make sure that our macro 'AM_PATH_LISPDIR' adds proper text to
 # the configure help screen.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > configure.ac <<END
 AC_INIT([$me], [1.0])
diff --git a/t/help-multilib.sh b/t/help-multilib.sh
deleted file mode 100755
index d4f6402..0000000
--- a/t/help-multilib.sh
+++ /dev/null
@@ -1,34 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2010-2012 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 our macro 'AM_ENABLE_MULTILIB' adds proper text to
-# the configure help screen.
-# FIXME: the features tested by this script has been moved in contrib.
-# FIXME: We should move this script accordingly.
-
-. ./defs || exit 1
-
-cat > configure.ac <<END
-AC_INIT([$me], [1.0])
-AM_ENABLE_MULTILIB
-END
-
-cat "$am_top_srcdir"/contrib/multilib/multi.m4 > aclocal.m4
-$AUTOCONF
-
-grep_configure_help --enable-multilib ' many library versions \(default\)'
-
-:
diff --git a/t/help-python.sh b/t/help-python.sh
index dcbcfe8..1c3e5a9 100755
--- a/t/help-python.sh
+++ b/t/help-python.sh
@@ -17,7 +17,7 @@
 # Make sure that macro 'AM_PATH_PYTHON' adds proper text to the
 # configure help screen.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > configure.ac <<END
 AC_INIT([$me], [1.0])
diff --git a/t/help-silent.sh b/t/help-silent.sh
index b7e805e..76cae9b 100755
--- a/t/help-silent.sh
+++ b/t/help-silent.sh
@@ -14,23 +14,20 @@
 # 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 our macro 'AM_SILENT_RULES' adds proper text to
-# the configure help screen.
+# Make sure configure options relative to automake silent rules are
+# added to the configure help screen.
 
-. ./defs || exit 1
-
-cat > configure.ac <<END
-AC_INIT([$me], [1.0])
-AM_SILENT_RULES
-END
+. test-init.sh
 
+: > Makefile.am
 $ACLOCAL
 
-mv -f configure.ac configure.tmpl
+cp configure.ac configure.tmpl
 
-for args in '' '([])' '([yes])' '([no])'; do
-  sed "s/AM_SILENT_RULES.*/&$args/" configure.tmpl >configure.ac
-  cat configure.ac
+for args in '' 'yes' 'no'; do
+  cp -f configure.tmpl configure.ac
+  test x"$args" = x || echo "AM_SILENT_RULES([$args])/" >> configure.ac
+  cat configure.ac # For debugging.
   $AUTOCONF --force
   grep_configure_help --enable-silent-rules \
                       ' less verbose build.*\(undo.*"make V=1".*\)'
diff --git a/t/help-upc.sh b/t/help-upc.sh
index 822eadf..6ccd962 100755
--- a/t/help-upc.sh
+++ b/t/help-upc.sh
@@ -17,7 +17,7 @@
 # Make sure that our macro 'AM_PROG_UPC' adds proper text to
 # the configure help screen.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > configure.ac <<END
 AC_INIT([$me], [1.0])
diff --git a/t/help.sh b/t/help.sh
index 2c8175c..961fcea 100755
--- a/t/help.sh
+++ b/t/help.sh
@@ -17,7 +17,7 @@
 # Make sure --help and --version work, even when no configure.ac nor
 # configure.in is in the current directory.
 
-. ./defs || exit 1
+. test-init.sh
 
 # Ensure we run in an empty directory.
 mkdir emptydir
diff --git a/t/help2.sh b/t/help2.sh
index fad2b29..e4a8dff 100755
--- a/t/help2.sh
+++ b/t/help2.sh
@@ -16,7 +16,7 @@
 
 # Make sure --help and --version work, even when the current directory
 # contains a broken configure.ac and a broken acinclude.m4.
-. ./defs || exit 1
+. test-init.sh
 
 # Ensure we run in a new, clean directory.
 mkdir cleandir
diff --git a/t/help3.sh b/t/help3.sh
index 368c456..14d5f8e 100755
--- a/t/help3.sh
+++ b/t/help3.sh
@@ -16,7 +16,7 @@
 
 # Make sure --help and --version takes precedence over other options.
 
-. ./defs || exit 1
+. test-init.sh
 
 # We must have full control over the content of the current directory.
 mkdir cleandir
diff --git a/t/help4.sh b/t/help4.sh
index 775a3ab..98c8f9a 100755
--- a/t/help4.sh
+++ b/t/help4.sh
@@ -17,7 +17,7 @@
 # Check that the first among --help and --version to be specified on
 # the command line takes precedence over the following one.
 
-. ./defs || exit 1
+. test-init.sh
 
 # Ensure we run in an empty directory.
 mkdir emptydir
diff --git a/t/hfs.sh b/t/hfs.sh
index fae069f..f794f5c 100755
--- a/t/hfs.sh
+++ b/t/hfs.sh
@@ -20,7 +20,7 @@
 # Darwin).
 # Report from Peter O'Gorman.
 
-. ./defs || exit 1
+. test-init.sh
 echo AC_OUTPUT >>configure.ac
 
 : >CHANGELOG
diff --git a/t/implicit.sh b/t/implicit.sh
index 86d6032..1d53fac 100755
--- a/t/implicit.sh
+++ b/t/implicit.sh
@@ -17,7 +17,7 @@
 # Test to make sure implicit .o's are listed as appropriate.  Report
 # from Henrik Frystyk Nielsen.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/init.sh b/t/init.sh
index 94cdd64..0d047bd 100755
--- a/t/init.sh
+++ b/t/init.sh
@@ -17,7 +17,7 @@
 # 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
+. test-init.sh
 
 for ac_init_args in '' '([x])'; do
   for am_init_args in '' '([1.10])'; do
diff --git a/t/init2.sh b/t/init2.sh
index fa2a065..94af06f 100755
--- a/t/init2.sh
+++ b/t/init2.sh
@@ -17,7 +17,7 @@
 # Make sure we give a sensible error message when AM_INIT_AUTOMAKE
 # contains junk.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >configure.ac <<END
 AC_INIT([init2], [1.0])
diff --git a/t/insh2.sh b/t/insh2.sh
index 38bb46a..a378a26 100755
--- a/t/insh2.sh
+++ b/t/insh2.sh
@@ -16,7 +16,7 @@
 
 # Test for bug where install-sh not included in distribution.
 
-. ./defs || exit 1
+. test-init.sh
 
 echo AC_OUTPUT >> configure.ac
 
diff --git a/t/install-info-dir.sh b/t/install-info-dir.sh
index abf16e3..c348b5e 100755
--- a/t/install-info-dir.sh
+++ b/t/install-info-dir.sh
@@ -22,7 +22,7 @@
 # FIXME: and could be merged with 'txinfo27.sh'.
 
 required=makeinfo
-. ./defs || exit 1
+. test-init.sh
 
 cwd=$(pwd) || fatal_ "cannot get current working directory"
 
diff --git a/t/install2.sh b/t/install2.sh
index 96d1c56..3aae3c0 100755
--- a/t/install2.sh
+++ b/t/install2.sh
@@ -18,7 +18,7 @@
 # From Pavel Roskin.
 
 am_create_testdir=empty
-. ./defs || exit 1
+. test-init.sh
 
 cat > configure.ac << END
 AC_INIT([$me], [1.0])
diff --git a/t/installdir.sh b/t/installdir.sh
index 1cef2c1..2978f5c 100755
--- a/t/installdir.sh
+++ b/t/installdir.sh
@@ -22,7 +22,7 @@
 # installdirs is missing this.  Ideally this would be an automatic
 # feature of any exported target.
 
-. ./defs || exit 1
+. test-init.sh
 
 echo AC_OUTPUT >> configure.ac
 
diff --git a/t/instdat.sh b/t/instdat.sh
index b6fad9d..afee3cb 100755
--- a/t/instdat.sh
+++ b/t/instdat.sh
@@ -17,7 +17,7 @@
 # Test to see if defining INSTALL_DATA causes problems.  From EGCS
 # list.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac <<END
 AC_SUBST([INSTALL_DATA])
diff --git a/t/instdat2.sh b/t/instdat2.sh
index 54d26a9..5379e82 100755
--- a/t/instdat2.sh
+++ b/t/instdat2.sh
@@ -17,7 +17,7 @@
 # Test that installing under $exec_prefix is handled by install-exec.
 # Testing with headers for instance.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >Makefile.am << 'EOF'
 # User directories.
diff --git a/t/instdir-cond.sh b/t/instdir-cond.sh
index d0be1a3..f646215 100755
--- a/t/instdir-cond.sh
+++ b/t/instdir-cond.sh
@@ -17,7 +17,7 @@
 # Check against automake bug#10997: directories holding only
 # conditionally-installed files should not be created unconditionally.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AM_CONDITIONAL([ENABLE_FOO], [false])
diff --git a/t/instdir-cond2.sh b/t/instdir-cond2.sh
index 559a7fe..a5fff9b 100755
--- a/t/instdir-cond2.sh
+++ b/t/instdir-cond2.sh
@@ -21,7 +21,7 @@
 # FIXME: So this test is still xfailing.
 # See sister test 'instdir-cond.sh' for the succeeding part.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AM_CONDITIONAL([ENABLE_FOO], [false])
diff --git a/t/instdir-java.sh b/t/instdir-java.sh
index f31cdb7..7d7bf3d 100755
--- a/t/instdir-java.sh
+++ b/t/instdir-java.sh
@@ -17,7 +17,7 @@
 # If $(javadir) is the empty string, then nothing should be installed there.
 
 required=javac
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac <<'END'
 AC_OUTPUT
diff --git a/t/instdir-lisp.sh b/t/instdir-lisp.sh
index 59bf8b0..d37083d 100755
--- a/t/instdir-lisp.sh
+++ b/t/instdir-lisp.sh
@@ -17,7 +17,7 @@
 # If $(lispdir) is the empty string, then nothing should be installed there.
 
 required=emacs
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac <<'END'
 AM_PATH_LISPDIR
diff --git a/t/instdir-ltlib.sh b/t/instdir-ltlib.sh
index c6578e2..2c6deb7 100755
--- a/t/instdir-ltlib.sh
+++ b/t/instdir-ltlib.sh
@@ -19,7 +19,7 @@
 # This test exercises the libtool code paths.
 
 required='cc libtoolize'
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac <<'END'
 AC_PROG_CC
diff --git a/t/instdir-no-empty.sh b/t/instdir-no-empty.sh
index bef179d..0881fb8 100755
--- a/t/instdir-no-empty.sh
+++ b/t/instdir-no-empty.sh
@@ -17,7 +17,7 @@
 # An empty "foo_PRIMARY" declaration should *not* cause "make install"
 # to create directory $(foodir).  See automake bug#10997 and bug#11030.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac <<'END'
 AC_SUBST([CC], [whatever])
diff --git a/t/instdir-prog.sh b/t/instdir-prog.sh
index ed0acc1..e59431c 100755
--- a/t/instdir-prog.sh
+++ b/t/instdir-prog.sh
@@ -19,7 +19,7 @@
 # This test exercises the prog and libs code paths.
 
 required=cc
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac <<'END'
 AC_PROG_CC
diff --git a/t/instdir-python.sh b/t/instdir-python.sh
index d57fb4b..1a20bea 100755
--- a/t/instdir-python.sh
+++ b/t/instdir-python.sh
@@ -17,7 +17,7 @@
 # If $(pythondir) is the empty string, then nothing should be installed there.
 
 required=python
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac <<'END'
 AM_PATH_PYTHON
diff --git a/t/instdir-texi.sh b/t/instdir-texi.sh
index ef6bc20..d8c575c 100755
--- a/t/instdir-texi.sh
+++ b/t/instdir-texi.sh
@@ -17,8 +17,8 @@
 # If $(infodir) is the empty string, then nothing should be installed there.
 # Likewise for the other install-* targets used for texinfo files.
 
-required='makeinfo-html tex texi2dvi'
-. ./defs || exit 1
+required='makeinfo tex texi2dvi'
+. test-init.sh
 
 dvips --help \
   || skip_ "dvips is missing"
diff --git a/t/instdir.sh b/t/instdir.sh
index 6c489fb..ef45105 100755
--- a/t/instdir.sh
+++ b/t/instdir.sh
@@ -18,7 +18,7 @@
 # This test only ensures this if $(foo_PRIMARY) is also empty, see
 # 'instdir2.sh' and siblings 'instdir-*.sh' for nonempty contents.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac <<'END'
 AC_SUBST([foodir], ['${datadir}'/foo])
diff --git a/t/instdir2.sh b/t/instdir2.sh
index 638e25a..e777bf6 100755
--- a/t/instdir2.sh
+++ b/t/instdir2.sh
@@ -18,7 +18,7 @@
 # This test ensures this also if $(foo_PRIMARY) is nonempty, see
 # 'instdir.sh'.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac <<'END'
 AC_SUBST([foodir], ['${datadir}'/foo])
diff --git a/t/instexec.sh b/t/instexec.sh
index f394d84..dc41c57 100755
--- a/t/instexec.sh
+++ b/t/instexec.sh
@@ -17,7 +17,7 @@
 # Test for this bug: when a Makefile.am builds nothing, no
 # install-exec target is generated.
 
-. ./defs || exit 1
+. test-init.sh
 
 : > Makefile.am
 
diff --git a/t/instfail-info.sh b/t/instfail-info.sh
index fea2f5b..59fb1eb 100755
--- a/t/instfail-info.sh
+++ b/t/instfail-info.sh
@@ -20,7 +20,7 @@
 # This test has a few sister tests, for java, info, libtool.
 
 required='makeinfo'
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac <<END
 AC_OUTPUT
diff --git a/t/instfail-java.sh b/t/instfail-java.sh
index 7211efa..ab4c2b4 100755
--- a/t/instfail-java.sh
+++ b/t/instfail-java.sh
@@ -20,7 +20,7 @@
 # This is the java sister test of 'instfail.sh'.
 
 required=javac
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac <<'END'
 AC_OUTPUT
diff --git a/t/instfail-libtool.sh b/t/instfail-libtool.sh
index 042f077..d5613b1 100755
--- a/t/instfail-libtool.sh
+++ b/t/instfail-libtool.sh
@@ -20,7 +20,7 @@
 # This is the libtool sister test of 'instfail.sh'.
 
 required='cc libtool libtoolize'
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac <<END
 AM_PROG_AR
diff --git a/t/instfail.sh b/t/instfail.sh
index 123e082..98b7a7a 100755
--- a/t/instfail.sh
+++ b/t/instfail.sh
@@ -20,7 +20,7 @@
 # This test has a few sister tests, for java, info, libtool.
 
 required=cc
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac <<END
 AC_PROG_CC
diff --git a/t/insthook.sh b/t/insthook.sh
index 1b29612..db243df 100755
--- a/t/insthook.sh
+++ b/t/insthook.sh
@@ -16,7 +16,7 @@
 
 # Make sure the install-exec-hook example we give in the manual works.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac <<'EOF'
 AC_PROG_LN_S
diff --git a/t/instman.sh b/t/instman.sh
index 612f9a8..0616684 100755
--- a/t/instman.sh
+++ b/t/instman.sh
@@ -17,7 +17,7 @@
 # Make sure the MKDIR_P invocation is correct in install-man
 # target.  Bug reported by Gordon Irlam <address@hidden>.
 
-. ./defs || exit 1
+. test-init.sh
 
 echo AC_OUTPUT >> configure.ac
 
diff --git a/t/instman2.sh b/t/instman2.sh
index 30baf91..b124f36 100755
--- a/t/instman2.sh
+++ b/t/instman2.sh
@@ -17,7 +17,7 @@
 # Test to make sure mkinstalldirs invocation correct in install-man
 # target.  Bug reported by Gordon Irlam <address@hidden>.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am << 'EOF'
 man8_MANS = frob.8
diff --git a/t/instmany-mans.sh b/t/instmany-mans.sh
index 4fd703b..1a581be 100755
--- a/t/instmany-mans.sh
+++ b/t/instmany-mans.sh
@@ -18,7 +18,7 @@
 
 # This is the mans sister test of 'instmany.sh', see there for details.
 
-. ./defs || exit 1
+. test-init.sh
 
 # In order to have a useful test on modern systems (which have a high
 # limit, if any), use a fake install program that errors out for more
diff --git a/t/instmany-python.sh b/t/instmany-python.sh
index 9cc659a..b7a614c 100755
--- a/t/instmany-python.sh
+++ b/t/instmany-python.sh
@@ -19,7 +19,7 @@
 # This is the python sister test of 'instmany.sh', see there for details.
 
 required='python'
-. ./defs || exit 1
+. test-init.sh
 
 limit=2500
 subdir=long_subdir_name_with_many_characters
diff --git a/t/instmany.sh b/t/instmany.sh
index 369e23a..6400517 100755
--- a/t/instmany.sh
+++ b/t/instmany.sh
@@ -26,7 +26,7 @@
 # For texinfos, we expand names using $(srcdir) in the first place.
 # Let's hope nobody uses many texinfos.
 
-. ./defs || exit 1
+. test-init.sh
 
 # In order to have a useful test on modern systems (which have a high
 # limit, if any), use a fake install program that errors out for more
diff --git a/t/instsh.sh b/t/instsh.sh
index e7924b2..4a452ba 100755
--- a/t/instsh.sh
+++ b/t/instsh.sh
@@ -18,7 +18,7 @@
 # automake: Makefile.am: required file "../../install-sh" not found; installing
 # This also makes sure that install-sh is created in the correct directory.
 
-. ./defs || exit 1
+. test-init.sh
 
 : > Makefile.am
 rm -f install-sh
diff --git a/t/instsh2.sh b/t/instsh2.sh
index 9e6182c..506eee9 100755
--- a/t/instsh2.sh
+++ b/t/instsh2.sh
@@ -17,7 +17,7 @@
 # Various install-sh checks.
 
 am_create_testdir=empty
-. ./defs || exit 1
+. test-init.sh
 
 get_shell_script install-sh
 
diff --git a/t/instsh3.sh b/t/instsh3.sh
index f823893..23334bb 100755
--- a/t/instsh3.sh
+++ b/t/instsh3.sh
@@ -18,7 +18,7 @@
 
 am_create_testdir=empty
 required=non-root
-. ./defs || exit 1
+. test-init.sh
 
 # Solaris /usr/ucb/touch does not accept -t.
 touch -t $old_timestamp foo \
diff --git a/t/instspc.tap b/t/instspc.tap
index 2a0fb10..aace95c 100755
--- a/t/instspc.tap
+++ b/t/instspc.tap
@@ -19,7 +19,7 @@
 # Original report from James Amundson about file names with spaces.
 # Other characters added by Paul Eggert.
 
-. ./defs || exit 99
+. test-init.sh
 
 # Usage: is_in_list ITEM [LIST...]
 is_in_list ()
diff --git a/t/interp.sh b/t/interp.sh
index 766e878..18d06c1 100755
--- a/t/interp.sh
+++ b/t/interp.sh
@@ -16,7 +16,7 @@
 
 # Test to make sure variable interpolation works.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/interp2.sh b/t/interp2.sh
index 5da8a61..32a357d 100755
--- a/t/interp2.sh
+++ b/t/interp2.sh
@@ -17,7 +17,7 @@
 # Test to make sure variable interpolation doesn't break other
 # features.  Report from Joel N. Weber, II.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/java-check.sh b/t/java-check.sh
index c9ae66c..d4b4f0e 100755
--- a/t/java-check.sh
+++ b/t/java-check.sh
@@ -19,7 +19,7 @@
 # See automake bug#8234.
 
 required=javac
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_OUTPUT
diff --git a/t/java-clean.sh b/t/java-clean.sh
index 5457f19..a6b465f 100755
--- a/t/java-clean.sh
+++ b/t/java-clean.sh
@@ -17,7 +17,7 @@
 # Test cleaning of Java class files and timestamps.
 
 required=javac
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac <<'END'
 AC_OUTPUT
diff --git a/t/java-compile-install.sh b/t/java-compile-install.sh
index 4f78ea8..89749e5 100755
--- a/t/java-compile-install.sh
+++ b/t/java-compile-install.sh
@@ -17,7 +17,7 @@
 # Test on compilation and installation of Java class files.
 
 required=javac
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac <<'EOF'
 AC_OUTPUT
diff --git a/t/java-compile-run-flat.sh b/t/java-compile-run-flat.sh
index c04f4d9..c4725b0 100755
--- a/t/java-compile-run-flat.sh
+++ b/t/java-compile-run-flat.sh
@@ -20,12 +20,12 @@
 # This test uses a "flat" setup for the source tree (i.e., everything in
 # the top-level directory), and forces the use of the old, non-parallel
 # testsuite driver.  The sister test 'java-compile-run-nested.sh' do
-# similar checks with a more usual, "nested" setup, and using the newer
-# 'parallel-tests' driver.
+# similar checks with a more usual, "nested" setup, and using the older
+# 'serial-tests' driver.
 
 required='java javac'
 am_serial_tests=yes
-. ./defs || exit 1
+. test-init.sh
 
 echo "AC_SUBST([PATH_SEPARATOR], ['$PATH_SEPARATOR'])" >> configure.ac
 
diff --git a/t/java-compile-run-nested.sh b/t/java-compile-run-nested.sh
index 1448952..2d99345 100755
--- a/t/java-compile-run-nested.sh
+++ b/t/java-compile-run-nested.sh
@@ -18,14 +18,14 @@
 # Also meddle with wrapper scripts, as would be probably seen in a real
 # "UNIX-style" use case.
 # This test uses a typical "nested" source tree setup (i.e., different
-# components/aspects are separated into different subdirectories),
-# and uses the 'parallel-tests' testsuite driver.  The sister test
-# 'java-compile-run-flat.sh' do similar checks with a "flat" setup
-# (i.e., everything in the top-level directory), and forcing the use
-# of the older non-parallel 'simple-tests' driver.
+# components/aspects are separated into different subdirectories), and
+# uses the parallel testsuite driver.
+# The sister test 'java-compile-run-flat.sh' do similar checks with
+# a "flat" setup (i.e., everything in the top-level directory), and
+# forcing the use of the older 'serial-tests' driver.
 
 required='java javac'
-. ./defs || exit 1
+. test-init.sh
 
 echo "AC_SUBST([PATH_SEPARATOR], ['$PATH_SEPARATOR'])" >> configure.ac
 
diff --git a/t/java-empty-classpath.sh b/t/java-empty-classpath.sh
index c54da0b..a610240 100755
--- a/t/java-empty-classpath.sh
+++ b/t/java-empty-classpath.sh
@@ -18,7 +18,7 @@
 # compilation time.  See automake bug#9306.
 
 required=javac
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac <<'END'
 AC_CONFIG_SRCDIR([org/gnu/bug/Library.java])
diff --git a/t/java-extra.sh b/t/java-extra.sh
index 7b3a759..4ab8de0 100755
--- a/t/java-extra.sh
+++ b/t/java-extra.sh
@@ -20,7 +20,7 @@
 # conditionals).
 
 required=javac
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AM_CONDITIONAL([COND], [test x"$cond" = x"yes"])
diff --git a/t/java-mix.sh b/t/java-mix.sh
index 25e8511..65ffd68 100755
--- a/t/java-mix.sh
+++ b/t/java-mix.sh
@@ -19,7 +19,7 @@
 # modifiers.  Also check that '.java' files are not distributed by
 # default.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_OUTPUT
diff --git a/t/java-no-duplicate.sh b/t/java-no-duplicate.sh
index b5ad9fc..ec7467e 100755
--- a/t/java-no-duplicate.sh
+++ b/t/java-no-duplicate.sh
@@ -17,7 +17,7 @@
 # Test that some Java-related variables and rules are not repeatedly
 # defined.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am << 'END'
 javadir = $(datadir)/java
diff --git a/t/java-nobase.sh b/t/java-nobase.sh
index a643b3d..b49210b 100755
--- a/t/java-nobase.sh
+++ b/t/java-nobase.sh
@@ -17,7 +17,7 @@
 # Test support of 'nobase_' with the 'JAVA' primary.
 
 required=javac
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac <<'END'
 AC_OUTPUT
diff --git a/t/java-noinst.sh b/t/java-noinst.sh
index 8bb3832..558a8aa 100755
--- a/t/java-noinst.sh
+++ b/t/java-noinst.sh
@@ -18,7 +18,7 @@
 # be installed.
 
 required=javac
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_OUTPUT
diff --git a/t/java-rebuild.sh b/t/java-rebuild.sh
index 5b5f296..3b15c58 100755
--- a/t/java-rebuild.sh
+++ b/t/java-rebuild.sh
@@ -17,7 +17,7 @@
 # Test rebuild rules for Java class files.
 
 required='javac'
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac <<'END'
 AC_OUTPUT
diff --git a/t/java-sources.sh b/t/java-sources.sh
index 532cb1f..b0d51ba 100755
--- a/t/java-sources.sh
+++ b/t/java-sources.sh
@@ -17,7 +17,7 @@
 # Test definition of automake-generated private Makefile variable
 # '$(am__java_sources)'.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_OUTPUT
diff --git a/t/java-uninstall.sh b/t/java-uninstall.sh
index a128406..175b9c6 100755
--- a/t/java-uninstall.sh
+++ b/t/java-uninstall.sh
@@ -17,7 +17,7 @@
 # Check uninstallation of Java class files.
 
 required=javac
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_OUTPUT
diff --git a/t/java.sh b/t/java.sh
index 0103eea..b1cf51d 100755
--- a/t/java.sh
+++ b/t/java.sh
@@ -17,7 +17,7 @@
 # Minimal test of Java functionality.
 
 required=javac
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac <<'EOF'
 AC_OUTPUT
diff --git a/t/java2.sh b/t/java2.sh
index 286fdd6..c9064ac 100755
--- a/t/java2.sh
+++ b/t/java2.sh
@@ -18,7 +18,7 @@
 # no classes to compile.
 # Report from Braden McDaniel.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AM_CONDITIONAL(WITH_JDK, false)
diff --git a/t/java3.sh b/t/java3.sh
index eab7203..f7fdf65 100755
--- a/t/java3.sh
+++ b/t/java3.sh
@@ -18,7 +18,7 @@
 # *.java files when there are none.
 # Report from Johannes Nicolai (PR/441).
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AM_CONDITIONAL([WHO_CARES], [false])
diff --git a/t/javadir-undefined.sh b/t/javadir-undefined.sh
index fb0872e..e0764bd 100755
--- a/t/javadir-undefined.sh
+++ b/t/javadir-undefined.sh
@@ -20,7 +20,7 @@
 # the *.class files).
 # See automake bug#8461.
 
-. ./defs || exit 1
+. test-init.sh
 
 $ACLOCAL
 
diff --git a/t/javaflags.sh b/t/javaflags.sh
index 17f0dad..e3aad99 100755
--- a/t/javaflags.sh
+++ b/t/javaflags.sh
@@ -16,7 +16,7 @@
 
 # Check support for $(JAVACFLAGS) and $(AM_JAVACFLAGS).
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > fake-javac <<'END'
 #!/bin/sh
diff --git a/t/javaprim.sh b/t/javaprim.sh
index a5c4a62..6d039c2 100755
--- a/t/javaprim.sh
+++ b/t/javaprim.sh
@@ -16,7 +16,7 @@
 
 # Test to make sure JAVA variable can be defined by AC_SUBST.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_SUBST([JAVA])
diff --git a/t/javasubst.sh b/t/javasubst.sh
index b6929b8..e0e8aca 100755
--- a/t/javasubst.sh
+++ b/t/javasubst.sh
@@ -16,7 +16,7 @@
 
 # Test to make sure redefining JAVAC with AC_SUBST works.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_SUBST([JAVAC])
diff --git a/t/ldadd.sh b/t/ldadd.sh
index 9487459..9fbaf2c 100755
--- a/t/ldadd.sh
+++ b/t/ldadd.sh
@@ -17,7 +17,7 @@
 # Check to make sure incorrect LDADD usage is diagnosed.
 
 required=libtool
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/ldflags.sh b/t/ldflags.sh
index 7eb9be3..d25231d 100755
--- a/t/ldflags.sh
+++ b/t/ldflags.sh
@@ -18,7 +18,7 @@
 # PR 77.
 
 required=libtool
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/lex-clean-cxx.sh b/t/lex-clean-cxx.sh
index 38a129c..52becb7 100755
--- a/t/lex-clean-cxx.sh
+++ b/t/lex-clean-cxx.sh
@@ -20,7 +20,7 @@
 # See also sister test 'lex-clean.sh'.
 
 required='c++ lex'
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CXX
diff --git a/t/lex-clean.sh b/t/lex-clean.sh
index 3bc52d3..7fb7a2e 100755
--- a/t/lex-clean.sh
+++ b/t/lex-clean.sh
@@ -20,7 +20,7 @@
 # See also sister test 'lex-clean-cxx.sh'.
 
 required='cc lex'
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/lex-depend-cxx.sh b/t/lex-depend-cxx.sh
index 15557a8..0e72281 100755
--- a/t/lex-depend-cxx.sh
+++ b/t/lex-depend-cxx.sh
@@ -18,7 +18,7 @@
 # Test synthesized from PR automake/6.
 
 required='c++ lex'
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CXX
diff --git a/t/lex-depend-grep.sh b/t/lex-depend-grep.sh
index e7c9538..7828088 100755
--- a/t/lex-depend-grep.sh
+++ b/t/lex-depend-grep.sh
@@ -18,7 +18,7 @@
 # in obvious ways.  See PR automake/6, and related semantic tests
 # 'lex-depend.sh' and 'lex-depend-cxx.sh'.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/lex-depend.sh b/t/lex-depend.sh
index 7280b84..081f1ba 100755
--- a/t/lex-depend.sh
+++ b/t/lex-depend.sh
@@ -18,7 +18,7 @@
 # Test suggested by PR automake/6.
 
 required='cc lex'
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/lex-header.sh b/t/lex-header.sh
index ad2976e..f1283f6 100755
--- a/t/lex-header.sh
+++ b/t/lex-header.sh
@@ -18,7 +18,7 @@
 # bugs #8844 and #9933).
 
 required='cc flex'
-. ./defs || exit 1
+. test-init.sh
 
 # Here, we need to use the use flex option '--header-file', but some
 # older flex versions don't support is (see automake bug#11524 and
diff --git a/t/lex-lib-external.sh b/t/lex-lib-external.sh
index 9a64266..5a2e3c3 100755
--- a/t/lex-lib-external.sh
+++ b/t/lex-lib-external.sh
@@ -18,7 +18,7 @@
 # library, if that's available.
 
 required='cc lex'
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/lex-lib.sh b/t/lex-lib.sh
index 11767d8..e0b05f5 100755
--- a/t/lex-lib.sh
+++ b/t/lex-lib.sh
@@ -19,7 +19,7 @@
 # See also test 'lex-lib-external.sh'.
 
 required='cc lex'
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/lex-libobj.sh b/t/lex-libobj.sh
index 9bd597a..f07b1bc 100755
--- a/t/lex-libobj.sh
+++ b/t/lex-libobj.sh
@@ -18,7 +18,7 @@
 # LIBOBJ machinery.
 
 required='cc lex'
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/lex-line.sh b/t/lex-line.sh
index 11f40b8..4a51c1e 100755
--- a/t/lex-line.sh
+++ b/t/lex-line.sh
@@ -20,7 +20,7 @@
 # See also sister test 'yacc-line.sh'.
 
 required='cc lex'
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_CONFIG_FILES([sub/Makefile])
diff --git a/t/lex-nodist.sh b/t/lex-nodist.sh
index 0bbb6cb..e318c3e 100755
--- a/t/lex-nodist.sh
+++ b/t/lex-nodist.sh
@@ -21,7 +21,7 @@
 # for yacc-generated .c and .h files.
 
 required='cc lex'
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/lex-noyywrap.sh b/t/lex-noyywrap.sh
index c4c4964..fed6cb0 100755
--- a/t/lex-noyywrap.sh
+++ b/t/lex-noyywrap.sh
@@ -17,7 +17,7 @@
 # Check Lex support with flex using the '%noyywrap' option.
 
 required='cc flex'
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/lex-pr204.sh b/t/lex-pr204.sh
index 8172ec7..f6b15ab 100755
--- a/t/lex-pr204.sh
+++ b/t/lex-pr204.sh
@@ -21,7 +21,7 @@
 # for yacc-generated .c and .h files.
 
 required='cc lex'
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac <<'EOF'
 AM_MAINTAINER_MODE
diff --git a/t/lex-subobj-nodep.sh b/t/lex-subobj-nodep.sh
index 0c021a2..2d64051 100755
--- a/t/lex-subobj-nodep.sh
+++ b/t/lex-subobj-nodep.sh
@@ -18,7 +18,7 @@
 # are used, even when dependency tracking is disabled.
 
 required='cc lex'
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac <<\END
 AC_PROG_CC
diff --git a/t/lex.sh b/t/lex.sh
index 34a1493..754031d 100755
--- a/t/lex.sh
+++ b/t/lex.sh
@@ -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/>.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/lex2.sh b/t/lex2.sh
index bfdde02..c959db7 100755
--- a/t/lex2.sh
+++ b/t/lex2.sh
@@ -16,7 +16,7 @@
 
 # Make sure that Automake suggest using AM_PROG_LEX when a lexer is used.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/lex3.sh b/t/lex3.sh
index b008880..633d55a 100755
--- a/t/lex3.sh
+++ b/t/lex3.sh
@@ -19,7 +19,7 @@
 # From Matthew D. Langston.
 
 required='cc lex'
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/lex5.sh b/t/lex5.sh
index cce028a..d8ccc7a 100755
--- a/t/lex5.sh
+++ b/t/lex5.sh
@@ -17,7 +17,7 @@
 # Test for subdir lexers.
 
 required='cc lex'
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/lexcpp.sh b/t/lexcpp.sh
index d46c82d..90f2dc0 100755
--- a/t/lexcpp.sh
+++ b/t/lexcpp.sh
@@ -17,7 +17,7 @@
 # Test to make sure Lex + C++ is supported.
 # Please keep this is sync with sister test 'yaccpp.sh'.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CXX
diff --git a/t/lexvpath.sh b/t/lexvpath.sh
index 569048e..04098bb 100755
--- a/t/lexvpath.sh
+++ b/t/lexvpath.sh
@@ -23,7 +23,7 @@
 # Please keep this in sync with sister test 'yaccvapth.sh'.
 
 required='cc lex'
-. ./defs || exit 1
+. test-init.sh
 
 cat > lexoutroot.in << 'END'
 LEX_OUTPUT_ROOT='@LEX_OUTPUT_ROOT@'
diff --git a/t/lflags.sh b/t/lflags.sh
index 933f896..b277521 100755
--- a/t/lflags.sh
+++ b/t/lflags.sh
@@ -20,7 +20,7 @@
 # and yflags2.sh.
 
 required=cc
-. ./defs || exit 1
+. test-init.sh
 
 cat >fake-lex <<'END'
 #!/bin/sh
diff --git a/t/lflags2.sh b/t/lflags2.sh
index f657da5..5e5e8bf 100755
--- a/t/lflags2.sh
+++ b/t/lflags2.sh
@@ -19,7 +19,7 @@
 # Please keep this in sync with the sister tests lflags.sh, yflags.sh
 # and yflags2.sh.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >fake-lex <<'END'
 #!/bin/sh
diff --git a/t/libexec.sh b/t/libexec.sh
index e4255e0..14c6739 100755
--- a/t/libexec.sh
+++ b/t/libexec.sh
@@ -16,7 +16,7 @@
 
 # PROGRAMS and LIBRARIES can be installed in (pkg)libexecdir.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am << 'END'
 libexec_PROGRAMS = foo
diff --git a/t/libobj-basic.sh b/t/libobj-basic.sh
index c730c52..c9e16da 100755
--- a/t/libobj-basic.sh
+++ b/t/libobj-basic.sh
@@ -17,7 +17,7 @@
 # Make sure AC_LIBSOURCE and AC_LIBSOURCES work.
 
 required=cc
-. ./defs || exit 1
+. test-init.sh
 
 mv configure.ac configure.proto
 cat >> configure.proto << 'END'
diff --git a/t/libobj10.sh b/t/libobj10.sh
index 1c0736b..d8e8d58 100755
--- a/t/libobj10.sh
+++ b/t/libobj10.sh
@@ -18,7 +18,7 @@
 # it's in BUILT_SOURCES.  Reported by Erez Zadok.
 
 required=cc
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/libobj12.sh b/t/libobj12.sh
index 6c917e2..910dd79 100755
--- a/t/libobj12.sh
+++ b/t/libobj12.sh
@@ -17,7 +17,7 @@
 # Test if a file can be mentioned in LIBOBJS and explicitly.
 # (See libobj13.sh for the LTLIBRARIES check.)
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/libobj13.sh b/t/libobj13.sh
index 3a9ee71..f872ec7 100755
--- a/t/libobj13.sh
+++ b/t/libobj13.sh
@@ -18,7 +18,7 @@
 # (Like libobj12.sh, but for Libtool libraries.)
 
 required='libtoolize'
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/libobj14.sh b/t/libobj14.sh
index 266aaad..17ba986 100755
--- a/t/libobj14.sh
+++ b/t/libobj14.sh
@@ -19,7 +19,7 @@
 # that uses it.
 # Report from Bill Davidson.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac <<'EOF'
 AC_PROG_CC
diff --git a/t/libobj15a.sh b/t/libobj15a.sh
index c7c30e8..b60154d 100755
--- a/t/libobj15a.sh
+++ b/t/libobj15a.sh
@@ -16,7 +16,7 @@
 
 # Nonexistent sources for AC_LIBOBJ should cause an Automake failure.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/libobj15b.sh b/t/libobj15b.sh
index 71ace12..004c539 100755
--- a/t/libobj15b.sh
+++ b/t/libobj15b.sh
@@ -16,7 +16,7 @@
 
 # Nonexistent source for AC_LIBSOURCE should cause Automake to fail.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/libobj15c.sh b/t/libobj15c.sh
index ccaa6bd..6db5f43 100755
--- a/t/libobj15c.sh
+++ b/t/libobj15c.sh
@@ -16,7 +16,7 @@
 
 # Nonexistent sources for AC_LIBSOURCES should cause Automake to fail.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/libobj16a.sh b/t/libobj16a.sh
index 9bf602a..f2b32ac 100755
--- a/t/libobj16a.sh
+++ b/t/libobj16a.sh
@@ -18,7 +18,7 @@
 # Please keep this in sync with sister test 'libobj16b.sh'.
 
 required=cc
-. ./defs || exit 1
+. test-init.sh
 
 mv configure.ac configure.proto
 cat >> configure.proto << 'END'
diff --git a/t/libobj16b.sh b/t/libobj16b.sh
index 6005725..abc6a66 100755
--- a/t/libobj16b.sh
+++ b/t/libobj16b.sh
@@ -18,7 +18,7 @@
 # Please keep this in sync with sister test 'libobj16a.sh'.
 
 required=cc
-. ./defs || exit 1
+. test-init.sh
 
 mv configure.ac configure.proto
 cat >> configure.proto << 'END'
diff --git a/t/libobj17.sh b/t/libobj17.sh
index e4277f9..bc743b2 100755
--- a/t/libobj17.sh
+++ b/t/libobj17.sh
@@ -17,7 +17,7 @@
 # Make sure AC_LIBOBJ accept non-literal arguments.
 
 required=cc
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/libobj18.sh b/t/libobj18.sh
index 77d7d54..209cab1 100755
--- a/t/libobj18.sh
+++ b/t/libobj18.sh
@@ -16,7 +16,7 @@
 
 # Make sure AC_LIBSOURCE and AC_LIBSOURCES use arguments literally.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/libobj19.sh b/t/libobj19.sh
index cae9e81..7a4c895 100755
--- a/t/libobj19.sh
+++ b/t/libobj19.sh
@@ -17,7 +17,7 @@
 # Test support for AC_CONFIG_LIBOBJ_DIR.
 
 required=cc
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_CONFIG_LIBOBJ_DIR([libobj-dir])
diff --git a/t/libobj2.sh b/t/libobj2.sh
index 778dbd3..cce0627 100755
--- a/t/libobj2.sh
+++ b/t/libobj2.sh
@@ -18,7 +18,7 @@
 # Bug from Josh MacDonald.
 
 required=cc
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_CONFIG_FILES([subdir/Makefile])
diff --git a/t/libobj20a.sh b/t/libobj20a.sh
index 52c41ec..3f67144 100755
--- a/t/libobj20a.sh
+++ b/t/libobj20a.sh
@@ -17,7 +17,7 @@
 # Test error reporting for AC_CONFIG_LIBOBJ_DIR.
 # See also sister tests 'libobj20b.sh' and 'libobj20c.sh'.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_CONFIG_LIBOBJ_DIR([libobj-dir])
diff --git a/t/libobj20b.sh b/t/libobj20b.sh
index d9ba8da..b42b8c9 100755
--- a/t/libobj20b.sh
+++ b/t/libobj20b.sh
@@ -17,7 +17,7 @@
 # Test error reporting for AC_CONFIG_LIBOBJ_DIR.
 # See also sister tests 'libobj20a.sh' and 'libobj20c.sh'.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_CONFIG_LIBOBJ_DIR([libobj-dir])
diff --git a/t/libobj20c.sh b/t/libobj20c.sh
index fe6ae63..295eeac 100755
--- a/t/libobj20c.sh
+++ b/t/libobj20c.sh
@@ -17,7 +17,7 @@
 # Test error reporting for AC_CONFIG_LIBOBJ_DIR.
 # See also sister tests 'libobj20a.sh' and 'libobj20b.sh'.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_CONFIG_LIBOBJ_DIR([libobj-dir])
diff --git a/t/libobj3.sh b/t/libobj3.sh
index 1c78cba..c423591 100755
--- a/t/libobj3.sh
+++ b/t/libobj3.sh
@@ -17,7 +17,7 @@
 # Make sure we complain if @LIBOBJS@ is used without being set in
 # configure.ac.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_RANLIB
diff --git a/t/libobj4.sh b/t/libobj4.sh
index c7a199e..f2ab0cf 100755
--- a/t/libobj4.sh
+++ b/t/libobj4.sh
@@ -17,7 +17,7 @@
 # Test to make sure LIBOBJS error only occurs if LIBOBJS seen.  Report
 # from Jim Meyering.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am << 'END'
 bin_PROGRAMS = foo
diff --git a/t/libobj5.sh b/t/libobj5.sh
index d8b7e2d..7d1d510 100755
--- a/t/libobj5.sh
+++ b/t/libobj5.sh
@@ -17,7 +17,7 @@
 # Test to make sure AC_REPLACE_FUNCS works across lines.  Report from
 # Jim Meyering.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am << 'END'
 bin_PROGRAMS = joe
diff --git a/t/libobj7.sh b/t/libobj7.sh
index 1630bee..1fa6d20 100755
--- a/t/libobj7.sh
+++ b/t/libobj7.sh
@@ -17,7 +17,7 @@
 # Test for multiple replacement functions.
 
 required=cc
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/library.sh b/t/library.sh
index e95fecb..8675f28 100755
--- a/t/library.sh
+++ b/t/library.sh
@@ -16,7 +16,7 @@
 
 # Test for _DEPENDENCIES with libraries.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_RANLIB
diff --git a/t/library2.sh b/t/library2.sh
index 98c880b..0de45af 100755
--- a/t/library2.sh
+++ b/t/library2.sh
@@ -16,7 +16,7 @@
 
 # Make sure Automake suggest using AC_PROG_RANLIB when *_LIBRARIES is used.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/library3.sh b/t/library3.sh
index 308e748..642c3c9 100755
--- a/t/library3.sh
+++ b/t/library3.sh
@@ -16,7 +16,7 @@
 
 # Make sure Automake simplify conditions in diagnostics.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac <<EOF
 AC_PROG_CC
diff --git a/t/libtoo10.sh b/t/libtoo10.sh
index c84ddb8..968bcb9 100755
--- a/t/libtoo10.sh
+++ b/t/libtoo10.sh
@@ -18,7 +18,7 @@
 # Report from Guillermo Ontañón.
 
 required='cc libtoolize'
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AM_PROG_AR
diff --git a/t/libtoo11.sh b/t/libtoo11.sh
index 1f91f19..5ebcf42 100755
--- a/t/libtoo11.sh
+++ b/t/libtoo11.sh
@@ -18,7 +18,7 @@
 # Report by Charles Wilson.
 
 required='cc libtoolize'
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_LIBTOOL
diff --git a/t/libtool-macros.sh b/t/libtool-macros.sh
index 17fea06..c50777b 100755
--- a/t/libtool-macros.sh
+++ b/t/libtool-macros.sh
@@ -18,7 +18,7 @@
 # to the test cases requiring them.
 # See also automake bug#9807.
 
-. ./defs || exit 1
+. test-init.sh
 
 echo "# Automatically generated by $me." > get.sh
 echo : >> get.sh
diff --git a/t/libtool.sh b/t/libtool.sh
index dd918a1..d1f1162 100755
--- a/t/libtool.sh
+++ b/t/libtool.sh
@@ -18,7 +18,7 @@
 # Report from Kevin Dalley.
 
 required=libtool
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_LIBTOOL_DLOPEN
diff --git a/t/libtool2.sh b/t/libtool2.sh
index d9db4aa..df25abb 100755
--- a/t/libtool2.sh
+++ b/t/libtool2.sh
@@ -18,7 +18,7 @@
 # Report from Eric Magnien.
 
 required=libtoolize
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/libtool3.sh b/t/libtool3.sh
index fdbd86d..b86c84f 100755
--- a/t/libtool3.sh
+++ b/t/libtool3.sh
@@ -18,7 +18,7 @@
 # Also make sure we do not bloat the Makefile with unneeded rules.
 
 required='cc libtoolize'
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/libtool4.sh b/t/libtool4.sh
index e8704b7..84fa95d 100755
--- a/t/libtool4.sh
+++ b/t/libtool4.sh
@@ -16,7 +16,7 @@
 
 # Make sure Automake suggests AC_PROG_LIBTOOL when *_LTLIBRARIES is used.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac <<'END'
 AC_PROG_CC
diff --git a/t/libtool5.sh b/t/libtool5.sh
index 7605098..9f7e995 100755
--- a/t/libtool5.sh
+++ b/t/libtool5.sh
@@ -19,7 +19,7 @@
 # Report from Harlan Stenn.
 
 required='libtoolize'
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac <<'END'
 AM_CONDITIONAL([COND1], [true])
diff --git a/t/libtool6.sh b/t/libtool6.sh
index 19f30e7..34c8dc8 100755
--- a/t/libtool6.sh
+++ b/t/libtool6.sh
@@ -18,7 +18,7 @@
 # in different directories.  PR/285.
 
 required='libtoolize'
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac <<'END'
 AM_CONDITIONAL([COND1], [true])
diff --git a/t/libtool7.sh b/t/libtool7.sh
index 59e9e25..f810b69 100755
--- a/t/libtool7.sh
+++ b/t/libtool7.sh
@@ -18,7 +18,7 @@
 # Also check basic support for AM_LIBTOOLFLAGS/LIBTOOLFLAGS
 
 required='cc libtoolize'
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/libtool8.sh b/t/libtool8.sh
index 8cfb8e3..edf432d 100755
--- a/t/libtool8.sh
+++ b/t/libtool8.sh
@@ -17,7 +17,7 @@
 # Make sure Automake diagnoses conflicting installations.
 
 required='libtoolize'
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac <<'END'
 AM_CONDITIONAL([COND1], [true])
diff --git a/t/libtool9.sh b/t/libtool9.sh
index 1bb85cc..4304467 100755
--- a/t/libtool9.sh
+++ b/t/libtool9.sh
@@ -20,7 +20,7 @@
 # xxx_LDFLAGS.
 
 required='cc libtoolize'
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/license.sh b/t/license.sh
index cad4307..bda8b86 100755
--- a/t/license.sh
+++ b/t/license.sh
@@ -16,7 +16,7 @@
 
 # Make sure COPYING is not overwritten, even with -a -f.
 
-. ./defs || exit 1
+. test-init.sh
 
 echo AC_OUTPUT >>configure.ac
 
diff --git a/t/license2.sh b/t/license2.sh
index 736e96f..ed1fd3c 100755
--- a/t/license2.sh
+++ b/t/license2.sh
@@ -16,7 +16,7 @@
 
 # Check that installing 'COPYING' outputs a warning.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am << 'END'
 AUTOMAKE_OPTIONS = gnu
diff --git a/t/link_c_cxx.sh b/t/link_c_cxx.sh
index 27dcb24..14710e8 100755
--- a/t/link_c_cxx.sh
+++ b/t/link_c_cxx.sh
@@ -17,7 +17,7 @@
 # Test to make sure the C++ linker is used when appropriate.
 # Matthew D. Langston <address@hidden>
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/link_cond.sh b/t/link_cond.sh
index a5ac4b1..6913d47 100755
--- a/t/link_cond.sh
+++ b/t/link_cond.sh
@@ -21,7 +21,7 @@
 # See automake bug#11089.
 
 required='cc c++'
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/link_dist.sh b/t/link_dist.sh
index 9ad4319..e9011e1 100755
--- a/t/link_dist.sh
+++ b/t/link_dist.sh
@@ -18,7 +18,7 @@
 # *_SOURCES
 # Richard Boulton <address@hidden>
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/link_f90_only.sh b/t/link_f90_only.sh
index f9c7c18..90348d7 100755
--- a/t/link_f90_only.sh
+++ b/t/link_f90_only.sh
@@ -17,7 +17,7 @@
 # Test to make sure the Fortran 90 linker is used when appropriate.
 # (copied from 'link_f_only.sh') Mike Nolta <address@hidden>
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_FC
diff --git a/t/link_f_only.sh b/t/link_f_only.sh
index 5d27025..a176902 100755
--- a/t/link_f_only.sh
+++ b/t/link_f_only.sh
@@ -17,7 +17,7 @@
 # Test to make sure the Fortran 77 linker is used when appropriate.
 # Matthew D. Langston <address@hidden>
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_F77
diff --git a/t/link_fc.sh b/t/link_fc.sh
index f334ad8..76b9053 100755
--- a/t/link_fc.sh
+++ b/t/link_fc.sh
@@ -17,7 +17,7 @@
 # Test to make sure the Fortran 77 linker is used when appropriate.
 # Matthew D. Langston <address@hidden>
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/link_fccxx.sh b/t/link_fccxx.sh
index 03b71f5..059f155 100755
--- a/t/link_fccxx.sh
+++ b/t/link_fccxx.sh
@@ -17,7 +17,7 @@
 # Test to make sure the C++ linker is used when appropriate.
 # Matthew D. Langston <address@hidden>
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/link_fcxx.sh b/t/link_fcxx.sh
index 29893d8..723cddc 100755
--- a/t/link_fcxx.sh
+++ b/t/link_fcxx.sh
@@ -17,7 +17,7 @@
 # Test to make sure the C++ linker is used when appropriate.
 # Matthew D. Langston <address@hidden>
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CXX
diff --git a/t/link_override.sh b/t/link_override.sh
index 1bf1085..682225f 100755
--- a/t/link_override.sh
+++ b/t/link_override.sh
@@ -16,7 +16,7 @@
 
 # Test to make sure _LINK variables are detected and used as documented.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/lisp-flags.sh b/t/lisp-flags.sh
new file mode 100755
index 0000000..4c52f2e
--- /dev/null
+++ b/t/lisp-flags.sh
@@ -0,0 +1,41 @@
+#! /bin/sh
+# Copyright (C) 2003-2012 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/>.
+
+# Elisp byte-compilation honours AM_ELCFLAFS and ELCFLAGS.
+
+. test-init.sh
+
+cat > Makefile.am << 'EOF'
+lisp_LISP = foo.el
+AM_ELCFLAGS = __am_elcflags__
+EOF
+
+cat >> configure.ac << 'EOF'
+AM_PATH_LISPDIR
+AC_OUTPUT
+EOF
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE --add-missing
+
+./configure EMACS='echo >$@' --with-lispdir="$(pwd)/unused"
+
+: > foo.el
+ELCFLAGS='__usr_elcflags__' $MAKE -e
+grep '__am_elcflags__.*__usr_elcflags__' foo.elc
+
+:
diff --git a/t/lisp-loadpath.sh b/t/lisp-loadpath.sh
new file mode 100755
index 0000000..43e2d09
--- /dev/null
+++ b/t/lisp-loadpath.sh
@@ -0,0 +1,67 @@
+#! /bin/sh
+# Copyright (C) 2012 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/>.
+
+# Emacs lisp files in both $(srcdir) and $(builddir) are found if
+# required by other files.  Related to automake bug#11806.
+
+required=emacs
+. test-init.sh
+
+cat >> configure.ac << 'END'
+AM_PATH_LISPDIR
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+noinst_LISP = requirer.el
+lisp_LISP = foo.el
+lisp_DATA = bar.el
+END
+
+echo "(require 'foo) (require 'bar)" >> requirer.el
+echo "(provide 'foo)" > foo.el
+echo "(provide 'bar)" > bar.el
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
+
+mkdir build
+cd build
+../configure
+$MAKE
+test -f requirer.elc
+test -f foo.elc
+test ! -e bar.elc
+
+$MAKE clean
+test ! -e requirer.elc
+test ! -e foo.elc
+
+# In the spirit of VPATH, stuff in the builddir is preferred to
+# stuff in the srcdir.
+echo "(provide" > ../foo.el  # Break it.
+echo "defun)" > ../bar.el    # Likewise.
+$MAKE && exit 1
+$sleep
+echo "(provide 'foo)" > foo.el
+echo "(provide 'bar)" > bar.el
+$MAKE
+test -f requirer.elc
+test -f foo.elc
+test ! -e bar.elc
+
+:
diff --git a/t/lisp-pr11806.sh b/t/lisp-pr11806.sh
index c372ea5..edcf9ba 100755
--- a/t/lisp-pr11806.sh
+++ b/t/lisp-pr11806.sh
@@ -18,7 +18,7 @@
 # See automake bug#11806.
 
 required=emacs
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AM_PATH_LISPDIR
diff --git a/t/lisp-subdir-mix.sh b/t/lisp-subdir-mix.sh
new file mode 100755
index 0000000..9688eec
--- /dev/null
+++ b/t/lisp-subdir-mix.sh
@@ -0,0 +1,96 @@
+#! /bin/sh
+# Copyright (C) 2012 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 compiling elisp files in different subdirectories, where a
+# file in a subdirectory might require a file in another one.
+# This doesn't work out of the box, but can be made to work with a
+# judicious use of $(AM_ELCFLAGS).
+
+required=emacs
+. test-init.sh
+
+cat >> configure.ac << 'END'
+AM_PATH_LISPDIR
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+dist_lisp_LISP = \
+  am-here.el \
+  sub1/am-one.el \
+  sub2/am-two.el \
+  sub3/subsub/am-three.el
+
+AM_ELCFLAGS = \
+  -L $(srcdir)/sub1 \
+  -L $(srcdir)/sub2 \
+  -L $(srcdir)/sub3/subsub
+
+elc-test:
+       test -f sub1/am-one.elc
+       test -f sub2/am-two.elc
+       test -f sub3/subsub/am-three.elc
+.PHONY: elc-test
+check-local: elc-test
+END
+
+mkdir sub1 sub2 sub3 sub3/subsub
+
+cat > am-here.el << 'END'
+(provide 'am-here)
+(require 'am-one)
+(require 'am-two)
+(require 'am-three)
+END
+
+cat > sub1/am-one.el << 'END'
+(require 'am-here)
+(provide 'am-one)
+(require 'am-two)
+(require 'am-three)
+END
+
+cat > sub2/am-two.el << 'END'
+(require 'am-here)
+(require 'am-one)
+(provide 'am-two)
+(require 'am-three)
+END
+
+cat > sub3/subsub/am-three.el << 'END'
+(require 'am-here)
+(require 'am-one)
+(require 'am-two)
+(provide 'am-three)
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE --add-missing
+
+./configure
+
+$MAKE
+$MAKE elc-test
+$MAKE clean
+for x in am-here sub1/am-one sub2/am-two sub3/subsub/am-three; do
+  test -f $x.el
+  test ! -e $x.elc
+done
+
+$MAKE distcheck
+
+:
diff --git a/t/lisp-subdir.sh b/t/lisp-subdir.sh
new file mode 100755
index 0000000..9836400
--- /dev/null
+++ b/t/lisp-subdir.sh
@@ -0,0 +1,80 @@
+#! /bin/sh
+# Copyright (C) 2012 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/>.
+
+# Emacs lisp files in subdirectories.
+
+required=emacs
+. test-init.sh
+
+cat >> configure.ac << 'END'
+AM_PATH_LISPDIR
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+nobase_lisp_LISP = sub/am-one.el sub/am-two.el sub/am-three.el
+nobase_dist_lisp_LISP = sub/am-three.el
+dist_noinst_LISP = sub/am-four.el
+EXTRA_DIST = sub/am-one.el sub/am-two.el
+END
+
+mkdir sub
+echo "(require 'am-two) (provide 'am-one)"      > sub/am-one.el
+echo "(require 'am-three) (provide 'am-two)"    > sub/am-two.el
+echo "(provide 'am-three)"                      > sub/am-three.el
+echo "(require 'am-one) (require 'am-two)"      > sub/am-four.el
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE --add-missing
+
+./configure --prefix="$(pwd)/inst" \
+            --with-lispdir="$(pwd)/inst/elisp" \
+
+$MAKE
+# No byte-compiled elisp files in the top-level directory.
+test "$(echo *.elc)" = '*.elc'
+test -f sub/am-one.elc
+test -f sub/am-two.elc
+test -f sub/am-three.elc
+test -f sub/am-four.elc
+$MAKE clean
+test ! -e sub/am-one.elc
+test ! -e sub/am-two.elc
+test ! -e sub/am-three.elc
+test ! -e sub/am-four.elc
+
+# Check installation.
+
+sort > exp << 'END'
+inst/elisp/sub/am-one.elc
+inst/elisp/sub/am-two.elc
+inst/elisp/sub/am-three.elc
+END
+
+$MAKE install
+find inst # For debugging.
+find inst -name '*.elc' > lst || { cat lst; exit 1; }
+sort lst > got
+
+cat exp
+cat got
+diff exp got
+
+# Also check VPATH builds and uninstall completeness.
+$MAKE distcheck
+
+:
diff --git a/t/lisp-subdir2.sh b/t/lisp-subdir2.sh
new file mode 100755
index 0000000..0ea3e9f
--- /dev/null
+++ b/t/lisp-subdir2.sh
@@ -0,0 +1,78 @@
+#! /bin/sh
+# Copyright (C) 2012 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/>.
+
+# Compiling elisp files in different subdirectories.
+
+required=emacs
+. test-init.sh
+
+cat >> configure.ac << 'END'
+AM_PATH_LISPDIR
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+dist_lisp_LISP = am-one.el
+nodist_lisp_LISP = sub/am-two.el
+sub/am-two.el:
+       mkdir sub
+       echo "(provide 'am-two)" > $@
+DISTCLEANFILES = $(nodist_lisp_LISP)
+dist_noinst_LISP = x/y/z/am-three.el
+
+elc-test:
+       test -f am-one.elc
+       test -f sub/am-two.elc
+       test -f x/y/z/am-three.elc
+.PHONY: elc-test
+check-local: elc-test
+END
+
+mkdir x x/y x/y/z
+echo "(provide 'am-one)" > am-one.el
+# sub/am-two.el is generated at make runtime
+echo "(provide 'am-three)" > x/y/z/am-three.el
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE --add-missing
+
+./configure
+
+$MAKE
+$MAKE elc-test
+$MAKE clean
+test ! -e am-one.elc
+test ! -e sub/am-two.elc
+test ! -e x/y/z/am-three.elc
+test -f am-one.el
+test -f sub/am-two.el
+test -f x/y/z/am-three.el
+
+# Byte-compiling only a subset of the elisp files.
+$MAKE am-one.elc sub/am-two.elc 
+test -f am-one.elc
+test -f sub/am-two.elc
+test ! -e x/y/z/am-three.elc
+rm -f am-one.elc sub/am-two.elc
+$MAKE x/y/z/am-three.elc
+test ! -e am-one.elc
+test ! -e sub/am-two.elc
+test -f x/y/z/am-three.elc
+
+$MAKE distcheck
+
+:
diff --git a/t/lisp2.sh b/t/lisp2.sh
index 4f07911..dfd6800 100755
--- a/t/lisp2.sh
+++ b/t/lisp2.sh
@@ -16,7 +16,7 @@
 
 # Make sure that Automake suggest using AM_PATH_LISPDIR to define lispdir.
 
-. ./defs || exit 1
+. test-init.sh
 
 
 : TRY 1 -- We lack both EMACS and lispdir.
diff --git a/t/lisp3.sh b/t/lisp3.sh
index 5b95715..7717c1c 100755
--- a/t/lisp3.sh
+++ b/t/lisp3.sh
@@ -17,7 +17,7 @@
 # Test that compiling interdependent elisp files works.
 
 required=emacs
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am << 'EOF'
 lisp_LISP = am-one.el am-two.el am-three.el
@@ -47,7 +47,6 @@ $MAKE
 test -f am-one.elc
 test -f am-two.elc
 test -f am-three.elc
-test -f elc-stamp
 
 # Make sure we can recover from a deletion.
 rm -f am-one.elc
@@ -79,15 +78,6 @@ test -f _inst/$dir/site-lisp/am-three.elc
 $MAKE uninstall
 find _inst | $EGREP '\.elc?$' && exit 1
 
-# Make sure we build all files when any of them change.
-# (We grep a message to make sure the compilation happens.)
-unique=0a3346e2af8a689b85002b53df09142a
-$sleep
-echo "(message \"$unique\")(provide 'am-three)" > am-three.el
-$MAKE >output 2>&1 || { cat output; exit 1; }
-cat output
-grep $unique output
-
 # It should also work for VPATH-builds.
 $MAKE distcheck
 
diff --git a/t/lisp4.sh b/t/lisp4.sh
index b8cb796..1b2809c 100755
--- a/t/lisp4.sh
+++ b/t/lisp4.sh
@@ -18,7 +18,7 @@
 # Report from Simon Josefsson.
 
 required=emacs
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am << 'EOF'
 lisp_LISP = am-one.el am-two.el am-three.el
@@ -32,7 +32,6 @@ test:
        test ! -f am-one.elc
        test ! -f am-two.elc
        test ! -f am-three.elc
-       test ! -f elc-stamp
 
 install-test: install
        test -f "$(lispdir)/am-one.el"
diff --git a/t/lisp5.sh b/t/lisp5.sh
index 4624010..de9c118 100755
--- a/t/lisp5.sh
+++ b/t/lisp5.sh
@@ -18,7 +18,7 @@
 # non-bytecompiled *.el files.
 
 required=emacs
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am << 'EOF'
 lisp_DATA = am-one.el am-two.el am-three.el
@@ -31,7 +31,6 @@ test:
        test ! -f am-one.elc
        test ! -f am-two.elc
        test ! -f am-three.elc
-       test ! -f elc-stamp
 
 install-test: install
        test -f "$(lispdir)/am-one.el"
diff --git a/t/lisp6.sh b/t/lisp6.sh
index e877d5a..ae81a1c 100755
--- a/t/lisp6.sh
+++ b/t/lisp6.sh
@@ -17,7 +17,7 @@
 # Test for conditional _LISP.
 
 required=emacs
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am << 'EOF'
 dist_lisp_LISP = am-one.el
@@ -57,7 +57,6 @@ $MAKE
 test -f am-one.elc
 test ! -e am-two.elc
 test -f am-three.elc
-test -f elc-stamp
 
 $MAKE install
 test -f lisp/am-one.el
@@ -73,7 +72,6 @@ $MAKE distclean
 test ! -e am-one.elc
 test ! -e am-two.elc
 test ! -e am-three.elc
-test ! -e elc-stamp
 
 ./configure --with-lispdir="$cwd/lisp" want_two=1
 
@@ -81,7 +79,6 @@ $MAKE
 test -f am-one.elc
 test -f am-two.elc
 test -f am-three.elc
-test -f elc-stamp
 
 # Let's mutilate the source tree, to check the recover rule.
 rm -f am-*.elc
@@ -89,7 +86,6 @@ $MAKE
 test -f am-one.elc
 test -f am-two.elc
 test -f am-three.elc
-test -f elc-stamp
 
 $MAKE install
 test -f lisp/am-one.el
@@ -105,6 +101,5 @@ $MAKE distclean
 test ! -e am-one.elc
 test ! -e am-two.elc
 test ! -e am-three.elc
-test ! -e elc-stamp
 
 :
diff --git a/t/lisp7.sh b/t/lisp7.sh
index 4553298..4c4676e 100755
--- a/t/lisp7.sh
+++ b/t/lisp7.sh
@@ -16,7 +16,7 @@
 
 # Make sure that lisp_LISP also works when emacs is not installed.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am << 'EOF'
 dist_lisp_LISP = am-one.el am-two.el am-three.el
@@ -39,12 +39,10 @@ $AUTOMAKE --add-missing
 
 $MAKE >stdout || { cat stdout; exit 1; }
 cat stdout
-test 1 -eq $(grep -c 'Warnings can be ignored' stdout)
 
 test ! -e am-one.elc
 test ! -e am-two.elc
 test ! -e am-three.elc
-test -f elc-stamp
 
 $MAKE distcheck
 
diff --git a/t/lisp8.sh b/t/lisp8.sh
index 6e6b901..7348e41 100755
--- a/t/lisp8.sh
+++ b/t/lisp8.sh
@@ -17,7 +17,7 @@
 # Check the recover rule of lisp_LISP with parallel make.
 
 required='GNUmake emacs'
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am << 'EOF'
 dist_lisp_LISP = am-one.el am-two.el am-three.el
@@ -42,12 +42,10 @@ $AUTOMAKE --add-missing
 $MAKE -j >>stdout || { cat stdout; exit 1; }
 
 cat stdout
-test 1 -eq $(grep -c 'Warnings can be ignored' stdout)
 
 test -f am-one.elc
 test -f am-two.elc
 test -f am-three.elc
-test -f elc-stamp
 
 rm -f am-*.elc
 
@@ -56,10 +54,8 @@ rm -f am-*.elc
 $MAKE -j >>stdout || { cat stdout; exit 1; }
 
 cat stdout
-test 1 -eq $(grep -c 'Warnings can be ignored' stdout)
 test -f am-one.elc
 test -f am-two.elc
 test -f am-three.elc
-test -f elc-stamp
 
 :
diff --git a/t/lispdry.sh b/t/lispdry.sh
index f7de071..f57e6dc 100755
--- a/t/lispdry.sh
+++ b/t/lispdry.sh
@@ -17,7 +17,7 @@
 # Check that 'make -n' works with the lisp_LISP recover rule.
 
 required='emacs non-root'
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am << 'EOF'
 dist_lisp_LISP = am-one.el am-two.el am-three.el
@@ -42,9 +42,8 @@ $MAKE
 test -f am-one.elc
 test -f am-two.elc
 test -f am-three.elc
-test -f elc-stamp
 
-rm -f am-*.elc elc-stamp
+rm -f am-*.elc
 
 chmod a-w .
 
@@ -53,6 +52,5 @@ $MAKE -n
 test ! -e am-one.elc
 test ! -e am-two.elc
 test ! -e am-three.elc
-test ! -e elc-stamp
 
 :
diff --git a/t/list-of-tests.mk b/t/list-of-tests.mk
index 1771ef6..5ee31d0 100644
--- a/t/list-of-tests.mk
+++ b/t/list-of-tests.mk
@@ -41,7 +41,6 @@ t/remake-timing-bug-pr8365.sh \
 t/lex-subobj-nodep.sh \
 t/remake-am-pr10111.sh \
 t/remake-m4-pr10111.sh \
-t/tags-pr12372.sh \
 t/txinfo5.sh \
 $(perl_fake_XFAIL_TESTS)
 
@@ -73,44 +72,54 @@ t/get-sysconf.sh \
 $(perl_TESTS) \
 t/instspc.tap \
 t/aclocal.sh \
-t/aclocal3.sh \
-t/aclocal4.sh \
-t/aclocal5.sh \
-t/aclocal6.sh \
-t/aclocal7.sh \
-t/aclocal8.sh \
-t/aclocal9.sh \
 t/acloca10.sh \
-t/acloca11.sh \
-t/acloca12.sh \
-t/acloca13.sh \
-t/acloca14.sh \
-t/acloca15.sh \
-t/acloca16.sh \
-t/acloca17.sh \
-t/acloca18.sh \
-t/acloca19.sh \
-t/acloca20.sh \
-t/acloca21.sh \
-t/acloca22.sh \
-t/acloca23.sh \
+t/aclocal-I-order-1.sh \
+t/aclocal-I-order-2.sh \
+t/aclocal-I-order-3.sh \
 t/aclocal-acdir.sh \
+t/aclocal-amflags.sh \
+t/aclocal-autoconf-version-check.sh \
+t/aclocal-comments-respected.sh \
+t/aclocal-deleted-header-aclocal-amflags.sh \
+t/aclocal-deleted-header.sh \
+t/aclocal-deps-subdir.sh \
+t/aclocal-deps.sh \
+t/aclocal-dirlist.sh \
+t/aclocal-dirlist-globbing.sh \
+t/aclocal-dirlist-abspath.sh \
 t/aclocal-install-absdir.sh \
-t/aclocal-print-acdir.sh \
+t/aclocal-install-fail.sh \
+t/aclocal-install-mkdir.sh \
+t/aclocal-m4-include-are-scanned-aclocal-amflags.sh \
+t/aclocal-m4-include-are-scanned.sh \
+t/aclocal-m4-sinclude.sh \
+t/aclocal-macrodir.tap \
+t/aclocal-macrodirs.tap \
+t/aclocal-missing-macros.sh \
+t/aclocal-no-extra-scan.sh \
+t/aclocal-no-force.sh \
+t/aclocal-no-install-no-mkdir.sh \
+t/aclocal-no-symlinked-overwrite.sh \
+t/aclocal-no-unused-required.sh \
 t/aclocal-path.sh \
 t/aclocal-path-install.sh \
 t/aclocal-path-install-serial.sh \
 t/aclocal-path-nonexistent.sh \
 t/aclocal-path-precedence.sh \
-t/aclocal-install-fail.sh \
-t/aclocal-install-mkdir.sh \
-t/aclocal-no-install-no-mkdir.sh \
+t/aclocal-pr450.sh \
+t/aclocal-print-acdir.sh \
+t/aclocal-req.sh \
+t/aclocal-remake-misc.sh \
+t/aclocal-scan-configure-ac-pr319.sh \
+t/aclocal-serial.sh \
+t/aclocal-underquoted-defun.sh \
 t/aclocal-verbose-install.sh \
 t/ac-output-old.tap \
 t/acsilent.sh \
 t/acsubst.sh \
 t/acsubst2.sh \
 t/add-missing.tap \
+t/add-missing-multiple.sh \
 t/all.sh \
 t/all2.sh \
 t/alloca.sh \
@@ -156,7 +165,6 @@ t/autodist-configure-no-subdir.sh \
 t/autodist-no-duplicate.sh \
 t/autodist-stamp-vti.sh \
 t/autohdr.sh \
-t/autohdr2.sh \
 t/autohdr3.sh \
 t/autohdr4.sh \
 t/autohdr-subdir-pr12495.sh \
@@ -174,9 +182,8 @@ t/auxdir-unportable.tap \
 t/backcompat.sh \
 t/backcompat2.sh \
 t/backcompat3.sh \
-t/backcompat4.sh \
-t/backcompat5.sh \
 t/backcompat6.sh \
+t/backcompat-acout.sh \
 t/backsl.sh \
 t/backsl2.sh \
 t/backsl3.sh \
@@ -184,7 +191,6 @@ t/backsl4.sh \
 t/badline.sh \
 t/badopt.sh \
 t/badprog.sh \
-t/block.sh \
 t/built-sources-check.sh \
 t/built-sources-cond.sh \
 t/built-sources-fork-bomb.sh \
@@ -223,7 +229,6 @@ t/check-no-test-driver.sh \
 t/check-concurrency-bug9245.sh \
 t/checkall.sh \
 t/clean.sh \
-t/clean2.sh \
 t/colneq.sh \
 t/colneq2.sh \
 t/colneq3.sh \
@@ -234,8 +239,9 @@ t/colon4.sh \
 t/colon5.sh \
 t/colon6.sh \
 t/colon7.sh \
-t/color.sh \
-t/color2.sh \
+t/color-tests.sh \
+t/color-tests2.sh \
+t/color-tests-opt.sh \
 t/comment.sh \
 t/comment2.sh \
 t/comment3.sh \
@@ -247,6 +253,7 @@ t/comment8.sh \
 t/comment9.sh \
 t/commen10.sh \
 t/commen11.sh \
+t/comment-block.sh \
 t/comments-in-var-def.sh \
 t/compile.sh \
 t/compile2.sh \
@@ -341,13 +348,7 @@ t/cxx-lt-demo.sh \
 t/cxxlibobj.sh \
 t/cxxlink.sh \
 t/cxxnoc.sh \
-t/cygnus-deprecation.sh \
-t/cygnus-check-without-all.sh \
-t/cygnus-dependency-tracking.sh \
-t/cygnus-imply-foreign.sh \
-t/cygnus-no-dist.sh \
-t/cygnus-no-installinfo.sh \
-t/cygnus-requires-maintainer-mode.sh \
+t/cygnus-no-more.sh \
 t/cygwin32.sh \
 t/dash.sh \
 t/defun.sh \
@@ -381,9 +382,6 @@ t/depend6.sh \
 t/deprecated-acinit.sh \
 t/destdir.sh \
 t/dir-named-obj-is-bad.sh \
-t/dirlist.sh \
-t/dirlist2.sh \
-t/dirlist-abspath.sh \
 t/discover.sh \
 t/dist-formats.tap \
 t/dist-auxdir-many-subdirs.sh \
@@ -498,7 +496,6 @@ t/help-depend2.sh \
 t/help-dmalloc.sh \
 t/help-init.sh \
 t/help-lispdir.sh \
-t/help-multilib.sh \
 t/help-python.sh \
 t/help-silent.sh \
 t/help-upc.sh \
@@ -638,8 +635,13 @@ t/lisp5.sh \
 t/lisp6.sh \
 t/lisp7.sh \
 t/lisp8.sh \
+t/lisp-loadpath.sh \
+t/lisp-subdir.sh \
+t/lisp-subdir2.sh \
+t/lisp-subdir-mix.sh \
 t/lispdry.sh \
 t/lisp-pr11806.sh \
+t/lisp-flags.sh \
 t/listval.sh \
 t/location.sh \
 t/longline.sh \
@@ -669,7 +671,6 @@ t/makevars.sh \
 t/man.sh \
 t/man2.sh \
 t/man3.sh \
-t/man4.sh \
 t/man5.sh \
 t/man6.sh \
 t/man7.sh \
@@ -680,12 +681,8 @@ t/mdate3.sh \
 t/mdate4.sh \
 t/mdate5.sh \
 t/mdate6.sh \
-t/missing.sh \
-t/missing2.sh \
+t/missing-version-mismatch.sh \
 t/missing3.sh \
-t/missing4.sh \
-t/missing5.sh \
-t/missing6.sh \
 t/am-missing-prog.sh \
 t/missing-auxfile-stops-makefiles-creation.sh \
 t/mkdir_p.sh \
@@ -695,7 +692,6 @@ t/mkinst2.sh \
 t/mkinst3.sh \
 t/mmode.sh \
 t/mmodely.sh \
-t/multlib.sh \
 t/no-extra-makefile-code.sh \
 t/no-spurious-install-recursive.sh \
 t/nobase.sh \
@@ -726,7 +722,6 @@ t/objcxx-flags.sh \
 t/objcxx-deps.sh \
 t/objc-megademo.sh \
 t/objext-pr10128.sh \
-t/obsolete.sh \
 t/oldvars.sh \
 t/order.sh \
 t/output.sh \
@@ -751,7 +746,6 @@ t/parallel-am.sh \
 t/parallel-am2.sh \
 t/parallel-am3.sh \
 t/serial-tests.sh \
-t/parallel-tests2.sh \
 t/parallel-tests-basics.sh \
 t/parallel-tests-concurrency.sh \
 t/parallel-tests-concurrency-2.sh \
@@ -900,8 +894,17 @@ t/python-dist.sh \
 t/python-vars.sh \
 t/python-virtualenv.sh \
 t/python-pr10995.sh \
-t/recurs.sh \
-t/recurs2.sh \
+t/recurs-user.sh \
+t/recurs-user2.sh \
+t/recurs-user-deeply-nested.sh \
+t/recurs-user-indir.sh \
+t/recurs-user-keep-going.sh \
+t/recurs-user-many.sh \
+t/recurs-user-no-subdirs.sh \
+t/recurs-user-no-top-level.sh \
+t/recurs-user-override.sh \
+t/recurs-user-phony.sh \
+t/recurs-user-wrap.sh \
 t/relativize.tap \
 t/remake-fail.sh \
 t/remake-not-after-make-dist.sh \
@@ -919,6 +922,7 @@ t/remake-deeply-nested.sh \
 t/remake-mild-stress.sh \
 t/remake-all-1.sh \
 t/remake-all-2.sh \
+t/remake-recurs-user.sh \
 t/remake-subdir.sh \
 t/remake-subdir2.sh \
 t/remake-subdir3.sh \
@@ -942,9 +946,9 @@ t/remake-deleted-am-2.sh \
 t/remake-deleted-am-subdir.sh \
 t/remake-deleted-am.sh \
 t/remake-renamed-am.sh \
+t/remake-aclocal-version-mismatch.sh \
+t/remake-macrodir.sh \
 t/remake-timing-bug-pr8365.sh \
-t/req.sh \
-t/reqd.sh \
 t/reqd2.sh \
 t/repeated-options.sh \
 t/rulepat.sh \
@@ -961,28 +965,20 @@ t/self-check-is-blocked-signal.tap \
 t/self-check-unindent.tap \
 t/sanity.sh \
 t/seenc.sh \
-t/silent.sh \
-t/silent2.sh \
-t/silent3.sh \
-t/silent4.sh \
-t/silent6.sh \
-t/silent7.sh \
-t/silent8.sh \
-t/silent9.sh \
-t/silent-obsolescent-warns.sh \
-t/silentcxx.sh \
-t/silentcxx-gcc.sh \
-t/silentf77.sh \
-t/silentf90.sh \
-t/silent-amopts.sh \
-t/silent-many-gcc.sh \
-t/silent-many-generic.sh \
-t/silent-nowarn.sh \
-t/silent-configsite.sh \
-t/silent-nested-vars.sh \
+t/silent-c.sh \
+t/silent-cxx.sh \
+t/silent-lt.sh \
+t/silent-f77.sh \
+t/silent-f90.sh \
+t/silent-many-languages.sh \
+t/silent-gen.sh \
+t/silent-texi.sh \
 t/silent-lex.sh \
 t/silent-yacc.sh \
 t/silent-yacc-headers.sh \
+t/silent-configsite.sh \
+t/silent-nested-vars.sh \
+t/silent-custom.sh \
 t/src-acsubst.sh \
 t/sourcefile-in-subdir.sh \
 t/space.sh \
@@ -1038,6 +1034,7 @@ t/subpkg2.sh \
 t/subpkg3.sh \
 t/subpkg4.sh \
 t/subpkg-yacc.sh \
+t/subpkg-macrodir.sh \
 t/subst.sh \
 t/subst3.sh \
 t/subst4.sh \
@@ -1163,8 +1160,6 @@ t/txinfo.sh \
 t/txinfo2.sh \
 t/txinfo3.sh \
 t/txinfo4.sh \
-t/txinfo5.sh \
-t/txinfo5b.sh \
 t/txinfo6.sh \
 t/txinfo7.sh \
 t/txinfo8.sh \
@@ -1184,7 +1179,6 @@ t/txinfo26.sh \
 t/txinfo27.sh \
 t/txinfo28.sh \
 t/txinfo29.sh \
-t/txinfo30.sh \
 t/txinfo31.sh \
 t/txinfo32.sh \
 t/txinfo33.sh \
@@ -1213,11 +1207,11 @@ t/vala-vapi.sh \
 t/vala-vpath.sh \
 t/vars.sh \
 t/vars3.sh \
+t/var-recurs.sh \
+t/var-recurs2.sh \
 t/vartar.sh \
 t/vartypos.sh \
 t/vartypo2.sh \
-t/version.sh \
-t/version2.sh \
 t/version3.sh \
 t/version4.sh \
 t/version6.sh \
diff --git a/t/listval.sh b/t/listval.sh
index 8bd6b79..2aa4d06 100755
--- a/t/listval.sh
+++ b/t/listval.sh
@@ -18,7 +18,7 @@
 # From Adam J. Richter.
 
 required=libtool
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_SUBST([LTLIBOBJS])
diff --git a/t/location.sh b/t/location.sh
index dab1e33..0ff7090 100755
--- a/t/location.sh
+++ b/t/location.sh
@@ -16,7 +16,7 @@
 
 # Test for locations in error messages.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AM_CONDITIONAL([COND1], [true])
diff --git a/t/longlin2.sh b/t/longlin2.sh
index 1174a14..1fcc54e 100755
--- a/t/longlin2.sh
+++ b/t/longlin2.sh
@@ -17,7 +17,7 @@
 # Long lines should be wrapped.
 # Report from Albert Chin.
 
-. ./defs || exit 1
+. test-init.sh
 
 n=1 files= match=
 while test $n -le 100
diff --git a/t/longline.sh b/t/longline.sh
index d0240fd..b262f45 100755
--- a/t/longline.sh
+++ b/t/longline.sh
@@ -17,7 +17,7 @@
 # Long lines of += should be wrapped.
 # Report from Simon Josefsson.
 
-. ./defs || exit 1
+. test-init.sh
 
 (echo DUMMY = some_long_filename_1;
 for i in 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20;
diff --git a/t/ltcond.sh b/t/ltcond.sh
index ae5415c..02e8bad 100755
--- a/t/ltcond.sh
+++ b/t/ltcond.sh
@@ -18,7 +18,7 @@
 # This combines two examples from the manual.
 
 required='cc libtoolize'
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac <<'END'
 AM_CONDITIONAL([WANT_LIBFOO], [true])
diff --git a/t/ltcond2.sh b/t/ltcond2.sh
index 49b14d8..48edede 100755
--- a/t/ltcond2.sh
+++ b/t/ltcond2.sh
@@ -17,7 +17,7 @@
 # Test for bug in conditionals.
 
 required='cc native libtoolize'
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
@@ -56,25 +56,19 @@ check-local:
 END
 
 cat > hello-linux.c <<'END'
-const char* str (void)
-{
-  return "hello-linux";
-}
+const char* str = "hello-linux";
 END
 
 cat > hello-generic.c <<'END'
-const char* str (void)
-{
-  return "hello-generic";
-}
+const char* str = "hello-generic";
 END
 
 cat > hello-common.c <<'END'
 #include <stdio.h>
-const char* str (void);
+extern const char* str;
 void print (void)
 {
-  puts (str ());
+  puts (str);
 }
 END
 
diff --git a/t/ltconv.sh b/t/ltconv.sh
index cf06271..580ee6d 100755
--- a/t/ltconv.sh
+++ b/t/ltconv.sh
@@ -18,7 +18,7 @@
 # This example is taken from the manual.
 
 required='cc native libtoolize'
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac <<'END'
 AC_PROG_CC
diff --git a/t/ltdeps.sh b/t/ltdeps.sh
index a13ae03..950bc42 100755
--- a/t/ltdeps.sh
+++ b/t/ltdeps.sh
@@ -17,7 +17,7 @@
 # Test to make sure libtool library dependencies are correct.
 # Report from Lars J. Aas.
 required=libtool
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AM_PROG_AR
diff --git a/t/ltinit.sh b/t/ltinit.sh
index 69e8d55..a98cffa 100755
--- a/t/ltinit.sh
+++ b/t/ltinit.sh
@@ -19,7 +19,7 @@
 # present since libtool 1.9b, circa 2004).
 
 required='cc libtoolize'
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac <<'END'
 AC_PROG_CC
diff --git a/t/ltinstloc.sh b/t/ltinstloc.sh
index f12da77..e476c98 100755
--- a/t/ltinstloc.sh
+++ b/t/ltinstloc.sh
@@ -18,7 +18,7 @@
 
 
 required='libtoolize'
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac <<'END'
 AC_PROG_CC
diff --git a/t/ltlibobjs.sh b/t/ltlibobjs.sh
index ed0d2ed..1e8ea24 100755
--- a/t/ltlibobjs.sh
+++ b/t/ltlibobjs.sh
@@ -17,7 +17,7 @@
 # Test to make sure LTLIBOBJS alone works ok.
 # Report from Vadim Zeitlin.
 required=libtool
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_SUBST([LTLIBOBJS])
diff --git a/t/ltlibsrc.sh b/t/ltlibsrc.sh
index 7c84814..acce8bb 100755
--- a/t/ltlibsrc.sh
+++ b/t/ltlibsrc.sh
@@ -17,7 +17,7 @@
 # Test to make sure a sensible default source for libraries is used.
 
 required='cc libtool'
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/ltorder.sh b/t/ltorder.sh
index c8f60ed..32d0816 100755
--- a/t/ltorder.sh
+++ b/t/ltorder.sh
@@ -17,7 +17,7 @@
 # Test for correct installation order of nobase libtool libraries.
 
 required='cc libtoolize'
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac <<'END'
 AC_PROG_CC
diff --git a/t/lzma.sh b/t/lzma.sh
index da38c31..46015ed 100755
--- a/t/lzma.sh
+++ b/t/lzma.sh
@@ -16,7 +16,7 @@
 
 # Check support for no-dist-gzip with lzma.
 
-. ./defs || exit 1
+. test-init.sh
 
 errmsg='support for lzma.*removed'
 
diff --git a/t/m4-inclusion.sh b/t/m4-inclusion.sh
index 3da20ee..c845617 100755
--- a/t/m4-inclusion.sh
+++ b/t/m4-inclusion.sh
@@ -16,7 +16,7 @@
 
 # Test to see if 'm4_sinclude' and 'm4_include' works.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac <<'EOF'
 sinclude([doesntexist.m4])
diff --git a/t/maintclean-vpath.sh b/t/maintclean-vpath.sh
index b5c6ffe..0732fab 100755
--- a/t/maintclean-vpath.sh
+++ b/t/maintclean-vpath.sh
@@ -18,7 +18,7 @@
 # This test is for VPATH builds; see sister test 'maintclean.sh'
 # for in-tree builds.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_CONFIG_FILES([bar sub/Makefile])
diff --git a/t/maintclean.sh b/t/maintclean.sh
index 757cf85..b7fd1b2 100755
--- a/t/maintclean.sh
+++ b/t/maintclean.sh
@@ -18,7 +18,7 @@
 # This test is for in-tree builds; see sister test 'maintclean-vpath.sh'
 # for VPATH builds.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_CONFIG_FILES([bar sub/Makefile])
diff --git a/t/maintmode-configure-msg.sh b/t/maintmode-configure-msg.sh
index ebdf4d7..058438d 100755
--- a/t/maintmode-configure-msg.sh
+++ b/t/maintmode-configure-msg.sh
@@ -19,7 +19,7 @@
 # related to the enabling/disabling of maintainer mode are correct (see
 # automake bug#9890).
 
-. ./defs || exit 1
+. test-init.sh
 
 set_maintmode ()
 {
diff --git a/t/make-dryrun.tap b/t/make-dryrun.tap
index 1fd255d..adf2f04 100755
--- a/t/make-dryrun.tap
+++ b/t/make-dryrun.tap
@@ -16,7 +16,7 @@
 
 # Check that $(am__make_dryrun) works as expected.
 
-. ./defs || exit 1
+. test-init.sh
 
 plan_ 14
 
diff --git a/t/make.sh b/t/make.sh
index fad2242..1cb8149 100755
--- a/t/make.sh
+++ b/t/make.sh
@@ -18,7 +18,7 @@
 # From Ralf Corsepius.
 
 required=GNUmake
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AM_MAKE_INCLUDE
diff --git a/t/makefile-deps.sh b/t/makefile-deps.sh
index 192e56b..b4c5bd7 100755
--- a/t/makefile-deps.sh
+++ b/t/makefile-deps.sh
@@ -17,7 +17,7 @@
 # Make sure we don't emit a rule with empty target if list of
 # automatically-computed dependencies for Makefile.in is empty.
 
-. ./defs || exit 1
+. test-init.sh
 
 : > Makefile.am
 
diff --git a/t/makej.sh b/t/makej.sh
index b339bd7..e8d1ea5 100755
--- a/t/makej.sh
+++ b/t/makej.sh
@@ -22,7 +22,7 @@
 # via autom4te.
 
 required=GNUmake
-. ./defs || exit 1
+. test-init.sh
 
 cat >configure.ac <<END
 m4_include([version.m4])
diff --git a/t/makej2.sh b/t/makej2.sh
index c7d809e..20ebb57 100755
--- a/t/makej2.sh
+++ b/t/makej2.sh
@@ -18,7 +18,7 @@
 # without -B, it may reuse the same shell for separate commands in a
 # rule, which can lead to interesting results.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac <<'END'
 AC_OUTPUT
diff --git a/t/maken.sh b/t/maken.sh
index ec72008..5087b92 100755
--- a/t/maken.sh
+++ b/t/maken.sh
@@ -19,7 +19,7 @@
 # Also, ensure that 'make -n dist' and 'make -n distcheck' show what
 # would happen, at least when using GNU make.
 
-. ./defs || exit 1
+. test-init.sh
 
 mkdir sub
 
diff --git a/t/maken3.sh b/t/maken3.sh
index 6d580ec..dbbdb4a 100755
--- a/t/maken3.sh
+++ b/t/maken3.sh
@@ -22,10 +22,10 @@
 #     special target, the output from make is sufficiently complete.
 #
 # This test exercises the GCS-mandated targets (except for dist)
-# as well as tags, TAGS.
+# as well as tags.
 
 # For gen-testsuite-part: ==> try-with-serial-tests <==
-. ./defs || exit 1
+. test-init.sh
 
 # Does $MAKE support the '.MAKE' special target?
 have_dotmake=false
@@ -111,8 +111,6 @@ installcheck-local:
        @: > stamp-installcheck-sub
 tags:
        @: > stamp-tags-sub
-TAGS:
-       @: > stamp-TAGS-sub
 mostlyclean-local:
        @: > stamp-mostlyclean-sub
 maintainer-clean-local:
@@ -127,7 +125,7 @@ html:
        @: > address@hidden
 install-info install-html install-dvi install-pdf install-ps:
        @: > address@hidden
-installcheck installdirs tags TAGS mostlyclean:
+installcheck installdirs tags mostlyclean:
        @: > address@hidden
 ## These targets cannot be overridden like this:
 ## install-strip distclean maintainer-clean
@@ -142,12 +140,12 @@ check_targets ()
     all install install-strip uninstall clean distclean check \
     info html dvi pdf ps \
     install-info install-html install-dvi install-pdf install-ps \
-    installcheck installdirs tags TAGS mostlyclean maintainer-clean
+    installcheck installdirs tags mostlyclean maintainer-clean
   do
     $MAKE -n $target >stdout || { cat stdout; exit 1; }
     cat stdout
     case $target in
-    install-* | installdirs | tags | TAGS ) ;;
+    install-* | installdirs | tags ) ;;
     *)
       if $have_dotmake; then
         grep "stamp-$target$" stdout || exit 1
diff --git a/t/makevars.sh b/t/makevars.sh
index 3654196..4614cd7 100755
--- a/t/makevars.sh
+++ b/t/makevars.sh
@@ -17,7 +17,7 @@
 # Test to make sure that automake includes the needed variables,
 # but not too many.
 
-. ./defs || exit 1
+. test-init.sh
 
 # Find the macros wanted by Automake.
 $ACLOCAL
diff --git a/t/man.sh b/t/man.sh
index 3feb3fa..d5c9ece 100755
--- a/t/man.sh
+++ b/t/man.sh
@@ -16,7 +16,7 @@
 
 # Test to make sure 'dist' prefix works with man pages.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am << 'END'
 dist_man_MANS = foo.1
diff --git a/t/man2.sh b/t/man2.sh
index a7b7646..31c4af5 100755
--- a/t/man2.sh
+++ b/t/man2.sh
@@ -17,7 +17,7 @@
 # Make sure that man pages listed in man_MANS are installed and
 # renamed as documented.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac <<'END'
 AC_OUTPUT
diff --git a/t/man3.sh b/t/man3.sh
index 2604c01..8904e54 100755
--- a/t/man3.sh
+++ b/t/man3.sh
@@ -16,7 +16,7 @@
 
 # PR 516: Prefer generated manpages to distributed ones.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am << 'END'
 dist_man_MANS = foo.1
diff --git a/t/man4.sh b/t/man4.sh
deleted file mode 100755
index 2688b7d..0000000
--- a/t/man4.sh
+++ /dev/null
@@ -1,105 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2008-2012 Free Software Foundation, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-# Ensure 'make dist' fails when help2man replacement man pages are created.
-#
-# The assumption here is the following: if the developer uses help2man to
-# generate man pages from --help output, then these man pages may not be
-# stored in VCS.  However, they should be distributed, so that the end user
-# that receives the tarball doesn't have to install help2man.  If they are
-# not distributed, then the developer should make help2man a prerequisite
-# to building the package from a tarball, e.g., with a configure check for
-# help2man that errors out if it is unavailable.  In both cases it is
-# sufficient to check only distributed man pages.
-#
-# Idea of this whole shenanigan is to allow somebody to check out sources from
-# a VCS and build and install them without needing help2man installed.  The
-# installed man pages will be bogus in this case.  Typically, this happens
-# when developers ask users to try out a fix from VCS; the developers 
themselves
-# will usually have help2man installed (or should install it).
-
-. ./defs || exit 1
-
-cat > Makefile.am << 'END'
-dist_man_MANS = $(srcdir)/foo.1 bar.1
-dist_bin_SCRIPTS = foo bar
-$(srcdir)/foo.1:
-       $(HELP2MAN) --output=$@ $(srcdir)/foo
-bar.1:
-       $(HELP2MAN) --output=$(srcdir)/bar.1 $(srcdir)/bar
-END
-
-cat >>configure.ac <<'END'
-AM_MISSING_PROG([HELP2MAN], [help2man])
-AC_OUTPUT
-END
-
-cat > foo <<'END'
-#! /bin/sh
-while test $# -gt 0; do
-  case $1 in
-    -h | --help) echo "usage: $0 [OPTIONS]..."; exit 0;;
-    -v | --version) echo "$0 1.0"; exit 0;;
-  esac
-  shift
-done
-END
-cp foo bar
-chmod +x foo bar
-
-mkdir bin
-cat > bin/help2man <<'END'
-#! /bin/sh
-# Fake help2man script that lets 'missing' think it is not installed.
-exit 127
-END
-chmod +x bin/help2man
-PATH=$(pwd)/bin$PATH_SEPARATOR$PATH
-
-grep_error_messages()
-{
-  grep ' man pages contain.*missing help2man.* replacement text' stderr \
-   && grep 'install help2man' stderr \
-   && grep 'regenerate the man pages' stderr \
-   || exit 1
-}
-
-$ACLOCAL
-$AUTOMAKE
-$AUTOCONF
-
-./configure
-$MAKE
-$MAKE dist 2>stderr && { cat stderr >&2; exit 1; }
-cat stderr >&2
-grep_error_messages
-$MAKE distcheck 2>stderr && { cat stderr >&2; exit 1; }
-cat stderr >&2
-grep_error_messages
-$MAKE distclean
-
-mkdir build
-cd build
-../configure
-$MAKE
-$MAKE dist 2>stderr && { cat stderr >&2; exit 1; }
-cat stderr >&2
-grep_error_messages
-$MAKE distcheck 2>stderr && { cat stderr >&2; exit 1; }
-cat stderr >&2
-grep_error_messages
-
-:
diff --git a/t/man5.sh b/t/man5.sh
index d3c2270..a04ccfe 100755
--- a/t/man5.sh
+++ b/t/man5.sh
@@ -16,7 +16,7 @@
 
 # Make sure to extract the correct mansection from files in man_MANS.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac <<'END'
 AC_OUTPUT
diff --git a/t/man6.sh b/t/man6.sh
index d6b51ef..d854732 100755
--- a/t/man6.sh
+++ b/t/man6.sh
@@ -18,7 +18,7 @@
 # even if the 'missing' script is involved.
 
 required=help2man
-. ./defs || exit 1
+. test-init.sh
 
 # Avoid a spurious failure due to a known FreeBSD make incompatibility.
 useless_vpath_rebuild \
@@ -65,7 +65,7 @@ cd build
 
 ../configure
 # Sanity check.
-grep '^HELP2MAN *=.*/missing --run help2man' Makefile
+grep '^HELP2MAN *=.*/missing help2man' Makefile
 
 $MAKE
 $FGREP foobar ../foobar.1
@@ -84,7 +84,7 @@ rm -f *.1 # Remove leftover generated manpages.
 
 ./configure
 # Sanity check.
-grep '^HELP2MAN *=.*/missing --run help2man' Makefile
+grep '^HELP2MAN *=.*/missing help2man' Makefile
 
 $MAKE
 $FGREP foobar  foobar.1
diff --git a/t/man7.sh b/t/man7.sh
index 5791b72..3ce410e 100755
--- a/t/man7.sh
+++ b/t/man7.sh
@@ -16,7 +16,7 @@
 
 # Check for a bug in maintainer-clean w.r.t. generated manpages.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am << 'END'
 dist_man_MANS = $(srcdir)/foo.1 bar.1
diff --git a/t/man8.sh b/t/man8.sh
index a7116ae..7396006 100755
--- a/t/man8.sh
+++ b/t/man8.sh
@@ -16,7 +16,7 @@
 
 # Check for a bug in distcheck w.r.t. generated manpages.
 
-. ./defs || exit 1
+. test-init.sh
 
 # Avoid a spurious failure due to a known FreeBSD make incompatibility.
 useless_vpath_rebuild \
diff --git a/t/mdate.sh b/t/mdate.sh
index e44144a..009c753 100755
--- a/t/mdate.sh
+++ b/t/mdate.sh
@@ -16,7 +16,7 @@
 
 # Test that mdate-sh is required when Texinfo used and version.texi needed.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am << 'END'
 info_TEXINFOS = textutils.texi
diff --git a/t/mdate2.sh b/t/mdate2.sh
index 6ba5727..ea005fe 100755
--- a/t/mdate2.sh
+++ b/t/mdate2.sh
@@ -16,7 +16,7 @@
 
 # Test to make sure mdate-sh is included in distribution.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am << 'END'
 info_TEXINFOS = textutils.texi
diff --git a/t/mdate3.sh b/t/mdate3.sh
index aa2755e..409abb7 100755
--- a/t/mdate3.sh
+++ b/t/mdate3.sh
@@ -16,7 +16,7 @@
 
 # Test to make sure mdate-sh run correctly.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > configure.ac << END
 AC_INIT([$me], [1.0])
diff --git a/t/mdate4.sh b/t/mdate4.sh
index 70809a6..912ef41 100755
--- a/t/mdate4.sh
+++ b/t/mdate4.sh
@@ -17,7 +17,7 @@
 # Test to make sure that mdate-sh is added to the right directory.
 # Report from Kevin Dalley.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_CONFIG_FILES([sub/Makefile])
diff --git a/t/mdate5.sh b/t/mdate5.sh
index 0cbc198..6603667 100755
--- a/t/mdate5.sh
+++ b/t/mdate5.sh
@@ -17,7 +17,7 @@
 # Test to make sure mdate-sh works correctly.
 
 am_create_testdir=empty
-. ./defs || exit 1
+. test-init.sh
 
 get_shell_script mdate-sh
 
diff --git a/t/mdate6.sh b/t/mdate6.sh
index 110bb2d..fbb8557 100755
--- a/t/mdate6.sh
+++ b/t/mdate6.sh
@@ -17,7 +17,7 @@
 # mdate-sh can work with weird file names, doesn't eval too much.
 
 am_create_testdir=empty
-. ./defs || exit 1
+. test-init.sh
 
 a=
 file='file  name $a'
diff --git a/t/missing-auxfile-stops-makefiles-creation.sh 
b/t/missing-auxfile-stops-makefiles-creation.sh
index d1c0cd4..f8e91f9 100755
--- a/t/missing-auxfile-stops-makefiles-creation.sh
+++ b/t/missing-auxfile-stops-makefiles-creation.sh
@@ -17,7 +17,7 @@
 # Automake should stop the creation of Makefile.in files at the first
 # encountered error due to a required auxiliary file not found.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac <<END
 AM_PATH_PYTHON
diff --git a/t/missing-version-mismatch.sh b/t/missing-version-mismatch.sh
new file mode 100755
index 0000000..43ebf20
--- /dev/null
+++ b/t/missing-version-mismatch.sh
@@ -0,0 +1,50 @@
+#! /bin/sh
+# Copyright (C) 2003-2012 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 missing with version mismatches.
+
+am_create_testdir=empty
+. test-init.sh
+
+get_shell_script missing
+
+do_check ()
+{
+  progname=$1; shift;
+  ./missing "$@" 2>stderr && { cat stderr >&2; exit 1; }
+  cat stderr >&2
+  $FGREP "WARNING: '$progname' is probably too old." stderr
+}
+
+echo 'AC_INIT([x], [1.0]) AC_PREREQ([9999])' >> configure.ac
+
+do_check autoconf               $AUTOCONF
+do_check autoheader             $AUTOHEADER
+do_check aclocal-$APIVERSION    $am_original_ACLOCAL
+
+cat > configure.ac << 'END'
+AC_INIT([x], [0])
+AM_INIT_AUTOMAKE
+AC_CONFIG_FILES([Makefile])
+END
+
+echo AUTOMAKE_OPTIONS = 9999.9999 > Makefile.am
+$ACLOCAL
+: > install-sh
+# FIXME: this doesn't work due to a bug in automake (not 'missing').
+#do_check automake-$APIVERSION  $am_original_AUTOMAKE
+
+:
diff --git a/t/missing.sh b/t/missing.sh
deleted file mode 100755
index fcca48f..0000000
--- a/t/missing.sh
+++ /dev/null
@@ -1,66 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2003-2012 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 missing with version mismatches.
-
-. ./defs || exit 1
-
-cat >>configure.ac <<'EOF'
-AC_OUTPUT
-EOF
-
-: > Makefile.am
-
-get_shell_script missing
-
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE --add-missing
-
-# Make sure we do use missing, even if the user exported AUTOCONF.
-# (We cannot export this new value, because it would be used by Automake
-# when tracing, and missing is no good for this.)
-MYAUTOCONF="./missing --run $AUTOCONF"
-unset AUTOCONF
-
-./configure AUTOCONF="$MYAUTOCONF"
-$MAKE
-$sleep
-# Hopefully the install version of Autoconf cannot compete with this one...
-echo 'AC_PREREQ(9999)' >> aclocal.m4
-$MAKE distdir
-
-# Try version number suffixes if we can add them safely.
-case $MYAUTOCONF in *autoconf)
-  ./configure AUTOCONF="${MYAUTOCONF}6789"
-  $MAKE
-  $sleep
-  # Hopefully the install version of Autoconf cannot compete with this one...
-  echo 'AC_PREREQ(9999)' >> aclocal.m4
-  $MAKE distdir
-esac
-
-# Run again, but without missing, to ensure that timestamps were updated.
-export AUTOMAKE ACLOCAL
-./configure AUTOCONF="$MYAUTOCONF"
-$MAKE
-
-# Make sure $MAKE fails when timestamps aren't updated and missing is not used.
-$sleep
-touch aclocal.m4
-$MAKE && exit 1
-
-:
diff --git a/t/missing2.sh b/t/missing2.sh
deleted file mode 100755
index a17c5fd..0000000
--- a/t/missing2.sh
+++ /dev/null
@@ -1,58 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2003-2012 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 missing with version mismatches.
-
-. ./defs || exit 1
-
-cat >>configure.ac <<'EOF'
-m4_include([v.m4])
-AC_OUTPUT
-EOF
-
-: > v.m4
-
-: > Makefile.am
-
-get_shell_script missing
-
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE --add-missing
-
-# See the test 'missing.sh' for explanations about this.
-MYAUTOCONF="./missing --run $AUTOCONF"
-unset AUTOCONF
-
-./configure AUTOCONF="$MYAUTOCONF"
-
-$MAKE
-$sleep
-# Hopefully the install version of Autoconf cannot compete with this one...
-echo 'AC_PREREQ(9999)' > v.m4
-$MAKE distdir
-
-# Run again, but without missing, to ensure that timestamps were updated.
-export AUTOMAKE ACLOCAL
-./configure AUTOCONF="$MYAUTOCONF"
-$MAKE
-
-# Make sure $MAKE fail when timestamps aren't updated and missing is not used.
-$sleep
-touch v.m4
-$MAKE && exit 1
-
-:
diff --git a/t/missing3.sh b/t/missing3.sh
index c5db4f0..3cd6333 100755
--- a/t/missing3.sh
+++ b/t/missing3.sh
@@ -17,37 +17,39 @@
 # Test missing when running a tool's --version.
 
 am_create_testdir=empty
-. ./defs || exit 1
+. test-init.sh
 
 get_shell_script missing
 
 # b7cb8259 assumed not to exist.
 
-./missing b7cb8259 --version 2>stderr && { cat stderr >&2; exit 1; }
-cat stderr >&2
-grep . stderr && exit 1
-./missing b7cb8259 --grep 2>stderr && { cat stderr >&2; exit 1; }
-cat stderr >&2
-grep WARNING stderr
+run_cmd ()
+{
+  st=0; "$@" >stdout 2>stderr || st=$?
+  cat stdout
+  cat stderr >&2
+  return $st
+}
 
-./missing --run b7cb8259 --version && exit 1
-./missing --run b7cb8259 --grep 2>stderr && { cat stderr >&2; exit 1; }
-cat stderr >&2
-grep WARNING stderr
+run_cmd ./missing b7cb8259 --version && exit 1
+grep WARNING stderr && exit 1
+run_cmd ./missing b7cb8259 --grep && exit 1
+
+if test x"$am_test_prefer_config_shell" != x"yes"; then
+  # The /bin/sh from Solaris 10 is a spectacular failure.  After a failure
+  # due to a "command not found", it sets '$?' to '1'.
+  if (st=0; /bin/sh -c 'no--such--command' || st=$?; test $st -eq 127); then
+    grep 'WARNING:.*missing on your system' stderr
+  fi
+fi
 
 # missing itself it known to exist :)
 
-./missing ./missing --version 2>stderr && { cat stderr >&2; exit 1; }
-cat stderr >&2
-grep . stderr && exit 1
-./missing ./missing --grep 2>stderr && { cat stderr >&2; exit 1; }
-cat stderr >&2
-grep WARNING stderr
-
-./missing --run ./missing --version 2>stderr || { cat stderr >&2; exit 1; }
-cat stderr >&2
-grep . stderr && exit 1
-./missing --run ./missing --grep 2>stderr && { cat stderr >&2; exit 1; }
-cat stderr >&2
+run_cmd ./missing ./missing --version || exit 1
+grep 'missing .*(GNU [aA]utomake)' stdout
+test -s stderr && exit 1
+run_cmd ./missing ./missing --grep && exit 1
 grep WARNING stderr && exit 1
-grep Unknown stderr
+grep "missing:.* unknown '--grep'" stderr
+
+:
diff --git a/t/missing4.sh b/t/missing4.sh
deleted file mode 100755
index 22d31d0..0000000
--- a/t/missing4.sh
+++ /dev/null
@@ -1,47 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2006-2012 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/>.
-
-# See how well the rebuild rule handles an aclocal.m4 that was
-# generated for another version of autoconf.
-
-. ./defs || exit 1
-
-echo AC_OUTPUT >>configure.ac
-
-touch Makefile.am
-
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE
-./configure
-$MAKE
-
-sed '1,20 s/m4_defn(\[AC_AUTOCONF_VERSION\]),/9999,/' < aclocal.m4 > 
aclocal.tmp
-cmp aclocal.m4 aclocal.tmp && exit 1
-
-mv aclocal.tmp aclocal.m4
-
-$MAKE 2>stderr || { cat cat stderr >&2; exit 1; }
-cat stderr >&2
-grep 'You have another version of autoconf' stderr
-grep 'aclocal.m4:.*this file was generated for' stderr
-
-$MAKE 2>stderr || { cat cat stderr >&2; exit 1; }
-cat stderr >&2
-grep 'You have another version of autoconf' stderr && exit 1
-grep 'aclocal.m4:.*this file was generated for' stderr && exit 1
-
-:
diff --git a/t/missing5.sh b/t/missing5.sh
deleted file mode 100755
index 6e575b6..0000000
--- a/t/missing5.sh
+++ /dev/null
@@ -1,64 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2006-2012 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 how well 'missing' finds output file names of various tools.
-# PR automake/483.
-
-am_create_testdir=empty
-. ./defs || exit 1
-
-get_shell_script missing
-
-# These programs may be invoked by 'missing'.
-needed_tools='chmod find sed test touch'
-needed_tools_csep=$(echo $needed_tools | sed 's/ /, /g')
-
-cat >configure.ac <<EOF
-AC_INIT([missing4], [1.0])
-m4_foreach([tool], [$needed_tools_csep],
-          [AC_PATH_PROG(tool, tool, [false])
-           AC_CONFIG_FILES(tool, chmod +x tool)
-          ])
-AC_OUTPUT
-EOF
-
-for tool in $needed_tools; do
-  unindent >$tool.in <<EOF
-    #! /bin/sh
-    exec @$tool@ "\$@"
-EOF
-done
-
-$AUTOCONF
-./configure
-
-echo output-file > output-file
-cp output-file my--output--file-o
-
-save_PATH=$PATH
-PATH=.
-export PATH
-missing --help
-missing --version
-for tool in autom4te help2man makeinfo; do
-  missing --run $tool -o my--output--file-o input
-  missing --run $tool --output my--output--file-o input
-done
-PATH=$save_PATH
-export PATH
-diff output-file my--output--file-o
-test ! -e ./--file-o
-test ! -e input
diff --git a/t/missing6.sh b/t/missing6.sh
deleted file mode 100755
index 8e02ae9..0000000
--- a/t/missing6.sh
+++ /dev/null
@@ -1,51 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2008-2012 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 autoconf version checks in aclocal.m4 are robust.
-
-am_create_testdirs=empty
-. ./defs || exit 1
-
-cat > configure.ac <<END
-m4_define([AC_AUTOCONF_VERSION], [9999a])
-dnl!! m4_define([a], [oops])
-AC_INIT([$me], [1.0])
-AM_INIT_AUTOMAKE
-AC_CONFIG_FILES([Makefile])
-AC_OUTPUT
-END
-
-: > Makefile.am
-
-$ACLOCAL
-$AUTOCONF 2>stderr || { cat stderr >&2; exit 1; }
-cat stderr >&2
-grep 'You have another version of autoconf' stderr
-grep 'aclocal.m4:.*this file was generated for' stderr
-$AUTOMAKE -a
-./configure
-$MAKE
-
-sed 's/^dnl!! //' < configure.ac > configure.tmp
-cmp configure.ac configure.tmp && fatal_ 'failed to edit configure.ac'
-mv -f configure.tmp configure.ac
-
-$MAKE 2>stderr || { cat stderr >&2; exit 1; }
-cat stderr >&2
-grep 'You have another version of autoconf' stderr
-grep 'aclocal.m4:.*this file was generated for autoconf 9999a' stderr
-
-:
diff --git a/t/mkdir_p.sh b/t/mkdir_p.sh
index 2cc68a3..bbd8c93 100755
--- a/t/mkdir_p.sh
+++ b/t/mkdir_p.sh
@@ -17,7 +17,7 @@
 # AM_INIT_AUTOMAKE should still define $(mkdir_p), for backward
 # compatibility.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_CONFIG_FILES([sub/Makefile])
diff --git a/t/mkdirp-deprecation.sh b/t/mkdirp-deprecation.sh
index 68ffa58..6f3b1ee 100755
--- a/t/mkdirp-deprecation.sh
+++ b/t/mkdirp-deprecation.sh
@@ -14,37 +14,13 @@
 # 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 AM_PROG_MKDIR_P macro is deprecated; it will be
-# be removed in the next major Automake release.  But also check
-# that it still works as expected in the current release series.
+# Check that the AM_PROG_MKDIR_P macro is deprecated.  It will be
+# be removed in the next major Automake release.
 
-. ./defs || exit 1
+. test-init.sh
 
-cat >> configure.ac << 'END'
-AM_PROG_MKDIR_P
-AC_CONFIG_FILES([sub/Makefile])
-AC_OUTPUT
-END
-
-cat > Makefile.am << 'END'
-SUBDIRS = sub
-all-local:
-       $(mkdir_p) . dir1/a
-       @mkdir_p@ . dir2/b
-check-local: all
-       test -d dir1/a
-       test -d dir2/b
-       test -d dir3/c
-       test -d dir3/d
-END
-
-mkdir sub
-cat > sub/Makefile.am << 'END'
-# '$(mkdir_p)' should continue to work even in subdir makefiles.
-all-local:
-       $(mkdir_p) .. ../dir3/c
-       @mkdir_p@ .. ../dir3/d
-END
+echo AM_PROG_MKDIR_P >> configure.ac
+: > Makefile.am
 
 grep_err ()
 {
@@ -62,15 +38,11 @@ grep_err
 
 $AUTOCONF -Werror -Wno-obsolete
 
-AUTOMAKE_fails
-grep_err
+#AUTOMAKE_fails
+#grep_err
 AUTOMAKE_fails --verbose -Wnone -Wobsolete
 grep_err
 
 $AUTOMAKE -Wno-obsolete
 
-./configure
-$MAKE check-local
-$MAKE distcheck
-
 :
diff --git a/t/mkinst2.sh b/t/mkinst2.sh
index daf8760..5ac297a 100755
--- a/t/mkinst2.sh
+++ b/t/mkinst2.sh
@@ -16,7 +16,7 @@
 
 # Test to make sure no-installman suppresses man dir creation.
 
-. ./defs || exit 1
+. test-init.sh
 
 echo AC_OUTPUT >> configure.ac
 
diff --git a/t/mkinst3.sh b/t/mkinst3.sh
index 2582758..02dca5e 100755
--- a/t/mkinst3.sh
+++ b/t/mkinst3.sh
@@ -17,7 +17,7 @@
 # Test mkinstalldirs with spaces in directory names.
 
 am_create_testdir=empty
-. ./defs || exit 1
+. test-init.sh
 
 cwd=$(pwd) || fatal_ "getting current working directory"
 
diff --git a/t/mkinstall.sh b/t/mkinstall.sh
index 51c1fe9..3fbb9a5 100755
--- a/t/mkinstall.sh
+++ b/t/mkinstall.sh
@@ -16,7 +16,7 @@
 
 # Test for bug where mkinstalldirs variable can be set incorrectly.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am << 'END'
 pkgdata_DATA =
diff --git a/t/mmode.sh b/t/mmode.sh
index 23cb646..ea26c02 100755
--- a/t/mmode.sh
+++ b/t/mmode.sh
@@ -16,7 +16,7 @@
 
 # Check for AM_MAINTAINER_MODE defaults.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AM_MAINTAINER_MODE
diff --git a/t/mmodely.sh b/t/mmodely.sh
index 9147da1..e1b2807 100755
--- a/t/mmodely.sh
+++ b/t/mmodely.sh
@@ -19,7 +19,7 @@
 # From Derek R. Price.
 
 required=cc
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AM_MAINTAINER_MODE
diff --git a/t/multlib.sh b/t/multlib.sh
deleted file mode 100755
index 778db14..0000000
--- a/t/multlib.sh
+++ /dev/null
@@ -1,162 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2003-2012 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 multilib support.
-# Based on a test case from Ralf Corsepius.
-# FIXME: the features tested by this script has been moved in contrib.
-# FIXME: We should move this script accordingly.
-
-required='gcc GNUmake'
-. ./defs || exit 1
-
-mldir=$am_top_srcdir/contrib/multilib
-mkdir m4
-cp "$mldir"/config-ml.in "$mldir"/symlink-tree .
-cp "$mldir"/multi.m4 m4
-
-ACLOCAL_PATH=${ACLOCAL_PATH+"$ACLOCAL_PATH:"}$(pwd)/m4
-export ACLOCAL_PATH
-
-cat >configure.ac <<'END'
-AC_INIT([multlib], [1.0])
-AC_CONFIG_SRCDIR(libfoo/foo.c)
-AC_CONFIG_AUX_DIR(.)
-AM_INIT_AUTOMAKE
-AC_CONFIG_FILES([Makefile])
-AC_CONFIG_SUBDIRS(libfoo)
-AC_CONFIG_SUBDIRS(libbar)
-AC_OUTPUT
-END
-
-cat >mycc <<'END'
-#! /bin/sh
-case ${1+"$@"} in
- *-print-multi-lib*)
-  echo ".;"
-  echo "debug;@g"
-  exit 0 ;;
-esac
-gcc ${1+"$@"}
-END
-
-chmod +x mycc
-PATH=$(pwd)$PATH_SEPARATOR$PATH; export PATH
-
-cat >Makefile.am <<'EOF'
-SUBDIRS = @subdirs@
-EXTRA_DIST = config-ml.in symlink-tree
-check-all:
-       test -f debug/libfoo/libfoo.a
-       test -f debug/libbar/libbar.a
-       test -f libfoo/libfoo.a
-       test -f libbar/libbar.a
-EOF
-
-# libfoo tests multilib supports when there are no subdirectories
-# libbar tests multilib supports when there are subdirectories
-
-mkdir libfoo
-cp "$mldir"/multilib.am libfoo/
-
-cat >libfoo/configure.ac <<'END'
-AC_PREREQ(2.57)
-AC_INIT(libfoo, 0.1, address@hidden)
-AC_CONFIG_SRCDIR(foo.c)
-# Apparently it doesn't work to have auxdir=.. when
-# multilib uses symlinked trees.
-AC_CONFIG_AUX_DIR(.)
-AM_INIT_AUTOMAKE
-AC_PROG_CC
-AM_PROG_AR
-AC_PROG_RANLIB
-AM_ENABLE_MULTILIB(Makefile,[..])
-AC_CONFIG_FILES([Makefile])
-AC_OUTPUT
-END
-
-cat >libfoo/Makefile.am <<'END'
-noinst_LIBRARIES = libfoo.a
-libfoo_a_SOURCES = foo.c
-include $(top_srcdir)/multilib.am
-END
-
-: > libfoo/foo.c
-
-mkdir libbar
-cp "$mldir"/multilib.am libbar/
-
-cat >libbar/configure.ac <<'END'
-AC_PREREQ(2.57)
-AC_INIT(libbar, 0.1, address@hidden)
-# Apparently it doesn't work to have auxdir=.. when
-# multilib uses symlinked trees.
-AC_CONFIG_AUX_DIR(.)
-AM_INIT_AUTOMAKE
-AC_PROG_CC
-AM_PROG_AR
-AC_PROG_RANLIB
-AM_ENABLE_MULTILIB(Makefile,[..])
-AC_CONFIG_FILES([Makefile sub/Makefile])
-AC_OUTPUT
-END
-
-cat >libbar/Makefile.am <<'END'
-SUBDIRS = sub
-noinst_LIBRARIES = libbar.a
-libbar_a_SOURCES = bar.c
-include $(top_srcdir)/multilib.am
-END
-
-mkdir libbar/sub
-echo 'include $(top_srcdir)/multilib.am' >libbar/sub/Makefile.am
-: > libbar/bar.c
-
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE --add-missing
-
-cd libfoo
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE --add-missing
-cd ..
-
-cd libbar
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE --add-missing
-cd ..
-
-# Check VPATH builds
-mkdir build
-cd build
-../configure --enable-multilib CC=mycc
-$MAKE
-test -f debug/libfoo/libfoo.a
-test -f debug/libbar/libbar.a
-test -f libfoo/libfoo.a
-test -f libbar/libbar.a
-$MAKE install
-$MAKE distcleancheck
-
-# Check standard builds.
-cd ..
-# Why to I have to specify --with-target-subdir?
-./configure --enable-multilib --with-target-subdir=. CC=mycc
-$MAKE check
-DISTCHECK_CONFIGURE_FLAGS='--enable-multilib CC=mycc' $MAKE distcheck
-
-:
diff --git a/t/no-extra-makefile-code.sh b/t/no-extra-makefile-code.sh
index ab0e33d..3673d45 100755
--- a/t/no-extra-makefile-code.sh
+++ b/t/no-extra-makefile-code.sh
@@ -19,7 +19,7 @@
 # by a regression caused by removal of automatic de-ANSI-fication support:
 # <http://lists.gnu.org/archive/html/automake-patches/2011-08/msg00200.html>
 
-. ./defs || exit 1
+. test-init.sh
 
 echo AC_OUTPUT >> configure.ac
 
diff --git a/t/no-spurious-install-recursive.sh 
b/t/no-spurious-install-recursive.sh
index d16b580..583686f 100755
--- a/t/no-spurious-install-recursive.sh
+++ b/t/no-spurious-install-recursive.sh
@@ -17,7 +17,7 @@
 # Regression test for install-recursive appearing in a non recursive Makefile.
 # Report from Bruno Haible.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am << 'END'
 noinst_SCRIPTS = hostname
diff --git a/t/nobase-libtool.sh b/t/nobase-libtool.sh
index 4a66601..af47c01 100755
--- a/t/nobase-libtool.sh
+++ b/t/nobase-libtool.sh
@@ -19,7 +19,7 @@
 # greater exposure of that test.
 
 required='cc libtoolize'
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac <<'EOF'
 AC_PROG_CC
diff --git a/t/nobase-nodist.sh b/t/nobase-nodist.sh
index 1ec466f..ef5dfce 100755
--- a/t/nobase-nodist.sh
+++ b/t/nobase-nodist.sh
@@ -16,7 +16,7 @@
 
 # Interaction of 'nobase_' and 'nodist_' prefixes.
 
-. ./defs || exit 1
+. test-init.sh
 
 # Simulate no emacs and no python (it shouldn't be needed in this test).
 EMACS="no" PYTHON=":"; export EMCAS PYTHON
diff --git a/t/nobase-python.sh b/t/nobase-python.sh
index 6480f26..de640f3 100755
--- a/t/nobase-python.sh
+++ b/t/nobase-python.sh
@@ -17,7 +17,7 @@
 # Make sure nobase_* works for python files.
 
 required=python
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac <<EOF
 AM_PATH_PYTHON
diff --git a/t/nobase.sh b/t/nobase.sh
index 1432d8d..249eb29 100755
--- a/t/nobase.sh
+++ b/t/nobase.sh
@@ -17,7 +17,7 @@
 # Make sure nobase_* works.
 
 required=cc
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac <<'EOF'
 AC_PROG_CC
diff --git a/t/nodef.sh b/t/nodef.sh
index a9034fa..8197f44 100755
--- a/t/nodef.sh
+++ b/t/nodef.sh
@@ -16,13 +16,13 @@
 
 # Make sure that PACKAGE and VERSION are AC_DEFINEd when requested.
 
-. ./defs || exit 1
+. test-init.sh
 
 # -------------------------------------------------------------------
 # Do not upgrade this file to use the modern AC_INIT/AM_INIT_AUTOMAKE
 # forms.  The day these obsolete AC_INIT and AM_INIT_AUTOMAKE forms
 # are dropped, just erase the file.
-# nodef2.sh contains the modern version of this test.
+# nodef2.test contains the modern version of this test.
 # -------------------------------------------------------------------
 
 # First, check that PACKAGE and VERSION are output by default.
diff --git a/t/nodef2.sh b/t/nodef2.sh
index 2f7bb77..0a6a5ce 100755
--- a/t/nodef2.sh
+++ b/t/nodef2.sh
@@ -16,7 +16,7 @@
 
 # Make sure that PACKAGE and VERSION are AC_DEFINEd when requested.
 
-. ./defs || exit 1
+. test-init.sh
 
 # First, check that PACKAGE and VERSION are output by default.
 
diff --git a/t/nodep.sh b/t/nodep.sh
index 8a4ce8e..fba3e5f 100755
--- a/t/nodep.sh
+++ b/t/nodep.sh
@@ -17,7 +17,7 @@
 # Test to make sure no-dependencies option does the right thing.
 # Bug report from Greg A. Woods.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am << 'END'
 AUTOMAKE_OPTIONS = no-dependencies
diff --git a/t/nodep2.sh b/t/nodep2.sh
index df411b7..5ad04a0 100755
--- a/t/nodep2.sh
+++ b/t/nodep2.sh
@@ -16,7 +16,7 @@
 
 # Another test to make sure no-dependencies option does the right thing.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am << 'END'
 bin_PROGRAMS = foo
@@ -30,12 +30,7 @@ AC_CONFIG_FILES([Makefile])
 AC_PROG_CC
 AC_PROG_CXX
 AC_PROG_OBJC
-# FIXME: this is to cater to older autoconf; remove this once we
-# FIXME: automake requires Autoconf 2.65 or later.
-m4_ifdef([AC_PROG_OBJCXX], [AC_PROG_OBJCXX], [
-  AC_SUBST([OBJCXX], [whocares])
-  AM_CONDITIONAL([am__fastdepOBJCXX], [whocares])
-])
+AC_PROG_OBJCXX
 AM_PROG_AS
 AM_PROG_GCJ
 AM_PROG_UPC
diff --git a/t/nodepcomp.sh b/t/nodepcomp.sh
index 25c66b5..9e96dc1 100755
--- a/t/nodepcomp.sh
+++ b/t/nodepcomp.sh
@@ -16,7 +16,7 @@
 
 # Test to make sure depcomp isn't always required.
 
-. ./defs || exit 1
+. test-init.sh
 
 rm -f depcomp
 
diff --git a/t/nodist.sh b/t/nodist.sh
index f63ea97..b7f491c 100755
--- a/t/nodist.sh
+++ b/t/nodist.sh
@@ -16,7 +16,7 @@
 
 # Test to make sure dist_*_SOURCES and nodist_*_SOURCES work.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/nodist2.sh b/t/nodist2.sh
index 9db9dce..36b6691 100755
--- a/t/nodist2.sh
+++ b/t/nodist2.sh
@@ -17,7 +17,7 @@
 # Test to make sure nodist_noinst_HEADERS work.
 # For PR 249.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac <<'EOF'
 AC_OUTPUT
diff --git a/t/nodist3.sh b/t/nodist3.sh
index f45f66f..cb302d2 100755
--- a/t/nodist3.sh
+++ b/t/nodist3.sh
@@ -16,7 +16,7 @@
 
 # Test to make sure no-dist option works.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/noinst.sh b/t/noinst.sh
index ca4440f..39fd72c 100755
--- a/t/noinst.sh
+++ b/t/noinst.sh
@@ -17,7 +17,7 @@
 # Check to make sure "make install" will build all in directory with
 # nothing to install.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am << 'END'
 all-local:
diff --git a/t/noinstdir.sh b/t/noinstdir.sh
index 24854cf..e2a7a84 100755
--- a/t/noinstdir.sh
+++ b/t/noinstdir.sh
@@ -18,7 +18,7 @@
 # From Pavel Roskin.
 
 required=cc
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am << 'END'
 noinst_SCRIPTS = foo.sh
diff --git a/t/nolink.sh b/t/nolink.sh
index 34219b2..cd0495c 100755
--- a/t/nolink.sh
+++ b/t/nolink.sh
@@ -16,7 +16,7 @@
 
 # Make sure Automake does not emit a link rule for unknown languages.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am << 'END'
 AUTOMAKE_OPTIONS = no-exeext
diff --git a/t/nostdinc.sh b/t/nostdinc.sh
index 812c6be..93761d5 100755
--- a/t/nostdinc.sh
+++ b/t/nostdinc.sh
@@ -21,7 +21,7 @@
 # just skip the rest of the test if configure fails to find a working C
 # compiler.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/notrans.sh b/t/notrans.sh
index d997e97..4b2c803 100755
--- a/t/notrans.sh
+++ b/t/notrans.sh
@@ -17,7 +17,7 @@
 # Check all notrans_, dist_, nodist_ prefix combinations for MANS
 # primary and install-man dependencies.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac <<'END'
 AC_OUTPUT
diff --git a/t/number.sh b/t/number.sh
index e0ccd24..673805e 100755
--- a/t/number.sh
+++ b/t/number.sh
@@ -17,7 +17,7 @@
 # Test to make sure _OBJECTS is only generated once.  Bug reported by
 # Joerg-Martin Schwarz.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/objc-basic.sh b/t/objc-basic.sh
index 919bb10..028cbc2 100755
--- a/t/objc-basic.sh
+++ b/t/objc-basic.sh
@@ -15,7 +15,7 @@
 # require an Objective-C compiler.
 # See also sister test 'objcxx-basic.sh'.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am <<'END'
 bin_PROGRAMS = hello
diff --git a/t/objc-deps.sh b/t/objc-deps.sh
index 31bc30d..2ac4ad0 100755
--- a/t/objc-deps.sh
+++ b/t/objc-deps.sh
@@ -17,7 +17,7 @@
 # Automatic dependency tracking for Objective C.
 # See also sister test 'objcxx-deps.sh'.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_OBJC
diff --git a/t/objc-flags.sh b/t/objc-flags.sh
index e98a811..91b0043 100755
--- a/t/objc-flags.sh
+++ b/t/objc-flags.sh
@@ -16,7 +16,7 @@
 
 # Test Objective C compilation flags.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_OBJC
@@ -57,6 +57,6 @@ grep '\$(OBJCFLAGS).*\$(foo.*_OBJCFLAGS)'    Makefile.in && 
exit 1
 grep '\$(foo.*_OBJCFLAGS).*\$(AM_OBJCFLAGS)' Makefile.in && exit 1
 
 ./configure OBJCFLAGS=-UERROR
-$MAKE 
+$MAKE
 
 :
diff --git a/t/objc-megademo.sh b/t/objc-megademo.sh
index 876fecb..a94f5f7 100755
--- a/t/objc-megademo.sh
+++ b/t/objc-megademo.sh
@@ -18,15 +18,13 @@
 
 required=libtoolize
 am_create_testdir=empty
-. ./defs || exit 1
+. test-init.sh
 
 ## Autotools Input Files.
 
 cat > configure.ac << 'END'
 AC_INIT([play], [1.3], address@hidden)
 
-dnl Support for Object C++ was introduced only in Autoconf 2.65.
-AC_PREREQ([2.65])
 AC_CONFIG_SRCDIR([play.c])
 AC_CONFIG_AUX_DIR([build-aux])
 AC_CONFIG_MACRO_DIR([m4])
@@ -87,13 +85,7 @@ END
 ## Run Autotools.
 
 libtoolize
-if $ACLOCAL; then
-  : We have a modern enough autoconf, go ahead.
-elif test $? -eq 63; then
-  skip_ "Object C++ support requires Autoconf 2.65 or later"
-else
-  exit 1 # Some other aclocal failure.
-fi
+$ACLOCAL
 $AUTOHEADER
 $AUTOCONF
 $AUTOMAKE --add-missing
diff --git a/t/objc-minidemo.sh b/t/objc-minidemo.sh
index e20a036..8b8d6e7 100755
--- a/t/objc-minidemo.sh
+++ b/t/objc-minidemo.sh
@@ -18,7 +18,7 @@
 # See also sister test 'objcxx-minidemo.sh'.
 
 required=native
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_OBJC
diff --git a/t/objcxx-basic.sh b/t/objcxx-basic.sh
index e00106d..e176660 100755
--- a/t/objcxx-basic.sh
+++ b/t/objcxx-basic.sh
@@ -15,7 +15,7 @@
 # require an Objective-C++ compiler.
 # See also sister test 'objc-basic.sh'.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am <<'END'
 bin_PROGRAMS = hello
@@ -30,19 +30,10 @@ grep "add .*'AC_PROG_OBJCXX'" stderr
 rm -rf autom4te*.cache
 
 cat >> configure.ac <<'END'
-dnl Support for Object C++ was introduced only in Autoconf 2.65.
-AC_PREREQ([2.65])
 AC_PROG_OBJCXX
 END
 
-if $ACLOCAL; then
-  : We have a modern enough autoconf, go ahead.
-elif test $? -eq 63; then
-  skip_ "Object C++ support requires Autoconf 2.65 or later"
-else
-  exit 1 # Some other aclocal failure.
-fi
-
+$ACLOCAL
 $AUTOMAKE
 $EGREP '^\.SUFFIXES:.* \.mm( |$)' Makefile.in
 
diff --git a/t/objcxx-deps.sh b/t/objcxx-deps.sh
index fef4ac5..5f35080 100755
--- a/t/objcxx-deps.sh
+++ b/t/objcxx-deps.sh
@@ -17,11 +17,9 @@
 # Automatic dependency tracking for Objective C++.
 # See also sister test 'objc-deps.sh'.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
-dnl Support for Object C++ was introduced only in Autoconf 2.65.
-AC_PREREQ([2.65])
 AC_PROG_OBJCXX
 AC_OUTPUT
 END
@@ -50,13 +48,7 @@ int main (void)
 }
 END
 
-if $ACLOCAL; then
-  : We have a modern enough autoconf, go ahead.
-elif test $? -eq 63; then
-  skip_ "Object C++ support requires Autoconf 2.65 or later"
-else
-  exit 1 # Some other aclocal failure.
-fi
+$ACLOCAL
 $AUTOCONF
 $AUTOMAKE --add-missing
 
diff --git a/t/objcxx-flags.sh b/t/objcxx-flags.sh
index 8f5df45..2dde42b 100755
--- a/t/objcxx-flags.sh
+++ b/t/objcxx-flags.sh
@@ -17,11 +17,9 @@
 # Test Objective C++ compilation flags.
 # See also sister test 'objc-flags.sh'.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
-dnl Support for Object C++ was introduced only in Autoconf 2.65.
-AC_PREREQ([2.65])
 AC_PROG_OBJCXX
 AC_OUTPUT
 END
@@ -50,14 +48,7 @@ for i in 2 4; do
 END
 done
 
-if $ACLOCAL; then
-  : We have a modern enough autoconf, go ahead.
-elif test $? -eq 63; then
-  skip_ "Object C++ support requires Autoconf 2.65 or later"
-else
-  exit 1 # Some other aclocal failure.
-fi
-
+$ACLOCAL
 $AUTOCONF
 $AUTOMAKE -a
 
@@ -67,6 +58,6 @@ grep '\$(OBJCXXFLAGS).*\$(foo.*_OBJCXXFLAGS)'    Makefile.in 
&& exit 1
 grep '\$(foo.*_OBJCXXFLAGS).*\$(AM_OBJCXXFLAGS)' Makefile.in && exit 1
 
 ./configure OBJCXXFLAGS=-UERROR
-$MAKE 
+$MAKE
 
 :
diff --git a/t/objcxx-minidemo.sh b/t/objcxx-minidemo.sh
index e4e7767..52d692d 100755
--- a/t/objcxx-minidemo.sh
+++ b/t/objcxx-minidemo.sh
@@ -18,11 +18,9 @@
 # See also sister test 'objc-minidemo.sh'.
 
 required=native
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
-dnl Support for Object C++ was introduced only in Autoconf 2.65.
-AC_PREREQ([2.65])
 AC_PROG_OBJCXX
 AC_CONFIG_HEADERS([config.h])
 AC_OUTPUT
@@ -57,13 +55,7 @@ int main (void)
 }
 END
 
-if $ACLOCAL; then
-  : We have a modern enough autoconf, go ahead.
-elif test $? -eq 63; then
-  skip_ "Object C++ support requires Autoconf 2.65 or later"
-else
-  exit 1 # Some other aclocal failure.
-fi
+$ACLOCAL
 $AUTOCONF
 $AUTOHEADER
 $AUTOMAKE --add-missing
diff --git a/t/objext-pr10128.sh b/t/objext-pr10128.sh
index e773b72..da77c41 100755
--- a/t/objext-pr10128.sh
+++ b/t/objext-pr10128.sh
@@ -17,7 +17,7 @@
 # Test for automake bug#10128: $(OBJEXT) redefinition causes
 # $(foo_OBJECTS) to be defined as empty.
 
-. ./defs || exit 1
+. test-init.sh
 
 echo AC_OUTPUT >> configure.ac
 
diff --git a/t/obsolete.sh b/t/obsolete.sh
deleted file mode 100755
index 2a21f54..0000000
--- a/t/obsolete.sh
+++ /dev/null
@@ -1,57 +0,0 @@
-#! /bin/sh
-# Copyright (C) 1996-2012 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 obsolete macros can be autoupdated.
-
-# We need the following indirection in case someone exported e.g.
-# AUTOUPDATE='autoupdate --verbose'.
-set x ${AUTOUPDATE-autoupdate}
-required=$2
-. ./defs || exit 1
-
-cat > configure.ac << 'END'
-AC_INIT
-END
-
-$PERL -ne '/AU_DEFUN\(\[(\w+)\]/ && print "$1\n"' \
-  "$am_automake_acdir/obsolete.m4" > obs
-cat obs >> configure.ac
-$PERL -ne 'chomp; print "grep $_ output || exit 1\n"; ' obs > obs.1
-$PERL -ne 'chomp; print "grep $_ configure.ac && exit 1\n"; ' obs > obs.2
-echo : >> obs.1 # Since it will be sourced, it must end with a success.
-echo : >> obs.2 # Likewise.
-
-cat configure.ac # For debugging.
-cat obs.1        # Likewise.
-cat obs.2        # Likewise.
-
-# Sanity check.  Make sure we have added something to configure.ac.
-test $(wc -l <configure.ac) -gt 1
-
-$ACLOCAL
-
-# Expect Autoconf to complain about each of the macros in obs.
-$AUTOCONF -Wobsolete >output 2>&1 || { cat output; exit 1; }
-cat output
-. ./obs.1
-# Make sure Autoupdate remove each of these macros.
-$AUTOUPDATE
-. ./obs.2
-
-# Autoconf should be able to grok the updated configure.ac.
-$AUTOCONF
-
-:
diff --git a/t/oldvars.sh b/t/oldvars.sh
index 26f6001..5f42229 100755
--- a/t/oldvars.sh
+++ b/t/oldvars.sh
@@ -17,7 +17,7 @@
 # Use of these variables is deprecated:
 # LISP, HEADERS, DATA, SCRIPTS, LTLIBRARIES, LIBRARIES, PROGRAMS, MANS.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >Makefile.am <<\EOF
 DATA =
diff --git a/t/order.sh b/t/order.sh
index cd0beac..6f5dd17 100755
--- a/t/order.sh
+++ b/t/order.sh
@@ -17,7 +17,7 @@
 # Make sure AC_DEFUN is handled correctly.  This test isn't named very
 # well.  Report from Jim Meyering.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 jm_TEST
diff --git a/t/output-order.sh b/t/output-order.sh
index 02b26df..569be90 100755
--- a/t/output-order.sh
+++ b/t/output-order.sh
@@ -17,7 +17,7 @@
 # Test that 'automake -a' output order is stable.
 # From report by Bruno Haible.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac <<'END'
 AC_OUTPUT
diff --git a/t/output.sh b/t/output.sh
index a21fe89..1a7cd1f 100755
--- a/t/output.sh
+++ b/t/output.sh
@@ -16,7 +16,7 @@
 
 # Test to make sure files listed in AC_OUTPUT are found.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > configure.ac <<END
 AC_INIT([$me], [1.0])
diff --git a/t/output10.sh b/t/output10.sh
index c6130f9..1702872 100755
--- a/t/output10.sh
+++ b/t/output10.sh
@@ -18,7 +18,7 @@
 # This is comparable to 'output9.sh', but testing Makefile rules.
 # PR/411
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << END
 AC_SUBST([FOO], [top])
diff --git a/t/output11.sh b/t/output11.sh
index 7dbd835..5b66a43 100755
--- a/t/output11.sh
+++ b/t/output11.sh
@@ -16,7 +16,7 @@
 
 # Make sure an AC_CONFIG_FILES ignore filenames with shell variables.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << \END
 AC_SUBST([FOO], [foo])
diff --git a/t/output12.sh b/t/output12.sh
index 80e0f20..8462b48 100755
--- a/t/output12.sh
+++ b/t/output12.sh
@@ -16,7 +16,7 @@
 
 # Make sure an AC_CONFIG_FILES process filenames with AC_SUBST variables.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << \END
 AC_SUBST([FOO], [foo])
diff --git a/t/output13.sh b/t/output13.sh
index 16bc0f9..e96552a 100755
--- a/t/output13.sh
+++ b/t/output13.sh
@@ -17,7 +17,7 @@
 # Make sure an AC_CONFIG_FILES, AC_CONFIG_LINKS, and AC_CONFIG_COMMANDS
 # are not prerequisites of 'all'.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << \END
 AC_SUBST([FOO], [foo])
diff --git a/t/output2.sh b/t/output2.sh
index 615f6cf..a69b979 100755
--- a/t/output2.sh
+++ b/t/output2.sh
@@ -16,7 +16,7 @@
 
 # Another AC_OUTPUT test.  From report by Ulrich Drepper.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > configure.ac <<END
 AC_INIT([$me], [1.0])
diff --git a/t/output3.sh b/t/output3.sh
index 2e4f38a..171c9fb 100755
--- a/t/output3.sh
+++ b/t/output3.sh
@@ -16,7 +16,7 @@
 
 # Yet another AC_OUTPUT test.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > configure.ac <<END
 AC_INIT([$me], [1.0])
diff --git a/t/output4.sh b/t/output4.sh
index 54d49e2..f5d3535 100755
--- a/t/output4.sh
+++ b/t/output4.sh
@@ -16,7 +16,7 @@
 
 # It's hard to believe there are so many AC_OUTPUT-related bugs.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > configure.ac <<END
 AC_INIT([$me], [1.0])
diff --git a/t/output5.sh b/t/output5.sh
index 8222ea7..f1453c6 100755
--- a/t/output5.sh
+++ b/t/output5.sh
@@ -16,7 +16,7 @@
 
 # Make sure Automake complains when there is no Makefile specified.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > configure.ac << 'END'
 AC_INIT([foo], [bar], [baz])
diff --git a/t/output6.sh b/t/output6.sh
index 418e1a5..2d4f3d4 100755
--- a/t/output6.sh
+++ b/t/output6.sh
@@ -16,7 +16,7 @@
 
 # Check for support for colon-separated input files in AC_CONFIG_FILES.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > configure.ac << END
 AC_INIT([$me], [1.0])
diff --git a/t/output7.sh b/t/output7.sh
index d5aca29..22d41f9 100755
--- a/t/output7.sh
+++ b/t/output7.sh
@@ -17,7 +17,7 @@
 # Check for support for colon separated input files in AC_CONFIG_FILES,
 # with sources in sub directories.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > configure.ac << END
 AC_INIT([$me], [1.0])
diff --git a/t/output8.sh b/t/output8.sh
index 62cade5..d9f8344 100755
--- a/t/output8.sh
+++ b/t/output8.sh
@@ -17,7 +17,7 @@
 # Check AC_CONFIG_FILES support for files starting with '../'.
 # Report from Bruno Haible.
 
-. ./defs || exit 1
+. test-init.sh
 
 mkdir testdir
 cd testdir
diff --git a/t/output9.sh b/t/output9.sh
index 54dc8c1..e5b55fe 100755
--- a/t/output9.sh
+++ b/t/output9.sh
@@ -16,7 +16,7 @@
 
 # Make sure an AC_CONFIG_FILES can have an AC_CONFIG_FILES output as input.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << END
 AC_CONFIG_FILES([a/mid.in:a/input.in.in])
diff --git a/t/override-conditional-1.sh b/t/override-conditional-1.sh
index 42e0350..8ccae76 100755
--- a/t/override-conditional-1.sh
+++ b/t/override-conditional-1.sh
@@ -16,7 +16,7 @@
 
 # Test for conditionally-defined overrides.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AM_CONDITIONAL([COND], [test x"$cond" = x"yes"])
diff --git a/t/override-conditional-2.sh b/t/override-conditional-2.sh
index 58ab1fd..00fa63d 100755
--- a/t/override-conditional-2.sh
+++ b/t/override-conditional-2.sh
@@ -18,7 +18,7 @@
 # This test is still xfailing; see the FIXME in Automake::Rule::define.
 # Once that is fixed, the test should succeed.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AM_CONDITIONAL([COND], [:])
diff --git a/t/override-html.sh b/t/override-html.sh
index 777d946..c5fbebb 100755
--- a/t/override-html.sh
+++ b/t/override-html.sh
@@ -17,7 +17,7 @@
 # Test that overriding 'html' target causes only one "html:" rule to
 # be output.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am << 'END'
 html:
diff --git a/t/override-suggest-local.sh b/t/override-suggest-local.sh
index 11b7fb9..671683f 100755
--- a/t/override-suggest-local.sh
+++ b/t/override-suggest-local.sh
@@ -17,7 +17,7 @@
 # Make sure automake -Woverride suggests using TARGET-local instead
 # of TARGET when possible.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am << 'END'
 install:
diff --git a/t/parallel-am.sh b/t/parallel-am.sh
index bd50af9..4b6ea5f 100755
--- a/t/parallel-am.sh
+++ b/t/parallel-am.sh
@@ -36,7 +36,7 @@
 # This test checks (0), (1), and (2).  See sister tests for further coverage.
 
 required=perl-threads
-. ./defs || exit 1
+. test-init.sh
 
 cat > configure.ac << 'END'
 AC_INIT([parallel-am], [1.0])
diff --git a/t/parallel-am2.sh b/t/parallel-am2.sh
index 0cca565..cb9853b 100755
--- a/t/parallel-am2.sh
+++ b/t/parallel-am2.sh
@@ -21,7 +21,7 @@
 #    warnings should be omitted in the same way as without threads.
 
 required=perl-threads
-. ./defs || exit 1
+. test-init.sh
 
 mkdir sub
 
diff --git a/t/parallel-am3.sh b/t/parallel-am3.sh
index 1bc12bb..9951aa5 100755
--- a/t/parallel-am3.sh
+++ b/t/parallel-am3.sh
@@ -22,7 +22,7 @@
 #    installation of aux files should be race-free.
 
 required=perl-threads
-. ./defs || exit 1
+. test-init.sh
 
 cat > configure.ac << 'END'
 AC_INIT([parallel-am], [1.0])
diff --git a/t/parallel-tests-basics.sh b/t/parallel-tests-basics.sh
index a1062d3..3022e22 100755
--- a/t/parallel-tests-basics.sh
+++ b/t/parallel-tests-basics.sh
@@ -23,7 +23,7 @@
 #  - TEST_LOGS redefinition at runtime
 #  - RECHECK_LOGS redefinition at runtime
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_OUTPUT
diff --git a/t/parallel-tests-cmdline-override.sh 
b/t/parallel-tests-cmdline-override.sh
index 4e8780f..37215a6 100755
--- a/t/parallel-tests-cmdline-override.sh
+++ b/t/parallel-tests-cmdline-override.sh
@@ -17,7 +17,7 @@
 # Check that we can use indirections when overriding TESTS and
 # TEST_LOGS from the command line.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_OUTPUT
diff --git a/t/parallel-tests-concurrency-2.sh 
b/t/parallel-tests-concurrency-2.sh
index 1a88ddf..bb38d50 100755
--- a/t/parallel-tests-concurrency-2.sh
+++ b/t/parallel-tests-concurrency-2.sh
@@ -21,7 +21,7 @@
 # It merely serves as demonstration.  :-)
 
 required='cc native GNUmake'
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/parallel-tests-concurrency.sh b/t/parallel-tests-concurrency.sh
index b606276..702572d 100755
--- a/t/parallel-tests-concurrency.sh
+++ b/t/parallel-tests-concurrency.sh
@@ -17,7 +17,7 @@
 # Check parallel-tests features:
 # - concurrent parallel execution
 
-. ./defs || exit 1
+. test-init.sh
 
 case $MAKE in
   *\ -j*) skip_ "\$MAKE contains '-j'";;
diff --git a/t/parallel-tests-console-output.sh 
b/t/parallel-tests-console-output.sh
index 2265008..409047e 100755
--- a/t/parallel-tests-console-output.sh
+++ b/t/parallel-tests-console-output.sh
@@ -17,7 +17,7 @@
 # parallel-tests: some checks on console output about testsuite
 # progress.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_OUTPUT
diff --git a/t/parallel-tests-driver-install.sh 
b/t/parallel-tests-driver-install.sh
index 9940661..803762b 100755
--- a/t/parallel-tests-driver-install.sh
+++ b/t/parallel-tests-driver-install.sh
@@ -15,19 +15,15 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # Check that auxiliary script 'test-driver' gets automatically installed
-# in the correct directory by 'parallel-tests' option.
+# in the correct directory.
 
-. ./defs || exit 1
-
-: Try first with parallel-tests defined in AM_INIT_AUTOMAKE.
-
-mkdir am-init-automake
-cd am-init-automake
+am_create_testdir=empty
+. test-init.sh
 
 cat > configure.ac <<END
 AC_INIT([$me], [1.0])
 AC_CONFIG_AUX_DIR([my_aux_dir])
-AM_INIT_AUTOMAKE([parallel-tests])
+AM_INIT_AUTOMAKE
 AC_CONFIG_FILES([Makefile sub/Makefile])
 AC_OUTPUT
 END
@@ -52,41 +48,6 @@ test -f my_aux_dir/test-driver
 test ! -e test-driver
 test ! -e sub/test-driver
 
-grep '^configure\.ac:3:.*installing.*my_aux_dir/test-driver' stderr
-
-cd ..
-
-: Now try with parallel-tests defined in AUTOMAKE_OPTIONS.
-
-mkdir automake-options
-cd automake-options
-
-cat > configure.ac <<END
-AC_INIT([$me], [1.0])
-AC_CONFIG_AUX_DIR([build-aux])
-AM_INIT_AUTOMAKE
-AC_CONFIG_FILES([dir/GNUmakefile])
-AC_OUTPUT
-END
-
-mkdir build-aux dir
-
-cat > dir/GNUmakefile.am <<END
-TESTS = foo.test
-AUTOMAKE_OPTIONS = parallel-tests
-TESTS += bar.test
-END
-
-$ACLOCAL
-$AUTOMAKE --add-missing --copy dir/GNUmakefile 2>stderr \
-  || { cat stderr >&2; exit 1; }
-cat stderr >&2
-
-ls -l . dir build-aux # For debugging.
-test -f build-aux/test-driver
-test ! -e test-driver
-test ! -e dir/test-driver
-
-grep '^dir/GNUmakefile\.am:2:.*installing.*build-aux/test-driver' stderr
+grep '^parallel-tests:.*installing.*my_aux_dir/test-driver' stderr
 
 :
diff --git a/t/parallel-tests-dry-run-1.sh b/t/parallel-tests-dry-run-1.sh
index 376a81a..5809dba 100755
--- a/t/parallel-tests-dry-run-1.sh
+++ b/t/parallel-tests-dry-run-1.sh
@@ -14,10 +14,10 @@
 # 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 parallel-tests interactions with "make -n".
+# Check interactions between the parallel test harness and "make -n".
 # See also sister test 'parallel-tests-dry-run-2.sh'.
 
-. ./defs || exit 1
+. test-init.sh
 
 echo AC_OUTPUT >> configure.ac
 
diff --git a/t/parallel-tests-dry-run-2.sh b/t/parallel-tests-dry-run-2.sh
index d041d2d..d47a76a 100755
--- a/t/parallel-tests-dry-run-2.sh
+++ b/t/parallel-tests-dry-run-2.sh
@@ -14,10 +14,10 @@
 # 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 parallel-tests interactions with "make -n".
+# Check interactions between the parallel test harness and "make -n".
 # See also sister test 'parallel-tests-dry-run-1.sh'.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_OUTPUT
diff --git a/t/parallel-tests-empty-testlogs.sh 
b/t/parallel-tests-empty-testlogs.sh
index 0ed2ff2..37ed83d 100755
--- a/t/parallel-tests-empty-testlogs.sh
+++ b/t/parallel-tests-empty-testlogs.sh
@@ -18,7 +18,7 @@
 # - empty TESTS
 # - empty TEST_LOGS
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_CONFIG_FILES([sub1/Makefile sub2/Makefile])
diff --git a/t/parallel-tests-empty.sh b/t/parallel-tests-empty.sh
index 146f1fc..a367038 100755
--- a/t/parallel-tests-empty.sh
+++ b/t/parallel-tests-empty.sh
@@ -19,7 +19,7 @@
 # BSD make will expand '$(TESTS:=.log)' to '.log' unless overridden.
 # See 'parallel-tests-trailing-whitespace.sh' for a similar issue.
 
-. ./defs || exit 1
+. test-init.sh
 cat >> configure.ac << 'END'
 AC_OUTPUT
 END
diff --git a/t/parallel-tests-exeext.sh b/t/parallel-tests-exeext.sh
index 22a5aad..bb96635 100755
--- a/t/parallel-tests-exeext.sh
+++ b/t/parallel-tests-exeext.sh
@@ -17,7 +17,7 @@
 # parallel-tests:
 #   - check2.am and interaction with $(EXEEXT)
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 dnl We need to fool the init.m4 internals a little.
diff --git a/t/parallel-tests-exit-statuses.sh 
b/t/parallel-tests-exit-statuses.sh
index bd5bb76..a7d6230 100755
--- a/t/parallel-tests-exit-statuses.sh
+++ b/t/parallel-tests-exit-statuses.sh
@@ -17,7 +17,7 @@
 # Check parallel-tests features: normal and special exit statuses
 # in the test scripts.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_OUTPUT
diff --git a/t/parallel-tests-extra-programs.sh 
b/t/parallel-tests-extra-programs.sh
index 0a7f97c..75a34b7 100755
--- a/t/parallel-tests-extra-programs.sh
+++ b/t/parallel-tests-extra-programs.sh
@@ -18,7 +18,7 @@
 # (or even be) $(EXTRA_PROGRAMS).
 
 required='cc native'
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/parallel-tests-fd-redirect-exeext.sh 
b/t/parallel-tests-fd-redirect-exeext.sh
index 3575765..80b6b28 100755
--- a/t/parallel-tests-fd-redirect-exeext.sh
+++ b/t/parallel-tests-fd-redirect-exeext.sh
@@ -22,7 +22,7 @@
 # sister test 'parallel-tests-fd-redirect.sh'.
 
 required='cc native'
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/parallel-tests-fd-redirect.sh b/t/parallel-tests-fd-redirect.sh
index 7cb59c3..ec48e4e 100755
--- a/t/parallel-tests-fd-redirect.sh
+++ b/t/parallel-tests-fd-redirect.sh
@@ -20,7 +20,7 @@
 # check for tests that are binary executables.
 # See also the more generic test 'check-fd-redirect.sh'.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_OUTPUT
diff --git a/t/parallel-tests-fork-bomb.sh b/t/parallel-tests-fork-bomb.sh
index 493e671..0698742 100755
--- a/t/parallel-tests-fork-bomb.sh
+++ b/t/parallel-tests-fork-bomb.sh
@@ -18,7 +18,7 @@
 #  - If $(TEST_SUITE_LOG) is in $(TEST_LOGS), we get a diagnosed
 #    error, not a make hang or a system freeze.
 
-. ./defs || exit 1
+. test-init.sh
 
 # We don't want localized error messages from make, since we'll have
 # to grep them.  See automake bug#11452.
diff --git a/t/parallel-tests-generated-and-distributed.sh 
b/t/parallel-tests-generated-and-distributed.sh
index eb48f93..ff6c2f5 100755
--- a/t/parallel-tests-generated-and-distributed.sh
+++ b/t/parallel-tests-generated-and-distributed.sh
@@ -24,7 +24,7 @@
 #       manual for the ugliness in this area, when VPATH comes into
 #       play.  :-/
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_OUTPUT
diff --git a/t/parallel-tests-harderror.sh b/t/parallel-tests-harderror.sh
index 8e1e014..88c5f59 100755
--- a/t/parallel-tests-harderror.sh
+++ b/t/parallel-tests-harderror.sh
@@ -16,7 +16,7 @@
 
 # Check parallel-tests features: DISABLE_HARD_ERRORS
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_CONFIG_FILES([sub/Makefile])
diff --git a/t/parallel-tests-interrupt.tap b/t/parallel-tests-interrupt.tap
index bce25b3..406bd7a 100755
--- a/t/parallel-tests-interrupt.tap
+++ b/t/parallel-tests-interrupt.tap
@@ -14,12 +14,12 @@
 # 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 parallel-tests driver removed incomplete log files
+# Check that the parallel testsuite harness removes incomplete log files
 # when interrupt upon some signal.  This test is definitely too hacky,
 # but we couldn't find a better way to deal with inter-processes
 # signals and the whole process-synchronization mess.
 
-. ./defs || exit 1
+. test-init.sh
 
 plan_ 16
 
diff --git a/t/parallel-tests-log-compiler-1.sh 
b/t/parallel-tests-log-compiler-1.sh
index 0e8c9d8..9214a07 100755
--- a/t/parallel-tests-log-compiler-1.sh
+++ b/t/parallel-tests-log-compiler-1.sh
@@ -19,7 +19,7 @@
 #   and xxx_LOG_FLAGS), also with AC_SUBST'd stuff.
 # See also related test 'parallel-tests-log-compiler-2.sh'.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_SUBST([acsubst_compiler], [t-compiler])
diff --git a/t/parallel-tests-log-compiler-2.sh 
b/t/parallel-tests-log-compiler-2.sh
index 775a4d1..2790dcb 100755
--- a/t/parallel-tests-log-compiler-2.sh
+++ b/t/parallel-tests-log-compiler-2.sh
@@ -20,7 +20,7 @@
 # See also related test 'parallel-tests-log-compiler-1.sh'.
 
 required='cc native'
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/parallel-tests-log-compiler-example.sh 
b/t/parallel-tests-log-compiler-example.sh
index 0d66b64..1c0d44d 100755
--- a/t/parallel-tests-log-compiler-example.sh
+++ b/t/parallel-tests-log-compiler-example.sh
@@ -18,7 +18,7 @@
 # LOG_COMPILER and LOG_FLAGS given in the manual.
 
 required=python
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac <<END
 AC_SUBST([PERL], ['$PERL'])
diff --git a/t/parallel-tests-log-override-1.sh 
b/t/parallel-tests-log-override-1.sh
index e4af517..cf77e82 100755
--- a/t/parallel-tests-log-override-1.sh
+++ b/t/parallel-tests-log-override-1.sh
@@ -16,7 +16,7 @@
 
 # Check parallel-tests features: runtime redefinition of $(TEST_SUITE_LOG).
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac <<'END'
 AC_OUTPUT
diff --git a/t/parallel-tests-log-override-2.sh 
b/t/parallel-tests-log-override-2.sh
index a747b00..0cbf730 100755
--- a/t/parallel-tests-log-override-2.sh
+++ b/t/parallel-tests-log-override-2.sh
@@ -18,7 +18,7 @@
 #  - $(TEST_SUITE_LOG) and $(TESTS)
 #  - $(TEST_SUITE_LOG) and $(TEST_LOGS)
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac <<'END'
 AC_OUTPUT
diff --git a/t/parallel-tests-log-override-recheck.sh 
b/t/parallel-tests-log-override-recheck.sh
index a6ab216..df08bd3 100755
--- a/t/parallel-tests-log-override-recheck.sh
+++ b/t/parallel-tests-log-override-recheck.sh
@@ -17,7 +17,7 @@
 # Check parallel-tests features: runtime redefinition of $(TEST_SUITE_LOG)
 # for the recheck target.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac <<'END'
 AC_OUTPUT
diff --git a/t/parallel-tests-no-color-in-log.sh 
b/t/parallel-tests-no-color-in-log.sh
index fe1036b..fb6fc13 100755
--- a/t/parallel-tests-no-color-in-log.sh
+++ b/t/parallel-tests-no-color-in-log.sh
@@ -17,7 +17,7 @@
 # Colorized output from the testsuite report shouldn't end up in log files.
 
 required='grep-nonprint'
-. ./defs || exit 1
+. test-init.sh
 
 TERM=ansi; export TERM
 
@@ -27,7 +27,7 @@ END
 
 cat >Makefile.am <<'END'
 LOG_COMPILER = $(SHELL)
-AUTOMAKE_OPTIONS = color-tests parallel-tests
+AUTOMAKE_OPTIONS = color-tests
 TESTS = pass fail skip xpass xfail error
 XFAIL_TESTS = xpass xfail
 END
diff --git a/t/parallel-tests-no-spurious-summary.sh 
b/t/parallel-tests-no-spurious-summary.sh
index 0088529..751ddb0 100755
--- a/t/parallel-tests-no-spurious-summary.sh
+++ b/t/parallel-tests-no-spurious-summary.sh
@@ -17,7 +17,7 @@
 # Check that ':test-results:' directives in test scripts' output doesn't
 # originate spurious results in the testsuite summary.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_OUTPUT
diff --git a/t/parallel-tests-once.sh b/t/parallel-tests-once.sh
index 67fcbab..d27224a 100755
--- a/t/parallel-tests-once.sh
+++ b/t/parallel-tests-once.sh
@@ -18,7 +18,7 @@
 # clean directory.  An early implementation of the '.trs' intermediate
 # files incurred a similar problem.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_OUTPUT
diff --git a/t/parallel-tests-recheck-depends-on-all.sh 
b/t/parallel-tests-recheck-depends-on-all.sh
index af53061..14783fd 100755
--- a/t/parallel-tests-recheck-depends-on-all.sh
+++ b/t/parallel-tests-recheck-depends-on-all.sh
@@ -18,7 +18,7 @@
 # See automake bug#11252.
 
 required='cc native'
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/parallel-tests-recheck-pr11791.sh 
b/t/parallel-tests-recheck-pr11791.sh
index 2d2fc5a..22203c9 100755
--- a/t/parallel-tests-recheck-pr11791.sh
+++ b/t/parallel-tests-recheck-pr11791.sh
@@ -18,7 +18,7 @@
 # failures for the test cases.  See automake bug#11791.
 
 required='cc native'
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/parallel-tests-recheck.sh b/t/parallel-tests-recheck.sh
index ea9dba6..85adf69 100755
--- a/t/parallel-tests-recheck.sh
+++ b/t/parallel-tests-recheck.sh
@@ -17,7 +17,7 @@
 # Check parallel-tests features:
 # - recheck
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_OUTPUT
diff --git a/t/parallel-tests-reset-term.sh b/t/parallel-tests-reset-term.sh
index 88a9852..3555fcb 100755
--- a/t/parallel-tests-reset-term.sh
+++ b/t/parallel-tests-reset-term.sh
@@ -14,11 +14,11 @@
 # 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 parallel-tests driver correctly handle overrides of the
+# Check that the testsuite harness correctly handle overrides of the
 # TERM variable by either TESTS_ENVIRONMENT and AM_TESTS_ENVIRONMENT.
 
 required='grep-nonprint'
-. ./defs || exit 1
+. test-init.sh
 
 TERM=ansi; export TERM
 
diff --git a/t/parallel-tests-subdir.sh b/t/parallel-tests-subdir.sh
index d57133f..de62f7f 100755
--- a/t/parallel-tests-subdir.sh
+++ b/t/parallel-tests-subdir.sh
@@ -14,10 +14,10 @@
 # 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 parallel-tests driver creates parent directories for
+# Check that the parallel test harness creates parent directories for
 # the log files when needed.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_OUTPUT
diff --git a/t/parallel-tests-suffix-prog.sh b/t/parallel-tests-suffix-prog.sh
index a0287da..f2ed390 100755
--- a/t/parallel-tests-suffix-prog.sh
+++ b/t/parallel-tests-suffix-prog.sh
@@ -19,7 +19,7 @@
 # See also sister test 'parallel-tests-suffix.sh'.
 
 required='cc native'
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/parallel-tests-suffix.sh b/t/parallel-tests-suffix.sh
index 93c7ea0..d0d1733 100755
--- a/t/parallel-tests-suffix.sh
+++ b/t/parallel-tests-suffix.sh
@@ -18,7 +18,7 @@
 # - suffix rules
 # See also sister test 'parallel-tests-suffix-prog.sh'.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_OUTPUT
diff --git a/t/parallel-tests-trailing-whitespace.sh 
b/t/parallel-tests-trailing-whitespace.sh
index e8e4203..3d729c8 100755
--- a/t/parallel-tests-trailing-whitespace.sh
+++ b/t/parallel-tests-trailing-whitespace.sh
@@ -18,7 +18,7 @@
 # - trailing whitespace in TESTS
 # GNU make 3.80 may expand trailing white space to '.log'.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_OUTPUT
diff --git a/t/parallel-tests-unreadable.sh b/t/parallel-tests-unreadable.sh
index 895d476..ff36294 100755
--- a/t/parallel-tests-unreadable.sh
+++ b/t/parallel-tests-unreadable.sh
@@ -17,7 +17,7 @@
 # Check that the testsuite driver copes well with unreadable '.log'
 # and '.trs' files.
 
-. ./defs || exit 1
+. test-init.sh
 
 : > t
 chmod a-r t && test ! -r t || skip_ "you can still read unreadable files"
diff --git a/t/parallel-tests2.sh b/t/parallel-tests2.sh
deleted file mode 100755
index ae9bd38..0000000
--- a/t/parallel-tests2.sh
+++ /dev/null
@@ -1,146 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2009-2012 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 parallel-tests features:
-#  - check-html
-#  - recheck-html
-# FIXME: the features tested by this script has been moved in contrib.
-# FIXME: We should move this script accordingly.
-
-. ./defs || exit 1
-
-# Try the variants that are tried in check-html.am.
-while :; do
-  for r2h in $RST2HTML rst2html rst2html.py; do
-    echo "$me: running $r2h --version"
-    $r2h --version && break 2
-    : For shells with busted 'set -e'.
-  done
-  skip_all_ "no proper rst2html program found"
-done
-unset r2h
-
-cp "$am_top_srcdir"/contrib/check-html.am . \
-  || fatal_ "cannot fetch 'check-html.am' from contrib"
-
-cat >> configure.ac << 'END'
-AC_OUTPUT
-END
-
-cat > Makefile.am << 'END'
-TEST_SUITE_LOG = mylog.log
-TESTS = foo.test bar.test baz.test
-check_SCRIPTS = bla
-bla:
-       echo bla > $@
-CLEANFILES = bla
-include $(srcdir)/check-html.am
-END
-
-cat > foo.test <<'END'
-#! /bin/sh
-echo "this is $0"
-test -f bla || exit 1
-exit 0
-END
-
-cat > bar.test <<'END'
-#! /bin/sh
-echo "this is $0"
-exit 99
-END
-
-cat > baz.test <<'END'
-#! /bin/sh
-echo "this is $0"
-exit 1
-END
-
-chmod a+x foo.test bar.test baz.test
-
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE -a
-
-./configure
-
-$MAKE check-html && exit 1
-test -f mylog.html
-# check-html should cause check_SCRIPTS to be created.
-test -f bla
-
-# "make clean" should remove HTML files.
-$MAKE clean
-test ! -e mylog.html
-test ! -e bla
-
-# Always create the HTML output, even if there were no failures.
-rm -f mylog.html
-env TESTS=foo.test $MAKE -e check-html
-test -f mylog.html
-
-# Create summarizing HTML output also with recheck-html.
-rm -f mylog.html
-env TESTS=foo.test $MAKE -e recheck-html
-test -f mylog.html
-
-# Create HTML output for an individual test.
-$MAKE foo.html
-grep 'this is .*foo\.test' foo.html
-test ! -e bar.html
-test ! -e baz.html
-
-# Create HTML output for individual tests.  Since the pre-existing log
-# files are expected to be used for the HTML conversion, this should
-# go smoothly even for failed tests.
-$MAKE bar.html baz.html
-grep 'this is .*bar\.test' bar.html
-grep 'this is .*baz\.test' baz.html
-
-# HTML output removed by mostlyclean.
-$MAKE mostlyclean
-test ! -e foo.html
-test ! -e bar.html
-test ! -e baz.html
-test ! -e mylog.html
-
-# check-html and recheck-html should cause check_SCRIPTS to be created,
-# and recheck-html should rerun no tests if check has not been run.
-
-$MAKE clean
-test ! -e mylog.html
-env TEST_LOGS=foo.log $MAKE -e check-html
-test -f bla
-test -f foo.log
-test ! -e bar.log
-test ! -e baz.log
-test -f mylog.html
-
-$MAKE clean
-env TESTS=foo.test $MAKE -e recheck-html
-test -f bla
-test ! -e foo.log
-test -f mylog.html
-
-$MAKE clean
-$MAKE recheck-html
-test -f bla
-test ! -e foo.log
-test ! -e bar.log
-test ! -e baz.log
-test -f mylog.html
-
-:
diff --git a/t/parse.sh b/t/parse.sh
index ec5bcbb..44a697b 100755
--- a/t/parse.sh
+++ b/t/parse.sh
@@ -16,7 +16,7 @@
 
 # Test to make sure backslash-newline is treated as whitespace.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/percent.sh b/t/percent.sh
index a4bad35..82040ae 100755
--- a/t/percent.sh
+++ b/t/percent.sh
@@ -17,7 +17,7 @@
 # Test to make sure that -Wportability understands %-style pattern
 # rules.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac <<EOF
 AC_PROG_CC
diff --git a/t/percent2.sh b/t/percent2.sh
index 4ed52c1..4313b24 100755
--- a/t/percent2.sh
+++ b/t/percent2.sh
@@ -19,7 +19,7 @@
 # '${ARCH}/%.$(OBJEXT):'.
 # Report from Ralf Corsepius.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >>Makefile.am << 'EOF'
 ${ARCH}/%.$(OBJEXT): %.S
diff --git a/t/perf/cond.sh b/t/perf/cond.sh
index cf9c760..cce2906 100755
--- a/t/perf/cond.sh
+++ b/t/perf/cond.sh
@@ -17,7 +17,7 @@
 # Check that many conditions do not lead to combinatorial explosion.
 # (This is related to PR/352.)
 
-. ./defs || exit 1
+. test-init.sh
 
 echo AC_PROG_CC >>configure.ac
 
diff --git a/t/perf/testsuite-recheck.sh b/t/perf/testsuite-recheck.sh
index e3383be..5400dc4 100755
--- a/t/perf/testsuite-recheck.sh
+++ b/t/perf/testsuite-recheck.sh
@@ -19,7 +19,7 @@
 # FIXME: performance is too low, and FAIL accordingly; it just offers an
 # FIXME: easy way to verify how effective a performance optimization is.
 
-. ./defs || exit 1
+. test-init.sh
 
 count=5000
 
diff --git a/t/perf/testsuite-summary.sh b/t/perf/testsuite-summary.sh
index 679a05a..3c02481 100755
--- a/t/perf/testsuite-summary.sh
+++ b/t/perf/testsuite-summary.sh
@@ -20,7 +20,7 @@
 # FIXME: performance is too low, and FAIL accordingly; it just offers
 # FIXME: an easy way verify how effective a performance optimization is.
 
-. ./defs || exit 1
+. test-init.sh
 
 count=10000
 
@@ -45,7 +45,7 @@ for i in $(seq_ 1 $count); do
   echo :test-result: PASS >> $i.trs
   echo :copy-in-global-log: yes >> $i.trs
   echo TESTS += $i.t
-done >> Makefile.am 
+done >> Makefile.am
 
 # Re-enable shell traces.
 set -x
diff --git a/t/phony.sh b/t/phony.sh
index fce2a6b..6f90b0e 100755
--- a/t/phony.sh
+++ b/t/phony.sh
@@ -17,7 +17,7 @@
 # Make sure .PHONY can be given dependencies several times.
 # From Ralf Corsepius.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >Makefile.am << 'EOF'
 .PHONY: foo
diff --git a/t/pkg-config-macros.sh b/t/pkg-config-macros.sh
index ddc6f8d..c0ebf9f 100755
--- a/t/pkg-config-macros.sh
+++ b/t/pkg-config-macros.sh
@@ -17,7 +17,7 @@
 # Try to find the pkg-config '.m4' files and make them easily accessed
 # to the test cases requiring them.
 
-. ./defs || exit 1
+. test-init.sh
 
 echo "# Automatically generated by $me." > get.sh
 echo : >> get.sh
diff --git a/t/pluseq.sh b/t/pluseq.sh
index 74dea56..a6dfb92 100755
--- a/t/pluseq.sh
+++ b/t/pluseq.sh
@@ -16,7 +16,7 @@
 
 # Test '+=' functionality.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am << 'END'
 data_DATA = zar
diff --git a/t/pluseq10.sh b/t/pluseq10.sh
index 20516c3..f0be6cf 100755
--- a/t/pluseq10.sh
+++ b/t/pluseq10.sh
@@ -17,7 +17,7 @@
 # Test for += and backslashes.
 # Reported by Ralf Corsepius.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac << 'END'
 AM_CONDITIONAL([A], [true])
diff --git a/t/pluseq11.sh b/t/pluseq11.sh
index 67dfd33..f00e743 100755
--- a/t/pluseq11.sh
+++ b/t/pluseq11.sh
@@ -18,7 +18,7 @@
 # is erroneously retained in the final value.
 # See also sister test 'pluseq11b.sh'.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac <<'END'
 AC_OUTPUT
diff --git a/t/pluseq2.sh b/t/pluseq2.sh
index 2069444..d2f7ee7 100755
--- a/t/pluseq2.sh
+++ b/t/pluseq2.sh
@@ -16,7 +16,7 @@
 
 # Test '+=' with conditionals.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AM_CONDITIONAL([CHECK], [true])
diff --git a/t/pluseq3.sh b/t/pluseq3.sh
index 52e82c5..b284847 100755
--- a/t/pluseq3.sh
+++ b/t/pluseq3.sh
@@ -16,7 +16,7 @@
 
 # Another '+=' test with conditionals.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AM_CONDITIONAL([CHECK], [true])
diff --git a/t/pluseq4.sh b/t/pluseq4.sh
index 32c64ea..3292dc5 100755
--- a/t/pluseq4.sh
+++ b/t/pluseq4.sh
@@ -16,7 +16,7 @@
 
 # Yet another '+=' test.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/pluseq5.sh b/t/pluseq5.sh
index 914e3b7..facab4e 100755
--- a/t/pluseq5.sh
+++ b/t/pluseq5.sh
@@ -16,7 +16,7 @@
 
 # Test for another '+=' problem.  Report from Brian Jones.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AM_CONDITIONAL([CHECK], [true])
diff --git a/t/pluseq6.sh b/t/pluseq6.sh
index 2db9c6f..0d4fcbe 100755
--- a/t/pluseq6.sh
+++ b/t/pluseq6.sh
@@ -16,7 +16,7 @@
 
 # Test that '+=' works with standard header-vars.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_SUBST([ZZZ])
diff --git a/t/pluseq7.sh b/t/pluseq7.sh
index c7ea2ad..f9a667f 100755
--- a/t/pluseq7.sh
+++ b/t/pluseq7.sh
@@ -16,7 +16,7 @@
 
 # Test that '+=' fails when required.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/pluseq8.sh b/t/pluseq8.sh
index da0ad89..83fa50a 100755
--- a/t/pluseq8.sh
+++ b/t/pluseq8.sh
@@ -16,7 +16,7 @@
 
 # Another '+=' test.  From Paul Berrevoets.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am << 'END'
 VAR = \
diff --git a/t/pluseq9.sh b/t/pluseq9.sh
index 4bbb78a..ab97c08 100755
--- a/t/pluseq9.sh
+++ b/t/pluseq9.sh
@@ -16,7 +16,7 @@
 
 # Test the += diagnostics.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac << 'END'
 AM_CONDITIONAL([COND1], [true])
diff --git a/t/posixsubst-data.sh b/t/posixsubst-data.sh
index 51b791e..9fd5340 100755
--- a/t/posixsubst-data.sh
+++ b/t/posixsubst-data.sh
@@ -17,7 +17,7 @@
 # Test that POSIX variable expansion '$(var:str=rpl)' works
 # in when used with the DATA primary.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_OUTPUT
diff --git a/t/posixsubst-extradist.sh b/t/posixsubst-extradist.sh
index b8e69d7..d8ba0d9 100755
--- a/t/posixsubst-extradist.sh
+++ b/t/posixsubst-extradist.sh
@@ -17,7 +17,7 @@
 # Test that POSIX variable expansion '$(var:str=rpl)' works when used
 # in EXTRA_DIST.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_OUTPUT
diff --git a/t/posixsubst-ldadd.sh b/t/posixsubst-ldadd.sh
index c9acd41..579bc23 100755
--- a/t/posixsubst-ldadd.sh
+++ b/t/posixsubst-ldadd.sh
@@ -18,7 +18,7 @@
 # when used in LDADD.
 
 required=cc
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/posixsubst-libraries.sh b/t/posixsubst-libraries.sh
index 884e8aa..69ea925 100755
--- a/t/posixsubst-libraries.sh
+++ b/t/posixsubst-libraries.sh
@@ -19,7 +19,7 @@
 # Keep this in sync with sister test 'posixsubst-ltlibraries.sh'.
 
 required=cc
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/posixsubst-ltlibraries.sh b/t/posixsubst-ltlibraries.sh
index 3111954..4a7d867 100755
--- a/t/posixsubst-ltlibraries.sh
+++ b/t/posixsubst-ltlibraries.sh
@@ -19,7 +19,7 @@
 # Keep this in sync with sister test 'posixsubst-libraries.sh'.
 
 required='cc libtool libtoolize'
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/posixsubst-programs.sh b/t/posixsubst-programs.sh
index 6e8e56b..edcd4dd 100755
--- a/t/posixsubst-programs.sh
+++ b/t/posixsubst-programs.sh
@@ -18,7 +18,7 @@
 # with the PROGRAMS primary.
 
 required=cc
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/posixsubst-scripts.sh b/t/posixsubst-scripts.sh
index c9083cb..7b758f3 100755
--- a/t/posixsubst-scripts.sh
+++ b/t/posixsubst-scripts.sh
@@ -17,7 +17,7 @@
 # Test that POSIX variable expansion '$(var:str=rpl)' works when used
 # with the SCRIPTS primary.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_OUTPUT
diff --git a/t/posixsubst-sources.sh b/t/posixsubst-sources.sh
index d3abfa1..b69bc54 100755
--- a/t/posixsubst-sources.sh
+++ b/t/posixsubst-sources.sh
@@ -18,7 +18,7 @@
 # with the SOURCES primary.
 
 required=cc
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/posixsubst-tests.sh b/t/posixsubst-tests.sh
index c631863..470527c 100755
--- a/t/posixsubst-tests.sh
+++ b/t/posixsubst-tests.sh
@@ -18,7 +18,7 @@
 # with the TESTS special variable.
 
 # For gen-testsuite-part: ==> try-with-serial-tests <==
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_OUTPUT
diff --git a/t/postproc.sh b/t/postproc.sh
index 2b60d88..d73eaec 100755
--- a/t/postproc.sh
+++ b/t/postproc.sh
@@ -18,7 +18,7 @@
 # and renamed.
 
 required=cc
-. ./defs || exit 1
+. test-init.sh
 
 cat >configure.ac <<END
 AC_INIT([$me], [1.0])
diff --git a/t/ppf77.sh b/t/ppf77.sh
index 73a32cb..f1c67e4 100755
--- a/t/ppf77.sh
+++ b/t/ppf77.sh
@@ -17,7 +17,7 @@
 # Test to make sure preprocessed F77 works.
 # Report from Jochen Kuepper.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_F77
diff --git a/t/pr2.sh b/t/pr2.sh
index bafff25..e5124d6 100755
--- a/t/pr2.sh
+++ b/t/pr2.sh
@@ -27,7 +27,7 @@
 # to the distribution directory before it creates a templ
 # subdirectory in the distribution directory.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_OUTPUT([README.foo:templ/README.foo.in])
diff --git a/t/pr211.sh b/t/pr211.sh
index a7dcee8..3d19a06 100755
--- a/t/pr211.sh
+++ b/t/pr211.sh
@@ -28,7 +28,7 @@
 # rename one of the 'foo.o' files.
 
 required=libtoolize
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/pr220.sh b/t/pr220.sh
index 2054fb3..fc67cf8 100755
--- a/t/pr220.sh
+++ b/t/pr220.sh
@@ -22,7 +22,7 @@
 # to debug the problem.
 # Note that this should be also in the documentation.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am << 'EOF'
 if NEVER_TRUE
diff --git a/t/pr224.sh b/t/pr224.sh
index c4fb9c1..640640f 100755
--- a/t/pr224.sh
+++ b/t/pr224.sh
@@ -24,7 +24,7 @@
 # should be '$(top_builddir)/bar/.deps'.
 
 required=cc
-. ./defs || exit 1
+. test-init.sh
 
 mkdir foo
 
diff --git a/t/pr229.sh b/t/pr229.sh
index cb3b223..b0ed4c4 100755
--- a/t/pr229.sh
+++ b/t/pr229.sh
@@ -18,7 +18,7 @@
 # Make sure AC_CYGWIN requires config.{sub,guess}.
 # Reported by James Youngman.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac <<EOF
 AC_CYGWIN
diff --git a/t/pr243.sh b/t/pr243.sh
index ee593f5..5ac3276 100755
--- a/t/pr243.sh
+++ b/t/pr243.sh
@@ -27,7 +27,7 @@
 # the colon in the CONFIG_FILES variable.
 
 required=cc
-. ./defs || exit 1
+. test-init.sh
 
 cat > configure.ac << END
 AC_INIT([$me], [1.0])
diff --git a/t/pr266.sh b/t/pr266.sh
index 5d8efad..c358227 100755
--- a/t/pr266.sh
+++ b/t/pr266.sh
@@ -18,7 +18,7 @@
 # Dependency tracking -vs- nonstandard Makefile names
 
 required=cc
-. ./defs || exit 1
+. test-init.sh
 
 cat > configure.ac << END
 AC_INIT([$me], [1.0])
diff --git a/t/pr279-2.sh b/t/pr279-2.sh
index fbd06ac..7f29251 100755
--- a/t/pr279-2.sh
+++ b/t/pr279-2.sh
@@ -24,7 +24,7 @@
 # fail with messages like:
 #       foo_DEPENDENCIES was already defined in condition TRUE, ...
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/pr279.sh b/t/pr279.sh
index 7f5f7b5..24b7fb7 100755
--- a/t/pr279.sh
+++ b/t/pr279.sh
@@ -24,7 +24,7 @@
 # fail with messages like:
 #       foo_DEPENDENCIES was already defined in condition TRUE, ...
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/pr287.sh b/t/pr287.sh
index 62eb739..bbbfe48 100755
--- a/t/pr287.sh
+++ b/t/pr287.sh
@@ -16,7 +16,7 @@
 
 # Test for PR 287: empty SUBDIRS.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_OUTPUT
diff --git a/t/pr300-lib.sh b/t/pr300-lib.sh
index d9a5dd1..ca73523 100755
--- a/t/pr300-lib.sh
+++ b/t/pr300-lib.sh
@@ -18,7 +18,7 @@
 # PR/300
 
 required=cc
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_RANLIB
diff --git a/t/pr300-ltlib.sh b/t/pr300-ltlib.sh
index 4926834..62c5b55 100755
--- a/t/pr300-ltlib.sh
+++ b/t/pr300-ltlib.sh
@@ -18,7 +18,7 @@
 # PR/300
 
 required='cc libtoolize'
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/pr300-prog.sh b/t/pr300-prog.sh
index b9aa97d..d7ada2d 100755
--- a/t/pr300-prog.sh
+++ b/t/pr300-prog.sh
@@ -18,7 +18,7 @@
 # PR/300
 
 required=cc
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/pr307.sh b/t/pr307.sh
index 04b4ee9..1204c77 100755
--- a/t/pr307.sh
+++ b/t/pr307.sh
@@ -33,7 +33,7 @@
 #  compilation.
 
 required='libtoolize gcc'
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/pr401.sh b/t/pr401.sh
index 73a7e25..3e73b0d 100755
--- a/t/pr401.sh
+++ b/t/pr401.sh
@@ -18,7 +18,7 @@
 # (pr401b.sh and pr401c.sh do the same for LTLIBOBJS and ALLOCA)
 
 required=cc
-. ./defs || exit 1
+. test-init.sh
 
 mkdir lib src
 
diff --git a/t/pr401b.sh b/t/pr401b.sh
index e591473..6193587 100755
--- a/t/pr401b.sh
+++ b/t/pr401b.sh
@@ -18,7 +18,7 @@
 # (pr401.sh and pr401c.sh do the same for LIBOBJS and ALLOCA)
 
 required='cc libtoolize'
-. ./defs || exit 1
+. test-init.sh
 
 mkdir lib src
 
diff --git a/t/pr401c.sh b/t/pr401c.sh
index e452ab6..96561c5 100755
--- a/t/pr401c.sh
+++ b/t/pr401c.sh
@@ -18,7 +18,7 @@
 # (pr401.sh and pr401b.sh do the same for LIBOBJS and LTLIBOBJS)
 
 required=cc
-. ./defs || exit 1
+. test-init.sh
 
 mkdir lib src
 
diff --git a/t/pr72.sh b/t/pr72.sh
index 3c2c914..9eb55b7 100755
--- a/t/pr72.sh
+++ b/t/pr72.sh
@@ -18,7 +18,7 @@
 # Empty _SOURCES results in $(LINK) undefined.
 
 required=libtool
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/pr87.sh b/t/pr87.sh
index 872dfa9..4027b5c 100755
--- a/t/pr87.sh
+++ b/t/pr87.sh
@@ -18,7 +18,7 @@
 # "make distcheck" fails when two source dirs exist.
 
 required=cc
-. ./defs || exit 1
+. test-init.sh
 
 subdirs="foo bar"
 
diff --git a/t/pr9.sh b/t/pr9.sh
index ccb0b93..7d75cc4 100755
--- a/t/pr9.sh
+++ b/t/pr9.sh
@@ -23,7 +23,7 @@
 # ltconfig, ltmain.sh, mdate-sh, missing, and mkinstalldirs.  In fact,
 # the entire 'support/' directory is omitted.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > configure.ac << END
 AC_INIT([$me], [1.0])
diff --git a/t/prefix.sh b/t/prefix.sh
index 907cd78..bc10771 100755
--- a/t/prefix.sh
+++ b/t/prefix.sh
@@ -16,7 +16,7 @@
 
 # Test to make sure range of prefixes can be extended
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/primary-prefix-couples-documented-valid.sh 
b/t/primary-prefix-couples-documented-valid.sh
index 5b43157..89e7880 100755
--- a/t/primary-prefix-couples-documented-valid.sh
+++ b/t/primary-prefix-couples-documented-valid.sh
@@ -18,7 +18,7 @@
 # examples in the Automake manual do not cause obvious errors.
 # Please keep this test in sync with the automake manual.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac <<'END'
 AC_PROG_CC
diff --git a/t/primary-prefix-couples-force-valid.sh 
b/t/primary-prefix-couples-force-valid.sh
index a6d7ace..5cf02d8 100755
--- a/t/primary-prefix-couples-force-valid.sh
+++ b/t/primary-prefix-couples-force-valid.sh
@@ -24,7 +24,7 @@
 # should work.
 
 required=cc
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac <<'END'
 AC_PROG_CC
diff --git a/t/primary-prefix-invalid-couples.tap 
b/t/primary-prefix-invalid-couples.tap
index dadf38d..2152d18 100755
--- a/t/primary-prefix-invalid-couples.tap
+++ b/t/primary-prefix-invalid-couples.tap
@@ -20,7 +20,7 @@
 # cover more cases.
 # See also test 'primary-prefix-valid-couples.test'.
 
-. ./defs || exit 1
+. test-init.sh
 
 plan_ "later"
 
@@ -29,7 +29,6 @@ oIFS=$IFS # Saved for later.
 : > ar-lib
 : > ltmain.sh
 : > texinfo.tex
-: > elisp-comp
 : > py-compile
 : > config.guess
 : > config.sub
diff --git a/t/primary-prefix-valid-couples.sh 
b/t/primary-prefix-valid-couples.sh
index e1e3c77..91d1b88 100755
--- a/t/primary-prefix-valid-couples.sh
+++ b/t/primary-prefix-valid-couples.sh
@@ -17,7 +17,7 @@
 # Test for valid prefix/primary combinations.
 # See also test 'primary-prefix-invalid-couples.sh'.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac <<'END'
 AC_PROG_CC
@@ -41,7 +41,6 @@ END
 echo '@setfilename foo' > foo.texi
 : > texinfo.tex
 : > py-compile
-: > elisp-comp
 : > ar-lib
 
 # Setup Makefile.am.
diff --git a/t/primary.sh b/t/primary.sh
index b107f4d..e11eb0e 100755
--- a/t/primary.sh
+++ b/t/primary.sh
@@ -16,7 +16,7 @@
 
 # Test to make sure errors in am_install_var work.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am << 'END'
 bin_PROGRAMS = @programs@
diff --git a/t/primary2.sh b/t/primary2.sh
index f355da0..c7437fe 100755
--- a/t/primary2.sh
+++ b/t/primary2.sh
@@ -16,7 +16,7 @@
 
 # Test to make sure errors in am_install_var work.
 
-. ./defs || exit 1
+. test-init.sh
 
 echo AC_PROG_CC >> configure.ac
 
diff --git a/t/primary3.sh b/t/primary3.sh
index 9905a8c..0a80a54 100755
--- a/t/primary3.sh
+++ b/t/primary3.sh
@@ -17,7 +17,7 @@
 # Make sure we can build programs ending in '.la'
 
 required=cc
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac <<EOF
 AC_PROG_CC
diff --git a/t/print-libdir.sh b/t/print-libdir.sh
index 9a33ac7..f9d596a 100755
--- a/t/print-libdir.sh
+++ b/t/print-libdir.sh
@@ -17,7 +17,7 @@
 # Test on automake options '--print-data-dir' and '--print-script-dir'.
 
 am_create_testdir=empty
-. ./defs || exit 1
+. test-init.sh
 
 libdir=$($AUTOMAKE --print-libdir) || exit 1
 case $libdir in /*);; *) exit 1;; esac
diff --git a/t/proginst.sh b/t/proginst.sh
index afb7300..c0f13a6 100755
--- a/t/proginst.sh
+++ b/t/proginst.sh
@@ -17,7 +17,7 @@
 # Test for bug where when multiple scripts are installed,
 # the check for AC_PROG_INSTALL fails.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am << 'END'
 bin_SCRIPTS = zardoz qbert brownie
diff --git a/t/programs-primary-rewritten.sh b/t/programs-primary-rewritten.sh
index 89b8025..40caf20 100755
--- a/t/programs-primary-rewritten.sh
+++ b/t/programs-primary-rewritten.sh
@@ -18,7 +18,7 @@
 # checks have been introduced in commit 'Release-1-9-254-g9d0eaef' into
 # the former test 'subst2.test'.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_SUBST([FOO], [c])
diff --git a/t/py-compile-basedir.sh b/t/py-compile-basedir.sh
index 75b45f7..05e1159 100755
--- a/t/py-compile-basedir.sh
+++ b/t/py-compile-basedir.sh
@@ -17,7 +17,7 @@
 # Test the '--basedir' option of the 'py-compile' script,
 
 required=python
-. ./defs || exit 1
+. test-init.sh
 
 # We'll need to create files in '..', so we need one more subdirectory
 # level in order not to clutter up the top-level tests directory.
diff --git a/t/py-compile-basic.sh b/t/py-compile-basic.sh
index cc5fec3..d846c1e 100755
--- a/t/py-compile-basic.sh
+++ b/t/py-compile-basic.sh
@@ -19,7 +19,7 @@
 # 'py-compile-basic2.sh'.
 
 required=python
-. ./defs || exit 1
+. test-init.sh
 
 cp "$am_scriptdir/py-compile" . \
   || fatal_ "failed to fetch auxiliary script py-compile"
diff --git a/t/py-compile-destdir.sh b/t/py-compile-destdir.sh
index 55137f0..f8dce2b 100755
--- a/t/py-compile-destdir.sh
+++ b/t/py-compile-destdir.sh
@@ -17,7 +17,7 @@
 # Test the '--destdir' option of the 'py-compile' script,
 
 required=python
-. ./defs || exit 1
+. test-init.sh
 
 cp "$am_scriptdir/py-compile" . \
   || fatal_ "failed to fetch auxiliary script py-compile"
diff --git a/t/py-compile-env.sh b/t/py-compile-env.sh
index 89d4ffc..a0d055d 100755
--- a/t/py-compile-env.sh
+++ b/t/py-compile-env.sh
@@ -16,7 +16,7 @@
 
 # Make sure 'py-compile' honours the PYTHON environment variable.
 
-. ./defs || exit 1
+. test-init.sh
 
 cp "$am_scriptdir/py-compile" . \
   || fatal_ "failed to fetch auxiliary script py-compile"
diff --git a/t/py-compile-option-terminate.sh b/t/py-compile-option-terminate.sh
index 0ad1fd8..a14c5ad 100755
--- a/t/py-compile-option-terminate.sh
+++ b/t/py-compile-option-terminate.sh
@@ -18,7 +18,7 @@
 # explicitly terminate the option list for 'py-compile'.
 
 required=python
-. ./defs || exit 1
+. test-init.sh
 
 cp "$am_scriptdir/py-compile" . \
   || fatal_ "failed to fetch auxiliary script py-compile"
diff --git a/t/py-compile-usage.sh b/t/py-compile-usage.sh
index 13ddc8e..ee5177d 100755
--- a/t/py-compile-usage.sh
+++ b/t/py-compile-usage.sh
@@ -17,7 +17,7 @@
 # Test 'py-compile --help', 'py-compile --version', and that 'py-compile'
 # correctly complains on wrong usage.
 
-. ./defs || exit 1
+. test-init.sh
 
 cp "$am_scriptdir/py-compile" . \
   || fatal_ "failed to fetch auxiliary script py-compile"
diff --git a/t/python-am-path-iftrue.sh b/t/python-am-path-iftrue.sh
index d7ba436..9c2335a 100755
--- a/t/python-am-path-iftrue.sh
+++ b/t/python-am-path-iftrue.sh
@@ -18,7 +18,7 @@
 
 am_create_testdir=empty
 required=python
-. ./defs || exit 1
+. test-init.sh
 
 cat > configure.ac <<END
 AC_INIT([$me], [1.0])
diff --git a/t/python-dist.sh b/t/python-dist.sh
index 0b6a4b0..070950c 100755
--- a/t/python-dist.sh
+++ b/t/python-dist.sh
@@ -17,7 +17,7 @@
 # Test distribution of *_PYTHON files.
 
 # This test does not require python.
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AM_PATH_PYTHON([], [:], [:])
diff --git a/t/python-missing.sh b/t/python-missing.sh
index b0912d3..9a3ccfb 100755
--- a/t/python-missing.sh
+++ b/t/python-missing.sh
@@ -20,7 +20,7 @@
 
 am_create_testdir=empty
 # An actual python is *not* required in this test.
-. ./defs || exit 1
+. test-init.sh
 
 PYTHON=; unset PYTHON
 
diff --git a/t/python-pr10995.sh b/t/python-pr10995.sh
index 63e97c5..60ebd67 100755
--- a/t/python-pr10995.sh
+++ b/t/python-pr10995.sh
@@ -19,7 +19,7 @@
 # declaration.
 
 required=python
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac <<'EOF'
 AM_PATH_PYTHON
diff --git a/t/python-too-old.sh b/t/python-too-old.sh
index b479c9e..e7d9234 100755
--- a/t/python-too-old.sh
+++ b/t/python-too-old.sh
@@ -19,7 +19,7 @@
 
 am_create_testdir=empty
 required=python
-. ./defs || exit 1
+. test-init.sh
 
 py_too_old ()
 {
diff --git a/t/python-vars.sh b/t/python-vars.sh
index 0c2c08b..24d274d 100755
--- a/t/python-vars.sh
+++ b/t/python-vars.sh
@@ -18,7 +18,7 @@
 # advertised in the manual.
 
 required=python
-. ./defs || exit 1
+. test-init.sh
 
 # In case the user's config.site defines pythondir or pyexecdir.
 CONFIG_SITE=/dev/null; export CONFIG_SITE
diff --git a/t/python-virtualenv.sh b/t/python-virtualenv.sh
index 89a99aa..9c0ffcc 100755
--- a/t/python-virtualenv.sh
+++ b/t/python-virtualenv.sh
@@ -18,7 +18,7 @@
 # This test also works as a mild stress-test on the python support.
 
 required='cc python virtualenv'
-. ./defs || exit 1
+. test-init.sh
 
 # In case the user's config.site defines pythondir or pyexecdir.
 CONFIG_SITE=/dev/null; export CONFIG_SITE
diff --git a/t/python.sh b/t/python.sh
index a3add40..3f79ca3 100755
--- a/t/python.sh
+++ b/t/python.sh
@@ -16,7 +16,7 @@
 
 # Test to make sure py_compile and am__py_compile are correctly defined.
 
-. ./defs || exit 1
+. test-init.sh
 
 echo 'AM_PATH_PYTHON' >> configure.ac
 
diff --git a/t/python10.sh b/t/python10.sh
index 8814902..9ee8cad 100755
--- a/t/python10.sh
+++ b/t/python10.sh
@@ -17,7 +17,7 @@
 # Test _PYTHON with conditionals.
 
 required=python
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac <<'EOF'
 AM_PATH_PYTHON
diff --git a/t/python11.sh b/t/python11.sh
index a22826c..a648c7b 100755
--- a/t/python11.sh
+++ b/t/python11.sh
@@ -17,7 +17,7 @@
 # Test missing python.
 
 # Python is not required for this test.
-. ./defs || exit 1
+. test-init.sh
 
 # We don't want to allow user overrides in this test.
 PYTHON=; unset PYTHON
diff --git a/t/python12.sh b/t/python12.sh
index 12dca5d..1939833 100755
--- a/t/python12.sh
+++ b/t/python12.sh
@@ -17,7 +17,7 @@
 # Ensure DESTDIR is not included in byte-compiled files.
 
 required=python
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac <<'EOF'
 AM_PATH_PYTHON
diff --git a/t/python2.sh b/t/python2.sh
index 71ba25f..0ecf79d 100755
--- a/t/python2.sh
+++ b/t/python2.sh
@@ -16,7 +16,7 @@
 
 # Make sure that Automake suggests using AM_PATH_PYTHON.
 
-. ./defs || exit 1
+. test-init.sh
 
 $ACLOCAL
 
diff --git a/t/python3.sh b/t/python3.sh
index 934be21..e57868b 100755
--- a/t/python3.sh
+++ b/t/python3.sh
@@ -17,7 +17,7 @@
 # Make sure we install built python files.
 
 required=python
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac <<EOF
 AM_PATH_PYTHON
diff --git a/t/recurs-user-deeply-nested.sh b/t/recurs-user-deeply-nested.sh
new file mode 100755
index 0000000..27a51ad
--- /dev/null
+++ b/t/recurs-user-deeply-nested.sh
@@ -0,0 +1,97 @@
+#! /bin/sh
+# Copyright (C) 2012 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 recursion on user-defined targets can be made to work
+# with "deeply" nested uses of $(SUBDIRS).
+
+. test-init.sh
+
+cat >> configure.ac <<'END'
+AC_CONFIG_FILES([
+    sub1/Makefile
+    sub1/sub2/Makefile
+    sub1/sub2/sub3/Makefile
+    sub1/sub2/sub3/sub4/Makefile
+])
+AM_EXTRA_RECURSIVE_TARGETS([foo])
+AC_OUTPUT
+END
+
+dirs='sub1 sub1/sub2 sub1/sub2/sub3 sub1/sub2/sub3/sub4'
+
+mkdir $dirs
+
+cat > Makefile.am <<'END'
+SUBDIRS = sub1
+
+foo-local:
+       cp sub1/foo foo
+MOSTLYCLEANFILES = foo
+
+.PHONY: test
+test:
+       echo 'It works!' > exp
+       diff exp foo
+       diff exp sub1/foo
+       test ! -f sub1/sub2/foo
+       test ! -f sub1/sub2/sub3/foo
+       diff exp sub1/sub2/sub3/sub4/foo
+       rm -f exp
+
+all-local: foo
+check-local: test
+END
+
+cat > sub1/Makefile.am <<'END'
+SUBDIRS = sub2
+foo-local:
+       test ! -f sub2/sub3/foo
+       cp sub2/sub3/sub4/foo foo
+MOSTLYCLEANFILES = foo
+END
+
+# Here we deliberately lack an explicit definition the 'foo-local'
+# target; that shouldn't stop 'foo' recursion into subdirectory
+# 'sub3/sub4'.
+echo SUBDIRS = sub3 > sub1/sub2/Makefile.am
+echo SUBDIRS = sub4 > sub1/sub2/sub3/Makefile.am
+
+cat > sub1/sub2/sub3/sub4/Makefile.am <<'END'
+foo-local:
+       echo 'It works!' > foo
+MOSTLYCLEANFILES = foo
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+for d in $dirs; do
+  $FGREP foo-am $d/Makefile.in || exit 1
+  case $d in
+    */sub4);;
+    *) $FGREP foo-recursive $d/Makefile.in || exit 1;;
+  esac
+done
+
+./configure
+
+$MAKE foo
+$MAKE test
+
+$MAKE distcheck
+
+:
diff --git a/t/recurs-user-indir.sh b/t/recurs-user-indir.sh
new file mode 100755
index 0000000..5e85d34
--- /dev/null
+++ b/t/recurs-user-indir.sh
@@ -0,0 +1,99 @@
+#! /bin/sh
+# Copyright (C) 2012 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 user recursion works with various types of indirections
+# *involved in the definition of the '*-local' targets*: make macros,
+# AC_SUBST'd strings, automake-time file inclusions, automake
+# conditionals...
+
+. test-init.sh
+
+cat >> configure.ac <<'END'
+AC_CONFIG_FILES([
+    sub1/Makefile
+    sub1/subsub/Makefile
+    sub2/Makefile
+    sub2/subsub/Makefile
+])
+AM_EXTRA_RECURSIVE_TARGETS([foo])
+AC_SUBST([FOO_LOCAL], [foo-local])
+AM_CONDITIONAL([COND], [:])
+AC_OUTPUT
+END
+
+mkdir sub1 sub1/subsub sub2 sub2/subsub
+
+cat > Makefile.am <<'END'
+SUBDIRS = sub1 sub2
+AM_FOO_LOCAL = foo-local
+
+$(AM_FOO_LOCAL):
+       pwd && : > foo
+CLEANFILES = foo
+
+all-local: foo
+check-local:
+       test -f foo
+       test -f sub1/foo
+       test -f sub1/subsub/foo
+       test -f sub2/foo
+       test -f sub2/subsub/foo
+       test ! -r sub2/subsub/bar
+END
+
+cat > sub1/Makefile.am <<'END'
+SUBDIRS = subsub
address@hidden@:
+       pwd && : > foo
+CLEANFILES = foo
+END
+
+cat > sub1/subsub/Makefile.am <<'END'
+$(FOO_LOCAL):
+       pwd && : > foo
+CLEANFILES = foo
+END
+
+cat > sub2/Makefile.am <<'END'
+include $(srcdir)/bar.am
+include $(srcdir)/baz.am
+CLEANFILES = foo
+END
+
+echo 'SUBDIRS = subsub' > sub2/bar.am
+echo 'foo-local: ; pwd && : > foo' > sub2/baz.am
+
+cat > sub2/subsub/Makefile.am <<'END'
+if COND
+foo-local:
+       pwd && : > foo
+CLEANFILES = foo
+else !COND
+foo-local:
+       pwd && : > bar
+endif !COND
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+./configure
+
+$MAKE check
+$MAKE distcheck
+
+:
diff --git a/t/recurs-user-keep-going.sh b/t/recurs-user-keep-going.sh
new file mode 100755
index 0000000..041e304
--- /dev/null
+++ b/t/recurs-user-keep-going.sh
@@ -0,0 +1,95 @@
+#! /bin/sh
+# Copyright (C) 2012 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 user recursion works with "make -k".
+
+. test-init.sh
+
+cat >> configure.ac <<'END'
+AM_EXTRA_RECURSIVE_TARGETS([foo])
+AC_CONFIG_FILES([
+    sub1/Makefile
+    sub1/subsub1/Makefile
+    sub2/Makefile
+    sub2/subsub2/Makefile
+    sub3/Makefile
+])
+FAIL='@echo "FAIL $@ in `pwd`"; exit 1'
+PASS='@echo "PASS $@ in `pwd`"; : > foo'
+AC_SUBST([FAIL])
+AC_SUBST([PASS])
+AC_OUTPUT
+END
+
+mkdir sub1 sub1/subsub1 sub2 sub2/subsub2 sub3
+
+cat > Makefile.am <<'END'
+SUBDIRS = sub1 . sub2 sub3
+foo-local:; @FAIL@
+END
+
+cat > sub1/Makefile.am <<'END'
+SUBDIRS = subsub1
+foo-local:; @PASS@
+END
+
+cat > sub2/Makefile.am <<'END'
+SUBDIRS = subsub2
+foo-local:; @FAIL@
+END
+
+echo 'foo-local:; @FAIL@' > sub1/subsub1/Makefile.am
+echo 'foo-local:; @PASS@' > sub2/subsub2/Makefile.am
+echo 'foo-local:; @PASS@' > sub3/Makefile.am
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+./configure
+
+cat > exp <<END
+./sub1/foo
+./sub2/subsub2/foo
+./sub3/foo
+END
+
+as_expected ()
+{
+  find . -name foo > t || { cat t; exit 1; }
+  LC_ALL=C sort t > got
+  cat exp
+  cat got
+  diff exp got
+}
+
+# Without "-k", we fail in 'sub1/subsub1', and do nothing else.
+# So, no 'foo' file gets created.
+$MAKE foo && exit 1
+find . -name foo | grep . && exit 1
+
+if using_gmake; then
+  $MAKE -k foo && exit 1
+  as_expected
+  $MAKE --keep-going foo && exit 1
+  as_expected
+else
+  # Don't trust the exit status of 'make -k' for non-GNU makes.
+  $MAKE -k foo || :
+  as_expected
+fi
+
+:
diff --git a/t/recurs-user-many.sh b/t/recurs-user-many.sh
new file mode 100755
index 0000000..b40dd79
--- /dev/null
+++ b/t/recurs-user-many.sh
@@ -0,0 +1,73 @@
+#! /bin/sh
+# Copyright (C) 2012 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 many user-defined recursive targets can be supported
+# at once, and that calls to 'AM_EXTRA_RECURSIVE_TARGETS' are
+# cumulative.
+
+. test-init.sh
+
+cat >> configure.ac <<'END'
+AC_CONFIG_FILES([sub/Makefile])
+## NOTE: extra white spaces, tabs, newlines and backslashes in the
+## lines below: on purpose.
+AM_EXTRA_RECURSIVE_TARGETS([ foo  \
+       bar  ])
+AC_SUBST([CLEANFILES], ['foo bar baz'])
+AC_OUTPUT
+# Yes, this appears after AC_OUTPUT.  So what?
+AM_EXTRA_RECURSIVE_TARGETS([baz])
+END
+
+mkdir sub
+
+cat > Makefile.am <<'END'
+SUBDIRS = sub
+foo-local:
+       : > foo
+bar-local:
+       echo x > bar
+baz-local: ; touch baz
+check-local: foo bar baz
+       ls -l . sub ;: For debugging.
+       test -f foo
+       test -f bar
+       test -f baz
+       test -f sub/foo
+       test -f sub/bar
+       test -f sub/baz
+END
+
+cat > sub/Makefile.am <<'END'
+foo-local bar-local baz-local:
+       touch `echo $@ | sed 's/-local$$//'`
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+for t in foo bar baz; do
+  $FGREP "$t-am" Makefile.in
+  $FGREP "$t-am" sub/Makefile.in
+done
+
+./configure
+
+$MAKE check
+$MAKE distcheck
+
+:
diff --git a/t/recurs-user-no-subdirs.sh b/t/recurs-user-no-subdirs.sh
new file mode 100755
index 0000000..76da433
--- /dev/null
+++ b/t/recurs-user-no-subdirs.sh
@@ -0,0 +1,52 @@
+#! /bin/sh
+# Copyright (C) 2012 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 user recursion can be made to work even when $(SUBDIRS)
+# is empty or undefined.
+
+. test-init.sh
+
+cat >> configure.ac <<'END'
+AM_EXTRA_RECURSIVE_TARGETS([foo])
+AC_OUTPUT
+END
+
+$ACLOCAL
+$AUTOCONF
+
+# First try with undefined $(SUBDIRS).
+cat > Makefile.am <<'END'
+all-local: foo
+foo-local:
+       : > bar
+MOSTLYCLEANFILES = bar
+END
+$AUTOMAKE
+./configure
+$MAKE foo
+test -f bar
+
+$MAKE distclean
+test ! -r bar # Sanity check.
+
+# Now try with empty but defined $(SUBDIRS).
+echo SUBDIRS = >> Makefile.am
+$AUTOMAKE
+./configure
+$MAKE foo
+test -f bar
+
+:
diff --git a/t/recurs-user-no-top-level.sh b/t/recurs-user-no-top-level.sh
new file mode 100755
index 0000000..1546f1c
--- /dev/null
+++ b/t/recurs-user-no-top-level.sh
@@ -0,0 +1,50 @@
+#! /bin/sh
+# Copyright (C) 2012 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 user recursion works even for targets that don't exist
+# in the top-level Makefile.
+
+. test-init.sh
+
+cat >> configure.ac <<'END'
+AC_CONFIG_FILES([sub/Makefile])
+AM_EXTRA_RECURSIVE_TARGETS([foo-bar])
+AC_OUTPUT
+END
+
+mkdir sub
+
+cat > Makefile.am <<'END'
+SUBDIRS = sub
+all-local: foo-bar
+END
+
+cat > sub/Makefile.am <<'END'
+foo-bar-local:
+       : > foo-bar
+MOSTLYCLEANFILES = foo-bar
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+./configure
+
+$MAKE foo-bar
+test -f sub/foo-bar
+
+:
diff --git a/t/recurs-user-override.sh b/t/recurs-user-override.sh
new file mode 100755
index 0000000..02dd333
--- /dev/null
+++ b/t/recurs-user-override.sh
@@ -0,0 +1,68 @@
+#! /bin/sh
+# Copyright (C) 2012 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 override of user-defined recursive targets work as
+# expected.
+
+. test-init.sh
+
+cat >> configure.ac <<'END'
+AC_CONFIG_FILES([sub/Makefile])
+AM_EXTRA_RECURSIVE_TARGETS([foobar zardoz])
+AC_OUTPUT
+END
+
+cat > Makefile.am <<'END'
+SUBDIRS = sub
+all-local: foobar zardoz
+foobar:
+       : > foobar.out
+MOSTLYCLEANFILES = foobar.out
+check-local:
+       test -f foobar.out
+       test ! -r sub/foobar.out
+       test -f sub/zardoz.out
+       test ! -r sub/baz.out
+END
+
+mkdir sub
+cat > sub/Makefile.am <<'END'
+foobar foobar-local:
+       : > foobar.out
+zardoz-local:
+       : > baz.out
+zardoz:
+       : > zardoz.out
+MOSTLYCLEANFILES = zardoz.out
+END
+
+$ACLOCAL
+$AUTOCONF
+
+AUTOMAKE_fails
+grep '^Makefile\.am:3:.*user target.*foobar' stderr
+grep '^Makefile\.am:.*foobar-local.*instead of foobar$' stderr
+grep '^sub/Makefile\.am:5:.*user target.*zardoz' stderr
+grep '^sub/Makefile\.am:.*zardoz-local.*instead of zardoz$' stderr
+
+$AUTOMAKE -Wno-override
+
+./configure
+
+$MAKE check
+$MAKE distcheck
+
+:
diff --git a/t/recurs-user-phony.sh b/t/recurs-user-phony.sh
new file mode 100755
index 0000000..274f441
--- /dev/null
+++ b/t/recurs-user-phony.sh
@@ -0,0 +1,64 @@
+#! /bin/sh
+# Copyright (C) 2012 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 user-defined recursive targets and their associate
+# '-local', '-am' and '-recursive' targets are declared as phony.
+
+# Require GNU make, because some vendo makes (e.g., Solaris) doesn't
+# truly respect .PHONY.
+required=GNUmake
+. test-init.sh
+
+cat >> configure.ac <<'END'
+AC_CONFIG_FILES([sub/Makefile])
+AM_EXTRA_RECURSIVE_TARGETS([foo])
+AC_OUTPUT
+END
+
+cat > Makefile.am <<'END'
+SUBDIRS = sub
+foo-local:
+       echo 'GOOD!' > foo
+END
+
+mkdir sub
+cat > sub/Makefile.am <<'END'
+foo-local:
+       echo 'GOOD!' > foo
+END
+
+dummy_files='
+  foo
+  foo-local
+  foo-am
+  foo-recursive
+  sub/foo
+  sub/foo-local
+  sub/foo-am
+'
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+./configure
+
+touch $dummy_files
+
+$MAKE foo
+grep 'GOOD!' foo
+grep 'GOOD!' sub/foo
+
+:
diff --git a/t/recurs-user-wrap.sh b/t/recurs-user-wrap.sh
new file mode 100755
index 0000000..15a210c
--- /dev/null
+++ b/t/recurs-user-wrap.sh
@@ -0,0 +1,59 @@
+#! /bin/sh
+# Copyright (C) 2012 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 rules generated by user recursion are apt to be wrapped
+# by other makefiles.
+
+required=GNUmake
+. test-init.sh
+
+cat >> configure.ac << 'END'
+AM_EXTRA_RECURSIVE_TARGETS([extra])
+AC_CONFIG_FILES([src/Makefile])
+AC_OUTPUT
+END
+
+mkdir src
+echo SUBDIRS = src > Makefile.am
+echo 'bar: ; : > $@ ' > src/Makefile.am
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+./configure
+
+$MAKE extra
+test ! -f extra-local
+test ! -f src/bar
+
+cat > GNUmakefile << 'END'
+.DEFAULT_GOAL = all
+extra-local:
+       : > $@
+include ./Makefile
+END
+
+cat > src/GNUmakefile << 'END'
+include ./Makefile
+extra-local: bar
+END
+
+$MAKE extra
+test -f extra-local
+test -f src/bar
+
+:
diff --git a/t/recurs-user.sh b/t/recurs-user.sh
new file mode 100755
index 0000000..198483f
--- /dev/null
+++ b/t/recurs-user.sh
@@ -0,0 +1,81 @@
+#! /bin/sh
+# Copyright (C) 2012 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 checks on user-defined recursive rules.
+# Check that user recursion respect $(SUBDIRS) order,
+# and proceeds in a depth-first fashion.
+
+. test-init.sh
+
+cat >> configure.ac <<'END'
+AM_EXTRA_RECURSIVE_TARGETS([foo])
+AC_CONFIG_FILES([
+    sub1/Makefile
+    sub2/Makefile
+    sub3/Makefile
+    sub3/deeper/Makefile
+])
+AC_OUTPUT
+END
+
+mkdir sub1 sub2 sub3 sub3/deeper
+
+cat > Makefile.am <<'END'
+SUBDIRS = sub1 . sub3 sub2
+foo-local:
+       echo '.' >> $(top_builddir)/got
+.PHONY: test
+test: foo
+       cat $(srcdir)/exp
+       cat ./got
+       diff $(srcdir)/exp ./got
+check-local: test
+MOSTLYCLEANFILES = got
+EXTRA_DIST = exp
+END
+
+for i in 1 2 3; do
+  cat > sub$i/Makefile.am <<END
+foo-local:
+       echo 'sub$i' >> \$(top_builddir)/got
+END
+done
+
+echo SUBDIRS = deeper >> sub3/Makefile.am
+
+cat >> sub3/deeper/Makefile.am <<'END'
+foo-local:
+       echo sub3/deeper >> $(top_builddir)/got
+END
+
+cat >> exp <<'END'
+sub1
+.
+sub3/deeper
+sub3
+sub2
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+./configure
+
+$MAKE test
+$MAKE distcheck
+
+:
diff --git a/t/recurs-user2.sh b/t/recurs-user2.sh
new file mode 100755
index 0000000..4664efd
--- /dev/null
+++ b/t/recurs-user2.sh
@@ -0,0 +1,103 @@
+#! /bin/sh
+# Copyright (C) 2012 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 user recursion can be made to work when $(SUBDIRS) are
+# not "strictly" nested, as in e.g.:
+#    SUBDIRS = src external/lib external/tests
+# with no Makefile in 'external'.
+
+. test-init.sh
+
+cat >> configure.ac <<'END'
+AC_CONFIG_FILES(
+    sub1/Makefile
+    sub2/Makefile
+dnl There's deliberately no 'sub3/Makefile'.
+    sub3/subsub/Makefile
+    sub4/Makefile
+    sub4/subsub/Makefile
+)
+AM_EXTRA_RECURSIVE_TARGETS([foo])
+AC_OUTPUT
+END
+
+mkdir sub1 sub2 sub3 sub4 sub3/subsub sub4/subsub
+
+cat > Makefile.am <<'END'
+SUBDIRS = sub1 sub2 sub3/subsub sub4 sub4/subsub
+
+foo-local:
+       echo _rootdir_ >foo
+MOSTLYCLEANFILES = foo
+
+.PHONY: test
+test: foo
+       grep _rootdir_ foo
+       grep ':sub1:' sub1/foo
+       grep ',sub1,' sub1/bar
+       test ! -r sub2/foo
+       test ! -r sub3/foo
+       grep '%sub3/subsub%' sub3/subsub/quux
+       test ! -r sub3/subsub/foo
+       test ! -r sub4/foo
+       grep '=sub4/subsub=' sub4/subsub/foo
+
+check-local: test
+END
+
+# A 'foo-local' target with dependencies shouldn't cause problems.
+cat > sub1/Makefile.am <<'END'
+foo-local: bar
+       sed 's/,/:/g' bar >foo
+bar:
+       echo ',sub1,' >$@
+MOSTLYCLEANFILES = foo bar
+END
+
+# The lack of a 'foo' target here shouldn't cause any error in
+# automake nor in make.
+: > sub2/Makefile.am
+
+# The lack of file 'sub3/Makefile.am' shouldn't cause any problem either.
+rm -f sub3/Makefile.am
+
+# A 'foo-local' creating a file != 'foo' shouldn't cause any problem.
+cat > sub3/subsub/Makefile.am <<'END'
+foo-local:
+       echo '%sub3/subsub%' >quux
+MOSTLYCLEANFILES = quux
+END
+
+# No 'foo-local' nor 'foo' target here ...
+: > sub4/Makefile.am
+# ... should not cause errors, nor cause the 'foo-local' target
+# here not to be executed.
+cat > sub4/subsub/Makefile.am <<'END'
+foo-local:
+       echo '=sub4/subsub=' >foo
+MOSTLYCLEANFILES = foo
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+./configure
+
+$MAKE test
+$MAKE distcheck
+
+:
diff --git a/t/recurs.sh b/t/recurs.sh
deleted file mode 100755
index 0dc04d3..0000000
--- a/t/recurs.sh
+++ /dev/null
@@ -1,36 +0,0 @@
-#! /bin/sh
-# Copyright (C) 1998-2012 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 recursive variable definitions die.
-
-. ./defs || exit 1
-
-cat >> configure.ac << 'END'
-AC_PROG_CC
-AM_CONDITIONAL(ONE, true)
-AM_CONDITIONAL(TWO, false)
-END
-
-cat > Makefile.am << 'END'
-bin_PROGRAMS = $(foo)
-foo = $(bin_PROGRAMS)
-END
-
-$ACLOCAL
-AUTOMAKE_fails
-grep 'Makefile\.am:.*bin_PROGRAMS.*recursively defined' stderr
-
-:
diff --git a/t/recurs2.sh b/t/recurs2.sh
deleted file mode 100755
index 9472631..0000000
--- a/t/recurs2.sh
+++ /dev/null
@@ -1,29 +0,0 @@
-#! /bin/sh
-# Copyright (C) 1998-2012 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 recursive variable definitions die.
-# From Jim Meyering.
-
-. ./defs || exit 1
-
-cat > Makefile.am << 'END'
-man_MANS = chgrp.1
-man_aux = $(man_MANS:.1=.x)
-EXTRA_DIST = $(man_aux) $(man_MANS)
-END
-
-$ACLOCAL
-$AUTOMAKE
diff --git a/t/relativize.tap b/t/relativize.tap
index d940ddf..6d469344 100755
--- a/t/relativize.tap
+++ b/t/relativize.tap
@@ -17,7 +17,7 @@
 # Test Automake-provided internal make macro $(am__relativize).
 
 am_create_testdir=empty
-. ./defs || exit 1
+. test-init.sh
 
 plan_ later
 
diff --git a/t/remake-aclocal-version-mismatch.sh 
b/t/remake-aclocal-version-mismatch.sh
new file mode 100755
index 0000000..b844fc1
--- /dev/null
+++ b/t/remake-aclocal-version-mismatch.sh
@@ -0,0 +1,47 @@
+#! /bin/sh
+# Copyright (C) 2006-2012 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/>.
+
+# See how well the rebuild rule handles an aclocal.m4 that was
+# generated for another version of autoconf.
+
+. test-init.sh
+
+echo AC_OUTPUT >>configure.ac
+
+touch Makefile.am
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+./configure
+$MAKE
+
+sed '1,20 s/m4_defn(\[AC_AUTOCONF_VERSION\]),/9999,/' < aclocal.m4 > 
aclocal.tmp
+cmp aclocal.m4 aclocal.tmp && exit 1
+
+mv aclocal.tmp aclocal.m4
+
+$MAKE 2>stderr || { cat cat stderr >&2; exit 1; }
+cat stderr >&2
+grep 'You have another version of autoconf' stderr
+grep 'aclocal.m4:.*this file was generated for' stderr
+
+$MAKE 2>stderr || { cat cat stderr >&2; exit 1; }
+cat stderr >&2
+grep 'You have another version of autoconf' stderr && exit 1
+grep 'aclocal.m4:.*this file was generated for' stderr && exit 1
+
+:
diff --git a/t/remake-after-acinclude-m4.sh b/t/remake-after-acinclude-m4.sh
index 7c899dc..39596f6 100755
--- a/t/remake-after-acinclude-m4.sh
+++ b/t/remake-after-acinclude-m4.sh
@@ -17,7 +17,7 @@
 # Test remake rules when acinclude.m4 or its prerequisites change.
 # Keep in sync with the other sister tests 'remake-after-*.sh'.
 
-. ./defs || exit 1
+. test-init.sh
 
 magic1=::MagicStringOne::
 magic2=__MagicStringTwo__
diff --git a/t/remake-after-aclocal-m4.sh b/t/remake-after-aclocal-m4.sh
index 45d7a6a..f7ba219 100755
--- a/t/remake-after-aclocal-m4.sh
+++ b/t/remake-after-aclocal-m4.sh
@@ -17,7 +17,7 @@
 # Test remake rules when aclocal.m4 or its prerequisites change.
 # Keep in sync with the other sister tests 'remake-after-*.sh'.
 
-. ./defs || exit 1
+. test-init.sh
 
 magic1=::MagicStringOne::
 magic2=__MagicStringTwo__
diff --git a/t/remake-after-configure-ac.sh b/t/remake-after-configure-ac.sh
index ee178b1..0ff7454 100755
--- a/t/remake-after-configure-ac.sh
+++ b/t/remake-after-configure-ac.sh
@@ -17,7 +17,7 @@
 # Test remake rules when configure.ac or its prerequisites change.
 # Keep in sync with the other sister tests 'remake-after-*.sh'.
 
-. ./defs || exit 1
+. test-init.sh
 
 magic1=::MagicStringOne::
 magic2=__MagicStringTwo__
diff --git a/t/remake-after-makefile-am.sh b/t/remake-after-makefile-am.sh
index fca90b6..2161790 100755
--- a/t/remake-after-makefile-am.sh
+++ b/t/remake-after-makefile-am.sh
@@ -17,7 +17,7 @@
 # Test remake rules when Makefile.am or its prerequisites change.
 # Keep in sync with the other sister tests 'remake-after-*.sh'.
 
-. ./defs || exit 1
+. test-init.sh
 
 if using_gmake; then
   remake_() { $MAKE nil; }
diff --git a/t/remake-all-1.sh b/t/remake-all-1.sh
index 93a870e..29cefd4 100755
--- a/t/remake-all-1.sh
+++ b/t/remake-all-1.sh
@@ -17,7 +17,7 @@
 # Check that the "all" target triggers rebuilt of outdated Makefiles.
 # See also sister test 'remake-all-2.sh'.
 
-. ./defs || exit 1
+. test-init.sh
 
 mkfile=Makefile
 
diff --git a/t/remake-all-2.sh b/t/remake-all-2.sh
index 0f7d984..debdbb4 100755
--- a/t/remake-all-2.sh
+++ b/t/remake-all-2.sh
@@ -18,7 +18,7 @@
 # This handle the case in which the makefiles are not called 'Makefile'.
 # See also sister test 'remake-all-1.sh'.
 
-. ./defs || exit 1
+. test-init.sh
 
 mkfile=foobar
 
diff --git a/t/remake-am-pr10111.sh b/t/remake-am-pr10111.sh
index b3b7c6c..787e71b 100755
--- a/t/remake-am-pr10111.sh
+++ b/t/remake-am-pr10111.sh
@@ -22,7 +22,7 @@
 # big deal in practice (in fact, this test *currently fails*).  Still,
 # keeping the limitation exposed is a good idea anyway.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac <<'END'
 AC_OUTPUT
diff --git a/t/remake-deeply-nested.sh b/t/remake-deeply-nested.sh
index 8f29499..4949b52 100755
--- a/t/remake-deeply-nested.sh
+++ b/t/remake-deeply-nested.sh
@@ -19,7 +19,7 @@
 # rules don't break in obvious ways in a slightly "heavier than usual"
 # setup.
 
-. ./defs || exit 1
+. test-init.sh
 
 ocwd=$(pwd) || fatal_ "getting current working directory"
 
diff --git a/t/remake-deleted-am-2.sh b/t/remake-deleted-am-2.sh
index 0b55062..dde1615 100755
--- a/t/remake-deleted-am-2.sh
+++ b/t/remake-deleted-am-2.sh
@@ -18,7 +18,7 @@
 # of the "deleted header problem".  This test checks deeper inclusion
 # stacks, and use VPATH builds.
 
-. ./defs || exit 1
+. test-init.sh
 
 echo AC_OUTPUT >> configure.ac
 
diff --git a/t/remake-deleted-am-subdir.sh b/t/remake-deleted-am-subdir.sh
index 868d36e..f784593 100755
--- a/t/remake-deleted-am-subdir.sh
+++ b/t/remake-deleted-am-subdir.sh
@@ -18,7 +18,7 @@
 # of the "deleted header problem".  This test does the check when the
 # SUBDIRS variable is involved.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac <<'END'
 AC_CONFIG_FILES([sub1/Makefile sub2/Makefile])
diff --git a/t/remake-deleted-am.sh b/t/remake-deleted-am.sh
index f754a37..485f37f 100755
--- a/t/remake-deleted-am.sh
+++ b/t/remake-deleted-am.sh
@@ -17,7 +17,7 @@
 # Check that inclusion of '.am' fragments by automake does not suffer
 # of the "deleted header problem".  Basic checks are done here.
 
-. ./defs || exit 1
+. test-init.sh
 
 echo AC_OUTPUT >> configure.ac
 
diff --git a/t/remake-deleted-m4-file.sh b/t/remake-deleted-m4-file.sh
index 0bb7cae..2499d82 100755
--- a/t/remake-deleted-m4-file.sh
+++ b/t/remake-deleted-m4-file.sh
@@ -20,7 +20,7 @@
 # header file" issue w.r.t. aclocal.m4 dependencies.  See also related
 # test 'acloca22.sh'.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac <<'END'
 FOO_MACRO
diff --git a/t/remake-fail.sh b/t/remake-fail.sh
index 9ccf5d1..99a5b00 100755
--- a/t/remake-fail.sh
+++ b/t/remake-fail.sh
@@ -16,7 +16,7 @@
 
 # Make sure remaking rules fail when they should.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_CONFIG_FILES([sub/Makefile])
diff --git a/t/remake-gnulib-add-acsubst.sh b/t/remake-gnulib-add-acsubst.sh
index 2fdab58..3aea5b9 100755
--- a/t/remake-gnulib-add-acsubst.sh
+++ b/t/remake-gnulib-add-acsubst.sh
@@ -22,7 +22,7 @@
 # for more info).
 
 required=cc
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac <<'END'
 AC_PROG_CC
diff --git a/t/remake-gnulib-add-header.sh b/t/remake-gnulib-add-header.sh
index 127fa1f..c70b3c6 100755
--- a/t/remake-gnulib-add-header.sh
+++ b/t/remake-gnulib-add-header.sh
@@ -22,7 +22,7 @@
 # for more info).
 
 required=cc
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac <<'END'
 AC_CONFIG_HEADERS([config.h])
diff --git a/t/remake-gnulib-remove-header.sh b/t/remake-gnulib-remove-header.sh
index 9044a04..23fbfc8 100755
--- a/t/remake-gnulib-remove-header.sh
+++ b/t/remake-gnulib-remove-header.sh
@@ -23,7 +23,7 @@
 # for more info).
 
 required=cc
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac <<'END'
 AC_CONFIG_HEADERS([config.h])
diff --git a/t/remake-include-aclocal.sh b/t/remake-include-aclocal.sh
index df1870e..7567dfb 100755
--- a/t/remake-include-aclocal.sh
+++ b/t/remake-include-aclocal.sh
@@ -19,7 +19,7 @@
 #   - remake-include-configure.sh
 #   - remake-include-makefile.sh
 
-. ./defs || exit 1
+. test-init.sh
 
 magic1=::MagicStringOne::
 magic2=__MagicStringTwo__
@@ -32,13 +32,13 @@ else
 fi
 
 cat >> configure.ac <<END
+AC_CONFIG_MACRO_DIR([m4])
 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.
@@ -51,7 +51,7 @@ END
 mkdir m4
 echo 'AC_DEFUN([my_fingerprint], [BadBadBad])' > m4/foo.m4
 
-$ACLOCAL -I m4
+$ACLOCAL
 $AUTOCONF
 $AUTOMAKE
 
diff --git a/t/remake-include-configure.sh b/t/remake-include-configure.sh
index f7f8c04..5e0a426 100755
--- a/t/remake-include-configure.sh
+++ b/t/remake-include-configure.sh
@@ -19,7 +19,7 @@
 #   - remake-include-aclocal.sh
 #   - remake-include-makefile.sh
 
-. ./defs || exit 1
+. test-init.sh
 
 magic1=::MagicStringOne::
 magic2=__MagicStringTwo__
diff --git a/t/remake-include-makefile.sh b/t/remake-include-makefile.sh
index ed749cc..0dcee58 100755
--- a/t/remake-include-makefile.sh
+++ b/t/remake-include-makefile.sh
@@ -20,7 +20,7 @@
 #   - remake-include-configure.sh
 
 
-. ./defs || exit 1
+. test-init.sh
 
 magic1=::MagicStringOne::
 magic2=__MagicStringTwo__
diff --git a/t/remake-m4-pr10111.sh b/t/remake-m4-pr10111.sh
index 8a28925..9df34b6 100755
--- a/t/remake-m4-pr10111.sh
+++ b/t/remake-m4-pr10111.sh
@@ -22,7 +22,7 @@
 # big deal in practice (in fact, this test *currently fails*).  Still,
 # keeping the limitation exposed is a good idea anyway.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac <<'END'
 m4_include([foobar.m4])
diff --git a/t/remake-macrodir.sh b/t/remake-macrodir.sh
new file mode 100755
index 0000000..bdd3f02
--- /dev/null
+++ b/t/remake-macrodir.sh
@@ -0,0 +1,83 @@
+#! /bin/sh
+# Copyright (C) 2012 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 aclocal honouring of AC_CONFIG_MACRO_DIR interacts
+# nicely with automatic rebuild rules.
+
+. test-init.sh
+
+cat >> configure.ac <<'END'
+AC_CONFIG_MACRO_DIR([macro-dir])
+my__FOO || AS_EXIT([1])
+AC_OUTPUT
+END
+
+: > Makefile.am
+
+mkdir macro-dir
+cat > macro-dir/foo.m4 <<'END'
+AC_DEFUN([my__FOO], [: > bar])
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+$FGREP my__FOO configure && exit 1
+
+./configure
+test -f bar
+rm -f bar
+
+$sleep
+
+cat > macro-dir/foo.m4 <<'END'
+AC_DEFUN([my__FOO], [: > baz])
+END
+
+$MAKE Makefile
+test -f baz
+test ! -r bar
+rm -f baz
+
+$sleep
+
+rm -f macro-dir/foo.m4
+cat > macro-dir/quux.m4 <<'END'
+AC_DEFUN([my__FOO], [: > quux])
+END
+
+$MAKE Makefile
+test -f quux
+test ! -r baz
+rm -f quux
+
+$sleep
+
+sed 's/^AC_CONFIG_MACRO_DIR/&([newdir])/' configure.ac > t
+mv -f t configure.ac
+
+mkdir newdir
+cat > newdir/mu.m4 <<'END'
+AC_DEFUN([my__FOO], [[: my__FOO do nothing]])
+END
+
+$MAKE Makefile
+$FGREP ': my__FOO do nothing' configure
+
+$MAKE distcheck
+
+:
diff --git a/t/remake-maintainer-mode.sh b/t/remake-maintainer-mode.sh
index b1e8dd8..326a3c9 100755
--- a/t/remake-maintainer-mode.sh
+++ b/t/remake-maintainer-mode.sh
@@ -18,7 +18,7 @@
 # but not all.
 # Report from Ralf Corsepius.
 
-. ./defs || exit 1
+. test-init.sh
 
 if using_gmake; then
   remake="$MAKE"
diff --git a/t/remake-makefile-intree.sh b/t/remake-makefile-intree.sh
index cb7c425..b9e33c3 100755
--- a/t/remake-makefile-intree.sh
+++ b/t/remake-makefile-intree.sh
@@ -21,7 +21,7 @@
 # Keep this in sync with sister test 'remake-makefile-vpath.sh', which
 # performs the same checks for a VPATH build.
 
-. ./defs || exit 1
+. test-init.sh
 
 mv -f configure.ac configure.stub
 
@@ -110,29 +110,29 @@ $MAKE distcheck
 
 rm -f quux
 
-# Modify Makefile.am to add a directory of extra m4 files
-# considered by aclocal.
+# Modify configure.ac and aclocal.m4 to add a directory of extra m4
+# files considered by aclocal.  Also update checks in Makefile.am.
+# Note that we won't use this new directory of extra m4 files in the
+# first rebuild below (but we will in the second).
 
 $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.ac and aclocal.m4.
 
 $sleep
 
 cat $srcdir/configure.stub - > $srcdir/configure.ac <<'END'
+AC_CONFIG_MACRO_DIR([m4])
 AC_CONFIG_FILES([quux])
 MY_CUSTOM_MACRO
 AC_OUTPUT
diff --git a/t/remake-makefile-vpath.sh b/t/remake-makefile-vpath.sh
index 7e37fe8..54c6af9 100755
--- a/t/remake-makefile-vpath.sh
+++ b/t/remake-makefile-vpath.sh
@@ -21,7 +21,7 @@
 # Keep this in sync with sister test 'remake-makefile-instree.sh', which
 # performs the same checks for a in-tree build.
 
-. ./defs || exit 1
+. test-init.sh
 
 mv -f configure.ac configure.stub
 
@@ -112,29 +112,29 @@ $MAKE distcheck
 
 rm -f quux
 
-# Modify Makefile.am to add a directory of extra m4 files
-# considered by aclocal.
+# Modify configure.ac and aclocal.m4 to add a directory of extra m4
+# files considered by aclocal.  Also update checks in Makefile.am.
+# Note that we won't use this new directory of extra m4 files in the
+# first rebuild below (but we will in the second).
 
 $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.ac and aclocal.m4.
 
 $sleep
 
 cat $srcdir/configure.stub - > $srcdir/configure.ac <<'END'
+AC_CONFIG_MACRO_DIR([m4])
 AC_CONFIG_FILES([quux])
 MY_CUSTOM_MACRO
 AC_OUTPUT
diff --git a/t/remake-mild-stress.sh b/t/remake-mild-stress.sh
index 02cef71..54f7cdf 100755
--- a/t/remake-mild-stress.sh
+++ b/t/remake-mild-stress.sh
@@ -17,7 +17,7 @@
 # Test basic remake rules for Makefiles with non-default names
 # and/or with multiple sources.
 
-. ./defs || exit 1
+. test-init.sh
 
 magic1=::MagicStringOne::
 magic2=__MagicStringTwo__
diff --git a/t/remake-moved-m4-file.sh b/t/remake-moved-m4-file.sh
index 68ea5a8..3ca1680 100755
--- a/t/remake-moved-m4-file.sh
+++ b/t/remake-moved-m4-file.sh
@@ -17,7 +17,7 @@
 # Test remake rules when m4 files get moved among different "include
 # dirs" (i.e. those passed to aclocal with '-I' option).
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac <<'END'
 MY_MACRO
diff --git a/t/remake-not-after-make-dist.sh b/t/remake-not-after-make-dist.sh
index 10fdf11..f06ede6 100755
--- a/t/remake-not-after-make-dist.sh
+++ b/t/remake-not-after-make-dist.sh
@@ -25,7 +25,7 @@
 #
 # Report from Akim Demaille.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac <<'EOF'
 # Rebuild rule are ok until make dist, but not afterwards.
diff --git a/t/remake-recurs-user.sh b/t/remake-recurs-user.sh
new file mode 100755
index 0000000..34f8651
--- /dev/null
+++ b/t/remake-recurs-user.sh
@@ -0,0 +1,89 @@
+#! /bin/sh
+# Copyright (C) 2012 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/>.
+
+# Remake rules and user-defined recursive rules.
+
+. test-init.sh
+
+cat >> configure.ac << 'END'
+m4_include([extra-targets.m4])
+AC_CONFIG_FILES([sub/Makefile])
+AC_OUTPUT
+END
+
+echo 'AM_EXTRA_RECURSIVE_TARGETS([foo])' > extra-targets.m4
+
+cat > Makefile.am << 'END'
+SUBDIRS = sub
+all-local: foo
+foo-local:
+       : > foo
+bar-local:
+       : > bar
+MOSTLYCLEANFILES = foo
+END
+
+mkdir sub
+cat > sub/Makefile.am << 'END'
+foo-local:
+       : > foo2
+MOSTLYCLEANFILES = foo2
+bar-local: later-target
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+./configure
+
+$MAKE
+test -f foo
+test -f sub/foo2
+test ! -f bar
+test ! -f sub/zardoz
+$MAKE distcheck
+
+$sleep
+
+echo 'AM_EXTRA_RECURSIVE_TARGETS([bar])' >> extra-targets.m4
+
+cat >> Makefile.am <<'END'
+MOSTLYCLEANFILES += bar oof
+all-local: bar
+foo-local: oof
+oof:
+       : > $@
+END
+
+echo 'include $(srcdir)/more.am' >> sub/Makefile.am
+
+cat > sub/more.am << 'END'
+later-target:
+       : > zardoz
+DISTCLEANFILES = zardoz
+END
+
+using_gmake || $MAKE Makefile
+$MAKE
+test -f foo
+test -f oof
+test -f sub/foo2
+test -f bar
+test -f sub/zardoz
+$MAKE distcheck
+
+:
diff --git a/t/remake-renamed-am.sh b/t/remake-renamed-am.sh
index 378aa26..200bef1 100755
--- a/t/remake-renamed-am.sh
+++ b/t/remake-renamed-am.sh
@@ -18,7 +18,7 @@
 # of the "deleted header problem".  This test checks that we can rename
 # an included .am file without confusing the remake rules.
 
-. ./defs || exit 1
+. test-init.sh
 
 echo AC_OUTPUT >> configure.ac
 
diff --git a/t/remake-renamed-m4-file.sh b/t/remake-renamed-m4-file.sh
index ee25c58..ff99f1d 100755
--- a/t/remake-renamed-m4-file.sh
+++ b/t/remake-renamed-m4-file.sh
@@ -16,7 +16,7 @@
 
 # Test remake rules when m4 files get renamed.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac <<'END'
 MY_MACRO
diff --git a/t/remake-renamed-m4-macro-and-file.sh 
b/t/remake-renamed-m4-macro-and-file.sh
index f440a45..9658737 100755
--- a/t/remake-renamed-m4-macro-and-file.sh
+++ b/t/remake-renamed-m4-macro-and-file.sh
@@ -18,7 +18,7 @@
 # an m4 macro in it gets renamed.  Kudos to Bruno Haible for thinking
 # about this situation.  See also related test 'acloca22.sh'.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac <<'END'
 MY_MACRO
diff --git a/t/remake-renamed-m4-macro.sh b/t/remake-renamed-m4-macro.sh
index 281dde2..99ab1db 100755
--- a/t/remake-renamed-m4-macro.sh
+++ b/t/remake-renamed-m4-macro.sh
@@ -17,7 +17,7 @@
 # Test remake rules when the name of an m4 macro change.  Try both with
 # and without indirection.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac <<'END'
 MY_MACRO
diff --git a/t/remake-subdir-from-subdir.sh b/t/remake-subdir-from-subdir.sh
index b6c0c61..0a2c5fa 100755
--- a/t/remake-subdir-from-subdir.sh
+++ b/t/remake-subdir-from-subdir.sh
@@ -19,7 +19,7 @@
 # See also the other similar tests 'remake-subdir*.sh', and the
 # related test 'aclocal5.sh'.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac <<'END'
 m4_include([subdirs.m4])
diff --git a/t/remake-subdir-gnu.sh b/t/remake-subdir-gnu.sh
index 9b2672b..a00ae57 100755
--- a/t/remake-subdir-gnu.sh
+++ b/t/remake-subdir-gnu.sh
@@ -21,7 +21,7 @@
 # related test 'aclocal5.sh'
 
 required=GNUmake
-. ./defs || exit 1
+. test-init.sh
 
 magic1='::MagicString::One::'
 magic2='__MagicString__Two__'
diff --git a/t/remake-subdir-grepping.sh b/t/remake-subdir-grepping.sh
index 0cce72e..6700472 100755
--- a/t/remake-subdir-grepping.sh
+++ b/t/remake-subdir-grepping.sh
@@ -18,7 +18,7 @@
 # are correctly generated.
 # See also sister functional test 'remake-subdir-only.sh'.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > configure.ac <<END
 AC_INIT([$me], [1.0])
diff --git a/t/remake-subdir-long-time.sh b/t/remake-subdir-long-time.sh
index 41cc40a..e9a6f57 100755
--- a/t/remake-subdir-long-time.sh
+++ b/t/remake-subdir-long-time.sh
@@ -21,7 +21,7 @@
 # an explicit delay in the build process.
 # Suggestion by Ralf Wildenhues.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > configure.ac <<END
 AC_INIT([$me], [1.0])
diff --git a/t/remake-subdir-no-makefile.sh b/t/remake-subdir-no-makefile.sh
index 5291ddd..56a1317 100755
--- a/t/remake-subdir-no-makefile.sh
+++ b/t/remake-subdir-no-makefile.sh
@@ -17,7 +17,7 @@
 # Ensure that remake rules work for files in a subdirectory even when
 # there is no Makefile for that subdirectory.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_CONFIG_FILES([sub/foo])
diff --git a/t/remake-subdir-only.sh b/t/remake-subdir-only.sh
index 12d1ca5..b1023dd 100755
--- a/t/remake-subdir-only.sh
+++ b/t/remake-subdir-only.sh
@@ -17,7 +17,7 @@
 # Make sure remaking rules in subdir are correctly generated.
 # See also sister "grepping" test 'remake-subdir-grepping.sh'.
 
-. ./defs || exit 1
+. test-init.sh
 
 fingerprint='=/FiNgErPrInT/='
 
diff --git a/t/remake-subdir.sh b/t/remake-subdir.sh
index 1e4716d..a8014cf 100755
--- a/t/remake-subdir.sh
+++ b/t/remake-subdir.sh
@@ -19,7 +19,7 @@
 # See also the other similar tests 'remake-subdir*.sh', and the
 # related test 'aclocal5.sh'.
 
-. ./defs || exit 1
+. test-init.sh
 
 if using_gmake; then
   remake=$MAKE
diff --git a/t/remake-subdir2.sh b/t/remake-subdir2.sh
index 42f0ba1..a875544 100755
--- a/t/remake-subdir2.sh
+++ b/t/remake-subdir2.sh
@@ -19,7 +19,7 @@
 # See also the other similar tests 'remake-subdir*.sh', and the
 # related test 'aclocal5.sh'.
 
-. ./defs || exit 1
+. test-init.sh
 
 magic1='::MagicString::One::'
 magic2='__MagicString__Two__'
diff --git a/t/remake-subdir3.sh b/t/remake-subdir3.sh
index b6c580c..9362a69 100755
--- a/t/remake-subdir3.sh
+++ b/t/remake-subdir3.sh
@@ -16,7 +16,7 @@
 
 # Make sure remaking rules work when subdir Makefile.in has been removed.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_CONFIG_FILES([sub/Makefile])
@@ -39,7 +39,7 @@ do_check ()
 {
   $MAKE >stdout || { cat stdout; exit 1; }
   cat stdout
-  test $(grep -c " --run " stdout) -eq 1
+  test $(grep -c "/missing " stdout) -eq 1
 }
 
 # Now, we are set up.  Ensure that, for either missing Makefile.in,
diff --git a/t/remake-timing-bug-pr8365.sh b/t/remake-timing-bug-pr8365.sh
index 3e7f1e6..db1c46c 100755
--- a/t/remake-timing-bug-pr8365.sh
+++ b/t/remake-timing-bug-pr8365.sh
@@ -22,7 +22,7 @@
 # make by hand.  Thus, fixing it would not be worth the hassle, but
 # we prefer to keep it exposed anyway.
 
-. ./defs || exit 1
+. test-init.sh
 
 # We'll use calls to stat to get debugging information.
 if stat /dev/null; then stat=stat; else stat=:; fi
diff --git a/t/repeated-options.sh b/t/repeated-options.sh
index c300996..83253d3 100755
--- a/t/repeated-options.sh
+++ b/t/repeated-options.sh
@@ -18,7 +18,7 @@
 # generate broken or incorrect makefiles.
 
 required='cc bzip2'
-. ./defs || exit 1
+. test-init.sh
 
 cat >configure.ac <<END
 AC_INIT([$me], [1.0])
diff --git a/t/req.sh b/t/req.sh
deleted file mode 100755
index cfeb44c..0000000
--- a/t/req.sh
+++ /dev/null
@@ -1,39 +0,0 @@
-#! /bin/sh
-# Copyright (C) 1996-2012 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 macro used in m4 file is included.
-
-. ./defs || exit 1
-
-cat > configure.ac <<EOF
-AC_INIT
-AM_INIT_GUILE_MODULE
-EOF
-
-cat > acinclude.m4 << 'END'
-AC_DEFUN([AM_INIT_GUILE_MODULE],[
-. $srcdir/../GUILE-VERSION
-AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
-AC_CONFIG_AUX_DIR(..)
-module=[$1]
-AC_SUBST(module)])
-END
-
-$ACLOCAL
-
-grep 'DEFUN.*INIT_AUTOMAKE' aclocal.m4
-
-:
diff --git a/t/reqd.sh b/t/reqd.sh
deleted file mode 100755
index 6006a9c..0000000
--- a/t/reqd.sh
+++ /dev/null
@@ -1,45 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2002-2012 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 Automake will install several copies of required files if needed.
-# Reported by Marius Vollmer.
-
-. ./defs || exit 1
-
-cat >> configure.ac <<EOF
-AC_CONFIG_FILES([one/Makefile two/Makefile])
-AC_OUTPUT
-EOF
-
-mkdir one
-mkdir two
-
-echo 'SUBDIRS = one two' > Makefile.am
-echo 'info_TEXINFOS = mumble.texi' > one/Makefile.am
-cat >one/mumble.texi <<'END'
address@hidden mumble.info
address@hidden version.texi
-END
-
-cp one/Makefile.am one/mumble.texi two
-
-$ACLOCAL
-$AUTOMAKE --add-missing --copy
-
-test -f one/mdate-sh
-test -f one/texinfo.tex
-test -f two/mdate-sh
-test -f two/texinfo.tex
diff --git a/t/reqd2.sh b/t/reqd2.sh
index 5734fd1..c6a3256 100755
--- a/t/reqd2.sh
+++ b/t/reqd2.sh
@@ -19,7 +19,7 @@
 # to fix the Makefiles.)
 
 required='libtoolize'
-. ./defs || exit 1
+. test-init.sh
 
 cat > configure.ac << 'END'
 AC_INIT([req2], [1.0])
diff --git a/t/rulepat.sh b/t/rulepat.sh
index a7cbb97..2d0e537 100755
--- a/t/rulepat.sh
+++ b/t/rulepat.sh
@@ -16,7 +16,7 @@
 
 # Test to make sure RULE_PATTERN catches strange targets.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am << 'END'
 $(srcdir)/Makefile.am:
diff --git a/t/sanity.sh b/t/sanity.sh
index 09b1272..1f20b11 100755
--- a/t/sanity.sh
+++ b/t/sanity.sh
@@ -16,7 +16,7 @@
 
 # Unsafe absolute directory names should be diagnosed.
 
-. ./defs || exit 1
+. test-init.sh
 
 mkdir 'unsafe$'
 cd 'unsafe$'
diff --git a/t/seenc.sh b/t/seenc.sh
index 9f0ae11..9a1ae2b 100755
--- a/t/seenc.sh
+++ b/t/seenc.sh
@@ -16,7 +16,7 @@
 
 # Test to make sure C-but-not-CC error works.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 dnl AC_PROG_CC and AC_PROG_CXX missing on purpose
diff --git a/t/self-check-configure-help.sh b/t/self-check-configure-help.sh
index cbe0aa5..2460025 100755
--- a/t/self-check-configure-help.sh
+++ b/t/self-check-configure-help.sh
@@ -17,7 +17,7 @@
 # Sanity check on the function used by the automake testsuite to
 # analyze output of "configure --help".
 
-. ./defs || exit 1
+. test-init.sh
 
 # FIXME: this test is a good candidate for a conversion to TAP.
 
diff --git a/t/self-check-dir.tap b/t/self-check-dir.tap
index 2bc2ce0..0dc893d 100755
--- a/t/self-check-dir.tap
+++ b/t/self-check-dir.tap
@@ -15,12 +15,12 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # Sanity check for the automake testsuite.
-# Check that tests using './defs' create a proper temporary directory,
-# and run in it.  Also check that we can prevent the pre-population
-# and the creation of such directory if we want.
+# Check that tests using 'test-init.sh' create a proper temporary
+# directory, and run in it.  Also check that we can prevent the
+# pre-population and the creation of such directory if we want.
 
 am_create_testdir=no
-. ./defs || exit 99
+. test-init.sh
 
 plan_ 5
 
@@ -37,7 +37,7 @@ do_check ()
   rm -rf _self.dir || framework_failure_ "cleaning up _self.dir"
   command_ok_ "$1 [$2]" $AM_TEST_RUNNER_SHELL -c "
     $2
-    . ./defs || exit 99
+   . test-init.sh
     # Don't fail if 'ls -l' fails; avoids possible racy spurious failures.
     pwd; ls -l || : # For debugging.
     $3
diff --git a/t/self-check-exit.tap b/t/self-check-exit.tap
index 19cf27a..14d9e8b 100755
--- a/t/self-check-exit.tap
+++ b/t/self-check-exit.tap
@@ -16,11 +16,11 @@
 
 # Sanity check for the automake testsuite.
 # Check that, in case of failing commands, the correct exit status is
-# passed to the exit trap installed by the './defs' script.
+# passed to the exit trap installed by the 'test-init.sh' script.
 # Also check that the 'errexit' shell flag is active.
 
 am_create_testdir=no
-. ./defs || exit 99
+. test-init.sh
 
 plan_ 32
 
@@ -30,14 +30,14 @@ plan_ 32
 set +e
 
 # It's especially important that the 'unset' is done before sourcing
-# ./defs, i.e., when 'set -e' is not active yet, for the benefit of shells
-# (like Bash 2.05 and Solaris 10 /bin/ksh) that returns a non-zero status
-# when unsetting an already-unset variable.
-# Add an extra newline at the end so that the aliases defined by 'defs'
-# can take effect.  Yes, this is truly required.
-init="stderr_fileno_=2; unset am_explicit_skips; . ./defs${nl}"
+# test-init.sh, i.e., when 'set -e' is not active yet, for the benefit
+# of shells (like Bash 2.05 and Solaris 10 /bin/ksh) that returns a
+# non-zero status when unsetting an already-unset variable.
+# Add an extra newline at the end so that the aliases defined by
+# test-init.sh can take effect.  Yes, this is truly required.
+init="stderr_fileno_=2; unset am_explicit_skips;. test-init.sh${nl}"
 
-# Required so that the code in defs doesn't go crazy trying to creating a
+# Required so that the code in test-init.sh doesn't go crazy trying to 
creating a
 # temporary directory in the absolute dir of $AM_TEST_RUNNER_SHELL.
 dummy_test_script=t/$me.sh
 
diff --git a/t/self-check-explicit-skips.sh b/t/self-check-explicit-skips.sh
index 97f5288..aa92504 100755
--- a/t/self-check-explicit-skips.sh
+++ b/t/self-check-explicit-skips.sh
@@ -19,7 +19,7 @@
 # an early exit due to some command exiting unexpectedly with status 77.
 
 am_create_testdir=no
-. ./defs || exit 1
+. test-init.sh
 
 set +e
 
@@ -31,7 +31,7 @@ run_dummy_test ()
 {
   env $2 $AM_TEST_RUNNER_SHELL -c "
     am_create_testdir=no
-    . ./defs
+   . test-init.sh
     $1
   " dummy.sh
 }
diff --git a/t/self-check-is-blocked-signal.tap 
b/t/self-check-is-blocked-signal.tap
index 9077ca8..cd23b29 100755
--- a/t/self-check-is-blocked-signal.tap
+++ b/t/self-check-is-blocked-signal.tap
@@ -18,7 +18,7 @@
 # shell function.
 
 am_create_testdir=no
-. ./defs || exit 99
+. test-init.sh
 
 plan_ 2
 
diff --git a/t/self-check-is_newest.tap b/t/self-check-is_newest.tap
index a5f84b3..a236798 100755
--- a/t/self-check-is_newest.tap
+++ b/t/self-check-is_newest.tap
@@ -16,7 +16,7 @@
 
 # Sanity check for the automake testsuite: the 'is_newest' subroutine.
 
-. ./defs || exit 1
+. test-init.sh
 
 plan_ 21
 
diff --git a/t/self-check-me.tap b/t/self-check-me.tap
index 9c3125e..6d008b6 100755
--- a/t/self-check-me.tap
+++ b/t/self-check-me.tap
@@ -15,10 +15,10 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # Sanity check for the automake testsuite.
-# Make sure that $me gets automatically defined by './defs'.
+# Make sure that $me gets automatically defined by 'test-init.sh'.
 
 am_create_testdir=no
-. ./defs || exit 1
+. test-init.sh
 
 plan_ 12
 
@@ -31,7 +31,7 @@ do_check ()
 {
   $AM_TEST_RUNNER_SHELL -c '
     am_create_testdir=no # Do not pollute the top-level directory.
-    . ./defs
+   . test-init.sh
     echo me=$me
   ' "$1" | grep "^me=$2$"
   command_ok_ "me=$1" test $? -eq 0
@@ -52,10 +52,10 @@ do_check abc. 'abc\.'
 s=$(me=bad $AM_TEST_RUNNER_SHELL -c '
   # Do not pollute the top-level directory.
   am_create_testdir=no
-  . ./defs
+ . test-init.sh
   echo me=$me
 ' foo.sh)
-command_ok_ "override of \$me before ./defs causes no error" \
+command_ok_ "override of \$me before test-init.sh causes no error" \
             test $? -eq 0
 
 r='ok'
diff --git a/t/self-check-report.sh b/t/self-check-report.sh
index 11211ec..74ec75c 100755
--- a/t/self-check-report.sh
+++ b/t/self-check-report.sh
@@ -21,7 +21,7 @@
 unset stderr_fileno_ || :
 
 am_create_testdir=empty
-. ./defs || exit 1
+. test-init.sh
 
 set +e
 
diff --git a/t/self-check-seq.tap b/t/self-check-seq.tap
index ead4eed..4db0050 100755
--- a/t/self-check-seq.tap
+++ b/t/self-check-seq.tap
@@ -17,7 +17,7 @@
 # Sanity check for the automake testsuite.
 # Check the 'seq_' subroutine.
 
-. ./defs || exit 1
+. test-init.sh
 
 plan_ 14
 
diff --git a/t/self-check-unindent.tap b/t/self-check-unindent.tap
index 2bd3bc2..c8dc5a8 100755
--- a/t/self-check-unindent.tap
+++ b/t/self-check-unindent.tap
@@ -17,7 +17,7 @@
 # Sanity check for the automake testsuite.
 # Check the 'unindent' subroutine.
 
-. ./defs || exit 1
+. test-init.sh
 
 plan_ 22
 
diff --git a/t/serial-tests.sh b/t/serial-tests.sh
index 26ce68f..52178c5 100755
--- a/t/serial-tests.sh
+++ b/t/serial-tests.sh
@@ -17,7 +17,7 @@
 # Option 'serial-tests'.
 
 am_create_testdir=empty
-. ./defs || exit 1
+. test-init.sh
 
 hasnt_parallel_tests ()
 {
diff --git a/t/silent-amopts.sh b/t/silent-amopts.sh
deleted file mode 100755
index c741453..0000000
--- a/t/silent-amopts.sh
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/bin/sh
-# Copyright (C) 2012 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 complaints if the 'silent-rules' option is
-# used in AUTOMAKE_OPTIONS.
-
-. ./defs || exit 1
-
-echo AUTOMAKE_OPTIONS = silent-rules > Makefile.am
-
-$ACLOCAL
-AUTOMAKE_fails
-grep "^Makefile\.am:1:.*'silent-rules'.*AM_INIT_AUTOMAKE" stderr
-
-:
diff --git a/t/silent-c.sh b/t/silent-c.sh
new file mode 100755
index 0000000..82b9587
--- /dev/null
+++ b/t/silent-c.sh
@@ -0,0 +1,91 @@
+#!/bin/sh
+# Copyright (C) 2009-2012 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 C, without libtool, both with and without
+# automatic dependency tracking.
+
+required=cc
+. test-init.sh
+
+mkdir sub
+
+cat >>configure.ac <<'EOF'
+AC_CONFIG_FILES([sub/Makefile])
+AC_PROG_CC
+AM_PROG_CC_C_O
+AC_OUTPUT
+EOF
+
+cat > Makefile.am <<'EOF'
+# Need generic and non-generic rules.
+bin_PROGRAMS = foo bar
+bar_CFLAGS = $(AM_CFLAGS)
+SUBDIRS = sub
+EOF
+
+cat > sub/Makefile.am <<'EOF'
+AUTOMAKE_OPTIONS = subdir-objects
+# Need generic and non-generic rules.
+bin_PROGRAMS = baz bla
+bla_CFLAGS = $(AM_CFLAGS)
+EOF
+
+cat > foo.c <<'EOF'
+int main ()
+{
+  return 0;
+}
+EOF
+cp foo.c bar.c
+cp foo.c sub/baz.c
+cp foo.c sub/bla.c
+
+$ACLOCAL
+$AUTOMAKE --add-missing
+$AUTOCONF
+
+for config_args in \
+  '--enable-dependency-tracking' \
+  '--disable-dependency-tracking' \
+; do
+
+  ./configure --enable-silent-rules $config_args
+
+  $MAKE >stdout || { cat stdout; exit 1; }
+  cat stdout
+  $EGREP ' (-c|-o)' stdout && exit 1
+  grep 'mv ' stdout && exit 1
+  grep 'CC .*foo\.' stdout
+  grep 'CC .*bar\.' stdout
+  grep 'CC .*baz\.' stdout
+  grep 'CC .*bla\.' stdout
+  grep 'CCLD .*foo' stdout
+  grep 'CCLD .*bar' stdout
+  grep 'CCLD .*baz' stdout
+  grep 'CCLD .*bla' stdout
+
+  $MAKE clean
+  $MAKE V=1 >stdout || { cat stdout; exit 1; }
+  cat stdout
+  grep ' -c' stdout
+  grep ' -o foo' stdout
+  $EGREP '(CC|LD) ' stdout && exit 1
+
+  $MAKE distclean
+
+done
+
+:
diff --git a/t/silent-configsite.sh b/t/silent-configsite.sh
index 4adc601..8bca33f 100755
--- a/t/silent-configsite.sh
+++ b/t/silent-configsite.sh
@@ -18,10 +18,10 @@
 # from config.site, and that this default can be overridden from
 # either the ./configure or make command line.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac <<'EOF'
-AM_SILENT_RULES
+# This line will be edited later to force silent-rules default.
 AC_OUTPUT
 EOF
 
@@ -51,8 +51,9 @@ $MAKE distclean
 
 : 'Disable by default in configure.ac, enable by default in config.site'
 
-sed 's/^AM_SILENT_RULES/&([no])/' configure.ac > configure.tmp
-mv -f configure.tmp configure.ac
+sed 's/.*silent-rules default.*/AM_SILENT_RULES([no])/' configure.ac > t
+diff t configure.ac && fatal_ "editing configure.ac"
+mv -f t configure.ac
 $ACLOCAL
 $AUTOCONF
 $AUTOMAKE --add-missing
@@ -67,8 +68,9 @@ $MAKE distclean
 
 : 'Enable by default in configure.ac, disable by default in config.site'
 
-sed 's/^AM_SILENT_RULES/&([yes])/' configure.ac > configure.tmp
-mv -f configure.tmp configure.ac
+sed 's/.*AM_SILENT_RULES.*/AM_SILENT_RULES([yes])/' configure.ac > t
+diff t configure.ac && fatal_ "editing configure.ac"
+mv -f t configure.ac
 $ACLOCAL
 $AUTOCONF
 $AUTOMAKE --add-missing
diff --git a/t/silent-custom.sh b/t/silent-custom.sh
new file mode 100755
index 0000000..73fc4d0
--- /dev/null
+++ b/t/silent-custom.sh
@@ -0,0 +1,101 @@
+#!/bin/sh
+# Copyright (C) 2009-2012 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 user extensibility of silent-rules mode.
+
+. test-init.sh
+
+cat >>configure.ac <<'EOF'
+AC_CONFIG_FILES([sub/Makefile])
+AC_OUTPUT
+EOF
+
+# We delegate all the work to the subdir makefile.  This is done
+# to ensure any command-line setting of $(V) gets correctly passed
+# down to recursive make invocations.
+echo SUBDIRS = sub > Makefile.am
+
+mkdir sub
+cat > sub/Makefile.am <<'EOF'
+AUTOMAKE_OPTIONS = -Wno-portability-recursive
+my_verbose = $(my_verbose_$(V))
+my_verbose_ = $(my_verbose_$(AM_DEFAULT_VERBOSITY))
+my_verbose_0 = @echo " XGEN    $@";
+
+all-local: foo gen-headers
+
+list = 0 1 2
+.PHONY: gen-headers
+gen-headers:
+       @headers=`for i in $(list); do echo sub/$$i.h; done`; \
+       if $(AM_V_P); then set -x; else \
+         echo " GEN     [headers]"; \
+       fi; \
+       rm -f $$headers || exit 1; \
+## Only fake header generation.
+       : generate-header --flags $$headers
+
+foo: foo.in
+       $(my_verbose)cp $(srcdir)/foo.in $@
+EXTRA_DIST = foo.in
+CLEANFILES = foo
+EOF
+
+: > sub/foo.in
+
+$ACLOCAL
+$AUTOMAKE --add-missing
+$AUTOCONF
+
+do_check ()
+{
+  case ${1-} in
+    --silent) silent=:;;
+    --verbose) silent=false;;
+    *) fatal_ "do_check(): incorrect usage";;
+  esac
+  shift
+  $MAKE clean
+  $MAKE ${1+"$@"} >output 2>&1 || { cat output; exit 1; }
+  sed 's/^/  /' output
+  if $silent; then
+    $FGREP 'cp ' output && exit 1
+    $FGREP 'generate-header' output && exit 1
+    $FGREP 'rm -f' output && exit 1
+    grep '[012]\.h' output && exit 1
+    grep '^ XGEN    foo$' output
+    grep '^ GEN     \[headers\]$' output
+  else
+    $FGREP 'GEN ' output && exit 1
+    $FGREP 'cp ./foo.in foo' output
+    $FGREP "rm -f sub/0.h sub/1.h sub/2.h" output
+    $FGREP "generate-header --flags sub/0.h sub/1.h sub/2.h" output
+  fi
+}
+
+./configure --enable-silent-rules
+do_check --silent
+do_check --verbose V=1
+
+$MAKE distclean
+
+./configure --disable-silent-rules
+do_check --verbose
+do_check --silent V=0
+
+$MAKE distclean
+
+:
diff --git a/t/silent-cxx.sh b/t/silent-cxx.sh
new file mode 100755
index 0000000..0a7aa82
--- /dev/null
+++ b/t/silent-cxx.sh
@@ -0,0 +1,107 @@
+#!/bin/sh
+# Copyright (C) 2010-2012 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 C++, both with and without automatic
+# dependency tracking.
+
+required=c++
+. test-init.sh
+
+mkdir sub
+
+cat >>configure.ac <<'EOF'
+AC_PROG_CXX
+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.cpp baz.cxx quux.cc
+foo2_SOURCES = $(foo1_SOURCES)
+foo2_CXXFLAGS = $(AM_CXXFLAGS)
+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.cpp
+bar2_SOURCES = $(bar1_SOURCES)
+bar2_CXXFLAGS = $(AM_CXXFLAGS)
+EOF
+
+cat > foo.cpp <<'EOF'
+using namespace std; /* C compilers fail on this. */
+int main (void) { return 0; }
+EOF
+
+# Let's try out other extensions too.
+echo 'class Baz  { public: int i;  };' > baz.cxx
+echo 'class Quux { public: bool b; };' > quux.cc
+
+cp foo.cpp sub/bar.cpp
+
+$ACLOCAL
+$AUTOMAKE --add-missing
+$AUTOCONF
+
+# Sanity check: make sure the cache variable we force is really used
+# by configure.
+$FGREP am_cv_CXX_dependencies_compiler_type configure
+
+# Force dependency tracking explicitly, so that slow dependency
+# extractors are not rejected.  Try also with dependency tracking
+# explicitly disabled.
+for config_args in \
+  --enable-dependency-tracking --disable-dependency-tracking
+do
+  ./configure $config_args --enable-silent-rules
+  $MAKE >stdout || { cat stdout; exit 1; }
+  cat stdout
+
+  $EGREP ' (-c|-o)' stdout && exit 1
+  grep 'mv ' stdout && exit 1
+
+  grep 'CXX .*foo\.'  stdout
+  grep 'CXX .*baz\.'  stdout
+  grep 'CXX .*quux\.' stdout
+  grep 'CXX .*bar\.'  stdout
+  grep 'CXXLD .*foo1' stdout
+  grep 'CXXLD .*bar1' stdout
+  grep 'CXXLD .*foo2' stdout
+  grep 'CXXLD .*bar2' stdout
+
+  # Ensure a clean rebuild.
+  $MAKE clean
+
+  $MAKE V=1 >stdout || { cat stdout; exit 1; }
+  cat stdout
+
+  grep ' -c ' stdout
+  grep ' -o ' stdout
+
+  $EGREP '(CXX|LD) ' stdout && exit 1
+
+  # Ensure a clean reconfiguration/rebuild.
+  $MAKE clean
+  $MAKE maintainer-clean
+
+done
+
+:
diff --git a/t/silent-f77.sh b/t/silent-f77.sh
new file mode 100755
index 0000000..24bc937
--- /dev/null
+++ b/t/silent-f77.sh
@@ -0,0 +1,91 @@
+#!/bin/sh
+# Copyright (C) 2010-2012 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 Fortran 77.
+# Keep this ins sync with the sister test 'silent-f90.sh'.
+
+required=fortran77
+. test-init.sh
+
+mkdir sub
+
+cat >>configure.ac <<'EOF'
+AC_PROG_F77
+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.f
+foo2_SOURCES = $(foo1_SOURCES)
+foo2_FFLAGS = $(AM_FFLAGS)
+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.f
+bar2_SOURCES = $(bar1_SOURCES)
+bar2_FFLAGS = $(AM_FFLAGS)
+EOF
+
+cat > foo.f <<'EOF'
+      program foo
+      stop
+      end
+EOF
+cp foo.f sub/bar.f
+
+$ACLOCAL
+$AUTOMAKE --add-missing
+$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
+
+grep 'F77 .*foo\.'  stdout
+grep 'F77 .*bar\.'  stdout
+grep 'F77LD .*foo1' stdout
+grep 'F77LD .*bar1' stdout
+grep 'F77LD .*foo2' stdout
+grep 'F77LD .*bar2' stdout
+
+$EGREP '(FC|FCLD) ' stdout && exit 1
+
+# Ensure a clean rebuild.
+$MAKE clean
+
+$MAKE V=1 >stdout || { cat stdout; exit 1; }
+cat stdout
+
+grep ' -c ' stdout
+grep ' -o ' stdout
+
+$EGREP '(F77|FC|LD) ' stdout && exit 1
+
+:
diff --git a/t/silent-f90.sh b/t/silent-f90.sh
new file mode 100755
index 0000000..ef83d80
--- /dev/null
+++ b/t/silent-f90.sh
@@ -0,0 +1,91 @@
+#!/bin/sh
+# Copyright (C) 2010-2012 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 Fortran 90.
+# Keep this ins sync with the sister test 'silent-f77.sh'.
+
+required=fortran
+. test-init.sh
+
+mkdir sub
+
+cat >>configure.ac <<'EOF'
+AC_PROG_FC
+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.f90
+foo2_SOURCES = $(foo1_SOURCES)
+foo2_FCFLAGS = $(AM_FCLAGS)
+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.f90
+bar2_SOURCES = $(bar1_SOURCES)
+bar2_FCFLAGS = $(AM_FCLAGS)
+EOF
+
+cat > foo.f90 <<'EOF'
+      program foo
+      stop
+      end
+EOF
+cp foo.f90 sub/bar.f90
+
+$ACLOCAL
+$AUTOMAKE --add-missing
+$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
+
+grep 'FC .*foo\.'  stdout
+grep 'FC .*bar\.'  stdout
+grep 'FCLD .*foo1' stdout
+grep 'FCLD .*bar1' stdout
+grep 'FCLD .*foo2' stdout
+grep 'FCLD .*bar2' stdout
+
+$EGREP '(F77|F77LD) ' stdout && exit 1
+
+# Ensure a clean rebuild.
+$MAKE clean
+
+$MAKE V=1 >stdout || { cat stdout; exit 1; }
+cat stdout
+
+grep ' -c ' stdout
+grep ' -o ' stdout
+
+$EGREP '(F77|FC|LD) ' stdout && exit 1
+
+:
diff --git a/t/silent-gen.sh b/t/silent-gen.sh
new file mode 100755
index 0000000..cd01a4f
--- /dev/null
+++ b/t/silent-gen.sh
@@ -0,0 +1,88 @@
+#!/bin/sh
+# Copyright (C) 2009-2012 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/>.
+
+# Silent rules: use of pre-defined variables $(AM_V_GEN) and $(AM_V_at).
+# Incidentally, also check that silent rules are disabled by default.
+
+. test-init.sh
+
+echo AC_OUTPUT >> configure.ac
+
+cat > Makefile.am <<'EOF'
+all-local: foo
+
+## And here's how you should do it in your own code:
+foo: foo.in
+       $(AM_V_GEN)cp $(srcdir)/foo.in $@
+       $(AM_V_at)echo more >> $@
+
+EXTRA_DIST = foo.in
+CLEANFILES = foo
+EOF
+
+: >foo.in
+
+$ACLOCAL
+$AUTOMAKE --add-missing
+$AUTOCONF
+
+# Silent rules are disabled by default, since we haven't called
+# "AM_SILENT_RULES([yes])" explicitly.
+./configure
+$MAKE >stdout || { cat stdout; exit 1; }
+cat stdout
+grep 'GEN ' stdout && exit 1
+grep 'cp ' stdout
+grep 'echo ' stdout
+
+$MAKE clean
+$MAKE V=1 >stdout || { cat stdout; exit 1; }
+cat stdout
+grep 'GEN ' stdout && exit 1
+grep 'cp ' stdout
+grep 'echo ' stdout
+
+$MAKE clean
+$MAKE V=0 >stdout || { cat stdout; exit 1; }
+cat stdout
+grep 'GEN .*foo' stdout
+grep 'cp ' stdout && exit 1
+grep 'echo ' stdout && exit 1
+
+$MAKE distclean
+
+./configure --enable-silent-rules
+$MAKE >stdout || { cat stdout; exit 1; }
+cat stdout
+grep 'GEN .*foo' stdout
+grep 'cp ' stdout && exit 1
+grep 'echo ' stdout && exit 1
+
+$MAKE clean
+$MAKE V=0 >stdout || { cat stdout; exit 1; }
+cat stdout
+grep 'GEN .*foo' stdout
+grep 'cp ' stdout && exit 1
+grep 'echo ' stdout && exit 1
+
+$MAKE clean
+$MAKE V=1 >stdout || { cat stdout; exit 1; }
+cat stdout
+grep 'GEN ' stdout && exit 1
+grep 'cp ' stdout
+grep 'echo ' stdout
+
+:
diff --git a/t/silent-lex.sh b/t/silent-lex.sh
index ca2164f..6cc0430 100755
--- a/t/silent-lex.sh
+++ b/t/silent-lex.sh
@@ -17,12 +17,11 @@
 # Check silent-rules mode for Lex.
 
 required='cc lex'
-. ./defs || exit 1
+. test-init.sh
 
 mkdir sub
 
 cat >>configure.ac <<'EOF'
-AM_SILENT_RULES
 AM_PROG_CC_C_O
 AC_PROG_LEX
 AC_CONFIG_FILES([sub/Makefile])
diff --git a/t/silent-lt.sh b/t/silent-lt.sh
new file mode 100755
index 0000000..28a4f89
--- /dev/null
+++ b/t/silent-lt.sh
@@ -0,0 +1,96 @@
+#!/bin/sh
+# Copyright (C) 2009-2012 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 C, with libtool, both with and without
+# automatic dependency tracking.
+
+required='cc libtoolize'
+. test-init.sh
+
+mkdir sub
+
+cat >>configure.ac <<'EOF'
+AC_CONFIG_FILES([sub/Makefile])
+AC_PROG_CC
+AM_PROG_AR
+AM_PROG_CC_C_O
+AC_PROG_LIBTOOL
+AC_OUTPUT
+EOF
+
+cat > Makefile.am <<'EOF'
+# Need generic and non-generic rules.
+lib_LTLIBRARIES = libfoo.la libbar.la
+libbar_la_CFLAGS = $(AM_CFLAGS)
+SUBDIRS = sub
+EOF
+
+cat > sub/Makefile.am <<'EOF'
+AUTOMAKE_OPTIONS = subdir-objects
+# Need generic and non-generic rules.
+lib_LTLIBRARIES = libbaz.la libbla.la
+libbla_la_CFLAGS = $(AM_CFLAGS)
+EOF
+
+cat > libfoo.c <<'EOF'
+int main ()
+{
+  return 0;
+}
+EOF
+cp libfoo.c libbar.c
+cp libfoo.c sub/libbaz.c
+cp libfoo.c sub/libbla.c
+
+libtoolize
+$ACLOCAL
+$AUTOMAKE --add-missing
+$AUTOCONF
+
+for config_args in \
+  '--enable-dependency-tracking' \
+  '--disable-dependency-tracking' \
+; do
+
+  ./configure --enable-silent-rules $config_args
+
+  $MAKE >stdout || { cat stdout; exit 1; }
+  cat stdout
+
+  $EGREP ' (-c|-o)' stdout && exit 1
+  grep 'mv ' stdout && exit 1
+  grep ' CC .*foo\.' stdout
+  grep ' CC .*bar\.' stdout
+  grep ' CC .*baz\.' stdout
+  grep ' CC .*bla\.' stdout
+  grep ' CCLD .*foo' stdout
+  grep ' CCLD .*bar' stdout
+  grep ' CCLD .*baz' stdout
+  grep ' CCLD .*bla' stdout
+
+  $MAKE clean
+  $MAKE V=1 >stdout || { cat stdout; exit 1; }
+  cat stdout
+  grep ' -c' stdout
+  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
+
+done
+
+:
diff --git a/t/silent-many-gcc.sh b/t/silent-many-gcc.sh
deleted file mode 100755
index 98104b6..0000000
--- a/t/silent-many-gcc.sh
+++ /dev/null
@@ -1,241 +0,0 @@
-#!/bin/sh
-# Copyright (C) 2009-2012 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*.sh', 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.sh', which should work with generic compilers.
-
-required='gcc g++ gfortran lex yacc'
-. ./defs || exit 1
-
-# 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
-    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
-    grep 'ylwrap ' stdout
-    $EGREP '(LEX|YACC) ' stdout && exit 1
-  fi
-
-  unset rebuild
-}
-
-mkdir sub
-
-cat >>configure.ac <<'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)
-fo2_YFLAGS = -v
-fo2_LFLAGS = -n
-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)
-ba2_YFLAGS = -v
-ba2_LFLAGS = -n
-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'
-%{
-#define YY_NO_UNISTD_H 1
-%}
-%%
-"END"   return EOF;
-.
-%%
-/* Avoid possible link errors. */
-int yywrap (void)
-{
-  return 1;
-}
-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
-
-# Sanity check: make sure the cache variables we force are really
-# used by configure.
-$FGREP am_cv_CC_dependencies_compiler_type configure
-$FGREP am_cv_CXX_dependencies_compiler_type configure
-# Ensure per-target rules are used, to ensure their coverage below.
-# (We do not do an exhaustive check, that wouldn't be practical).
-$FGREP 'bar-bar.o' Makefile.in
-$FGREP 'fo2-foo5.c' Makefile.in
-$FGREP 'fo2-foo6.c' Makefile.in
-
-# Force gcc ("fast") depmode.
-depmodes="am_cv_CC_dependencies_compiler_type=gcc \
-          am_cv_CXX_dependencies_compiler_type=gcc"
-# This apparently useless "for" loop is here to simplify the syncing
-# with sister test 'silent-many-generic.sh'.
-for config_args in \
-  "$depmodes"
-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
-
-:
diff --git a/t/silent-many-generic.sh b/t/silent-many-generic.sh
deleted file mode 100755
index 6cbcbd7..0000000
--- a/t/silent-many-generic.sh
+++ /dev/null
@@ -1,266 +0,0 @@
-#!/bin/sh
-# Copyright (C) 2009-2012 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 many languages at once.
-# This test partly overlaps with other 'silent*.sh', 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.sh', which requires the GNU compilers
-# and forces the use of gcc depmode.
-
-required='cc c++ fortran fortran77 lex yacc'
-. ./defs || exit 1
-
-# 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
-    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
-    grep 'ylwrap ' stdout
-    $EGREP '(LEX|YACC) ' stdout && exit 1
-  fi
-
-  unset rebuild
-}
-
-mkdir sub
-
-cat >>configure.ac <<'EOF'
-AM_SILENT_RULES
-AM_PROG_CC_C_O
-AC_PROG_F77
-AC_PROG_FC
-AC_PROG_LEX
-AC_PROG_YACC
-AC_PROG_CXX
-
-# FIXME: remove this hack once the requirements c++, fortran and fortran77
-# are implemented correctly.
-test -n "`echo $CXX`" || AC_MSG_ERROR([C++ compiler not found], [77])
-test -n "`echo $FC`"  || AC_MSG_ERROR([Fortran compiler not found], [77])
-test -n "`echo $F77`" || AC_MSG_ERROR([Fortran 77 compiler not found], [77])
-
-# The SunStudio C++ compiler is unfortunately named 'sunCC' (or even just
-# 'CC', yuck!); similarly and the Portland group C++ compiler is named
-# 'pgCC'.  This can cause problems with our grepping checks on the output
-# from make.  Avoid these problems by invoking a wrapper script, as
-# filtering the make output proved too fragile.
-case " $CXX " in
-  *'CC '*)
-    AC_MSG_WARN([the C++ compiler '$CXX' name ends with 'CC'])
-    AC_MSG_WARN([it will be wrapped with the custom script 'am--cxx'])
-    echo '#!/bin/sh' > bin/am--cxx
-    echo 'PATH=$saved_PATH; export PATH' >> bin/am--cxx
-    echo "case \$# in" >> bin/am--cxx
-    echo "  0) exec $CXX ;;" >> bin/am--cxx
-    echo "  *) exec $CXX \"address@hidden" ;;" >> bin/am--cxx
-    echo "esac" >> bin/am--cxx
-    chmod a+x bin/am--cxx
-    CXX=am--cxx
-esac
-
-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)
-fo2_YFLAGS = -v
-fo2_LFLAGS = -n
-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)
-ba2_YFLAGS = -v
-ba2_LFLAGS = -n
-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'
-%{
-#define YY_NO_UNISTD_H 1
-%}
-%%
-"END"   return EOF;
-.
-%%
-/* Avoid possible link errors. */
-int yywrap (void)
-{
-  return 1;
-}
-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
-
-mkdir bin
-saved_PATH=$PATH; export saved_PATH
-PATH=$(pwd)/bin$PATH_SEPARATOR$PATH; export PATH
-
-$ACLOCAL
-$AUTOMAKE --add-missing
-$AUTOCONF
-
-# Ensure per-target rules are used, to ensure their coverage below.
-# (We do not do an exhaustive check, that wouldn't be practical).
-$FGREP 'bar-bar.o' Makefile.in
-$FGREP 'fo2-foo5.c' Makefile.in
-$FGREP 'fo2-foo6.c' Makefile.in
-
-# Force dependency tracking explicitly, so that slow dependency
-# extractors are not rejected.  Try also with dependency tracking
-# explicitly disabled.
-for config_args in \
-  --enable-dependency-tracking --disable-dependency-tracking
-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
-
-:
diff --git a/t/silent-many-languages.sh b/t/silent-many-languages.sh
new file mode 100755
index 0000000..c8954d1
--- /dev/null
+++ b/t/silent-many-languages.sh
@@ -0,0 +1,262 @@
+#!/bin/sh
+# Copyright (C) 2009-2012 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 many languages at once.
+# This test partly overlaps with other 'silent*.sh', but it serves as
+# a stress test by using many different languages at once -- so don't
+# remove this test script.
+
+required='cc c++ fortran fortran77 lex yacc'
+. test-init.sh
+
+# 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
+    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
+    grep 'ylwrap ' stdout
+    $EGREP '(LEX|YACC) ' stdout && exit 1
+  fi
+
+  unset rebuild
+}
+
+mkdir sub
+
+cat >>configure.ac <<'EOF'
+AM_PROG_CC_C_O
+AC_PROG_F77
+AC_PROG_FC
+AC_PROG_LEX
+AC_PROG_YACC
+AC_PROG_CXX
+
+# FIXME: remove this hack once the requirements c++, fortran and fortran77
+# are implemented correctly.
+test -n "`echo $CXX`" || AC_MSG_ERROR([C++ compiler not found], [77])
+test -n "`echo $FC`"  || AC_MSG_ERROR([Fortran compiler not found], [77])
+test -n "`echo $F77`" || AC_MSG_ERROR([Fortran 77 compiler not found], [77])
+
+# The SunStudio C++ compiler is unfortunately named 'sunCC' (or even just
+# 'CC', yuck!); similarly and the Portland group C++ compiler is named
+# 'pgCC'.  This can cause problems with our grepping checks on the output
+# from make.  Avoid these problems by invoking a wrapper script, as
+# filtering the make output proved too fragile.
+case " $CXX " in
+  *'CC '*)
+    AC_MSG_WARN([the C++ compiler '$CXX' name ends with 'CC'])
+    AC_MSG_WARN([it will be wrapped with the custom script 'am--cxx'])
+    echo '#!/bin/sh' > bin/am--cxx
+    echo 'PATH=$saved_PATH; export PATH' >> bin/am--cxx
+    echo "case \$# in" >> bin/am--cxx
+    echo "  0) exec $CXX ;;" >> bin/am--cxx
+    echo "  *) exec $CXX \"address@hidden" ;;" >> bin/am--cxx
+    echo "esac" >> bin/am--cxx
+    chmod a+x bin/am--cxx
+    CXX=am--cxx
+esac
+
+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)
+fo2_YFLAGS = -v
+fo2_LFLAGS = -n
+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)
+ba2_YFLAGS = -v
+ba2_LFLAGS = -n
+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'
+%{
+#define YY_NO_UNISTD_H 1
+%}
+%%
+"END"   return EOF;
+.
+%%
+/* Avoid possible link errors. */
+int yywrap (void)
+{
+  return 1;
+}
+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
+
+mkdir bin
+saved_PATH=$PATH; export saved_PATH
+PATH=$(pwd)/bin$PATH_SEPARATOR$PATH; export PATH
+
+$ACLOCAL
+$AUTOMAKE --add-missing
+$AUTOCONF
+
+# Ensure per-target rules are used, to ensure their coverage below.
+# (We do not do an exhaustive check, that wouldn't be practical).
+$FGREP 'bar-bar.o' Makefile.in
+$FGREP 'fo2-foo5.c' Makefile.in
+$FGREP 'fo2-foo6.c' Makefile.in
+
+# Force dependency tracking explicitly, so that slow dependency
+# extractors are not rejected.  Try also with dependency tracking
+# explicitly disabled.
+for config_args in \
+  --enable-dependency-tracking --disable-dependency-tracking
+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
+
+:
diff --git a/t/silent-nested-vars.sh b/t/silent-nested-vars.sh
index 08ba070..3969ada 100755
--- a/t/silent-nested-vars.sh
+++ b/t/silent-nested-vars.sh
@@ -17,7 +17,7 @@
 # Check silent-rules mode, on 'make' implementations that do not
 # support nested variables (Bug#9928, Bug#10237).
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac <<'EOF'
 AM_SILENT_RULES
diff --git a/t/silent-nowarn.sh b/t/silent-nowarn.sh
deleted file mode 100755
index 9eb759d..0000000
--- a/t/silent-nowarn.sh
+++ /dev/null
@@ -1,44 +0,0 @@
-#!/bin/sh
-# Copyright (C) 2011-2012 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 'silent-rules' mode suppresses the warnings for recursive
-# make variable expansions.  This should happen regardless of whether and
-# where these warnings are requested.
-
-. ./defs || exit 1
-
-cat > configure.ac <<END
-AC_INIT([$me], [1.0])
-# Yes, we repeat the warnings two times, both before and after
-# 'silent-rules'.  This is deliberate.
-AM_INIT_AUTOMAKE([gnu -Wall -Wportability-recursive
-                      silent-rules
-                      -Wall -Wportability-recursive])
-AC_CONFIG_FILES([Makefile])
-END
-
-cat > Makefile.am <<'END'
-AUTOMAKE_OPTIONS = gnu -Wall -Wportability-recursive
-foo = $($(v)) $(x$(v)) $($(v)x) $(y$(v)z)
-END
-
-# Files required bu gnu strictness.
-touch AUTHORS ChangeLog COPYING INSTALL NEWS README THANKS
-
-$ACLOCAL
-$AUTOMAKE --gnu -Wall -Wportability-recursive
-
-:
diff --git a/t/silent-obsolescent-warns.sh b/t/silent-obsolescent-warns.sh
deleted file mode 100755
index 38d845c..0000000
--- a/t/silent-obsolescent-warns.sh
+++ /dev/null
@@ -1,71 +0,0 @@
-#!/bin/sh
-# Copyright (C) 2009-2012 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/>.
-
-# Some checks about silent-rules mode and warnings.
-
-. ./defs || exit 1
-
-cat >>configure.ac <<'EOF'
-AM_SILENT_RULES
-AC_OUTPUT
-EOF
-
-cat > Makefile.am <<'EOF'
-my_verbose = $(my_verbose_$(V))
-my_verbose_ = $(my_verbose_$(AM_DEFAULT_VERBOSITY))
-my_verbose_0 = @echo " PKG-GEN    $@";
-foo: foo.in
-       $(my_verbose)cp $(srcdir)/foo.in $@
-EOF
-
-$ACLOCAL
-$AUTOMAKE --add-missing
-
-cat > configure.ac <<'END'
-AC_INIT([silent6], [1.0])
-AM_INIT_AUTOMAKE([-Wall])
-AC_CONFIG_FILES([Makefile])
-END
-
-rm -rf autom4te*.cache
-$ACLOCAL
-AUTOMAKE_fails
-grep 'my_verbose_\$(V.*non-POSIX ' stderr
-$AUTOMAKE -Wno-error
-
-# AM_SILENT_RULES should turn off the warning.
-echo 'AM_SILENT_RULES' >> configure.ac
-rm -rf autom4te*.cache
-$ACLOCAL
-$AUTOMAKE
-grep 'AM_V_GEN' Makefile.in
-$AUTOMAKE --force -Wno-all -Wportability
-grep 'AM_V_GEN' Makefile.in
-
-# The 'silent-rules' option to AM_INIT_AUTOMAKE should work likewise.
-cat > configure.ac <<'END'
-AC_INIT([silent6], [1.0])
-AM_INIT_AUTOMAKE([silent-rules])
-AC_CONFIG_FILES([Makefile])
-END
-rm -rf autom4te*.cache
-$ACLOCAL
-$AUTOMAKE
-grep 'AM_V_GEN' Makefile.in
-$AUTOMAKE --force -Wno-all -Wportability
-grep 'AM_V_GEN' Makefile.in
-
-:
diff --git a/t/silent-texi.sh b/t/silent-texi.sh
new file mode 100755
index 0000000..3ddbc40
--- /dev/null
+++ b/t/silent-texi.sh
@@ -0,0 +1,87 @@
+#!/bin/sh
+# Copyright (C) 2009-2012 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 tex texi2dvi dvips'
+. test-init.sh
+
+echo AC_OUTPUT >> configure.ac
+
+cat > Makefile.am <<'EOF'
+info_TEXINFOS = foo.texi sub/zardoz.texi
+EOF
+
+cat > foo.texi <<'EOF'
+\input texinfo
address@hidden foo.info
address@hidden foo manual
address@hidden
+EOF
+
+mkdir sub
+cat > sub/zardoz.texi <<'EOF'
+\input texinfo
address@hidden zardoz.info
address@hidden zardoz manual
address@hidden
+EOF
+
+$ACLOCAL
+$AUTOMAKE --add-missing
+$AUTOCONF
+
+./configure --disable-silent-rules
+
+# Silent mode output.
+st=0
+$MAKE V=0 dvi html info ps pdf >stdout 2>stderr || st=$?
+cat stdout
+cat stderr >&2
+test $st -eq 0
+grep '^  DVIPS    foo\.ps$'         stdout
+grep '^  MAKEINFO foo\.html$'       stdout
+# NetBSD make will print './foo.info' instead of 'foo.info'.
+$EGREP '^  MAKEINFO (\./)?foo\.info$' stdout
+grep '^  TEXI2DVI foo\.dvi$'        stdout
+grep '^  TEXI2PDF foo\.pdf$'        stdout
+grep '^  DVIPS    sub/zardoz.ps$'   stdout
+grep '^  MAKEINFO sub/zardoz.html$' stdout
+# NetBSD make will print './sub/zardoz.info' instead of 'zardoz.info'.
+$EGREP '^  MAKEINFO (\./)?sub/zardoz.info$' stdout
+grep '^  TEXI2DVI sub/zardoz.dvi$'  stdout
+grep '^  TEXI2PDF sub/zardoz.pdf$'  stdout
+# No make recipe is displayed before being executed.
+$EGREP 'texi2(dvi|pdf)|dvips|makeinfo|(rm|mv) ' \
+  stdout stderr && exit 1
+# No verbose output from TeX nor dvips.
+$EGREP '(zardoz|foo)\.log|3\.14|Copyright|This is|[Oo]utput ' \
+  stdout stderr && exit 1
+
+# Verbose mode output.
+$MAKE clean || exit 1
+$MAKE V=1 dvi html info ps pdf >output 2>&1 || { cat output; exit 1; }
+cat output
+$EGREP '(DVIPS|MAKEINFO|TEXI2(PDF|DVI)) ' output && exit 1
+# Verbose output from TeX.
+grep '[Oo]utput .*foo\.pdf' output
+grep '[Oo]utput .*zardoz\.pdf' output
+$FGREP 'foo.log' output
+$FGREP 'zardoz.log' output
+# Verbose output from dvips.
+$FGREP ' dvips' output
+
+:
diff --git a/t/silent-yacc-headers.sh b/t/silent-yacc-headers.sh
index e89fe5a..e9ef9a0 100755
--- a/t/silent-yacc-headers.sh
+++ b/t/silent-yacc-headers.sh
@@ -18,12 +18,11 @@
 # involved (i.e., the '-d' option is in *YFLAGS).
 
 required='cc yacc'
-. ./defs || exit 1
+. test-init.sh
 
 mkdir sub
 
 cat >>configure.ac <<'EOF'
-AM_SILENT_RULES
 AC_PROG_YACC
 AC_PROG_CC
 AC_OUTPUT
diff --git a/t/silent-yacc.sh b/t/silent-yacc.sh
index c5729ef..a1de8b7 100755
--- a/t/silent-yacc.sh
+++ b/t/silent-yacc.sh
@@ -15,15 +15,13 @@
 # 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.sh'.
 
 required='cc yacc'
-. ./defs || exit 1
+. test-init.sh
 
 mkdir sub
 
 cat >>configure.ac <<'EOF'
-AM_SILENT_RULES
 AM_PROG_CC_C_O
 AC_PROG_YACC
 AC_CONFIG_FILES([sub/Makefile])
diff --git a/t/silent.sh b/t/silent.sh
deleted file mode 100755
index 5a12036..0000000
--- a/t/silent.sh
+++ /dev/null
@@ -1,83 +0,0 @@
-#!/bin/sh
-# Copyright (C) 2009-2012 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, without libtool, standard depmode case.
-
-# Please keep this file in sync with 'silent2.sh'.
-
-required=cc
-. ./defs || exit 1
-
-mkdir sub
-
-cat >>configure.ac <<'EOF'
-AM_SILENT_RULES
-AC_CONFIG_FILES([sub/Makefile])
-AC_PROG_CC
-AM_PROG_CC_C_O
-AC_OUTPUT
-EOF
-
-cat > Makefile.am <<'EOF'
-# Need generic and non-generic rules.
-bin_PROGRAMS = foo bar
-bar_CFLAGS = $(AM_CFLAGS)
-SUBDIRS = sub
-EOF
-
-cat > sub/Makefile.am <<'EOF'
-AUTOMAKE_OPTIONS = subdir-objects
-# Need generic and non-generic rules.
-bin_PROGRAMS = baz bla
-bla_CFLAGS = $(AM_CFLAGS)
-EOF
-
-cat > foo.c <<'EOF'
-int main ()
-{
-  return 0;
-}
-EOF
-cp foo.c bar.c
-cp foo.c sub/baz.c
-cp foo.c sub/bla.c
-
-$ACLOCAL
-$AUTOMAKE --add-missing
-$AUTOCONF
-
-./configure --enable-silent-rules
-$MAKE >stdout || { cat stdout; exit 1; }
-cat stdout
-$EGREP ' (-c|-o)' stdout && exit 1
-grep 'mv ' stdout && exit 1
-grep 'CC    .*foo\.' stdout
-grep 'CC .*bar\.' stdout
-grep 'CC .*baz\.' stdout
-grep 'CC .*bla\.' stdout
-grep 'CCLD .*foo' stdout
-grep 'CCLD .*bar' stdout
-grep 'CCLD .*baz' stdout
-grep 'CCLD .*bla' stdout
-
-$MAKE clean
-$MAKE V=1 >stdout || { cat stdout; exit 1; }
-cat stdout
-grep ' -c' stdout
-grep ' -o foo' stdout
-$EGREP '(CC|LD) ' stdout && exit 1
-
-:
diff --git a/t/silent2.sh b/t/silent2.sh
deleted file mode 100755
index 4e8fd6b..0000000
--- a/t/silent2.sh
+++ /dev/null
@@ -1,84 +0,0 @@
-#!/bin/sh
-# Copyright (C) 2009-2012 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, without libtool, non-fastdep case
-# (so that, with GCC, we also cover the other code paths in depend2).
-
-# Please keep this file in sync with 'silent.sh'.
-
-required=gcc
-. ./defs || exit 1
-
-mkdir sub
-
-cat >>configure.ac <<'EOF'
-AM_SILENT_RULES
-AC_CONFIG_FILES([sub/Makefile])
-AC_PROG_CC
-AM_PROG_CC_C_O
-AC_OUTPUT
-EOF
-
-cat > Makefile.am <<'EOF'
-# Need generic and non-generic rules.
-bin_PROGRAMS = foo bar
-bar_CFLAGS = $(AM_CFLAGS)
-SUBDIRS = sub
-EOF
-
-cat > sub/Makefile.am <<'EOF'
-AUTOMAKE_OPTIONS = subdir-objects
-# Need generic and non-generic rules.
-bin_PROGRAMS = baz bla
-bla_CFLAGS = $(AM_CFLAGS)
-EOF
-
-cat > foo.c <<'EOF'
-int main ()
-{
-  return 0;
-}
-EOF
-cp foo.c bar.c
-cp foo.c sub/baz.c
-cp foo.c sub/bla.c
-
-$ACLOCAL
-$AUTOMAKE --add-missing
-$AUTOCONF
-
-./configure am_cv_CC_dependencies_compiler_type=gcc --enable-silent-rules
-$MAKE >stdout || { cat stdout; exit 1; }
-cat stdout
-$EGREP ' (-c|-o)' stdout && exit 1
-grep 'mv ' stdout && exit 1
-grep 'CC .*foo\.' stdout
-grep 'CC .*bar\.' stdout
-grep 'CC .*baz\.' stdout
-grep 'CC .*bla\.' stdout
-grep 'CCLD .*foo' stdout
-grep 'CCLD .*bar' stdout
-grep 'CCLD .*baz' stdout
-grep 'CCLD .*bla' stdout
-
-$MAKE clean
-$MAKE V=1 >stdout || { cat stdout; exit 1; }
-cat stdout
-grep ' -c' stdout
-grep ' -o foo' stdout
-$EGREP '(CC|LD) ' stdout && exit 1
-
-:
diff --git a/t/silent3.sh b/t/silent3.sh
deleted file mode 100755
index e4c043a..0000000
--- a/t/silent3.sh
+++ /dev/null
@@ -1,87 +0,0 @@
-#!/bin/sh
-# Copyright (C) 2009-2012 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 libtool, standard depmode case.
-
-# Please keep this file in sync with 'silent4.sh' and 'silent9.sh'.
-
-required='cc libtoolize'
-. ./defs || exit 1
-
-mkdir sub
-
-cat >>configure.ac <<'EOF'
-AM_SILENT_RULES
-AC_CONFIG_FILES([sub/Makefile])
-AC_PROG_CC
-AM_PROG_AR
-AM_PROG_CC_C_O
-AC_PROG_LIBTOOL
-AC_OUTPUT
-EOF
-
-cat > Makefile.am <<'EOF'
-# Need generic and non-generic rules.
-lib_LTLIBRARIES = libfoo.la libbar.la
-libbar_la_CFLAGS = $(AM_CFLAGS)
-SUBDIRS = sub
-EOF
-
-cat > sub/Makefile.am <<'EOF'
-AUTOMAKE_OPTIONS = subdir-objects
-# Need generic and non-generic rules.
-lib_LTLIBRARIES = libbaz.la libbla.la
-libbla_la_CFLAGS = $(AM_CFLAGS)
-EOF
-
-cat > libfoo.c <<'EOF'
-int main ()
-{
-  return 0;
-}
-EOF
-cp libfoo.c libbar.c
-cp libfoo.c sub/libbaz.c
-cp libfoo.c sub/libbla.c
-
-libtoolize
-$ACLOCAL
-$AUTOMAKE --add-missing
-$AUTOCONF
-
-./configure --enable-silent-rules
-$MAKE >stdout || { cat stdout; exit 1; }
-cat stdout
-$EGREP ' (-c|-o)' stdout && exit 1
-grep 'mv ' stdout && exit 1
-grep ' CC .*foo\.' stdout
-grep ' CC .*bar\.' stdout
-grep ' CC .*baz\.' stdout
-grep ' CC .*bla\.' stdout
-grep ' CCLD .*foo' stdout
-grep ' CCLD .*bar' stdout
-grep ' CCLD .*baz' stdout
-grep ' CCLD .*bla' stdout
-
-$MAKE clean
-$MAKE V=1 >stdout || { cat stdout; exit 1; }
-cat stdout
-grep ' -c' stdout
-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
-
-:
diff --git a/t/silent4.sh b/t/silent4.sh
deleted file mode 100755
index 15568fd..0000000
--- a/t/silent4.sh
+++ /dev/null
@@ -1,88 +0,0 @@
-#!/bin/sh
-# Copyright (C) 2009-2012 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 libtool, non-fastdep case
-# (so that, with GCC, we also cover the other code paths in depend2).
-
-# Please keep this file in sync with 'silent3.sh' and 'silent9.sh'.
-
-required="libtoolize gcc"
-. ./defs || exit 1
-
-mkdir sub
-
-cat >>configure.ac <<'EOF'
-AM_SILENT_RULES
-AC_CONFIG_FILES([sub/Makefile])
-AC_PROG_CC
-AM_PROG_AR
-AM_PROG_CC_C_O
-AC_PROG_LIBTOOL
-AC_OUTPUT
-EOF
-
-cat > Makefile.am <<'EOF'
-# Need generic and non-generic rules.
-lib_LTLIBRARIES = libfoo.la libbar.la
-libbar_la_CFLAGS = $(AM_CFLAGS)
-SUBDIRS = sub
-EOF
-
-cat > sub/Makefile.am <<'EOF'
-AUTOMAKE_OPTIONS = subdir-objects
-# Need generic and non-generic rules.
-lib_LTLIBRARIES = libbaz.la libbla.la
-libbla_la_CFLAGS = $(AM_CFLAGS)
-EOF
-
-cat > libfoo.c <<'EOF'
-int main ()
-{
-  return 0;
-}
-EOF
-cp libfoo.c libbar.c
-cp libfoo.c sub/libbaz.c
-cp libfoo.c sub/libbla.c
-
-libtoolize
-$ACLOCAL
-$AUTOMAKE --add-missing
-$AUTOCONF
-
-./configure am_cv_CC_dependencies_compiler_type=gcc --enable-silent-rules
-$MAKE >stdout || { cat stdout; exit 1; }
-cat stdout
-$EGREP ' (-c|-o)' stdout && exit 1
-grep 'mv ' stdout && exit 1
-grep ' CC .*foo\.' stdout
-grep ' CC .*bar\.' stdout
-grep ' CC .*baz\.' stdout
-grep ' CC .*bla\.' stdout
-grep ' CCLD .*foo' stdout
-grep ' CCLD .*bar' stdout
-grep ' CCLD .*baz' stdout
-grep ' CCLD .*bla' stdout
-
-$MAKE clean
-$MAKE V=1 >stdout || { cat stdout; exit 1; }
-cat stdout
-grep ' -c' stdout
-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
-
-:
diff --git a/t/silent6.sh b/t/silent6.sh
deleted file mode 100755
index 3593adf..0000000
--- a/t/silent6.sh
+++ /dev/null
@@ -1,101 +0,0 @@
-#!/bin/sh
-# Copyright (C) 2009-2012 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 user extensibility of silent-rules mode.
-
-. ./defs || exit 1
-
-cat >>configure.ac <<'EOF'
-AM_SILENT_RULES
-AC_CONFIG_FILES([sub/Makefile])
-AC_OUTPUT
-EOF
-
-# We delegate all the work to the subdir makefile.  This is done
-# to ensure any command-line setting of $(V) gets correctly passed
-# down to recursive make invocations.
-echo SUBDIRS = sub > Makefile.am
-
-mkdir sub
-cat > sub/Makefile.am <<'EOF'
-my_verbose = $(my_verbose_$(V))
-my_verbose_ = $(my_verbose_$(AM_DEFAULT_VERBOSITY))
-my_verbose_0 = @echo " XGEN    $@";
-
-all-local: foo gen-headers
-
-list = 0 1 2
-.PHONY: gen-headers
-gen-headers:
-       @headers=`for i in $(list); do echo sub/$$i.h; done`; \
-       if $(AM_V_P); then set -x; else \
-         echo " GEN     [headers]"; \
-       fi; \
-       rm -f $$headers || exit 1; \
-## Only fake header generation.
-       : generate-header --flags $$headers
-
-foo: foo.in
-       $(my_verbose)cp $(srcdir)/foo.in $@
-EXTRA_DIST = foo.in
-CLEANFILES = foo
-EOF
-
-: > sub/foo.in
-
-$ACLOCAL
-$AUTOMAKE --add-missing
-$AUTOCONF
-
-do_check ()
-{
-  case ${1-} in
-    --silent) silent=:;;
-    --verbose) silent=false;;
-    *) fatal_ "do_check(): incorrect usage";;
-  esac
-  shift
-  $MAKE clean
-  $MAKE ${1+"$@"} >output 2>&1 || { cat output; exit 1; }
-  sed 's/^/  /' output
-  if $silent; then
-    $FGREP 'cp ' output && exit 1
-    $FGREP 'generate-header' output && exit 1
-    $FGREP 'rm -f' output && exit 1
-    grep '[012]\.h' output && exit 1
-    grep '^ XGEN    foo$' output
-    grep '^ GEN     \[headers\]$' output
-  else
-    $FGREP 'GEN ' output && exit 1
-    $FGREP 'cp ./foo.in foo' output
-    $FGREP "rm -f sub/0.h sub/1.h sub/2.h" output
-    $FGREP "generate-header --flags sub/0.h sub/1.h sub/2.h" output
-  fi
-}
-
-./configure --enable-silent-rules
-do_check --silent
-do_check --verbose V=1
-
-$MAKE distclean
-
-./configure --disable-silent-rules
-do_check --verbose
-do_check --silent V=0
-
-$MAKE distclean
-
-:
diff --git a/t/silent7.sh b/t/silent7.sh
deleted file mode 100755
index 898a442..0000000
--- a/t/silent7.sh
+++ /dev/null
@@ -1,92 +0,0 @@
-#!/bin/sh
-# Copyright (C) 2009-2012 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 user extensibility of silent-rules mode.
-
-. ./defs || exit 1
-
-cat >>configure.ac <<'EOF'
-AM_SILENT_RULES
-AC_OUTPUT
-EOF
-
-cat > Makefile.am <<'EOF'
-all-local: foo
-
-## And here's how you should do it in your own code:
-foo: foo.in
-       $(AM_V_GEN)cp $(srcdir)/foo.in $@
-       $(AM_V_at)echo more >> $@
-
-EXTRA_DIST = foo.in
-CLEANFILES = foo
-EOF
-
-: >foo.in
-
-$ACLOCAL
-$AUTOMAKE --add-missing
-$AUTOCONF
-
-./configure --disable-silent-rules
-$MAKE >stdout || { cat stdout; exit 1; }
-cat stdout
-grep 'GEN ' stdout && exit 1
-grep 'cp ' stdout
-grep 'echo ' stdout
-
-$MAKE clean
-$MAKE V=1 >stdout || { cat stdout; exit 1; }
-cat stdout
-grep 'GEN ' stdout && exit 1
-grep 'cp ' stdout
-grep 'echo ' stdout
-
-$MAKE clean
-$MAKE V=0 >stdout || { cat stdout; exit 1; }
-cat stdout
-grep 'GEN .*foo' stdout
-grep 'cp ' stdout && exit 1
-grep 'echo ' stdout && exit 1
-
-$MAKE distclean
-
-./configure --enable-silent-rules
-$MAKE >stdout || { cat stdout; exit 1; }
-cat stdout
-grep 'GEN .*foo' stdout
-grep 'cp ' stdout && exit 1
-grep 'echo ' stdout && exit 1
-
-$MAKE clean
-$MAKE V=0 >stdout || { cat stdout; exit 1; }
-cat stdout
-grep 'GEN .*foo' stdout
-grep 'cp ' stdout && exit 1
-grep 'echo ' stdout && exit 1
-
-$MAKE clean
-$MAKE V=1 >stdout || { cat stdout; exit 1; }
-cat stdout
-grep 'GEN ' stdout && exit 1
-grep 'cp ' stdout
-grep 'echo ' stdout
-
-# Ensure that setting 'silent-rules' in a Makefile.am produces an error.
-echo 'AUTOMAKE_OPTIONS = silent-rules' >> Makefile.am
-AUTOMAKE_fails --force
-
-:
diff --git a/t/silent8.sh b/t/silent8.sh
deleted file mode 100755
index 76bf62c..0000000
--- a/t/silent8.sh
+++ /dev/null
@@ -1,66 +0,0 @@
-#!/bin/sh
-# Copyright (C) 2009-2012 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
-
-cat >>configure.ac <<'EOF'
-AM_SILENT_RULES
-AC_OUTPUT
-EOF
-
-cat > Makefile.am <<'EOF'
-info_TEXINFOS = foo.texi
-EOF
-
-cat > foo.texi <<'EOF'
-\input texinfo
address@hidden %**start of header
address@hidden foo.info
address@hidden foo manual
address@hidden %**end of header
address@hidden
-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
-
-:
diff --git a/t/silent9.sh b/t/silent9.sh
deleted file mode 100755
index 63441e9..0000000
--- a/t/silent9.sh
+++ /dev/null
@@ -1,87 +0,0 @@
-#!/bin/sh
-# Copyright (C) 2009-2012 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 libtool, nodep case.
-
-# Please keep this file in sync with 'silent3.sh' and 'silent4.sh'.
-
-required='cc libtoolize'
-. ./defs || exit 1
-
-mkdir sub
-
-cat >>configure.ac <<'EOF'
-AM_SILENT_RULES
-AC_CONFIG_FILES([sub/Makefile])
-AC_PROG_CC
-AM_PROG_CC_C_O
-AM_PROG_AR
-AC_PROG_LIBTOOL
-AC_OUTPUT
-EOF
-
-cat > Makefile.am <<'EOF'
-# Need generic and non-generic rules.
-lib_LTLIBRARIES = libfoo.la libbar.la
-libbar_la_CFLAGS = $(AM_CFLAGS)
-SUBDIRS = sub
-EOF
-
-cat > sub/Makefile.am <<'EOF'
-AUTOMAKE_OPTIONS = subdir-objects
-# Need generic and non-generic rules.
-lib_LTLIBRARIES = libbaz.la libbla.la
-libbla_la_CFLAGS = $(AM_CFLAGS)
-EOF
-
-cat > libfoo.c <<'EOF'
-int main ()
-{
-  return 0;
-}
-EOF
-cp libfoo.c libbar.c
-cp libfoo.c sub/libbaz.c
-cp libfoo.c sub/libbla.c
-
-libtoolize
-$ACLOCAL
-$AUTOMAKE --add-missing
-$AUTOCONF
-
-./configure --disable-dependency-tracking --enable-silent-rules
-$MAKE >stdout || { cat stdout; exit 1; }
-cat stdout
-$EGREP ' (-c|-o)' stdout && exit 1
-grep 'mv ' stdout && exit 1
-grep ' CC .*foo\.' stdout
-grep ' CC .*bar\.' stdout
-grep ' CC .*baz\.' stdout
-grep ' CC .*bla\.' stdout
-grep ' CCLD .*foo' stdout
-grep ' CCLD .*bar' stdout
-grep ' CCLD .*baz' stdout
-grep ' CCLD .*bla' stdout
-
-$MAKE clean
-$MAKE V=1 >stdout || { cat stdout; exit 1; }
-cat stdout
-grep ' -c' stdout
-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
-
-:
diff --git a/t/silentcxx-gcc.sh b/t/silentcxx-gcc.sh
deleted file mode 100755
index 1907e21..0000000
--- a/t/silentcxx-gcc.sh
+++ /dev/null
@@ -1,109 +0,0 @@
-#!/bin/sh
-# Copyright (C) 2010-2012 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 C++.
-# This test requires the GNU C++ compiler; keep it in sync with sister
-# test 'silentcxx.sh', which should work with generic compilers.
-
-required=g++
-. ./defs || exit 1
-
-mkdir sub
-
-cat >>configure.ac <<'EOF'
-AM_SILENT_RULES
-AC_PROG_CXX
-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.cpp baz.cxx quux.cc
-foo2_SOURCES = $(foo1_SOURCES)
-foo2_CXXFLAGS = $(AM_CXXFLAGS)
-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.cpp
-bar2_SOURCES = $(bar1_SOURCES)
-bar2_CXXFLAGS = $(AM_CXXFLAGS)
-EOF
-
-cat > foo.cpp <<'EOF'
-using namespace std; /* C compilers fail on this. */
-int main() { return 0; }
-EOF
-
-# Let's try out other extensions too.
-echo 'class Baz  { public: int i;  };' > baz.cxx
-echo 'class Quux { public: bool b; };' > quux.cc
-
-cp foo.cpp sub/bar.cpp
-
-$ACLOCAL
-$AUTOMAKE --add-missing
-$AUTOCONF
-
-# Sanity check: make sure the cache variable we force is really used
-# by configure.
-$FGREP am_cv_CXX_dependencies_compiler_type configure
-
-# Force gcc ("fast") depmode.
-# This apparently useless "for" loop is here to simplify the syncing
-# with sister test 'silentcxx.sh'.
-for config_args in \
-  am_cv_CXX_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
-  grep 'mv ' stdout && exit 1
-
-  grep 'CXX .*foo\.'  stdout
-  grep 'CXX .*baz\.'  stdout
-  grep 'CXX .*quux\.' stdout
-  grep 'CXX .*bar\.'  stdout
-  grep 'CXXLD .*foo1' stdout
-  grep 'CXXLD .*bar1' stdout
-  grep 'CXXLD .*foo2' stdout
-  grep 'CXXLD .*bar2' stdout
-
-  # Ensure a clean rebuild.
-  $MAKE clean
-
-  $MAKE V=1 >stdout || { cat stdout; exit 1; }
-  cat stdout
-
-  grep ' -c ' stdout
-  grep ' -o ' stdout
-
-  $EGREP '(CC|CXX|LD) ' stdout && exit 1
-
-  # Ensure a clean reconfiguration/rebuild.
-  $MAKE clean
-  $MAKE maintainer-clean
-
-done
-
-:
diff --git a/t/silentcxx.sh b/t/silentcxx.sh
deleted file mode 100755
index 1cb9f26..0000000
--- a/t/silentcxx.sh
+++ /dev/null
@@ -1,110 +0,0 @@
-#!/bin/sh
-# Copyright (C) 2010-2012 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 C++.
-# This test should work with generic C++ compilers; keep it in sync with
-# sister test 'silentcxx-gcc.sh', which requires the GNU C++ compiler
-# and forces the use of gcc depmode.
-
-required=c++
-. ./defs || exit 1
-
-mkdir sub
-
-cat >>configure.ac <<'EOF'
-AM_SILENT_RULES
-AC_PROG_CXX
-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.cpp baz.cxx quux.cc
-foo2_SOURCES = $(foo1_SOURCES)
-foo2_CXXFLAGS = $(AM_CXXFLAGS)
-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.cpp
-bar2_SOURCES = $(bar1_SOURCES)
-bar2_CXXFLAGS = $(AM_CXXFLAGS)
-EOF
-
-cat > foo.cpp <<'EOF'
-using namespace std; /* C compilers fail on this. */
-int main (void) { return 0; }
-EOF
-
-# Let's try out other extensions too.
-echo 'class Baz  { public: int i;  };' > baz.cxx
-echo 'class Quux { public: bool b; };' > quux.cc
-
-cp foo.cpp sub/bar.cpp
-
-$ACLOCAL
-$AUTOMAKE --add-missing
-$AUTOCONF
-
-# Sanity check: make sure the cache variable we force is really used
-# by configure.
-$FGREP am_cv_CXX_dependencies_compiler_type configure
-
-# Force dependency tracking explicitly, so that slow dependency
-# extractors are not rejected.  Try also with dependency tracking
-# explicitly disabled.
-for config_args in \
-  --enable-dependency-tracking --disable-dependency-tracking
-do
-  ./configure $config_args --enable-silent-rules
-  $MAKE >stdout || { cat stdout; exit 1; }
-  cat stdout
-
-  $EGREP ' (-c|-o)' stdout && exit 1
-  grep 'mv ' stdout && exit 1
-
-  grep 'CXX .*foo\.'  stdout
-  grep 'CXX .*baz\.'  stdout
-  grep 'CXX .*quux\.' stdout
-  grep 'CXX .*bar\.'  stdout
-  grep 'CXXLD .*foo1' stdout
-  grep 'CXXLD .*bar1' stdout
-  grep 'CXXLD .*foo2' stdout
-  grep 'CXXLD .*bar2' stdout
-
-  # Ensure a clean rebuild.
-  $MAKE clean
-
-  $MAKE V=1 >stdout || { cat stdout; exit 1; }
-  cat stdout
-
-  grep ' -c ' stdout
-  grep ' -o ' stdout
-
-  $EGREP '(CXX|LD) ' stdout && exit 1
-
-  # Ensure a clean reconfiguration/rebuild.
-  $MAKE clean
-  $MAKE maintainer-clean
-
-done
-
-:
diff --git a/t/silentf77.sh b/t/silentf77.sh
deleted file mode 100755
index 580ec6d..0000000
--- a/t/silentf77.sh
+++ /dev/null
@@ -1,92 +0,0 @@
-#!/bin/sh
-# Copyright (C) 2010-2012 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 Fortran 77.
-# Keep this ins sync with the sister test 'silentf90.sh'.
-
-required=fortran77
-. ./defs || exit 1
-
-mkdir sub
-
-cat >>configure.ac <<'EOF'
-AM_SILENT_RULES
-AC_PROG_F77
-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.f
-foo2_SOURCES = $(foo1_SOURCES)
-foo2_FFLAGS = $(AM_FFLAGS)
-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.f
-bar2_SOURCES = $(bar1_SOURCES)
-bar2_FFLAGS = $(AM_FFLAGS)
-EOF
-
-cat > foo.f <<'EOF'
-      program foo
-      stop
-      end
-EOF
-cp foo.f sub/bar.f
-
-$ACLOCAL
-$AUTOMAKE --add-missing
-$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
-
-grep 'F77 .*foo\.'  stdout
-grep 'F77 .*bar\.'  stdout
-grep 'F77LD .*foo1' stdout
-grep 'F77LD .*bar1' stdout
-grep 'F77LD .*foo2' stdout
-grep 'F77LD .*bar2' stdout
-
-$EGREP '(FC|FCLD) ' stdout && exit 1
-
-# Ensure a clean rebuild.
-$MAKE clean
-
-$MAKE V=1 >stdout || { cat stdout; exit 1; }
-cat stdout
-
-grep ' -c ' stdout
-grep ' -o ' stdout
-
-$EGREP '(F77|FC|LD) ' stdout && exit 1
-
-:
diff --git a/t/silentf90.sh b/t/silentf90.sh
deleted file mode 100755
index fb422fd..0000000
--- a/t/silentf90.sh
+++ /dev/null
@@ -1,92 +0,0 @@
-#!/bin/sh
-# Copyright (C) 2010-2012 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 Fortran 90.
-# Keep this ins sync with the sister test 'silentf77.sh'.
-
-required=fortran
-. ./defs || exit 1
-
-mkdir sub
-
-cat >>configure.ac <<'EOF'
-AM_SILENT_RULES
-AC_PROG_FC
-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.f90
-foo2_SOURCES = $(foo1_SOURCES)
-foo2_FCFLAGS = $(AM_FCLAGS)
-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.f90
-bar2_SOURCES = $(bar1_SOURCES)
-bar2_FCFLAGS = $(AM_FCLAGS)
-EOF
-
-cat > foo.f90 <<'EOF'
-      program foo
-      stop
-      end
-EOF
-cp foo.f90 sub/bar.f90
-
-$ACLOCAL
-$AUTOMAKE --add-missing
-$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
-
-grep 'FC .*foo\.'  stdout
-grep 'FC .*bar\.'  stdout
-grep 'FCLD .*foo1' stdout
-grep 'FCLD .*bar1' stdout
-grep 'FCLD .*foo2' stdout
-grep 'FCLD .*bar2' stdout
-
-$EGREP '(F77|F77LD) ' stdout && exit 1
-
-# Ensure a clean rebuild.
-$MAKE clean
-
-$MAKE V=1 >stdout || { cat stdout; exit 1; }
-cat stdout
-
-grep ' -c ' stdout
-grep ' -o ' stdout
-
-$EGREP '(F77|FC|LD) ' stdout && exit 1
-
-:
diff --git a/t/sourcefile-in-subdir.sh b/t/sourcefile-in-subdir.sh
index 831300e..66fe9b7 100755
--- a/t/sourcefile-in-subdir.sh
+++ b/t/sourcefile-in-subdir.sh
@@ -16,7 +16,7 @@
 
 # Test to make sure subdir source file generates explicit dependency.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am << 'END'
 bin_PROGRAMS = zardoz widdershins
diff --git a/t/space.sh b/t/space.sh
index 96bf9ba..21cffd2 100755
--- a/t/space.sh
+++ b/t/space.sh
@@ -16,7 +16,7 @@
 
 # Test leading space on macro assignment.
 
-. ./defs || exit 1
+. test-init.sh
 
 echo AC_PROG_CC >> configure.ac
 
diff --git a/t/specflg-dummy.sh b/t/specflg-dummy.sh
index 28d576c..e0611bc 100755
--- a/t/specflg-dummy.sh
+++ b/t/specflg-dummy.sh
@@ -20,7 +20,7 @@
 # even if AM_CFLAGS is undefined. Similarly for other *FLAGS variables
 # (CXXFLAGS, YFLAGS, LDFLAGS, ...)
 
-. ./defs || exit 1
+. test-init.sh
 
 # Disable shell globbing if possible.
 (set +f) >/dev/null 2>&1 && set +f
diff --git a/t/specflg6.sh b/t/specflg6.sh
index 958e887..791d9f7 100755
--- a/t/specflg6.sh
+++ b/t/specflg6.sh
@@ -18,7 +18,7 @@
 # conditionals are present.
 # From Richard Boulton.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/specflg7.sh b/t/specflg7.sh
index 7261d18..0572040 100755
--- a/t/specflg7.sh
+++ b/t/specflg7.sh
@@ -17,7 +17,7 @@
 # The true/false example from the manual, plus a check for _SHORTNAME.
 
 required='cc native'
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/specflg8.sh b/t/specflg8.sh
index 598970a..be7cf45 100755
--- a/t/specflg8.sh
+++ b/t/specflg8.sh
@@ -19,7 +19,7 @@
 # use of _CPPFLAGS (PR/337).
 
 required='cc native'
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/specflg9.sh b/t/specflg9.sh
index c8cde9e..4292629 100755
--- a/t/specflg9.sh
+++ b/t/specflg9.sh
@@ -16,7 +16,7 @@
 
 # Another check for per-target flag substitutions.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/spell.sh b/t/spell.sh
index 18abba2..3bed9b1 100755
--- a/t/spell.sh
+++ b/t/spell.sh
@@ -16,7 +16,7 @@
 
 # Test to make sure misspellings in _SOURCES variables cause failure.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am << 'END'
 bin_PROGRAMS = zardoz foo
diff --git a/t/spell2.sh b/t/spell2.sh
index c468b2b..98550af 100755
--- a/t/spell2.sh
+++ b/t/spell2.sh
@@ -16,7 +16,7 @@
 
 # Test to make sure misspellings in _SOURCES variables cause failure.
 
-. ./defs || exit 1
+. test-init.sh
 
 echo AC_PROG_CC >> configure.ac
 
diff --git a/t/spell3.sh b/t/spell3.sh
index c12703b..4d20930 100755
--- a/t/spell3.sh
+++ b/t/spell3.sh
@@ -17,7 +17,7 @@
 # Test to make sure some internal _DEPENDENCIES variables don't cause
 # errors.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am << 'END'
 TAGS_DEPENDENCIES = joe
diff --git a/t/spelling.sh b/t/spelling.sh
index f6f99eb..94cce09 100755
--- a/t/spelling.sh
+++ b/t/spelling.sh
@@ -16,7 +16,7 @@
 
 # Test to make sure that misspelled prefixes actually cause error.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am << 'EOF'
 bni_PROGRAMS = zot
diff --git a/t/spy-rm.tap b/t/spy-rm.tap
index f279745..0a2e512 100755
--- a/t/spy-rm.tap
+++ b/t/spy-rm.tap
@@ -25,7 +25,7 @@
 #  <http://austingroupbugs.net/view.php?id=542>
 
 am_create_testdir=empty
-. ./defs || exit 1
+. test-init.sh
 
 plan_ 10
 
diff --git a/t/spy.sh b/t/spy.sh
index a23772d..641627a 100755
--- a/t/spy.sh
+++ b/t/spy.sh
@@ -67,7 +67,7 @@
 # So it seems only non-overlapping ::-rule may be portable.  This is
 # what we check now.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >Makefile <<\EOF
 a :: b
diff --git a/t/src-acsubst.sh b/t/src-acsubst.sh
index 13531ac..5772cb2 100755
--- a/t/src-acsubst.sh
+++ b/t/src-acsubst.sh
@@ -16,7 +16,7 @@
 
 # Test to make sure config substitution in _SOURCES fails.
 
-. ./defs || exit 1
+. test-init.sh
 
 echo AC_PROG_CC >> configure.ac
 
diff --git a/t/stamph2.sh b/t/stamph2.sh
index a6f5895..7860e72 100755
--- a/t/stamph2.sh
+++ b/t/stamph2.sh
@@ -15,13 +15,12 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # Make sure stamp-h* files are created where we expect
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << END
-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([1.h
+                   2.h:config.hin
+                   3.h:sdir1/config1.hin])
 AC_CONFIG_HEADERS([sdir1/4.h
                    sdir1/5.h:config.hin
                    sdir1/6.h:sdir1/config1.hin
diff --git a/t/stdinc.sh b/t/stdinc.sh
index d030e64..21c66b8 100755
--- a/t/stdinc.sh
+++ b/t/stdinc.sh
@@ -18,7 +18,7 @@
 # Report by Kent Boortz.
 
 required=cc
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/stdlib.sh b/t/stdlib.sh
index b3f458a..59177fc 100755
--- a/t/stdlib.sh
+++ b/t/stdlib.sh
@@ -16,7 +16,7 @@
 
 # Test "not a standard library" error.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/stdlib2.sh b/t/stdlib2.sh
index 6cce916..f79353c 100755
--- a/t/stdlib2.sh
+++ b/t/stdlib2.sh
@@ -17,7 +17,7 @@
 # Check for AM_LDFLAGS = -module
 # Report from Kevin P. Fleming.
 required=libtool
-. ./defs || exit 1
+. test-init.sh
 
 : > README
 : > NEWS
diff --git a/t/strictness-override.sh b/t/strictness-override.sh
index 27e44dd..f3028db 100755
--- a/t/strictness-override.sh
+++ b/t/strictness-override.sh
@@ -21,7 +21,7 @@
 # been in place for quite a long time); see also Automake bug #7673.
 # Update this test if the semantics are changed.
 
-. ./defs || exit 1
+. test-init.sh
 
 # We want complete control over automake options.
 AUTOMAKE=$am_original_AUTOMAKE
diff --git a/t/strictness-precedence.sh b/t/strictness-precedence.sh
index ab70ee3..d56cf5f 100755
--- a/t/strictness-precedence.sh
+++ b/t/strictness-precedence.sh
@@ -18,7 +18,7 @@
 # strictness specified later should take precedence over strictness
 # specified earlier.
 
-. ./defs || exit 1
+. test-init.sh
 
 # We want complete control over automake options.
 AUTOMAKE=$am_original_AUTOMAKE
diff --git a/t/strip.sh b/t/strip.sh
index 6170627..338d5bb 100755
--- a/t/strip.sh
+++ b/t/strip.sh
@@ -17,7 +17,7 @@
 # Test for install-strip.
 
 required=cc
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/strip2.sh b/t/strip2.sh
index 2397545..c18b517 100755
--- a/t/strip2.sh
+++ b/t/strip2.sh
@@ -18,7 +18,7 @@
 # This test needs GNU binutils strip.  See sister test 'strip3.sh'.
 
 required='cc strip'
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/strip3.sh b/t/strip3.sh
index 543449d..5c3121f 100755
--- a/t/strip3.sh
+++ b/t/strip3.sh
@@ -19,7 +19,7 @@
 # test 'strip2.sh'.
 
 required='cc libtoolize strip'
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/subdir-ac-subst.sh b/t/subdir-ac-subst.sh
index a8deb17..37f5899 100755
--- a/t/subdir-ac-subst.sh
+++ b/t/subdir-ac-subst.sh
@@ -18,7 +18,7 @@
 # SUBDIRS + AC_SUBST setup from the manual.
 # Lots of lines here are duplicated in 'subcond-am-cond.sh'.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac <<'END'
 if test "$want_opt" = yes; then
diff --git a/t/subdir-add-pr46.sh b/t/subdir-add-pr46.sh
index 66ecfda..750ae80 100755
--- a/t/subdir-add-pr46.sh
+++ b/t/subdir-add-pr46.sh
@@ -19,7 +19,7 @@
 # test 'subdir-add2-pr46.sh' do it from a subdirectory.
 # PR automake/46
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_OUTPUT
diff --git a/t/subdir-add2-pr46.sh b/t/subdir-add2-pr46.sh
index 7fa51b9..bfe7e9c 100755
--- a/t/subdir-add2-pr46.sh
+++ b/t/subdir-add2-pr46.sh
@@ -19,9 +19,10 @@
 # it works when make is run from the top-level directory.
 # PR automake/46
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
+AC_CONFIG_MACRO_DIR([m4])
 m4_include([confiles.m4])
 MORE_DEFS
 AC_OUTPUT
@@ -31,7 +32,6 @@ echo 'AC_CONFIG_FILES([sub/Makefile])' > confiles.m4
 
 cat > Makefile.am << 'END'
 SUBDIRS = sub
-ACLOCAL_AMFLAGS = -I m4
 END
 
 mkdir sub
@@ -41,7 +41,7 @@ mkdir sub
 mkdir m4
 echo 'AC_DEFUN([MORE_DEFS], [])' > m4/moredefs.m4
 
-$ACLOCAL -I m4
+$ACLOCAL
 $AUTOCONF
 $AUTOMAKE
 ./configure
diff --git a/t/subdir-am-cond.sh b/t/subdir-am-cond.sh
index cb55ffb..28868bf 100755
--- a/t/subdir-am-cond.sh
+++ b/t/subdir-am-cond.sh
@@ -18,7 +18,7 @@
 # SUBDIRS + AM_CONDITIONAL setup from the manual.
 # Lots of lines here are duplicated in 'subdir-ac-subst.sh'.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac <<'END'
 AM_CONDITIONAL([COND_OPT], [test "$want_opt" = yes])
diff --git a/t/subdir-cond-err.sh b/t/subdir-cond-err.sh
index 4eba4f8..da0ab56 100755
--- a/t/subdir-cond-err.sh
+++ b/t/subdir-cond-err.sh
@@ -16,7 +16,7 @@
 
 # Check SUBDIRS set based on conditionals.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AM_CONDITIONAL([TEST], [true])
diff --git a/t/subdir-cond-gettext.sh b/t/subdir-cond-gettext.sh
index f933f77..4cc48e5 100755
--- a/t/subdir-cond-gettext.sh
+++ b/t/subdir-cond-gettext.sh
@@ -17,7 +17,7 @@
 # It is ok to have a conditional SUBDIRS when using gettext.
 
 required=gettext
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AM_GNU_GETTEXT
diff --git a/t/subdir-distclean.sh b/t/subdir-distclean.sh
index 25274fd..4b005e8 100755
--- a/t/subdir-distclean.sh
+++ b/t/subdir-distclean.sh
@@ -17,7 +17,7 @@
 # Check that "./configure && make && make distclean" is actually a
 # no-op, even when conditional SUBDIRS are involved.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_CONFIG_FILES([sub1/Makefile sub2/Makefile sub1/subsub/Makefile])
diff --git a/t/subdir-env-interference.sh b/t/subdir-env-interference.sh
index 396aecc..8c3dc58 100755
--- a/t/subdir-env-interference.sh
+++ b/t/subdir-env-interference.sh
@@ -16,7 +16,7 @@
 
 # SUDBIRS with $fail set in the environment.
 
-. ./defs || exit 1
+. test-init.sh
 
 mkdir sub
 
diff --git a/t/subdir-order.sh b/t/subdir-order.sh
index 0ce19d9..1b6ee9d 100755
--- a/t/subdir-order.sh
+++ b/t/subdir-order.sh
@@ -16,7 +16,7 @@
 
 # The $(SUDBIRS) entries are processed in the order they are specified.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_CONFIG_FILES([
diff --git a/t/subdir-subsub.sh b/t/subdir-subsub.sh
index b8389dd..6925ea7 100755
--- a/t/subdir-subsub.sh
+++ b/t/subdir-subsub.sh
@@ -16,7 +16,7 @@
 
 # Test to make sure sub-sub-dirs work correctly.
 
-. ./defs || exit 1
+. test-init.sh
 
 mkdir one
 mkdir one/two
diff --git a/t/subdir-with-slash.sh b/t/subdir-with-slash.sh
index 0a3330b..1063589 100755
--- a/t/subdir-with-slash.sh
+++ b/t/subdir-with-slash.sh
@@ -16,7 +16,7 @@
 
 # Test SUDBIRS with '/' in them.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_CONFIG_FILES([src/subdir/Makefile src/subdir2/Makefile])
diff --git a/t/subdir.sh b/t/subdir.sh
index 249481a..e871999 100755
--- a/t/subdir.sh
+++ b/t/subdir.sh
@@ -17,7 +17,7 @@
 # Test to make sure install-sh and mkinstalldirs correctly found in
 # subdirs.
 
-. ./defs || exit 1
+. test-init.sh
 
 mkdir zot
 
diff --git a/t/subobj-clean-lt-pr10697.sh b/t/subobj-clean-lt-pr10697.sh
index 6cbc021..b02a6a4 100755
--- a/t/subobj-clean-lt-pr10697.sh
+++ b/t/subobj-clean-lt-pr10697.sh
@@ -22,7 +22,7 @@
 # 'subobj-clean-pr10697.sh', which deals with the non-libtool case.
 
 required='cc libtoolize'
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AM_PROG_AR
diff --git a/t/subobj-clean-pr10697.sh b/t/subobj-clean-pr10697.sh
index e7be1c5..9fdc786 100755
--- a/t/subobj-clean-pr10697.sh
+++ b/t/subobj-clean-pr10697.sh
@@ -22,7 +22,7 @@
 # 'subobj-clean-lt-pr10697.sh', which deals with the libtool case.
 
 required=cc
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/subobj.sh b/t/subobj.sh
index 7ac839b..19b1311 100755
--- a/t/subobj.sh
+++ b/t/subobj.sh
@@ -16,7 +16,7 @@
 
 # Test of subdir objects with C.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/subobj10.sh b/t/subobj10.sh
index cefb0ab..68f0e32 100755
--- a/t/subobj10.sh
+++ b/t/subobj10.sh
@@ -17,7 +17,7 @@
 # PR 492: Test asm subdir-objects.
 
 required=gcc
-. ./defs || exit 1
+. test-init.sh
 
 cat > configure.ac << END
 AC_INIT([$me], [1.0])
diff --git a/t/subobj11a.sh b/t/subobj11a.sh
index 25bdb93..4bd8863 100755
--- a/t/subobj11a.sh
+++ b/t/subobj11a.sh
@@ -27,7 +27,7 @@
 # 'subobj11c.sh'.
 
 required=cc
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/subobj11b.sh b/t/subobj11b.sh
index 6d539c2..89f878b 100755
--- a/t/subobj11b.sh
+++ b/t/subobj11b.sh
@@ -26,7 +26,7 @@
 # See also "semantic" sister test 'subobj11a.sh', and related test
 # 'subobj11c.sh'.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/subobj11c.sh b/t/subobj11c.sh
index ce33e30..20119e1 100755
--- a/t/subobj11c.sh
+++ b/t/subobj11c.sh
@@ -19,7 +19,7 @@
 # included makefile fragments (containing dependency info).
 # See also related tests 'subobj11a.sh' and 'subobj11b.sh'.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/subobj2.sh b/t/subobj2.sh
index 646c6cf..d0b05fe 100755
--- a/t/subobj2.sh
+++ b/t/subobj2.sh
@@ -16,7 +16,7 @@
 
 # Test of subdir objects with C++.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CXX
diff --git a/t/subobj4.sh b/t/subobj4.sh
index 4399eef..4fb227f 100755
--- a/t/subobj4.sh
+++ b/t/subobj4.sh
@@ -17,7 +17,7 @@
 # Make sure '../foo/foo.cpp' generates a rule.
 # Report from Dave Brolley.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/subobj5.sh b/t/subobj5.sh
index 6736cb1..b056374 100755
--- a/t/subobj5.sh
+++ b/t/subobj5.sh
@@ -18,7 +18,7 @@
 # From Robert Collins.
 
 required=cc
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_CONFIG_FILES([generic/Makefile])
diff --git a/t/subobj6.sh b/t/subobj6.sh
index cf265f7..67a0548 100755
--- a/t/subobj6.sh
+++ b/t/subobj6.sh
@@ -18,7 +18,7 @@
 # From Robert Collins.
 
 required=cc
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AM_PROG_CC_C_O
diff --git a/t/subobj7.sh b/t/subobj7.sh
index 1ce58ae..4e95b4c 100755
--- a/t/subobj7.sh
+++ b/t/subobj7.sh
@@ -17,7 +17,7 @@
 # Test to make sure AM_CFLAGS appears in subdir compilation rule.
 # Report from Steve M. Robbins.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/subobj8.sh b/t/subobj8.sh
index 58b1e41..fe0d0c8 100755
--- a/t/subobj8.sh
+++ b/t/subobj8.sh
@@ -16,7 +16,7 @@
 
 # Make sure 'compile' is included when subdir-objects is used in a subdir.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > configure.ac << END
 AC_INIT([$me], [1.0])
diff --git a/t/subobj9.sh b/t/subobj9.sh
index 2d8f8fb..6967576 100755
--- a/t/subobj9.sh
+++ b/t/subobj9.sh
@@ -23,7 +23,7 @@
 # forgets '.../<file>.o'.
 
 required='c++ libtoolize'
-. ./defs || exit 1
+. test-init.sh
 
 cat > configure.ac << END
 AC_INIT([$me], [1.0])
diff --git a/t/subobjname.sh b/t/subobjname.sh
index 7601664..36cb4d6 100755
--- a/t/subobjname.sh
+++ b/t/subobjname.sh
@@ -18,7 +18,7 @@
 # combinational explosion.  (This test is named after the &subobjname
 # sub in Automake).
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/subpkg-macrodir.sh b/t/subpkg-macrodir.sh
new file mode 100755
index 0000000..189df06
--- /dev/null
+++ b/t/subpkg-macrodir.sh
@@ -0,0 +1,85 @@
+#! /bin/sh
+# Copyright (C) 2002-2012 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/>.
+
+# Subpackages that want to use m4 macros from their superpackages,
+# with AC_CONFIG_MACRO_DIRS.
+
+. test-init.sh
+
+cat > configure.ac <<'END'
+AC_INIT([super], [1.0])
+AM_INIT_AUTOMAKE
+AC_CONFIG_MACRO_DIR([m4])
+AC_CONFIG_SUBDIRS([pkg])
+AX_BAR
+AX_FOO
+END
+
+mkdir m4
+
+cat > m4/foo.m4 <<'EOF'
+AC_DEFUN([AX_FOO], [
+  AC_CONFIG_FILES([Makefile])
+  AC_OUTPUT
+])
+EOF
+
+cat > m4/bar.m4 <<'EOF'
+AC_DEFUN([AX_BAR], [AC_SUBST([WHOAMI], [SuperPkg])])
+EOF
+
+cat > Makefile.am << 'END'
+test-whoami:
+       test '$(WHOAMI)' = SuperPkg
+check-local: test-whoami
+END
+
+mkdir pkg
+
+cat > pkg/configure.ac <<'END'
+AC_INIT([super], [1.0])
+AM_INIT_AUTOMAKE
+AC_CONFIG_MACRO_DIRS([macros ../m4])
+AX_BAR
+AX_FOO
+END
+
+mkdir pkg/macros
+cat > pkg/macros/zardoz.m4 << 'END'
+AC_DEFUN([AX_BAR], [AC_SUBST([WHOAMI], [sub-pkg])])
+END
+
+cat > pkg/Makefile.am << 'END'
+test-whoami:
+       test '$(WHOAMI)' = sub-pkg
+check-local: test-whomai
+END
+
+AUTOMAKE=$AUTOMAKE ACLOCAL=$ACLOCAL AUTOCONF=$AUTOCONF $AUTORECONF -vi
+
+$FGREP 'm4_include([m4/foo.m4])' aclocal.m4
+$FGREP 'm4_include([m4/bar.m4])' aclocal.m4
+$FGREP 'm4_include([../m4/foo.m4])' pkg/aclocal.m4
+$FGREP 'm4_include([macros/zardoz.m4])' pkg/aclocal.m4
+
+./configure
+
+$MAKE test-whoami
+(cd pkg && $MAKE test-whoami) || exit 1
+
+$MAKE distcheck
+
+:
diff --git a/t/subpkg-yacc.sh b/t/subpkg-yacc.sh
index 0ce1a7c..f05396f 100755
--- a/t/subpkg-yacc.sh
+++ b/t/subpkg-yacc.sh
@@ -18,7 +18,7 @@
 # properly, when a subpackage is involved.
 
 required='cc yacc'
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac <<'END'
 AC_PROG_CC
diff --git a/t/subpkg.sh b/t/subpkg.sh
index c8ce125..6944535 100755
--- a/t/subpkg.sh
+++ b/t/subpkg.sh
@@ -17,7 +17,7 @@
 # Check subpackage handling.
 
 required=cc
-. ./defs || exit 1
+. test-init.sh
 
 mkdir m4
 
@@ -29,6 +29,7 @@ AC_DEFUN([FOO],[
 EOF
 
 cat >>configure.ac <<'END'
+AC_CONFIG_MACRO_DIR([m4])
 AC_CONFIG_SUBDIRS([lib])
 FOO
 END
@@ -46,8 +47,6 @@ distdir = subpack-1
 dist-hook:
        test -f $(distdir)/LDADD.c
        test -f $(top_distdir)/LDADD.c
-
-ACLOCAL_AMFLAGS = -I m4
 EOF
 
 cat >LDADD.c <<'EOF'
@@ -64,6 +63,7 @@ mkdir lib/src
 cat >lib/configure.ac <<'EOF'
 AC_INIT([lib], [2.3])
 AM_INIT_AUTOMAKE
+AC_CONFIG_MACRO_DIR([../m4])
 AM_PROG_AR
 AC_PROG_RANLIB
 AC_CONFIG_HEADERS([config.h:config.hin])
@@ -80,8 +80,6 @@ dist-hook:
        test -f $(top_distdir)/LDADD.c
        test -f $(distdir)/src/x.c
        test ! -f $(top_distdir)/src/x.c
-
-ACLOCAL_AMFLAGS = -I ../m4
 EOF
 
 cat >lib/src/x.c <<'EOF'
@@ -92,12 +90,12 @@ int lib (void)
 }
 EOF
 
-$ACLOCAL -I m4
+$ACLOCAL
 $AUTOCONF
 $AUTOMAKE -Wno-override
 
 cd lib
-$ACLOCAL -I ../m4
+$ACLOCAL
 $FGREP 'm4_include([../m4/foo.m4])' aclocal.m4
 $AUTOCONF
 $AUTOHEADER
diff --git a/t/subpkg2.sh b/t/subpkg2.sh
index 8afcc5a..2914fdc 100755
--- a/t/subpkg2.sh
+++ b/t/subpkg2.sh
@@ -17,7 +17,7 @@
 # Try a DIST_SUBDIRS subpackage with no SUBDIRS.
 # Report from Gary V. Vaughan.
 
-. ./defs || exit 1
+. test-init.sh
 
 mkdir m4
 
@@ -28,6 +28,7 @@ AC_DEFUN([FOO],[
 EOF
 
 cat >>configure.ac <<'END'
+AC_CONFIG_MACRO_DIR([m4])
 AC_CONFIG_SUBDIRS([sub])
 AC_OUTPUT
 END
@@ -43,20 +44,21 @@ mkdir sub
 cat >sub/configure.ac <<'EOF'
 AC_INIT([sub], [2.3])
 AM_INIT_AUTOMAKE
+AC_CONFIG_MACRO_DIR([../m4])
 AC_CONFIG_FILES([Makefile])
 AC_CONFIG_FILES([script])
 FOO
 EOF
 
 : >sub/script.in
-echo ACLOCAL_AMFLAGS = -I ../m4 > sub/Makefile.am
+: >sub/Makefile.am
 
-$ACLOCAL -I m4
+$ACLOCAL
 $AUTOCONF
 $AUTOMAKE
 
 cd sub
-$ACLOCAL -I ../m4
+$ACLOCAL
 $FGREP 'm4_include([../m4/foo.m4])' aclocal.m4
 $AUTOCONF
 $AUTOMAKE -Wno-override
@@ -64,3 +66,5 @@ cd ..
 
 ./configure
 $MAKE distcheck
+
+:
diff --git a/t/subpkg3.sh b/t/subpkg3.sh
index 6ebc4bd..5f89b91 100755
--- a/t/subpkg3.sh
+++ b/t/subpkg3.sh
@@ -16,7 +16,7 @@
 
 # Make sure different subpackages may share files and directories.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >Makefile.am <<'END'
 SUBDIRS = subpkg
diff --git a/t/subpkg4.sh b/t/subpkg4.sh
index 97f452c..d4ac46d 100755
--- a/t/subpkg4.sh
+++ b/t/subpkg4.sh
@@ -17,7 +17,7 @@
 # Test to ensure 'distdir' fixes the mode of files and directories
 # copied into '$(distdir)', even with sub-packages.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >Makefile.am <<'END'
 SUBDIRS = subpkg
diff --git a/t/subst-no-trailing-empty-line.sh 
b/t/subst-no-trailing-empty-line.sh
index 388f297..f9a9c5b 100755
--- a/t/subst-no-trailing-empty-line.sh
+++ b/t/subst-no-trailing-empty-line.sh
@@ -21,7 +21,7 @@
 # These checks have been introduced in commit 'Release-1-9-254-g9d0eaef'
 # into the former test 'subst2.test'.
 
-. ./defs || exit 1
+. test-init.sh
 
 # These are deliberately quite long, so that the xxx_PROGRAMS definition
 # in Makefile.am below will be split on multiple lines, with the last
diff --git a/t/subst.sh b/t/subst.sh
index db83d73..a6010e4 100755
--- a/t/subst.sh
+++ b/t/subst.sh
@@ -17,7 +17,7 @@
 # Test that AC_SUBST($1) does something sensible.  From Ulrich
 # Drepper.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 dnl This test used to have the following lines, which cannot have
diff --git a/t/subst3.sh b/t/subst3.sh
index 18c17e2..475027b 100755
--- a/t/subst3.sh
+++ b/t/subst3.sh
@@ -18,7 +18,7 @@
 # 'nobase.sh'.
 
 required=cc
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac <<'EOF'
 AC_PROG_CC
diff --git a/t/subst4.sh b/t/subst4.sh
index 739b368..91066e8 100755
--- a/t/subst4.sh
+++ b/t/subst4.sh
@@ -16,7 +16,7 @@
 
 # Test AM_SUBST_NOTMAKE.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac <<'EOF'
 myrule="\
diff --git a/t/subst5.sh b/t/subst5.sh
index f44b851..636d188 100755
--- a/t/subst5.sh
+++ b/t/subst5.sh
@@ -19,7 +19,7 @@
 # Thus, we allow substitutions in bin_PROGRAMS, but then EXTRA_PROGRAMS
 # needs to list possible values of that substitution, literally.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac <<'END'
 AC_PROG_CC
diff --git a/t/substre2.sh b/t/substre2.sh
index 06fcdf1..dd23e00 100755
--- a/t/substre2.sh
+++ b/t/substre2.sh
@@ -17,7 +17,7 @@
 # Test for bug in variable substitution references, where
 # undefined variables break later substitutions.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_SUBST([CC], [whocares])
diff --git a/t/substref.sh b/t/substref.sh
index 4ea39e6..81aa175 100755
--- a/t/substref.sh
+++ b/t/substref.sh
@@ -18,7 +18,7 @@
 # pattern is null.
 # Report from Richard Boulton.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_SUBST([CC], [whocares])
diff --git a/t/substtarg.sh b/t/substtarg.sh
index 757885c..75e19fb 100755
--- a/t/substtarg.sh
+++ b/t/substtarg.sh
@@ -17,7 +17,7 @@
 # Test that substitutions in variables work.
 # From Lars J. Aas.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_CONFIG_SOURCE([fakelib.c])
diff --git a/t/suffix-chain.tap b/t/suffix-chain.tap
index 535e36e..20656db 100755
--- a/t/suffix-chain.tap
+++ b/t/suffix-chain.tap
@@ -19,7 +19,7 @@
 # See automake bug#7824 and bug#7670.
 
 required=cc
-. ./defs || exit 1
+. test-init.sh
 
 plan_ 8
 
diff --git a/t/suffix-custom-subobj-and-specflg.sh 
b/t/suffix-custom-subobj-and-specflg.sh
index bcdbc9a..15aa56a 100755
--- a/t/suffix-custom-subobj-and-specflg.sh
+++ b/t/suffix-custom-subobj-and-specflg.sh
@@ -19,7 +19,7 @@
 # Reported by Florian Briegel.
 
 required=cc
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac <<EOF
 AC_PROG_CC
diff --git a/t/suffix-custom-subobj.sh b/t/suffix-custom-subobj.sh
index 22ec985..ae49151 100755
--- a/t/suffix-custom-subobj.sh
+++ b/t/suffix-custom-subobj.sh
@@ -18,7 +18,7 @@
 # Reported by John Ratliff.
 
 required=cc
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac <<EOF
 AC_PROG_CC
diff --git a/t/suffix.sh b/t/suffix.sh
index cf7ea10..64100df 100755
--- a/t/suffix.sh
+++ b/t/suffix.sh
@@ -18,7 +18,7 @@
 # only once.
 # See also related test 'suffix2.sh'.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/suffix10.tap b/t/suffix10.tap
index 7e19e04..1f83590 100755
--- a/t/suffix10.tap
+++ b/t/suffix10.tap
@@ -18,7 +18,7 @@
 # (related to PR/37)
 
 required='cc libtoolize yacc'
-. ./defs || exit 1
+. test-init.sh
 
 plan_ 7
 
diff --git a/t/suffix11.tap b/t/suffix11.tap
index 26694eb..61fbb51 100755
--- a/t/suffix11.tap
+++ b/t/suffix11.tap
@@ -19,7 +19,7 @@
 # We also check for suffixes containing '-'.
 
 required=cc
-. ./defs || exit 1
+. test-init.sh
 
 plan_ 10
 
diff --git a/t/suffix2.sh b/t/suffix2.sh
index 1cee875..9fc8f2b 100755
--- a/t/suffix2.sh
+++ b/t/suffix2.sh
@@ -19,7 +19,7 @@
 # See also related test 'suffix.sh'.
 required=libtoolize
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/suffix3.tap b/t/suffix3.tap
index 15c562d..166788b 100755
--- a/t/suffix3.tap
+++ b/t/suffix3.tap
@@ -17,7 +17,7 @@
 # Test to make sure that suffix rules chain.
 
 required=c++
-. ./defs || exit 1
+. test-init.sh
 
 plan_ 10
 
diff --git a/t/suffix4.sh b/t/suffix4.sh
index 2defd08..4756e7b 100755
--- a/t/suffix4.sh
+++ b/t/suffix4.sh
@@ -20,7 +20,7 @@
 # Also make sure that .SUFFIXES is automatically adjusted with
 # extensions from implicit rules.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am << 'END'
 .k.o:
diff --git a/t/suffix5.sh b/t/suffix5.sh
index fec51e9..d8c43ea 100755
--- a/t/suffix5.sh
+++ b/t/suffix5.sh
@@ -19,7 +19,7 @@
 # Based on a report from Arkadiusz Miskiewicz <address@hidden>.
 
 required='cc libtool'
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_SUBST([LINK], [:])
diff --git a/t/suffix6.sh b/t/suffix6.sh
index 4b3dee2..23cd5f0 100755
--- a/t/suffix6.sh
+++ b/t/suffix6.sh
@@ -19,7 +19,7 @@
 # '.$(OBJEXT)'.  See also related "semantic" tests 'suffix6b.sh'
 # and 'suffix6c.sh'.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am << 'END'
 SUFFIXES = a b .$(OBJEXT) c .o .obj
diff --git a/t/suffix6b.sh b/t/suffix6b.sh
index cfd1662..f5504dc 100755
--- a/t/suffix6b.sh
+++ b/t/suffix6b.sh
@@ -18,7 +18,7 @@
 # extensions.  Se also related "grepping" test 'suffix6.sh'.
 
 required=GNUmake # Other makes might not grok dot-less suffix rules.
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 # $(LINK) is not defined automatically by Automake, since the *_SOURCES
diff --git a/t/suffix6c.sh b/t/suffix6c.sh
index f688ef7..ae3399f 100755
--- a/t/suffix6c.sh
+++ b/t/suffix6c.sh
@@ -17,7 +17,7 @@
 # Test to make sure that '.o' and '.obj' are handled like '.$(OBJEXT)'.
 # See also related "grepping" test 'suffix6.sh'.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 # $(LINK) is not defined automatically by Automake, since the *_SOURCES
diff --git a/t/suffix7.sh b/t/suffix7.sh
index 30a18c0..253a652 100755
--- a/t/suffix7.sh
+++ b/t/suffix7.sh
@@ -17,7 +17,7 @@
 # Test to make sure Automake supports implicit rules "confusing"
 # extensions.  Inspired by a mail from Alex Hornby.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am << 'END'
 SUFFIXES = .idl S.cpp C.h
diff --git a/t/suffix8.tap b/t/suffix8.tap
index 516c9b2..f61a6b0 100755
--- a/t/suffix8.tap
+++ b/t/suffix8.tap
@@ -19,7 +19,7 @@
 # From PR/37.
 
 required='cc libtoolize'
-. ./defs || exit 1
+. test-init.sh
 
 plan_ 10
 
diff --git a/t/suffix9.sh b/t/suffix9.sh
index a0135da..043b9ad 100755
--- a/t/suffix9.sh
+++ b/t/suffix9.sh
@@ -17,7 +17,7 @@
 # Make sure that Automake choose the shorter route between suffixes
 # (related to PR/37)
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/symlink.sh b/t/symlink.sh
index ad7de70..a4c7449 100755
--- a/t/symlink.sh
+++ b/t/symlink.sh
@@ -18,7 +18,7 @@
 # Reported by Joerg-Martin Schwarz.
 
 am_create_testdir=empty
-. ./defs || exit 1
+. test-init.sh
 
 : > Makefile.am
 
diff --git a/t/symlink2.sh b/t/symlink2.sh
index f1f9dc5..fe7d2fa 100755
--- a/t/symlink2.sh
+++ b/t/symlink2.sh
@@ -16,7 +16,7 @@
 
 # Test to make sure that 'automake -a' redirects dangling symlinks.
 
-. ./defs || exit 1
+. test-init.sh
 
 rm -f install-sh
 ln -s Zardoz install-sh || skip_ "cannot create broken symlinks"
diff --git a/t/syntax.sh b/t/syntax.sh
index e2404ba..96cc8b3 100755
--- a/t/syntax.sh
+++ b/t/syntax.sh
@@ -16,7 +16,7 @@
 
 # Test for error for bad syntax.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am << 'END'
 foo = q \
diff --git a/t/tags-pr12372.sh b/t/tags-pr12372.sh
index 66b40a0..2e20322 100755
--- a/t/tags-pr12372.sh
+++ b/t/tags-pr12372.sh
@@ -18,11 +18,14 @@
 # extensions.  See automake bug#12372.
 
 required='cc etags'
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac <<'END'
 AC_PROG_CC
 AC_CONFIG_FILES([sub/Makefile])
+# Fake linking.  Help avoid possible spurious errors from make
+# or from the linker; errors that are irrelevant to this test.
+AC_SUBST([LINK], ['echo $(CCLD) $(CFLAGS) $(LDFLAGS) -o $@'])
 AC_OUTPUT
 END
 
@@ -33,7 +36,6 @@ all-local: tags
        $(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) -c $*.c
        rm -f $*.c
 
-LINK = $(CCLD) $(CFLAGS) $(LDFLAGS) -o $@
 noinst_PROGRAMS = foo
 foo_SOURCES = foo-main.pc barbar.c
 SUBDIRS = sub
@@ -47,7 +49,6 @@ all-local: tags
        $(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) -c $*.c
        rm -f $*.c
 
-LINK = $(CCLD) $(CFLAGS) $(LDFLAGS) -o $@
 noinst_PROGRAMS = zap
 zap_SOURCES = zardoz.pc
 END
diff --git a/t/tags.sh b/t/tags.sh
index 8f38e6b..deeea16 100755
--- a/t/tags.sh
+++ b/t/tags.sh
@@ -17,7 +17,7 @@
 # Test for bug reported by Harlan Stenn: the tags target doesn't work
 # when there are only headers in a directory.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am << 'END'
 noinst_HEADERS = iguana.h
diff --git a/t/tags2.sh b/t/tags2.sh
index 521d2ef..a8d3486 100755
--- a/t/tags2.sh
+++ b/t/tags2.sh
@@ -17,7 +17,7 @@
 # TAGS_DEPENDENCIES only make sense if other tag-worthy things (such as
 # sources) exist.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/tagsub.sh b/t/tagsub.sh
index 9103805..fab0c30 100755
--- a/t/tagsub.sh
+++ b/t/tagsub.sh
@@ -18,7 +18,7 @@
 # François Pinard, and later by Akim Demaille.
 
 required=etags
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_CONFIG_FILES([sub/Makefile])
diff --git a/t/tap-ambiguous-directive.sh b/t/tap-ambiguous-directive.sh
index 63544e3..9c8b03f 100755
--- a/t/tap-ambiguous-directive.sh
+++ b/t/tap-ambiguous-directive.sh
@@ -18,7 +18,7 @@
 #  - handling of "ambiguous" TODO and SKIP directives
 # See also related test 'tap-todo-skip-together.sh'.
 
-. ./defs || exit 1
+. test-init.sh
 
 . tap-setup.sh
 
diff --git a/t/tap-autonumber.sh b/t/tap-autonumber.sh
index 876245e..450a381 100755
--- a/t/tap-autonumber.sh
+++ b/t/tap-autonumber.sh
@@ -20,7 +20,7 @@
 #  - test results without number get automatically numbered in the
 #    console progress output
 
-. ./defs || exit 1
+. test-init.sh
 
 . tap-setup.sh
 
diff --git a/t/tap-bad-prog.tap b/t/tap-bad-prog.tap
index 09b2c74..e37f18c 100755
--- a/t/tap-bad-prog.tap
+++ b/t/tap-bad-prog.tap
@@ -18,7 +18,7 @@
 #  - missing, unreadable, or not-executable test scripts cause proper
 #    error reports
 
-. ./defs || exit 1
+. test-init.sh
 
 fetch_tap_driver
 
diff --git a/t/tap-bailout-and-logging.sh b/t/tap-bailout-and-logging.sh
index f87ccb3..33fab0d 100755
--- a/t/tap-bailout-and-logging.sh
+++ b/t/tap-bailout-and-logging.sh
@@ -18,7 +18,7 @@
 #  - even after a "Bail out!" directive, all input is still copied in
 #    the log file
 
-. ./defs || exit 1
+. test-init.sh
 
 . tap-setup.sh
 
diff --git a/t/tap-bailout-leading-space.sh b/t/tap-bailout-leading-space.sh
index dfbadba..54985ba 100755
--- a/t/tap-bailout-leading-space.sh
+++ b/t/tap-bailout-leading-space.sh
@@ -21,7 +21,7 @@
 # "more modern" behaviour in our awk TAP driver.
 
 am_tap_implementation=shell
-. ./defs || exit 1
+. test-init.sh
 
 . tap-setup.sh
 
diff --git a/t/tap-bailout-suppress-badexit.sh 
b/t/tap-bailout-suppress-badexit.sh
index 7cd5458..e9bf2a1 100755
--- a/t/tap-bailout-suppress-badexit.sh
+++ b/t/tap-bailout-suppress-badexit.sh
@@ -18,7 +18,7 @@
 #  - A "Bail out!" directive causes the driver to ignore the exit
 #    status of the test script.
 
-. ./defs || exit 1
+. test-init.sh
 
 tests='exit.test exit127.test sighup.test sigterm.test'
 
diff --git a/t/tap-bailout-suppress-later-diagnostic.sh 
b/t/tap-bailout-suppress-later-diagnostic.sh
index 54e21fd..72a0512 100755
--- a/t/tap-bailout-suppress-later-diagnostic.sh
+++ b/t/tap-bailout-suppress-later-diagnostic.sh
@@ -18,7 +18,7 @@
 #  - A "Bail out!" directive causes the driver to ignore any TAP
 #    diagnostic message in the rest of the following TAP stream.
 
-. ./defs || exit 1
+. test-init.sh
 
 . tap-setup.sh
 
diff --git a/t/tap-bailout-suppress-later-errors.sh 
b/t/tap-bailout-suppress-later-errors.sh
index bd90f8d..fffc21d 100755
--- a/t/tap-bailout-suppress-later-errors.sh
+++ b/t/tap-bailout-suppress-later-errors.sh
@@ -18,7 +18,7 @@
 #  - A "Bail out!" directive causes the driver to ignore any TAP
 #    result or error in the rest of the following TAP stream.
 
-. ./defs || exit 1
+. test-init.sh
 
 . tap-setup.sh
 
diff --git a/t/tap-bailout.sh b/t/tap-bailout.sh
index 08f12fd..0cc3434 100755
--- a/t/tap-bailout.sh
+++ b/t/tap-bailout.sh
@@ -17,7 +17,7 @@
 # Basic TAP test protocol support:
 #  - "Bail out!" magic
 
-. ./defs || exit 1
+. test-init.sh
 
 . tap-setup.sh
 
diff --git a/t/tap-basic.sh b/t/tap-basic.sh
index 4781ce5..31f330e 100755
--- a/t/tap-basic.sh
+++ b/t/tap-basic.sh
@@ -24,7 +24,7 @@
 # Note that some of the features checked here are checked in other
 # test cases too, usually in a more thorough and detailed way.
 
-. ./defs || exit 1
+. test-init.sh
 
 fetch_tap_driver
 
diff --git a/t/tap-color.sh b/t/tap-color.sh
index a3fab2f..1e83623 100755
--- a/t/tap-color.sh
+++ b/t/tap-color.sh
@@ -18,7 +18,7 @@
 #  - colorization of TAP results and diagnostic messages
 
 required='grep-nonprint'
-. ./defs || exit 1
+. test-init.sh
 
 # Escape '[' for grep, below.
 red="$esc\[0;31m"
diff --git a/t/tap-common-setup.sh b/t/tap-common-setup.sh
index 6bf168e..63af43c 100755
--- a/t/tap-common-setup.sh
+++ b/t/tap-common-setup.sh
@@ -16,7 +16,7 @@
 
 # Auxiliary test to set up common data used by many tests on TAP support.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << END
 AC_OUTPUT
diff --git a/t/tap-deps.sh b/t/tap-deps.sh
index 8e84a63..535c58d 100755
--- a/t/tap-deps.sh
+++ b/t/tap-deps.sh
@@ -17,7 +17,7 @@
 # Basic TAP test protocol support:
 #  - dependencies between test scripts
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am << 'END'
 # The tests are *deliberately* listed in inversed order here.
diff --git a/t/tap-diagnostic-custom.sh b/t/tap-diagnostic-custom.sh
index 7c29aa9..511ed8b 100755
--- a/t/tap-diagnostic-custom.sh
+++ b/t/tap-diagnostic-custom.sh
@@ -18,7 +18,7 @@
 #  - option '--diagnostic-string' to customize the string introducing
 #    TAP diagnostics
 
-. ./defs || exit 1
+. test-init.sh
 
 fetch_tap_driver
 
diff --git a/t/tap-diagnostic.sh b/t/tap-diagnostic.sh
index fc00af9..9cadc86 100755
--- a/t/tap-diagnostic.sh
+++ b/t/tap-diagnostic.sh
@@ -18,7 +18,7 @@
 #  - diagnostic messages (TAP lines with leading "#")
 #  - flags '--comments' and '--no-comments' of the TAP test driver
 
-. ./defs || exit 1
+. test-init.sh
 
 . tap-setup.sh
 
diff --git a/t/tap-doc.sh b/t/tap-doc.sh
index 69c56f0..b858ec9 100755
--- a/t/tap-doc.sh
+++ b/t/tap-doc.sh
@@ -17,7 +17,7 @@
 # Check that an example given in the documentation really works.
 # See section "Simple Tests" subsection "Script-based Testsuites".
 
-. ./defs || exit 1
+. test-init.sh
 
 fetch_tap_driver
 
diff --git a/t/tap-doc2.sh b/t/tap-doc2.sh
index f874ff8..78b88f6 100755
--- a/t/tap-doc2.sh
+++ b/t/tap-doc2.sh
@@ -19,7 +19,7 @@
 # with the Automake test harness".
 
 am_create_testdir=empty
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am <<'END'
 TEST_LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) \
@@ -31,7 +31,7 @@ END
 cat > configure.ac <<'END'
 AC_INIT([GNU Try Tap], [1.0], address@hidden)
 AC_CONFIG_AUX_DIR([build-aux])
-AM_INIT_AUTOMAKE([foreign parallel-tests -Wall -Werror])
+AM_INIT_AUTOMAKE([foreign -Wall -Werror])
 AC_CONFIG_FILES([Makefile])
 AC_REQUIRE_AUX_FILE([tap-driver.sh])
 AC_PROG_AWK
diff --git a/t/tap-driver-stderr.sh b/t/tap-driver-stderr.sh
index b1d9227..909769a 100755
--- a/t/tap-driver-stderr.sh
+++ b/t/tap-driver-stderr.sh
@@ -19,7 +19,7 @@
 
 required=non-root
 am_create_testdir=empty
-. ./defs || exit 1
+. test-init.sh
 
 fetch_tap_driver
 
diff --git a/t/tap-empty-diagnostic.sh b/t/tap-empty-diagnostic.sh
index ae0deef..e0e5967 100755
--- a/t/tap-empty-diagnostic.sh
+++ b/t/tap-empty-diagnostic.sh
@@ -17,7 +17,7 @@
 # TAP support:
 #  - empty diagnostic messages are discarder
 
-. ./defs || exit 1
+. test-init.sh
 
 . tap-setup.sh
 
diff --git a/t/tap-empty.sh b/t/tap-empty.sh
index e3d400c..a4c8e73 100755
--- a/t/tap-empty.sh
+++ b/t/tap-empty.sh
@@ -18,7 +18,7 @@
 #  - empty TAP input
 #  - blank TAP input
 
-. ./defs || exit 1
+. test-init.sh
 
 . tap-setup.sh
 
diff --git a/t/tap-escape-directive-2.sh b/t/tap-escape-directive-2.sh
index 49c6398..4e476fa 100755
--- a/t/tap-escape-directive-2.sh
+++ b/t/tap-escape-directive-2.sh
@@ -17,7 +17,7 @@
 # TAP support:
 #  - "escape" TODO and SKIP directives (by escaping the "#" character)
 
-. ./defs || exit 1
+. test-init.sh
 
 . tap-setup.sh
 
diff --git a/t/tap-escape-directive.sh b/t/tap-escape-directive.sh
index 9b59c3d..b635814 100755
--- a/t/tap-escape-directive.sh
+++ b/t/tap-escape-directive.sh
@@ -17,7 +17,7 @@
 # TAP support:
 #  - "escape" TODO and SKIP directives (by escaping the "#" character)
 
-. ./defs || exit 1
+. test-init.sh
 
 . tap-setup.sh
 
diff --git a/t/tap-exit.sh b/t/tap-exit.sh
index c9a9823..3c51cc3 100755
--- a/t/tap-exit.sh
+++ b/t/tap-exit.sh
@@ -19,7 +19,7 @@
 #  - the '--ignore-exit' option causes the TAP test driver to ignore
 #    exit statuses of the test scripts.
 
-. ./defs || exit 1
+. test-init.sh
 
 echo TESTS = > Makefile.am
 for st in 1 2 77 99; do
diff --git a/t/tap-fancy.sh b/t/tap-fancy.sh
index c59d0c1..587b0ae 100755
--- a/t/tap-fancy.sh
+++ b/t/tap-fancy.sh
@@ -17,7 +17,7 @@
 # TAP support: some unusual forms for valid TAP input.
 # See also related test 'tap-fancy2.sh'.
 
-. ./defs || exit 1
+. test-init.sh
 
 . tap-setup.sh
 
diff --git a/t/tap-fancy2.sh b/t/tap-fancy2.sh
index 1a3ab02..aaa4fbc 100755
--- a/t/tap-fancy2.sh
+++ b/t/tap-fancy2.sh
@@ -17,7 +17,7 @@
 # TAP support: more unusual forms for valid TAP input.
 # See also related test 'tap-fancy.sh'.
 
-. ./defs || exit 1
+. test-init.sh
 
 . tap-setup.sh
 
diff --git a/t/tap-global-log.sh b/t/tap-global-log.sh
index 31e1ccb..2ebad94 100755
--- a/t/tap-global-log.sh
+++ b/t/tap-global-log.sh
@@ -17,7 +17,7 @@
 # TAP support:
 #  - which log files get copied in the global log?
 
-. ./defs || exit 1
+. test-init.sh
 
 . tap-setup.sh
 
diff --git a/t/tap-global-result.sh b/t/tap-global-result.sh
index 528c7bb..2c27259 100755
--- a/t/tap-global-result.sh
+++ b/t/tap-global-result.sh
@@ -18,7 +18,7 @@
 #  - which global test result derives from different test results
 #    mixed in a single script?
 
-. ./defs || exit 1
+. test-init.sh
 
 . tap-setup.sh
 
diff --git a/t/tap-log.sh b/t/tap-log.sh
index b9d3603..c679d4f 100755
--- a/t/tap-log.sh
+++ b/t/tap-log.sh
@@ -22,7 +22,7 @@
 #  - VERBOSE environment variable support
 # Keep in sync with 'test-log.sh'.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am << 'END'
 TESTS = pass.test skip.test xfail.test fail.test xpass.test error.test
diff --git a/t/tap-merge-stdout-stderr.sh b/t/tap-merge-stdout-stderr.sh
index b13d41d..37167c6 100755
--- a/t/tap-merge-stdout-stderr.sh
+++ b/t/tap-merge-stdout-stderr.sh
@@ -18,7 +18,7 @@
 #  - The Automake TAP driver has an option that instruct it to read TAP
 #    input also from the stderr of the test command, not only its stdout.
 
-. ./defs || exit 1
+. test-init.sh
 
 fetch_tap_driver
 
diff --git a/t/tap-missing-plan-and-bad-exit.sh 
b/t/tap-missing-plan-and-bad-exit.sh
index 06a6f88..c49852a 100755
--- a/t/tap-missing-plan-and-bad-exit.sh
+++ b/t/tap-missing-plan-and-bad-exit.sh
@@ -19,7 +19,7 @@
 #    plan, then the driver reports both "missing plan" and "exited with
 #    non-zero status" errors.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > foo.test <<END
 #!/bin/sh
diff --git a/t/tap-more.sh b/t/tap-more.sh
index 1556d70..f330d15 100755
--- a/t/tap-more.sh
+++ b/t/tap-more.sh
@@ -24,7 +24,7 @@
 #    correct test script(s)
 #  - "make distcheck" works
 
-. ./defs || exit 1
+. test-init.sh
 
 fetch_tap_driver
 
diff --git a/t/tap-more2.sh b/t/tap-more2.sh
index bb06248..b4d8d50 100755
--- a/t/tap-more2.sh
+++ b/t/tap-more2.sh
@@ -20,7 +20,7 @@
 #  - interactions with 'check_*' variables
 
 required='cc native'
-. ./defs || exit 1
+. test-init.sh
 
 fetch_tap_driver
 
diff --git a/t/tap-msg0-bailout.sh b/t/tap-msg0-bailout.sh
index bdda865..4fab883 100755
--- a/t/tap-msg0-bailout.sh
+++ b/t/tap-msg0-bailout.sh
@@ -19,7 +19,7 @@
 #    of a "plan with skip" TAP plan
 # generally true!
 
-. ./defs || exit 1
+. test-init.sh
 
 . tap-setup.sh
 
diff --git a/t/tap-msg0-directive.sh b/t/tap-msg0-directive.sh
index 9be3816..dd97359 100755
--- a/t/tap-msg0-directive.sh
+++ b/t/tap-msg0-directive.sh
@@ -17,7 +17,7 @@
 # TAP support:
 #  - literal string "0" as a TODO or SKIP message
 
-. ./defs || exit 1
+. test-init.sh
 
 . tap-setup.sh
 
diff --git a/t/tap-msg0-misc.sh b/t/tap-msg0-misc.sh
index d7751d7..1d5c568 100755
--- a/t/tap-msg0-misc.sh
+++ b/t/tap-msg0-misc.sh
@@ -18,7 +18,7 @@
 #  - literal "0" and "0.0" in a test description and a TODO/SKIP message
 #    at the same time
 
-. ./defs || exit 1
+. test-init.sh
 
 . tap-setup.sh
 
diff --git a/t/tap-msg0-planskip.sh b/t/tap-msg0-planskip.sh
index 24e569c..72f37b7 100755
--- a/t/tap-msg0-planskip.sh
+++ b/t/tap-msg0-planskip.sh
@@ -18,7 +18,7 @@
 #  - literal strings "0" and "0.0" as the reason of the skip in a "TAP
 #    plan with skip" (i.e., "1..0 # SKIP ...").
 
-. ./defs || exit 1
+. test-init.sh
 
 . tap-setup.sh
 
diff --git a/t/tap-msg0-result.sh b/t/tap-msg0-result.sh
index f55b055..23bcdfb 100755
--- a/t/tap-msg0-result.sh
+++ b/t/tap-msg0-result.sh
@@ -17,7 +17,7 @@
 # TAP support:
 #  - the string "0" as a test description
 
-. ./defs || exit 1
+. test-init.sh
 
 . tap-setup.sh
 
diff --git a/t/tap-negative-numbers.sh b/t/tap-negative-numbers.sh
index fbf54be..b7b2d72 100755
--- a/t/tap-negative-numbers.sh
+++ b/t/tap-negative-numbers.sh
@@ -18,7 +18,7 @@
 #  - don't spuriously recognize negative TAP result numbers, but correctly
 #    interpret them as test descriptions instead
 
-. ./defs || exit 1
+. test-init.sh
 
 . tap-setup.sh
 
diff --git a/t/tap-no-disable-hard-error.sh b/t/tap-no-disable-hard-error.sh
index dc4cad3..2dc881e 100755
--- a/t/tap-no-disable-hard-error.sh
+++ b/t/tap-no-disable-hard-error.sh
@@ -18,7 +18,7 @@
 #  - "Bail out!" magic and TAP parse errors are not disabled nor turned
 #    into simple failures by the definition DISABLE_HARD_ERRORS.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am << 'END'
 DISABLE_HARD_ERRORS = yes
diff --git a/t/tap-no-merge-stdout-stderr.sh b/t/tap-no-merge-stdout-stderr.sh
index f101315..6be67a7 100755
--- a/t/tap-no-merge-stdout-stderr.sh
+++ b/t/tap-no-merge-stdout-stderr.sh
@@ -18,7 +18,7 @@
 #  - By default, TAP input is only from the stdout (and not the stderr)
 #    of the test command.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am << 'END'
 TEST_LOG_DRIVER_FLAGS = --comments
diff --git a/t/tap-no-spurious-numbers.sh b/t/tap-no-spurious-numbers.sh
index 81104af..1f5e1b7 100755
--- a/t/tap-no-spurious-numbers.sh
+++ b/t/tap-no-spurious-numbers.sh
@@ -18,7 +18,7 @@
 #  - we shouldn't spuriously recognize as TAP result numbers what it
 #    not, even if it seems pretty close
 
-. ./defs || exit 1
+. test-init.sh
 
 . tap-setup.sh
 
diff --git a/t/tap-no-spurious-summary.sh b/t/tap-no-spurious-summary.sh
index 13c577c..1c420a0 100755
--- a/t/tap-no-spurious-summary.sh
+++ b/t/tap-no-spurious-summary.sh
@@ -18,7 +18,7 @@
 #  - ':test-results:' directives in test scripts' output doesn't
 #    originate spurious results in the testsuite summary
 
-. ./defs || exit 1
+. test-init.sh
 
 . tap-setup.sh
 
diff --git a/t/tap-no-spurious.sh b/t/tap-no-spurious.sh
index d8bf5ee..d40dd41 100755
--- a/t/tap-no-spurious.sh
+++ b/t/tap-no-spurious.sh
@@ -18,7 +18,7 @@
 #  - don't spuriously recognize lines that are "almost" TAP lines as
 #    real TAP lines
 
-. ./defs || exit 1
+. test-init.sh
 
 . tap-setup.sh
 
diff --git a/t/tap-not-ok-skip.sh b/t/tap-not-ok-skip.sh
index bbb9a03..4fb0511 100755
--- a/t/tap-not-ok-skip.sh
+++ b/t/tap-not-ok-skip.sh
@@ -18,7 +18,7 @@
 #  - a "not ok # SKIP" line should count as a failure, for consistency
 #    with the prove(1) utility.
 
-. ./defs || exit 1
+. test-init.sh
 
 . tap-setup.sh
 
diff --git a/t/tap-number-wordboundary.sh b/t/tap-number-wordboundary.sh
index 2d15121..5cc3fa4 100755
--- a/t/tap-number-wordboundary.sh
+++ b/t/tap-number-wordboundary.sh
@@ -18,7 +18,7 @@
 #  - TAP result numbers terminated by a non-whitespace "word boundary"
 #    character are recognized
 
-. ./defs || exit 1
+. test-init.sh
 
 . tap-setup.sh
 
diff --git a/t/tap-numbers-leading-zero.sh b/t/tap-numbers-leading-zero.sh
index 620addf..af30688 100755
--- a/t/tap-numbers-leading-zero.sh
+++ b/t/tap-numbers-leading-zero.sh
@@ -17,7 +17,7 @@
 # TAP support:
 #  - how does TAP result numbers with leading zero fares?
 
-. ./defs || exit 1
+. test-init.sh
 
 . tap-setup.sh
 
diff --git a/t/tap-numeric-description.sh b/t/tap-numeric-description.sh
index 61bc252..080aae9 100755
--- a/t/tap-numeric-description.sh
+++ b/t/tap-numeric-description.sh
@@ -16,7 +16,7 @@
 
 # TAP result lines whose description is a number.
 
-. ./defs || exit 1
+. test-init.sh
 
 . tap-setup.sh
 
diff --git a/t/tap-out-of-order.sh b/t/tap-out-of-order.sh
index ff0e806..d08fd90 100755
--- a/t/tap-out-of-order.sh
+++ b/t/tap-out-of-order.sh
@@ -17,7 +17,7 @@
 # TAP support:
 #  - out-of-order test results
 
-. ./defs || exit 1
+. test-init.sh
 
 . tap-setup.sh
 
diff --git a/t/tap-passthrough-exit.sh b/t/tap-passthrough-exit.sh
index 33287be..9ba399b 100755
--- a/t/tap-passthrough-exit.sh
+++ b/t/tap-passthrough-exit.sh
@@ -19,7 +19,7 @@
 #    log file
 # See also related test 'tap-passthrough.sh'.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am << 'END'
 TEST_LOG_COMPILER = $(SHELL)
diff --git a/t/tap-passthrough.sh b/t/tap-passthrough.sh
index 981c428..f3055c3 100755
--- a/t/tap-passthrough.sh
+++ b/t/tap-passthrough.sh
@@ -20,7 +20,7 @@
 #  - TAP errors are reported in the log file too
 # See also related test 'tap-passthrough-exit.sh'.
 
-. ./defs || exit 1
+. test-init.sh
 
 weirdchars=\''"address@hidden&()[]<>#;,:.^?*/'
 
diff --git a/t/tap-plan-corner.sh b/t/tap-plan-corner.sh
index 8fc0c7e..fc9b1a2 100755
--- a/t/tap-plan-corner.sh
+++ b/t/tap-plan-corner.sh
@@ -17,7 +17,7 @@
 # TAP support:
 #  - some corner cases for TAP plan
 
-. ./defs || exit 1
+. test-init.sh
 
 . tap-setup.sh
 
diff --git a/t/tap-plan-errors.sh b/t/tap-plan-errors.sh
index dd37aff..bbe580e 100755
--- a/t/tap-plan-errors.sh
+++ b/t/tap-plan-errors.sh
@@ -23,7 +23,7 @@
 # and 'tap-skip-whole-badcount.sh'.  More checks about corner-cases
 # in TAP plans are performed in 'tap-plan-corner.sh'.
 
-. ./defs || exit 1
+. test-init.sh
 
 . tap-setup.sh
 
diff --git a/t/tap-plan-leading-zero.sh b/t/tap-plan-leading-zero.sh
index dc1923c..54097da 100755
--- a/t/tap-plan-leading-zero.sh
+++ b/t/tap-plan-leading-zero.sh
@@ -19,7 +19,7 @@
 #  - TAP "SKIP" plans with multiple zeroes, as in "1..00 # SKIP"
 # This is consistent with the behaviour of the 'prove' utility.
 
-. ./defs || exit 1
+. test-init.sh
 
 . tap-setup.sh
 
diff --git a/t/tap-plan-malformed.sh b/t/tap-plan-malformed.sh
index cf43d47..1f7e4dd 100755
--- a/t/tap-plan-malformed.sh
+++ b/t/tap-plan-malformed.sh
@@ -17,7 +17,7 @@
 # TAP support: a malformed TAP plan is not recognized.  The checks in
 # here should be consistent with the behaviour of the 'prove' utility.
 
-. ./defs || exit 1
+. test-init.sh
 
 . tap-setup.sh
 
diff --git a/t/tap-plan-middle.sh b/t/tap-plan-middle.sh
index 971869b..f234cb0 100755
--- a/t/tap-plan-middle.sh
+++ b/t/tap-plan-middle.sh
@@ -17,7 +17,7 @@
 # TAP support:
 #  - test plan preceding and/or following non-result TAP lines
 
-. ./defs || exit 1
+. test-init.sh
 
 . tap-setup.sh
 
diff --git a/t/tap-plan-whitespace.sh b/t/tap-plan-whitespace.sh
index 5cc198f..ea9e45c 100755
--- a/t/tap-plan-whitespace.sh
+++ b/t/tap-plan-whitespace.sh
@@ -17,7 +17,7 @@
 # TAP support:
 #  - plan line with trailing whitespace is recognized and handled correctly
 
-. ./defs || exit 1
+. test-init.sh
 
 . tap-setup.sh
 
diff --git a/t/tap-plan.sh b/t/tap-plan.sh
index d222870..bc4170b 100755
--- a/t/tap-plan.sh
+++ b/t/tap-plan.sh
@@ -18,7 +18,7 @@
 #  - test scripts with the test plan at the beginning
 #  - test scripts with the test plan at the end
 
-. ./defs || exit 1
+. test-init.sh
 
 . tap-setup.sh
 
diff --git a/t/tap-planskip-and-logging.sh b/t/tap-planskip-and-logging.sh
index 33e5f7f..71426ac 100755
--- a/t/tap-planskip-and-logging.sh
+++ b/t/tap-planskip-and-logging.sh
@@ -18,7 +18,7 @@
 #  - interactions between "TAP plan with SKIP" and logging of earlier or
 #    later TAP or non-TAP text
 
-. ./defs || exit 1
+. test-init.sh
 
 . tap-setup.sh
 
diff --git a/t/tap-planskip-badexit.sh b/t/tap-planskip-badexit.sh
index 0bcc7e3..cf39060 100755
--- a/t/tap-planskip-badexit.sh
+++ b/t/tap-planskip-badexit.sh
@@ -18,7 +18,7 @@
 #  - an exit status != 0 of a test script causes an hard error, even if
 #    the last line of output is a "SKIP plan" (e.g., "1..0 # SKIP").
 
-. ./defs || exit 1
+. test-init.sh
 
 echo TESTS = one.test two.test > Makefile.am
 
diff --git a/t/tap-planskip-bailout.sh b/t/tap-planskip-bailout.sh
index 6558a69..2bf683f 100755
--- a/t/tap-planskip-bailout.sh
+++ b/t/tap-planskip-bailout.sh
@@ -18,7 +18,7 @@
 #  - a "Bail out!" directive causes an hard error, even if coming after
 #    a "SKIP plan" (e.g., "1..0 # SKIP").
 
-. ./defs || exit 1
+. test-init.sh
 
 . tap-setup.sh
 
diff --git a/t/tap-planskip-case-insensitive.sh 
b/t/tap-planskip-case-insensitive.sh
index ece3b25..01df36d 100755
--- a/t/tap-planskip-case-insensitive.sh
+++ b/t/tap-planskip-case-insensitive.sh
@@ -17,7 +17,7 @@
 # TAP support:
 #  - "SKIP" keyword in a TAP plan is case-insensitive
 
-. ./defs || exit 1
+. test-init.sh
 
 . tap-setup.sh
 
diff --git a/t/tap-planskip-late.sh b/t/tap-planskip-late.sh
index 678bd19..a5fd5f1 100755
--- a/t/tap-planskip-late.sh
+++ b/t/tap-planskip-late.sh
@@ -18,7 +18,7 @@
 #  - the special "plan with SKIP" can also be used "late" in the TAP
 #    stream, i.e., preceded by non-TAP output or TAP diagnostic.
 
-. ./defs || exit 1
+. test-init.sh
 
 . tap-setup.sh
 
diff --git a/t/tap-planskip-later-errors.sh b/t/tap-planskip-later-errors.sh
index c840044..ecb5496 100755
--- a/t/tap-planskip-later-errors.sh
+++ b/t/tap-planskip-later-errors.sh
@@ -17,7 +17,7 @@
 # TAP support:
 #  - TAP errors following a "TAP plan with SKIP" are still diagnosed.
 
-. ./defs || exit 1
+. test-init.sh
 
 . tap-setup.sh
 
diff --git a/t/tap-planskip-unplanned-corner.sh 
b/t/tap-planskip-unplanned-corner.sh
index ef9ab3c..0272dd6 100755
--- a/t/tap-planskip-unplanned-corner.sh
+++ b/t/tap-planskip-unplanned-corner.sh
@@ -18,7 +18,7 @@
 #  - test results seen in a TAP stream that has a "plan with SKIP" are
 #    flagged as errors, even if all of them are "SKIP" results.
 
-. ./defs || exit 1
+. test-init.sh
 
 . tap-setup.sh
 
diff --git a/t/tap-planskip-unplanned.sh b/t/tap-planskip-unplanned.sh
index 5fa8ca5..6ea3f05 100755
--- a/t/tap-planskip-unplanned.sh
+++ b/t/tap-planskip-unplanned.sh
@@ -19,7 +19,7 @@
 #    been seen is an error
 #  - any test result following a "plan with skip" is an error.
 
-. ./defs || exit 1
+. test-init.sh
 
 . tap-setup.sh
 
diff --git a/t/tap-planskip-whitespace.sh b/t/tap-planskip-whitespace.sh
index 5ae9d3a..0946b84 100755
--- a/t/tap-planskip-whitespace.sh
+++ b/t/tap-planskip-whitespace.sh
@@ -18,7 +18,7 @@
 #  - normalization of whitespace in console testsuite progress associated
 #    with a SKIP directive in the TAP plan
 
-. ./defs || exit 1
+. test-init.sh
 
 . tap-setup.sh
 
diff --git a/t/tap-planskip.sh b/t/tap-planskip.sh
index 76a7244..4bb9c42 100755
--- a/t/tap-planskip.sh
+++ b/t/tap-planskip.sh
@@ -17,7 +17,7 @@
 # Basic TAP test protocol support:
 #  - special plan format to skip all the tests in a script
 
-. ./defs || exit 1
+. test-init.sh
 
 . tap-setup.sh
 
diff --git a/t/tap-realtime.sh b/t/tap-realtime.sh
index 92d7831..f8544ee 100755
--- a/t/tap-realtime.sh
+++ b/t/tap-realtime.sh
@@ -22,7 +22,7 @@
 # children, and is pretty hacky and complex; is there a better way to
 # accomplish the checks done here?
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >expect-check <<'END'
 eval spawn $env(SHELL) -c ":"
@@ -53,7 +53,9 @@ fi
 
 cat > Makefile.am << 'END'
 TESTS = all.test
+AM_COLOR_TESTS= no
 END
+
 . tap-setup.sh
 
 cat > all.test <<'END'
diff --git a/t/tap-recheck-logs.sh b/t/tap-recheck-logs.sh
index 1b7597e..69c0fe2 100755
--- a/t/tap-recheck-logs.sh
+++ b/t/tap-recheck-logs.sh
@@ -17,7 +17,7 @@
 # TAP support:
 # - RECHECK_LOGS
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am << 'END'
 TEST_LOG_COMPILER = cat
diff --git a/t/tap-recheck.sh b/t/tap-recheck.sh
index a567964..55f0812 100755
--- a/t/tap-recheck.sh
+++ b/t/tap-recheck.sh
@@ -17,7 +17,7 @@
 # Test the 'recheck' target for TAP test protocol.
 # Keep in sync with 'test-driver-custom-multitest-recheck.sh'.
 
-. ./defs || exit 1
+. test-init.sh
 
 fetch_tap_driver
 
diff --git a/t/tap-result-comment.sh b/t/tap-result-comment.sh
index 714f328..b7880ab 100755
--- a/t/tap-result-comment.sh
+++ b/t/tap-result-comment.sh
@@ -17,7 +17,7 @@
 # TAP support:
 #  - non-directive comments in TAP results are kept verbatim
 
-. ./defs || exit 1
+. test-init.sh
 
 . tap-setup.sh
 
diff --git a/t/tap-signal.tap b/t/tap-signal.tap
index 1dfc52d..f400695 100755
--- a/t/tap-signal.tap
+++ b/t/tap-signal.tap
@@ -17,7 +17,7 @@
 # TAP support:
 #  - a test script terminated by a signal causes an hard error
 
-. ./defs || exit 1
+. test-init.sh
 
 fetch_tap_driver
 
diff --git a/t/tap-test-number-0.sh b/t/tap-test-number-0.sh
index f360349..6939ed7 100755
--- a/t/tap-test-number-0.sh
+++ b/t/tap-test-number-0.sh
@@ -18,7 +18,7 @@
 #  - a test result numbered as 0 is to be considered out-of-order
 # This is consistent with the behaviour of the 'prove' utility.
 
-. ./defs || exit 1
+. test-init.sh
 
 if test $am_tap_implementation = perl; then
   $PERL -MTAP::Parser -e 1 \
diff --git a/t/tap-todo-skip-together.sh b/t/tap-todo-skip-together.sh
index ee40058..212ad87 100755
--- a/t/tap-todo-skip-together.sh
+++ b/t/tap-todo-skip-together.sh
@@ -18,7 +18,7 @@
 #  - TODO and SKIP directives on the same line: the first one wins
 # See also related test 'tap-ambiguous-directive.sh'.
 
-. ./defs || exit 1
+. test-init.sh
 
 . tap-setup.sh
 
diff --git a/t/tap-todo-skip-whitespace.sh b/t/tap-todo-skip-whitespace.sh
index b979c8b..7839e37 100755
--- a/t/tap-todo-skip-whitespace.sh
+++ b/t/tap-todo-skip-whitespace.sh
@@ -18,7 +18,7 @@
 #  - normalization of whitespace in console testsuite progress associated
 #    with TODO and SKIP directives
 
-. ./defs || exit 1
+. test-init.sh
 
 . tap-setup.sh
 
diff --git a/t/tap-todo-skip.sh b/t/tap-todo-skip.sh
index c4e47cf..ceacdbf 100755
--- a/t/tap-todo-skip.sh
+++ b/t/tap-todo-skip.sh
@@ -23,7 +23,7 @@
 #  - the reasons for TODO and SKIP, if present, are nicely printed in
 #    the testsuite progress output
 
-. ./defs || exit 1
+. test-init.sh
 
 . tap-setup.sh
 
diff --git a/t/tap-unplanned.sh b/t/tap-unplanned.sh
index 75ad7bf..49af6e0 100755
--- a/t/tap-unplanned.sh
+++ b/t/tap-unplanned.sh
@@ -17,7 +17,7 @@
 # TAP support:
 #  - unplanned tests are properly reported as errors
 
-. ./defs || exit 1
+. test-init.sh
 
 . tap-setup.sh
 
diff --git a/t/tap-whitespace-normalization.sh 
b/t/tap-whitespace-normalization.sh
index c907d11..cb5b759 100755
--- a/t/tap-whitespace-normalization.sh
+++ b/t/tap-whitespace-normalization.sh
@@ -20,7 +20,7 @@
 # force us to tweak dozens of other tests (hopefully).
 # See also related test 'tap-todo-skip-whitespace.sh'.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am << 'END'
 TEST_LOG_COMPILER = cat
diff --git a/t/tap-with-and-without-number.sh b/t/tap-with-and-without-number.sh
index 6d69eb6..8e34d80 100755
--- a/t/tap-with-and-without-number.sh
+++ b/t/tap-with-and-without-number.sh
@@ -19,7 +19,7 @@
 #  - tests without explicit number get automatically numbered in the
 #    testsuite progress output on console
 
-. ./defs || exit 1
+. test-init.sh
 
 . tap-setup.sh
 
diff --git a/t/tap-xfail-tests.sh b/t/tap-xfail-tests.sh
index 94ae1c9..7458942 100755
--- a/t/tap-xfail-tests.sh
+++ b/t/tap-xfail-tests.sh
@@ -17,7 +17,7 @@
 # TAP and $(XFAIL_TESTS): test results without directives are turned from
 # PASS to XPASS and from FAIL to XFAIL; other results are unchanged.
 
-. ./defs || exit 1
+. test-init.sh
 
 . tap-setup.sh
 
diff --git a/t/tar-override.sh b/t/tar-override.sh
index c35234e..ce8529d 100755
--- a/t/tar-override.sh
+++ b/t/tar-override.sh
@@ -19,7 +19,7 @@
 # FIXME: currently this works only when the tar format used is 'v7'
 # FIXME: (which is the default one).
 
-. ./defs || exit 1
+. test-init.sh
 
 cwd=$(pwd) || fatal_ "getting current working directory"
 
diff --git a/t/tar.sh b/t/tar.sh
index db3e489..76256b8 100755
--- a/t/tar.sh
+++ b/t/tar.sh
@@ -16,7 +16,7 @@
 
 # Check the tar-ustar option.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > configure.ac << 'END'
 AC_INIT([tar], [1.0])
diff --git a/t/tar2.sh b/t/tar2.sh
index 5d49cc3..3ae53fc 100755
--- a/t/tar2.sh
+++ b/t/tar2.sh
@@ -16,7 +16,7 @@
 
 # Check the tar-pax option.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > configure.ac << 'END'
 AC_INIT([tar2], [1.0])
diff --git a/t/tar3.sh b/t/tar3.sh
index c09aa6f..bc7c353 100755
--- a/t/tar3.sh
+++ b/t/tar3.sh
@@ -16,7 +16,7 @@
 
 # Check the tar options diagnostics.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > configure.ac << 'END'
 AC_INIT([tar2], [1.0])
diff --git a/t/target-cflags.sh b/t/target-cflags.sh
index 9b975d5..f005838 100755
--- a/t/target-cflags.sh
+++ b/t/target-cflags.sh
@@ -18,7 +18,7 @@
 # Assar Westerlund <address@hidden>
 
 required=cc
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/targetclash.sh b/t/targetclash.sh
index 031cbc1..72cf55d 100755
--- a/t/targetclash.sh
+++ b/t/targetclash.sh
@@ -16,7 +16,7 @@
 
 # Check that target clashes are diagnosed.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/test-driver-acsubst.sh b/t/test-driver-acsubst.sh
index 12af609..076235d 100755
--- a/t/test-driver-acsubst.sh
+++ b/t/test-driver-acsubst.sh
@@ -17,7 +17,7 @@
 # parallel-tests:
 #  - LOG_DRIVER variables can be AC_SUBST'd
 
-. ./defs || exit 1
+. test-init.sh
 
 mkdir test-drivers
 
diff --git a/t/test-driver-cond.sh b/t/test-driver-cond.sh
index 4709582..f2eb8d2 100755
--- a/t/test-driver-cond.sh
+++ b/t/test-driver-cond.sh
@@ -18,7 +18,7 @@
 #   - Automake can correctly handle conditionals contents for the
 #     LOG_DRIVER variables.
 
-. ./defs || exit 1
+. test-init.sh
 
 cp "$am_testaux_srcdir"/trivial-test-driver . \
   || fatal_ "failed to fetch auxiliary script trivial-test-driver"
diff --git a/t/test-driver-create-log-dir.sh b/t/test-driver-create-log-dir.sh
index 5441abf..87db907 100755
--- a/t/test-driver-create-log-dir.sh
+++ b/t/test-driver-create-log-dir.sh
@@ -18,7 +18,7 @@
 # e.g., 'sub/foo.log'), the Automake test harness must ensure that
 # directory exists before calling any custom test driver.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_OUTPUT
diff --git a/t/test-driver-custom-multitest-recheck.sh 
b/t/test-driver-custom-multitest-recheck.sh
index 55a6b93..e27f56f 100755
--- a/t/test-driver-custom-multitest-recheck.sh
+++ b/t/test-driver-custom-multitest-recheck.sh
@@ -22,7 +22,7 @@
 # and 'parallel-tests-recheck-override.sh'.
 # Keep in sync with 'tap-recheck.sh'.
 
-. ./defs || exit 1
+. test-init.sh
 
 cp "$am_testaux_srcdir"/trivial-test-driver . \
   || fatal_ "failed to fetch auxiliary script trivial-test-driver"
diff --git a/t/test-driver-custom-multitest-recheck2.sh 
b/t/test-driver-custom-multitest-recheck2.sh
index 54fd467..d72ebf8 100755
--- a/t/test-driver-custom-multitest-recheck2.sh
+++ b/t/test-driver-custom-multitest-recheck2.sh
@@ -21,7 +21,7 @@
 # See also related tests 'test-driver-custom-multitest-recheck.sh' and
 # 'parallel-tests-recheck-override.sh'.
 
-. ./defs || exit 1
+. test-init.sh
 
 cp "$am_testaux_srcdir"/trivial-test-driver . \
   || fatal_ "failed to fetch auxiliary script trivial-test-driver"
diff --git a/t/test-driver-custom-multitest.sh 
b/t/test-driver-custom-multitest.sh
index 7a073e2..b68333e 100755
--- a/t/test-driver-custom-multitest.sh
+++ b/t/test-driver-custom-multitest.sh
@@ -19,7 +19,7 @@
 # only checks implementation details in Automake's custom test drivers
 # support, but also serves as a "usability test" for our APIs.
 
-. ./defs || exit 1
+. test-init.sh
 
 cp "$am_testaux_srcdir"/trivial-test-driver . \
   || fatal_ "failed to fetch auxiliary script trivial-test-driver"
diff --git a/t/test-driver-custom-no-extra-driver.sh 
b/t/test-driver-custom-no-extra-driver.sh
index a44febd..edd6183 100755
--- a/t/test-driver-custom-no-extra-driver.sh
+++ b/t/test-driver-custom-no-extra-driver.sh
@@ -18,7 +18,7 @@
 # installed or referenced if it's not used, i.e., if the user has
 # defined his own '*LOG_DRIVER' variables.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac <<'END'
 AC_PROG_CC
diff --git a/t/test-driver-custom-xfail-tests.sh 
b/t/test-driver-custom-xfail-tests.sh
index c19e69f..8bfe3e6 100755
--- a/t/test-driver-custom-xfail-tests.sh
+++ b/t/test-driver-custom-xfail-tests.sh
@@ -16,7 +16,7 @@
 
 # Custom test drivers: "abstract" XFAIL_TESTS support.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac <<'END'
 AC_SUBST([nihil], [])
diff --git a/t/test-driver-custom.sh b/t/test-driver-custom.sh
index f8306ff..db41826 100755
--- a/t/test-driver-custom.sh
+++ b/t/test-driver-custom.sh
@@ -16,7 +16,7 @@
 
 # Custom test drivers: per-extension test drivers.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_OUTPUT
diff --git a/t/test-driver-fail.sh b/t/test-driver-fail.sh
index 10a4b1e..963aadd 100755
--- a/t/test-driver-fail.sh
+++ b/t/test-driver-fail.sh
@@ -22,7 +22,7 @@
 # (like our dummy one in this test) might leave around a test log even
 # in case of internal failures.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac <<'END'
 AC_OUTPUT
diff --git a/t/test-driver-is-distributed.sh b/t/test-driver-is-distributed.sh
index 2208a04..f13bf9b 100755
--- a/t/test-driver-is-distributed.sh
+++ b/t/test-driver-is-distributed.sh
@@ -19,35 +19,29 @@
 #    defined in a subdir Makefile
 
 am_create_testdir=empty
-. ./defs || exit 1
+. test-init.sh
 
 ocwd=$(pwd) || fatal_ "getting current working directory"
 
-do_check ()
-{
-  whereopts=$1 auxdir=$2
-  case $#,$whereopts in
-    2,ac) ac_opts=parallel-tests am_code= ;;
-    2,am) am_opts=parallel-tests ac_code= ;;
-       *) fatal_ "do_check: bad usage";;
-  esac
-  mkdir $whereopts
-  cd $whereopts
+for i in 1 2; do
+  mkdir D$i
+  cd D$i
+  if test $i -eq 1; then
+    auxdir=.
+    test_driver=test-driver
+  else
+    auxdir=build-aux
+    test_driver=$auxdir/test-driver
+    mkdir $auxdir
+  fi
   mkdir tests
   unindent > configure.ac << END
     AC_INIT([$me], [1.0])
     AC_CONFIG_AUX_DIR([$auxdir])
-    AM_INIT_AUTOMAKE([$ac_opts])
+    AM_INIT_AUTOMAKE
     AC_CONFIG_FILES([Makefile tests/Makefile])
     AC_OUTPUT
 END
-  if test $auxdir = .; then
-    test_driver=test-driver
-  else
-    mkdir $auxdir
-    test_driver=$auxdir/test-driver
-  fi
-  # No 'AUTOMAKE_OPTIONS' in here -- purposely.
   unindent > Makefile.am << END
     SUBDIRS = tests
     check-local: test-top
@@ -57,7 +51,6 @@ END
     .PHONY: test-top
 END
   unindent > tests/Makefile.am << END
-    AUTOMAKE_OPTIONS = $am_opts
     check-local: test-sub
     test-sub:
        echo ' ' \$(DIST_COMMON) ' ' | grep '[ /]$test_driver '
@@ -84,10 +77,7 @@ END
   $AUTOMAKE
   diff Makefile.in Makefile.sav
   diff tests/Makefile.in tests/Makefile.sav
-  :
-}
-
-do_check ac .
-do_check am build-aux
+  cd "$ocwd" || fatal_ "cannot chdir back to '$ocwd'"
+done
 
 :
diff --git a/t/test-driver-strip-vpath.sh b/t/test-driver-strip-vpath.sh
index ab774db..6aafb6a 100755
--- a/t/test-driver-strip-vpath.sh
+++ b/t/test-driver-strip-vpath.sh
@@ -17,7 +17,7 @@
 # Custom test drivers: check that the test name passed to the test
 # driver has any VPATH prefix stripped.
 
-. ./defs || exit 1
+. test-init.sh
 
 ocwd=$(pwd) || fatal_ "cannot get current working directory"
 
diff --git a/t/test-driver-trs-suffix-registered.sh 
b/t/test-driver-trs-suffix-registered.sh
index 78acca2..9ce8b56 100755
--- a/t/test-driver-trs-suffix-registered.sh
+++ b/t/test-driver-trs-suffix-registered.sh
@@ -20,7 +20,7 @@
 #  - .test if $(TEST_EXTENSIONS) is not defined
 #  - stuff in $(TEST_EXTENSIONS) otherwise
 
-. ./defs || exit 1
+. test-init.sh
 
 : > Makefile.am
 
diff --git a/t/test-extensions-cond.sh b/t/test-extensions-cond.sh
index dda0193..3cc7d85 100755
--- a/t/test-extensions-cond.sh
+++ b/t/test-extensions-cond.sh
@@ -16,7 +16,7 @@
 
 # Expose bug in conditional definition of TEST_EXTENSIONS.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AM_CONDITIONAL([COND], [:])
diff --git a/t/test-extensions.sh b/t/test-extensions.sh
index 8f8c413..b1c457a 100755
--- a/t/test-extensions.sh
+++ b/t/test-extensions.sh
@@ -18,7 +18,7 @@
 # and do not diagnose valid (albeit more unusual) ones.
 # See automake bug#9400.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac <<'END'
 AC_OUTPUT
diff --git a/t/test-harness-vpath-rewrite.sh b/t/test-harness-vpath-rewrite.sh
index 85e4bbb..ce904ce 100755
--- a/t/test-harness-vpath-rewrite.sh
+++ b/t/test-harness-vpath-rewrite.sh
@@ -17,7 +17,7 @@
 # Check that our concurrent test harness is not subject to spurious VPATH
 # rewrites.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_OUTPUT
diff --git a/t/test-log.sh b/t/test-log.sh
index 0350cce..91c31c6 100755
--- a/t/test-log.sh
+++ b/t/test-log.sh
@@ -22,7 +22,7 @@
 #  - VERBOSE environment variable support
 # Keep in sync with 'tap-log.sh'.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac <<END
 AC_OUTPUT
diff --git a/t/test-logs-repeated.sh b/t/test-logs-repeated.sh
index 881f67f..f4dd066 100755
--- a/t/test-logs-repeated.sh
+++ b/t/test-logs-repeated.sh
@@ -20,7 +20,7 @@
 # different test scripts don't end up sharing the same log file.
 # (Automake itself is such a project, BTW ;-)
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac <<END
 AC_OUTPUT
diff --git a/t/test-metadata-global-log.sh b/t/test-metadata-global-log.sh
index 74bb6ff..b646cc2 100755
--- a/t/test-metadata-global-log.sh
+++ b/t/test-metadata-global-log.sh
@@ -14,13 +14,13 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Custom test drivers and parallel-tests harness: check the documented
+# Custom test drivers and parallel test harness: check the documented
 # semantics for deciding when the content of a test log file should be
 # copied in the global test-suite.log file.  Currently, this is done
 # with the use of the reStructuredText field ':copy-in-global-log:' in
 # the associated '.trs' files.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_OUTPUT
diff --git a/t/test-metadata-global-result.sh b/t/test-metadata-global-result.sh
index 8b6a3c8..d7fd8e9 100755
--- a/t/test-metadata-global-result.sh
+++ b/t/test-metadata-global-result.sh
@@ -18,7 +18,7 @@
 # "global test result" in '*.trs' files, as documented in the automake
 # manual.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_OUTPUT
diff --git a/t/test-metadata-recheck.sh b/t/test-metadata-recheck.sh
index 4f2d29b..1aadc05 100755
--- a/t/test-metadata-recheck.sh
+++ b/t/test-metadata-recheck.sh
@@ -17,7 +17,7 @@
 # Test the "make recheck" semantics for custom test drivers, as documented
 # in the Automake manual.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_OUTPUT
diff --git a/t/test-metadata-results.sh b/t/test-metadata-results.sh
index 2410e03..5bcd0b8 100755
--- a/t/test-metadata-results.sh
+++ b/t/test-metadata-results.sh
@@ -17,7 +17,7 @@
 # Parallel testsuite harness: check APIs for the registering of test
 # results in '*.trs' files, as documented in the automake manual.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_OUTPUT
diff --git a/t/test-missing.sh b/t/test-missing.sh
index 5db274d..f830248 100755
--- a/t/test-missing.sh
+++ b/t/test-missing.sh
@@ -18,7 +18,7 @@
 #  - non-existent scripts listed in TESTS get diagnosed
 # See also related test 'test-missing2.sh'.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_OUTPUT
diff --git a/t/test-missing2.sh b/t/test-missing2.sh
index 2ba3479..ca0588e 100755
--- a/t/test-missing2.sh
+++ b/t/test-missing2.sh
@@ -19,7 +19,7 @@
 #    all the $(TEST_LOGS) have a dummy dependency.
 # See also related test 'test-missing.sh'.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_OUTPUT
diff --git a/t/test-trs-basic.sh b/t/test-trs-basic.sh
index f0c30b8..209e023 100755
--- a/t/test-trs-basic.sh
+++ b/t/test-trs-basic.sh
@@ -18,7 +18,7 @@
 #  - creation and removal of '.trs' auxiliary files
 #  - check some internals regarding the use of '.trs' files.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac <<END
 AC_OUTPUT
diff --git a/t/test-trs-recover.sh b/t/test-trs-recover.sh
index 95a9ddc..6821839 100755
--- a/t/test-trs-recover.sh
+++ b/t/test-trs-recover.sh
@@ -19,7 +19,7 @@
 # This test is complex and tricky, but that's acceptable since we are
 # testing semantics that are potentially complex and tricky.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac <<END
 AC_OUTPUT
diff --git a/t/test-trs-recover2.sh b/t/test-trs-recover2.sh
index b8e56b5..8db3ed8 100755
--- a/t/test-trs-recover2.sh
+++ b/t/test-trs-recover2.sh
@@ -17,7 +17,7 @@
 # Check parallel harness features:
 #  - recovery from unreadable '.trs' files, in various scenarios
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac <<END
 AC_OUTPUT
diff --git a/t/tests-environment-and-log-compiler.sh 
b/t/tests-environment-and-log-compiler.sh
index 9184a5e..3fd1b28 100755
--- a/t/tests-environment-and-log-compiler.sh
+++ b/t/tests-environment-and-log-compiler.sh
@@ -18,7 +18,7 @@
 # by TESTS_ENVIRONMENT and AM_TESTS_ENVIRONMENT in LOG_COMPILER and
 # LOG_FLAGS (for tests both with and without registered extensions).
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_OUTPUT
diff --git a/t/tests-environment-backcompat.sh 
b/t/tests-environment-backcompat.sh
index a5d888d..bd79456 100755
--- a/t/tests-environment-backcompat.sh
+++ b/t/tests-environment-backcompat.sh
@@ -16,11 +16,11 @@
 
 # With old serial testsuite driver, TESTS_ENVIRONMENT can be used to
 # define the "test runner", i.e. the program that the test scripts must
-# be run by (with the parallel-tests driver one should use LOG_COMPILER
+# be run by (with the parallel test harness one should use LOG_COMPILER
 # for this).  The behaviour tested here is also documented in the manual.
 
 am_serial_tests=yes
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac <<END
 AC_SUBST([PERL], ['$PERL'])
diff --git a/t/tests-environment-fd-redirect.sh 
b/t/tests-environment-fd-redirect.sh
index 5780e57..1a512ba 100755
--- a/t/tests-environment-fd-redirect.sh
+++ b/t/tests-environment-fd-redirect.sh
@@ -26,7 +26,7 @@
 # and the following CC:ed thread on bug-autoconf list:
 #   <http://lists.gnu.org/archive/html/bug-autoconf/2011-06/msg00002.html>
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_OUTPUT
diff --git a/t/tests-environment.sh b/t/tests-environment.sh
index d6f219d..519aa92 100755
--- a/t/tests-environment.sh
+++ b/t/tests-environment.sh
@@ -17,7 +17,7 @@
 # "Simple Tests" testsuite driver: check TESTS_ENVIRONMENT support.
 
 am_serial_tests=yes
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_OUTPUT
diff --git a/t/testsuite-summary-count-many.sh 
b/t/testsuite-summary-count-many.sh
index 553df50..7fee21d 100755
--- a/t/testsuite-summary-count-many.sh
+++ b/t/testsuite-summary-count-many.sh
@@ -19,7 +19,7 @@
 # Incidentally, this test also checks that the testsuite summary doesn't
 # give any bug-report address if it's not defined.
 
-. ./defs || exit 1
+. test-init.sh
 
 for s in trivial-test-driver extract-testsuite-summary.pl; do
   cp "$am_testaux_srcdir/$s" . || fatal_ "failed to fetch auxiliary script $s"
diff --git a/t/testsuite-summary-reference-log.sh 
b/t/testsuite-summary-reference-log.sh
index 1851226..6b7485b 100755
--- a/t/testsuite-summary-reference-log.sh
+++ b/t/testsuite-summary-reference-log.sh
@@ -17,7 +17,7 @@
 # Check that the global testsuite log file referenced in the testsuite
 # summary and in the global testsuite log itself is correct.
 
-. ./defs || exit 1
+. test-init.sh
 
 mv configure.ac configure.stub
 
diff --git a/t/transform.sh b/t/transform.sh
index aa07970..dfea36f 100755
--- a/t/transform.sh
+++ b/t/transform.sh
@@ -17,7 +17,7 @@
 # Make sure that --program-transform works.
 
 required=cc
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac <<'END'
 AC_PROG_CC
diff --git a/t/transform2.sh b/t/transform2.sh
index cab5f1a..72c5359 100755
--- a/t/transform2.sh
+++ b/t/transform2.sh
@@ -18,7 +18,7 @@
 # collapsed.
 
 required=cc
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac <<'END'
 AC_PROG_CC
diff --git a/t/transform3.sh b/t/transform3.sh
index fc37be1..8eb6735 100755
--- a/t/transform3.sh
+++ b/t/transform3.sh
@@ -18,7 +18,7 @@
 # stuff (in particular, pgklibdir, pkgdatadir and pkglibexecdir).
 
 required=cc
-. ./defs || exit 1
+. test-init.sh
 
 cat > configure.ac <<'END'
 AC_INIT([foo], [1.0])
diff --git a/t/txinfo-no-clutter.sh b/t/txinfo-no-clutter.sh
index 3de21b4..0325e68 100755
--- a/t/txinfo-no-clutter.sh
+++ b/t/txinfo-no-clutter.sh
@@ -14,19 +14,28 @@
 # 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 pdf, ps and dvi targets shouldn't let clutter in the build directory.
-# Related to automake bug#11146.
+# The info, html, pdf, ps and dvi targets shouldn't let clutter in the
+# build directory.  Related to automake bug#11146.
 
-required='makeinfo tex texi2dvi-o dvips'
-. ./defs || exit 1
+required='makeinfo tex texi2dvi dvips'
+. test-init.sh
 
-mkdir sub
-
-echo AC_OUTPUT >> configure.ac
+cat >> configure.ac <<'END'
+AC_CONFIG_FILES([sub/Makefile])
+AC_OUTPUT
+END
 
 cat > Makefile.am << 'END'
-all-local: ps pdf dvi html
-info_TEXINFOS = foo.texi sub/bar.texi
+all-local: ps pdf dvi html # For "make distcheck".
+info_TEXINFOS = foo.texi doc/bar.texi baz.texi
+SUBDIRS = sub
+END
+
+mkdir sub doc
+
+cat > sub/Makefile.am << 'END'
+all-local: ps pdf dvi html # For "make distcheck".
+info_TEXINFOS = baz.texi
 END
 
 cat > foo.texi << 'END'
@@ -39,7 +48,7 @@ Hello walls.
 @bye
 END
 
-cat > sub/bar.texi << 'END'
+cat > doc/bar.texi << 'END'
 \input texinfo
 @setfilename bar.info
 @settitle bar
@@ -53,15 +62,6 @@ cat > baz.texi << 'END'
 \input texinfo
 @setfilename baz.info
 @settitle baz
address@hidden Top
-Hello walls.
address@hidden
-END
-
-cat > baz.texi << 'END'
-\input texinfo
address@hidden baz.info
address@hidden baz
 @defindex au
 @defindex sa
 @defindex sb
@@ -81,6 +81,8 @@ sb
 @bye
 END
 
+cp baz.texi sub
+
 $ACLOCAL
 $AUTOMAKE --add-missing
 $AUTOCONF
@@ -91,10 +93,53 @@ $AUTOCONF
 # clean up potential cruft left by earlier ones.
 for fmt in info pdf ps dvi html all; do
   $MAKE $fmt
-  ls -l . sub # For debugging.
-  ls -d foo* baz* sub/bar* > lst
-  $EGREP -v '^(foo|sub/bar|baz)\.(texi|dvi|ps|pdf|html|info)$' lst && exit 1
-  $MAKE clean
+  # For debugging.
+  ls -l . doc sub
+  # Sanity check.
+  case $fmt in
+    html)
+      test -e foo.html
+      test -e doc/bar.html
+      test -e baz.html
+      test -e sub/baz.html
+      ;;
+    all)
+      for x in info pdf ps dvi; do
+        test -f foo.$x
+        test -f doc/bar.$x
+        test -f baz.$x
+        test -f sub/baz.$x
+      done
+      test -e foo.html
+      test -e doc/bar.html
+      test -e baz.html
+      test -e sub/baz.html
+      ;;
+    *)
+      test -f foo.$fmt
+      test -f doc/bar.$fmt
+      test -f baz.$fmt
+      test -f sub/baz.$fmt
+      ;;
+  esac
+  # Real test.
+  ls -d foo* baz* sub/baz* doc/bar* > lst
+  basename_rx='(foo|doc/bar|baz|sub/baz)'
+  case $fmt in
+    pdf) extension_rx="(texi|pdf|t2p)";;
+    dvi) extension_rx="(texi|dvi|t2d)";;
+     ps) extension_rx="(texi|ps|dvi|t2d)";;
+   info) extension_rx="(texi|info)";;
+   html) extension_rx="(texi|html)";;
+    all) extension_rx="(texi|html|info|pdf|ps|dvi|t2[pd])";;
+      *) fatal_ "unreachable code reached";;
+  esac
+  $EGREP -v "^$basename_rx\.$extension_rx$" lst && exit 1
+  # Cleanup for checks on the next format.
+  case $fmt in
+    info) rm -f *.info doc/*.info sub/*.info;;
+       *) $MAKE clean;;
+  esac
 done
 
 $MAKE distcheck
diff --git a/t/txinfo-unrecognized-extension.sh 
b/t/txinfo-unrecognized-extension.sh
index 96b5f91..bb2b83d 100755
--- a/t/txinfo-unrecognized-extension.sh
+++ b/t/txinfo-unrecognized-extension.sh
@@ -17,7 +17,7 @@
 # Test that automake complains properly when the files with unrecognized
 # extensions are passed to the TEXINFOS primary.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am << 'END'
 info_TEXINFOS = foobar.foo bazquux.tex zardoz.c
diff --git a/t/txinfo.sh b/t/txinfo.sh
index 31990c4..8b22b27 100755
--- a/t/txinfo.sh
+++ b/t/txinfo.sh
@@ -18,7 +18,7 @@
 # Jim Meyering.
 
 required=makeinfo
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac <<'END'
 AC_OUTPUT
diff --git a/t/txinfo10.sh b/t/txinfo10.sh
index 903d6f5..2a186e1 100755
--- a/t/txinfo10.sh
+++ b/t/txinfo10.sh
@@ -17,7 +17,7 @@
 # Make sure dvi target recurses into subdir.
 # Reported by Pavel Roskin.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am << 'END'
 SUBDIRS = sub
diff --git a/t/txinfo13.sh b/t/txinfo13.sh
index 53a2ee7..374c44a 100755
--- a/t/txinfo13.sh
+++ b/t/txinfo13.sh
@@ -18,8 +18,8 @@
 # Also make sure we do not distribute too much foo.info* files (Report
 # from Vincent Lefevre).
 
-required='makeinfo tex texi2dvi-o'
-. ./defs || exit 1
+required='makeinfo tex texi2dvi'
+. test-init.sh
 
 echo AC_OUTPUT >> configure.ac
 
diff --git a/t/txinfo16.sh b/t/txinfo16.sh
index f4c1cee..11f7dea 100755
--- a/t/txinfo16.sh
+++ b/t/txinfo16.sh
@@ -18,7 +18,7 @@
 # not in $(builddir).
 
 required='makeinfo tex texi2dvi'
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_OUTPUT
diff --git a/t/txinfo17.sh b/t/txinfo17.sh
index d216769..f125af4 100755
--- a/t/txinfo17.sh
+++ b/t/txinfo17.sh
@@ -17,7 +17,7 @@
 # Make sure Automake uses the _first_ @setfilname it sees.
 # Report from Karl Berry.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am << 'END'
 info_TEXINFOS = texinfo.texi
diff --git a/t/txinfo19.sh b/t/txinfo19.sh
index 71af13a..1fbc79e 100755
--- a/t/txinfo19.sh
+++ b/t/txinfo19.sh
@@ -17,7 +17,7 @@
 # Test support for DJGPP's .iNN info files.
 
 required=makeinfo
-. ./defs || exit 1
+. test-init.sh
 
 echo AC_OUTPUT >> configure.ac
 
diff --git a/t/txinfo2.sh b/t/txinfo2.sh
index 37c2953..c5e0e47 100755
--- a/t/txinfo2.sh
+++ b/t/txinfo2.sh
@@ -17,7 +17,7 @@
 # Test to ensure that a ".info~" file doesn't end up in the
 # distribution.  Bug report from Greg McGary.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_OUTPUT
diff --git a/t/txinfo20.sh b/t/txinfo20.sh
index 3d644f5..261725d 100755
--- a/t/txinfo20.sh
+++ b/t/txinfo20.sh
@@ -17,7 +17,7 @@
 # Make sure info files survive makeinfo errors.
 
 required=makeinfo
-. ./defs || exit 1
+. test-init.sh
 
 echo AC_OUTPUT >> configure.ac
 
diff --git a/t/txinfo21.sh b/t/txinfo21.sh
index 5a3da15..4e9245c 100755
--- a/t/txinfo21.sh
+++ b/t/txinfo21.sh
@@ -17,8 +17,8 @@
 # Test support for building HTML documentation, and the many
 # install-DOC flavors.
 
-required='makeinfo-html tex texi2dvi'
-. ./defs || exit 1
+required='makeinfo tex texi2dvi'
+. test-init.sh
 
 cat >>configure.ac <<\EOF
 AC_CONFIG_FILES([rec/Makefile])
@@ -34,6 +34,7 @@ AC_OUTPUT
 EOF
 
 cat > Makefile.am << 'END'
+check-local: ps pdf dvi html # For "make distcheck".
 SUBDIRS = rec
 info_TEXINFOS = main.texi sub/main2.texi
 END
@@ -75,13 +76,15 @@ install-pdf-local:
        :> "$(pdfdir)/hello"
 uninstall-local:
        rm -f "$(pdfdir)/hello"
+
+check-local: ps pdf dvi html # For "make distcheck".
 END
 
 $ACLOCAL
 $AUTOMAKE --add-missing
 $AUTOCONF
 
-./configure
+./configure --prefix "$(pwd)"
 
 $MAKE
 
@@ -115,17 +118,20 @@ test ! -e sub/main2.html
 test ! -e rec/main3.html
 
 # Make sure AM_MAKEINFOHTMLFLAGS is supported, and override AM_MAKEINFO.
+
+cp Makefile.am Makefile.sav
 cat >>Makefile.am <<\EOF
 AM_MAKEINFOHTMLFLAGS = --no-headers --no-split
 AM_MAKEINFOFLAGS = --unsupported-option
 EOF
 $AUTOMAKE
-./configure --prefix "$(pwd)"
+./config.status Makefile
 
 $MAKE html
 test -f main.html
 test -f sub/main2.html
 test -d rec/main3.html
+
 $MAKE clean
 test ! -e main.html
 test ! -e sub/main2.html
@@ -174,4 +180,11 @@ test ! -e share/$me/pdf/main2.pdf
 test ! -e share/$me/pdf/main3.pdf
 test ! -e share/$me/pdf/hello
 
+# Restore the makefile without a broken AM_MAKEINFOFLAGS definition.
+mv -f Makefile.sav Makefile.am
+$AUTOMAKE
+./config.status Makefile
+
+$MAKE distcheck
+
 :
diff --git a/t/txinfo22.sh b/t/txinfo22.sh
index efde953..d337d6e 100755
--- a/t/txinfo22.sh
+++ b/t/txinfo22.sh
@@ -19,7 +19,7 @@
 # Report from Tom Tromey.
 
 required='makeinfo tex texi2dvi'
-. ./defs || exit 1
+. test-init.sh
 
 cat > configure.ac << END
 AC_INIT([$me], [1.0])
diff --git a/t/txinfo23.sh b/t/txinfo23.sh
index 294370b..6b90f18 100755
--- a/t/txinfo23.sh
+++ b/t/txinfo23.sh
@@ -19,8 +19,8 @@
 # (Similar to txinfo13.sh, plus DISTCLEANFILES).
 # (See also txinfo24.sh and txinfo25.sh).
 
-required='makeinfo tex texi2dvi-o'
-. ./defs || exit 1
+required='makeinfo tex texi2dvi'
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_OUTPUT
diff --git a/t/txinfo24.sh b/t/txinfo24.sh
index ae3e8ab..5a89c6b 100755
--- a/t/txinfo24.sh
+++ b/t/txinfo24.sh
@@ -18,8 +18,8 @@
 # (Similar to txinfo16.sh, plus CLEANFILES).
 # (See also txinfo23.sh and txinfo25.sh).
 
-required='makeinfo tex texi2dvi-o'
-. ./defs || exit 1
+required='makeinfo tex texi2dvi'
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_OUTPUT
diff --git a/t/txinfo25.sh b/t/txinfo25.sh
index 4feedca..45ea428 100755
--- a/t/txinfo25.sh
+++ b/t/txinfo25.sh
@@ -20,8 +20,8 @@
 # (Similar to txinfo16.sh, plus CLEANFILES).
 # (See also txinfo23.sh and txinfo24.sh).
 
-required='makeinfo tex texi2dvi-o'
-. ./defs || exit 1
+required='makeinfo tex texi2dvi'
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_OUTPUT
diff --git a/t/txinfo26.sh b/t/txinfo26.sh
index 5401fc9..268f818 100755
--- a/t/txinfo26.sh
+++ b/t/txinfo26.sh
@@ -18,7 +18,7 @@
 # PR/408
 
 required='makeinfo'
-. ./defs || exit 1
+. test-init.sh
 
 echo AC_OUTPUT >> configure.ac
 
diff --git a/t/txinfo27.sh b/t/txinfo27.sh
index bfc075a..f1e8791 100755
--- a/t/txinfo27.sh
+++ b/t/txinfo27.sh
@@ -17,7 +17,7 @@
 # Make sure install-info works even if no-installinfo is given.
 
 required='makeinfo'
-. ./defs || exit 1
+. test-init.sh
 
 echo AC_OUTPUT >> configure.ac
 
diff --git a/t/txinfo28.sh b/t/txinfo28.sh
index 216cb63..069a515 100755
--- a/t/txinfo28.sh
+++ b/t/txinfo28.sh
@@ -19,8 +19,8 @@
 # references.
 # Report from Ralf Corsepius.
 
-required='makeinfo tex texi2dvi-o'
-. ./defs || exit 1
+required='makeinfo tex texi2dvi'
+. test-init.sh
 
 # This setting, when honored by GNU ls, used to cause an infinite loop
 # in mdate-sh.
diff --git a/t/txinfo29.sh b/t/txinfo29.sh
index 3e27362..b219678 100755
--- a/t/txinfo29.sh
+++ b/t/txinfo29.sh
@@ -17,7 +17,7 @@
 # Make sure that INFO_DEPS can be overridden.
 # Report from Bruce Korb.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am << 'END'
 INFO_DEPS = foo.info
diff --git a/t/txinfo3.sh b/t/txinfo3.sh
index 5d7694f..d6f7caf 100755
--- a/t/txinfo3.sh
+++ b/t/txinfo3.sh
@@ -17,7 +17,7 @@
 # Test to make sure .info-less @setfilename works.
 
 required='makeinfo tex texi2dvi'
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_OUTPUT
diff --git a/t/txinfo30.sh b/t/txinfo30.sh
deleted file mode 100755
index 8c6aa91..0000000
--- a/t/txinfo30.sh
+++ /dev/null
@@ -1,63 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2005-2012 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 'missing texinfo' does not create empty files.
-# Report from Bob Proulx.
-
-. ./defs || exit 1
-
-echo info_TEXINFOS = bar.texi >Makefile.am
-echo grepme >bar.info
-$sleep
-cat >bar.texi <<EOF
address@hidden bar.info
-EOF
-
-echo AC_OUTPUT >>configure.ac
-
-cat >makeinfo <<\EOF
-#!/bin/sh
-# This script
-# 1. fails so 'missing' can take over
-# 2. does not understand '--version' so 'missing' thinks 'makeinfo' isn't
-#    installed
-exec false
-EOF
-
-chmod +x makeinfo
-
-PATH=$(pwd)$PATH_SEPARATOR$PATH
-export PATH
-
-# Otherwise configure might pick up a working makeinfo from the
-# environment.  Seen in automake bug#10866.
-unset MAKEINFO || :
-
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE --add-missing
-
-./configure
-$MAKE
-grep grepme bar.info
-test -f bar.info
-
-# We should not create a missing bar.info.
-rm -f bar.info
-$MAKE && exit 1
-test ! -e bar.info
-
-:
diff --git a/t/txinfo31.sh b/t/txinfo31.sh
index e8186e5..567e28f 100755
--- a/t/txinfo31.sh
+++ b/t/txinfo31.sh
@@ -17,7 +17,7 @@
 # Make sure file extensions are matched correctly.
 # Report from Eric Dorland.
 
-. ./defs || exit 1
+. test-init.sh
 
 echo info_TEXINFOS = bar.texi >Makefile.am
 cat >bar.texi <<EOF
diff --git a/t/txinfo32.sh b/t/txinfo32.sh
index 9f2134a..c9d7d83 100755
--- a/t/txinfo32.sh
+++ b/t/txinfo32.sh
@@ -17,7 +17,7 @@
 # Make sure the documentation targets work as required with BSD make,
 # even in the presence of subdirs (requires presence of default *-am rules).
 
-. ./defs || exit 1
+. test-init.sh
 
 mkdir sub
 cat >>configure.ac <<'END'
diff --git a/t/txinfo33.sh b/t/txinfo33.sh
index efb2678..47f4038 100755
--- a/t/txinfo33.sh
+++ b/t/txinfo33.sh
@@ -17,8 +17,8 @@
 # DVIS, PDFS, PSS, HTMLS should not be cleaned upon 'mostlyclean'.
 # Similar to txinfo25.sh.
 
-required='makeinfo tex texi2dvi-o dvips'
-. ./defs || exit 1
+required='makeinfo tex texi2dvi dvips'
+. test-init.sh
 
 mkdir sub
 
diff --git a/t/txinfo4.sh b/t/txinfo4.sh
index e6c67b9..6784d03 100755
--- a/t/txinfo4.sh
+++ b/t/txinfo4.sh
@@ -16,7 +16,7 @@
 
 # Make sure non-empty, non-info suffixes are diagnosed.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am << 'END'
 info_TEXINFOS = textutils.texi
diff --git a/t/txinfo5.sh b/t/txinfo5.sh
deleted file mode 100755
index 44a2fae..0000000
--- a/t/txinfo5.sh
+++ /dev/null
@@ -1,38 +0,0 @@
-#! /bin/sh
-# Copyright (C) 1998-2012 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 that texinfo.tex is not required by --cygnus.
-# Also check that TEXINFOS + cygnus work without requiring the
-# '-Wno-override' option.
-# See also sister test txinfo5b.sh.
-# Report from Ian Taylor.
-
-. ./defs || exit 1
-
-cat >> configure.ac << 'END'
-AM_MAINTAINER_MODE
-END
-
-cat > Makefile.am << 'END'
-info_TEXINFOS = ian.texi
-END
-
-echo '@setfilename ian.info' > ian.texi
-
-$ACLOCAL
-$AUTOMAKE --cygnus -Wno-obsolete
-
-:
diff --git a/t/txinfo5b.sh b/t/txinfo5b.sh
deleted file mode 100755
index 6c81ced..0000000
--- a/t/txinfo5b.sh
+++ /dev/null
@@ -1,42 +0,0 @@
-#! /bin/sh
-# Copyright (C) 1998-2012 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 that texinfo.tex is not required by --cygnus.
-# See also sister test txinfo5.sh.
-# Report from Ian Taylor.
-
-. ./defs || exit 1
-
-cat >> configure.ac << 'END'
-AM_MAINTAINER_MODE
-END
-
-cat > Makefile.am << 'END'
-# Disable 'override' warnings to work around an unrelated
-# texi+cygnus bug.
-# Disable obsolete warnings because the 'cygnus' mode is now deprecated.
-AUTOMAKE_OPTIONS = -Wno-override -Wno-obsolete
-info_TEXINFOS = ian.texi
-END
-
-echo '@setfilename ian.info' > ian.texi
-
-$ACLOCAL
-$AUTOMAKE --cygnus
-$AUTOMAKE -a --cygnus
-test ! -e texinfo.tex
-
-:
diff --git a/t/txinfo6.sh b/t/txinfo6.sh
index ca3184d..549ead8 100755
--- a/t/txinfo6.sh
+++ b/t/txinfo6.sh
@@ -16,7 +16,7 @@
 
 # Test to make sure '.txi' extension works.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am << 'END'
 info_TEXINFOS = foo.txi
diff --git a/t/txinfo7.sh b/t/txinfo7.sh
index 93d199c..8d72054 100755
--- a/t/txinfo7.sh
+++ b/t/txinfo7.sh
@@ -17,7 +17,7 @@
 # Test to make sure texinfo.tex correctly installed by -a.  Bug report
 # by Per Cederqvist.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am << 'END'
 info_TEXINFOS = textutils.texi
diff --git a/t/txinfo8.sh b/t/txinfo8.sh
index 6b1c6fa..46b791a 100755
--- a/t/txinfo8.sh
+++ b/t/txinfo8.sh
@@ -18,7 +18,7 @@
 # -a when we're using AC_CONFIG_AUX_DIR.  Bug report by by Per
 # Cederqvist.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > configure.ac << END
 AC_INIT([$me], [1.0])
diff --git a/t/txinfo9.sh b/t/txinfo9.sh
index 97770f4..63dcf75 100755
--- a/t/txinfo9.sh
+++ b/t/txinfo9.sh
@@ -16,7 +16,7 @@
 
 # Make sure we only create texinfo-related targets once.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am << 'END'
 info_TEXINFOS = maude.texi liver.txi heart.texinfo
diff --git a/t/uninstall-fail.sh b/t/uninstall-fail.sh
index 510c968..6c0c57c 100755
--- a/t/uninstall-fail.sh
+++ b/t/uninstall-fail.sh
@@ -20,7 +20,7 @@
 # tests for other primaries too?  E.g., SCRIPTS, PROGRAMS, LISP, PYTHON,
 # etc...
 
-. ./defs || exit 1
+. test-init.sh
 
 mkdir d
 : > d/f
diff --git a/t/uninstall-pr9578.sh b/t/uninstall-pr9578.sh
index cb870b3..e5f9acb 100755
--- a/t/uninstall-pr9578.sh
+++ b/t/uninstall-pr9578.sh
@@ -22,7 +22,7 @@
 # need sister tests for other primaries too?  E.g., PROGRAMS, LISP,
 # PYTHON, etc...
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_OUTPUT
diff --git a/t/unused.sh b/t/unused.sh
index 79c7b41..11c43c1 100755
--- a/t/unused.sh
+++ b/t/unused.sh
@@ -16,7 +16,7 @@
 
 # Test for failing check for unused macros.  From Johan Danielsson.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 MACRO_1
diff --git a/t/upc.sh b/t/upc.sh
index 4128ea0..3800a06 100755
--- a/t/upc.sh
+++ b/t/upc.sh
@@ -16,7 +16,7 @@
 
 # A simple Hello World for UPC.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AM_PROG_UPC
diff --git a/t/upc2.sh b/t/upc2.sh
index be6461f..5abd0df 100755
--- a/t/upc2.sh
+++ b/t/upc2.sh
@@ -17,7 +17,7 @@
 # Test that Automake suggests using AM_PROG_UPC if Unified Parallel C
 # sources are used.
 
-. ./defs || exit 1
+. test-init.sh
 
 echo AC_PROG_CC >>configure.ac
 
diff --git a/t/upc3.sh b/t/upc3.sh
index 7da65d5..e031252 100755
--- a/t/upc3.sh
+++ b/t/upc3.sh
@@ -16,7 +16,7 @@
 
 # Test that C and Unified Parallel C link safely.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/var-recurs.sh b/t/var-recurs.sh
new file mode 100755
index 0000000..7a61584
--- /dev/null
+++ b/t/var-recurs.sh
@@ -0,0 +1,34 @@
+#! /bin/sh
+# Copyright (C) 1998-2012 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 recursive variable definitions die.
+
+. test-init.sh
+
+cat >> configure.ac << 'END'
+AC_PROG_CC
+END
+
+cat > Makefile.am << 'END'
+bin_PROGRAMS = $(foo)
+foo = $(bin_PROGRAMS)
+END
+
+$ACLOCAL
+AUTOMAKE_fails
+grep 'Makefile\.am:.*bin_PROGRAMS.*recursively defined' stderr
+
+:
diff --git a/t/var-recurs2.sh b/t/var-recurs2.sh
new file mode 100755
index 0000000..edf5d7b
--- /dev/null
+++ b/t/var-recurs2.sh
@@ -0,0 +1,31 @@
+#! /bin/sh
+# Copyright (C) 1998-2012 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 recursive variable definitions die.
+# From Jim Meyering.
+
+. test-init.sh
+
+cat > Makefile.am << 'END'
+man_MANS = chgrp.1
+man_aux = $(man_MANS:.1=.x)
+EXTRA_DIST = $(man_aux) $(man_MANS)
+END
+
+$ACLOCAL
+$AUTOMAKE
+
+:
diff --git a/t/vars.sh b/t/vars.sh
index cf45cb9..14c62d8 100755
--- a/t/vars.sh
+++ b/t/vars.sh
@@ -17,7 +17,7 @@
 # Test various variable definitions that include an '=' sign.
 # From Raja R Harinath.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am << 'END'
 MY_FLAGS_1=-DABC=345
diff --git a/t/vars3.sh b/t/vars3.sh
index be30006..72af29c 100755
--- a/t/vars3.sh
+++ b/t/vars3.sh
@@ -17,7 +17,7 @@
 # Check that Automake warns about variables containing spaces
 # and other non-POSIX characters.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >Makefile.am <<'EOF'
 L01 = $(shell echo *)
diff --git a/t/vartar.sh b/t/vartar.sh
index 1c9dc3b..384538a 100755
--- a/t/vartar.sh
+++ b/t/vartar.sh
@@ -16,7 +16,7 @@
 
 # Targets and macros are two different name spaces.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am << 'END'
 install = install
diff --git a/t/vartypo2.sh b/t/vartypo2.sh
index 90facaa..94151eb 100755
--- a/t/vartypo2.sh
+++ b/t/vartypo2.sh
@@ -18,7 +18,7 @@
 # Libtool variant.
 
 required=libtoolize
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac <<'END'
 AM_PROG_AR
diff --git a/t/vartypos.sh b/t/vartypos.sh
index 16317fb..e8da7e7 100755
--- a/t/vartypos.sh
+++ b/t/vartypos.sh
@@ -16,7 +16,7 @@
 
 # Make sure we warn about possible variable typos when we should.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac <<'END'
 AC_PROG_RANLIB
diff --git a/t/version.sh b/t/version.sh
deleted file mode 100755
index acfbbe6..0000000
--- a/t/version.sh
+++ /dev/null
@@ -1,41 +0,0 @@
-#! /bin/sh
-# Copyright (C) 1996-2012 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 [...] is ok in version number.  Report from Jim
-# Meyering.
-
-. ./defs || exit 1
-
-cat > configure.ac << 'END'
-AC_INIT
-AM_INIT_AUTOMAKE([sh-utils], [1.12o])
-AC_CONFIG_FILES([Makefile])
-AC_OUTPUT
-END
-
-: > Makefile.am
-
-# Files required by Gnits.
-: > INSTALL
-: > NEWS
-: > README
-: > COPYING
-: > AUTHORS
-: > ChangeLog
-: > THANKS
-
-$ACLOCAL
-$AUTOMAKE --gnits -Wno-obsolete
diff --git a/t/version2.sh b/t/version2.sh
deleted file mode 100755
index b690dc9..0000000
--- a/t/version2.sh
+++ /dev/null
@@ -1,41 +0,0 @@
-#! /bin/sh
-# Copyright (C) 1997-2012 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 3rd arg to AM_INIT_AUTOMAKE not picked up in
-# version.  From Joel Weber.
-
-. ./defs || exit 1
-
-cat > configure.ac << 'END'
-AC_INIT
-AM_INIT_AUTOMAKE([sh-utils], [1.12o], [no])
-AC_CONFIG_FILES([Makefile])
-AC_OUTPUT
-END
-
-: > Makefile.am
-
-# Files required by Gnits.
-: > INSTALL
-: > NEWS
-: > README
-: > COPYING
-: > AUTHORS
-: > ChangeLog
-: > THANKS
-
-$ACLOCAL
-$AUTOMAKE --gnits -Wno-obsolete
diff --git a/t/version3.sh b/t/version3.sh
index 2b5294d..6299c61 100755
--- a/t/version3.sh
+++ b/t/version3.sh
@@ -16,7 +16,7 @@
 
 # Test to make sure version in AUTOMAKE_OPTIONS works.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am << 'END'
 AUTOMAKE_OPTIONS = 9.9x
diff --git a/t/version4.sh b/t/version4.sh
index f04305e..53285fe 100755
--- a/t/version4.sh
+++ b/t/version4.sh
@@ -16,7 +16,7 @@
 
 # Test to make sure we are compatible with the 1.4-p1 series.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am << 'END'
 AUTOMAKE_OPTIONS = 1.4-p3
diff --git a/t/version6.sh b/t/version6.sh
index 74fa088..659394e 100755
--- a/t/version6.sh
+++ b/t/version6.sh
@@ -16,7 +16,7 @@
 
 # Make sure the current version can be required.
 
-. ./defs || exit 1
+. test-init.sh
 
 amver=$($AUTOMAKE --version | sed -e 's/.* //;1q')
 
diff --git a/t/version7.sh b/t/version7.sh
index 812dc01..93eed4d 100755
--- a/t/version7.sh
+++ b/t/version7.sh
@@ -20,7 +20,7 @@
 # changes -- we don't support this feature on non-GNU Makes).
 
 required='makeinfo tex texi2dvi'
-. ./defs || exit 1
+. test-init.sh
 
 cat >configure.ac <<END
 m4_include([version.m4])
diff --git a/t/version8.sh b/t/version8.sh
index 28f7548..cff0f02 100755
--- a/t/version8.sh
+++ b/t/version8.sh
@@ -16,7 +16,7 @@
 
 # Calling AM_AUTOMAKE_VERSION by hand is a bug.
 
-. ./defs || exit 1
+. test-init.sh
 
 echo 'AM_AUTOMAKE_VERSION([1.9])' >>configure.ac
 $ACLOCAL 2>stderr && { cat stderr >&2; exit 0; }
diff --git a/t/vpath.sh b/t/vpath.sh
index dcb08ff..a67af17 100755
--- a/t/vpath.sh
+++ b/t/vpath.sh
@@ -17,7 +17,7 @@
 # Test to make sure VPATH can be overridden.
 # Report from Anthony Green.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am << 'END'
 VPATH = zardoz
diff --git a/t/vtexi.sh b/t/vtexi.sh
index 5928ddd..31b763e 100755
--- a/t/vtexi.sh
+++ b/t/vtexi.sh
@@ -17,7 +17,7 @@
 # Basic checks and some regressions testing on 'version.texi'
 # support for texinfo files.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am << 'END'
 info_TEXINFOS = textutils.texi
diff --git a/t/vtexi2.sh b/t/vtexi2.sh
index 30f679f..aee1044 100755
--- a/t/vtexi2.sh
+++ b/t/vtexi2.sh
@@ -19,7 +19,7 @@
 #   version.texi gets listed as a dependency for the .info file but
 #   not the .dvi file.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am << 'END'
 info_TEXINFOS = zardoz.texi
diff --git a/t/vtexi3.sh b/t/vtexi3.sh
index 9afadce..a49579a 100755
--- a/t/vtexi3.sh
+++ b/t/vtexi3.sh
@@ -20,7 +20,7 @@
 # See also the related test 'vtexi4.sh', which does similar checks, but
 # for version.texi only, and requires makeinfo, tex and texi2dvi.
 
-. ./defs || exit 1
+. test-init.sh
 
 # We are going to override package version in AC_INIT, so we need
 # to redefine the name of the distdir as well.
diff --git a/t/vtexi4.sh b/t/vtexi4.sh
index 3f2a89b..97345ac 100755
--- a/t/vtexi4.sh
+++ b/t/vtexi4.sh
@@ -21,8 +21,8 @@
 # for more vers*.texi files, and does not require makeinfo, tex and
 # texi2dvi.
 
-required='makeinfo tex texi2dvi-o grep-nonprint'
-. ./defs || exit 1
+required='makeinfo tex texi2dvi grep-nonprint'
+. test-init.sh
 
 test $(LC_ALL=C date '+%u') -gt 0 && test $(LC_ALL=C date '+%u') -lt 8 \
   && day=$(LC_ALL=C date '+%d')   && test -n "$day" \
diff --git a/t/warning-groups-win-over-strictness.sh 
b/t/warning-groups-win-over-strictness.sh
index 8824fa7..057ddaf 100755
--- a/t/warning-groups-win-over-strictness.sh
+++ b/t/warning-groups-win-over-strictness.sh
@@ -19,7 +19,7 @@
 # levels are "catch-all warnings" (such as '-Wall' and '-Wnone').
 # Since we are at it, also throw in *.am and *.m4 file inclusions.
 
-. ./defs || exit 1
+. test-init.sh
 
 # We want complete control over automake options.
 AUTOMAKE=$am_original_AUTOMAKE
diff --git a/t/warnings-obsolete-default.sh b/t/warnings-obsolete-default.sh
index fc439ea..7fbb1bc 100755
--- a/t/warnings-obsolete-default.sh
+++ b/t/warnings-obsolete-default.sh
@@ -17,7 +17,7 @@
 # Check that automake warnings in the 'obsolete' category are enabled
 # by default.
 
-. ./defs || exit 1
+. test-init.sh
 
 # We want (almost) complete control over automake options.
 AUTOMAKE="$am_original_AUTOMAKE --foreign -Werror"
diff --git a/t/warnings-override.sh b/t/warnings-override.sh
index 756cac8..94047a2 100755
--- a/t/warnings-override.sh
+++ b/t/warnings-override.sh
@@ -21,7 +21,7 @@
 # been in place for quite a long time); see also Automake bug #7673.
 # Update this test if the semantics are changed.
 
-. ./defs || exit 1
+. test-init.sh
 
 # We want (almost) complete control over automake options.
 AUTOMAKE="$am_original_AUTOMAKE -Werror"
diff --git a/t/warnings-precedence.sh b/t/warnings-precedence.sh
index 4c15ecd..4a42234 100755
--- a/t/warnings-precedence.sh
+++ b/t/warnings-precedence.sh
@@ -18,7 +18,7 @@
 # warnings specified later should take precedence over those specified
 # earlier.
 
-. ./defs || exit 1
+. test-init.sh
 
 # We want (almost) complete control over automake options.
 AUTOMAKE="$am_original_AUTOMAKE -Werror"
diff --git a/t/warnings-strictness-interactions.sh 
b/t/warnings-strictness-interactions.sh
index a2b6b40..83537a2 100755
--- a/t/warnings-strictness-interactions.sh
+++ b/t/warnings-strictness-interactions.sh
@@ -18,7 +18,7 @@
 # in AUTOMAKE_OPTIONS take precedence over explicit warnings given in
 # AM_INIT_AUTOMAKE.
 
-. ./defs || exit 1
+. test-init.sh
 
 # We want (almost) complete control over automake options.
 AUTOMAKE="$am_original_AUTOMAKE -Werror"
diff --git a/t/warnings-unknown.sh b/t/warnings-unknown.sh
index d1b2b8c..f5e809f 100755
--- a/t/warnings-unknown.sh
+++ b/t/warnings-unknown.sh
@@ -16,7 +16,7 @@
 
 # Check that automake complains about unknown warnings.
 
-. ./defs || exit 1
+. test-init.sh
 
 # We want (almost) complete control over automake options.
 AUTOMAKE="$am_original_AUTOMAKE --foreign -Werror"
@@ -34,10 +34,6 @@ END
 $ACLOCAL
 
 AUTOMAKE_fails -Wbazquux
-# FIXME: we could get rid of this once we improve our wrapper scripts.
-sed "s/^automake:/automake-$APIVERSION:/" stderr > t
-mv -f t stderr
-cat stderr >&2
 grep '^configure\.ac:2:.* unknown warning category.*zardoz' stderr
 grep '^Makefile\.am:1:.* unknown warning category.*foobar' stderr
 grep "^automake-$APIVERSION:.* unknown warning category.*bazquux" stderr
diff --git a/t/warnings-win-over-strictness.sh 
b/t/warnings-win-over-strictness.sh
index 087a70d..eaeb825 100755
--- a/t/warnings-win-over-strictness.sh
+++ b/t/warnings-win-over-strictness.sh
@@ -17,7 +17,7 @@
 # Check that, on the command line, explicitly-defined warnings take
 # precedence over implicit strictness-implied warnings.
 
-. ./defs || exit 1
+. test-init.sh
 
 # We want complete control over automake options.
 AUTOMAKE=$am_original_AUTOMAKE
diff --git a/t/warnopts.sh b/t/warnopts.sh
index 68ceb2a..65165b7 100755
--- a/t/warnopts.sh
+++ b/t/warnopts.sh
@@ -16,7 +16,7 @@
 
 # Make sure that we can enable or disable warnings on a per-file basis.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac <<END
 AC_CONFIG_FILES([sub/Makefile])
diff --git a/t/werror.sh b/t/werror.sh
index 01d76fc..57f6d64 100755
--- a/t/werror.sh
+++ b/t/werror.sh
@@ -16,7 +16,7 @@
 
 # Test to make sure -Werror and --add-missing work together.
 
-. ./defs || exit 1
+. test-init.sh
 
 : > Makefile.am
 
diff --git a/t/werror2.sh b/t/werror2.sh
index 52ec181..b1feeff 100755
--- a/t/werror2.sh
+++ b/t/werror2.sh
@@ -19,7 +19,7 @@
 # succeed if make is run a second time immediately afterwards.
 # Report from Harlan Stenn.
 
-. ./defs || exit 1
+. test-init.sh
 
 echo AC_OUTPUT>>configure.ac
 
diff --git a/t/werror3.sh b/t/werror3.sh
index a22ff84..91e4dbc 100755
--- a/t/werror3.sh
+++ b/t/werror3.sh
@@ -17,7 +17,7 @@
 # Make sure a per-Makefile.am -Werror setting is not carried over
 # to another Makefile.am.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac <<\END
 AC_CONFIG_FILES([sub/Makefile])
diff --git a/t/werror4.sh b/t/werror4.sh
index 1b930d5..7908d1d 100755
--- a/t/werror4.sh
+++ b/t/werror4.sh
@@ -16,7 +16,7 @@
 
 # -Werror and local -Werror settings should be flagged for the user.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac <<\END
 AC_CONFIG_FILES([sub/Makefile])
diff --git a/t/whoami.sh b/t/whoami.sh
index 4a4c2e9..6d0b13c 100755
--- a/t/whoami.sh
+++ b/t/whoami.sh
@@ -18,7 +18,7 @@
 # from Johan Danielsson (and a very nice bug report, too, I might
 # add).
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 WHO_AM_I=17
diff --git a/t/xsource.sh b/t/xsource.sh
index cca400a..8e2814b 100755
--- a/t/xsource.sh
+++ b/t/xsource.sh
@@ -17,7 +17,7 @@
 # Test to make sure multiple source files with the same object
 # file causes error.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat > Makefile.am << 'END'
 bin_PROGRAMS = zardoz
diff --git a/t/yacc-auxdir.sh b/t/yacc-auxdir.sh
index eb7357d..03175c9 100755
--- a/t/yacc-auxdir.sh
+++ b/t/yacc-auxdir.sh
@@ -17,7 +17,7 @@
 # Test to make sure ylwrap is put in right location.
 # Report from Tim Van Holder.
 
-. ./defs || exit 1
+. test-init.sh
 
 mkdir aux1 sub
 
diff --git a/t/yacc-basic.sh b/t/yacc-basic.sh
index b188338..0d37382 100755
--- a/t/yacc-basic.sh
+++ b/t/yacc-basic.sh
@@ -18,7 +18,7 @@
 # Keep in sync with sister test 'yacc-cxx.sh'.
 
 required='cc yacc'
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/yacc-bison-skeleton-cxx.sh b/t/yacc-bison-skeleton-cxx.sh
index 57e0091..6fb7387 100755
--- a/t/yacc-bison-skeleton-cxx.sh
+++ b/t/yacc-bison-skeleton-cxx.sh
@@ -18,7 +18,7 @@
 # For Automake bug#7648 and PR automake/491.
 
 required='c++ bison'
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CXX
diff --git a/t/yacc-bison-skeleton.sh b/t/yacc-bison-skeleton.sh
index 6d1ed6b..408cbf1 100755
--- a/t/yacc-bison-skeleton.sh
+++ b/t/yacc-bison-skeleton.sh
@@ -18,7 +18,7 @@
 # For Automake bug#7648 and PR automake/491.
 
 required='cc bison'
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/yacc-clean-cxx.sh b/t/yacc-clean-cxx.sh
index f30ce1b..7bc009d 100755
--- a/t/yacc-clean-cxx.sh
+++ b/t/yacc-clean-cxx.sh
@@ -21,7 +21,7 @@
 # See also sister test 'yacc-clean.sh'.
 
 required='c++ yacc'
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CXX
diff --git a/t/yacc-clean.sh b/t/yacc-clean.sh
index dce70a2..1f6664c 100755
--- a/t/yacc-clean.sh
+++ b/t/yacc-clean.sh
@@ -20,7 +20,7 @@
 # See also sister test 'yacc-cxx-clean.sh'.
 
 required='cc yacc'
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/yacc-cxx.sh b/t/yacc-cxx.sh
index 3c1babb..5d0eafc 100755
--- a/t/yacc-cxx.sh
+++ b/t/yacc-cxx.sh
@@ -19,7 +19,7 @@
 # Keep in sync with sister test 'yacc-basic.sh'.
 
 required='c++ yacc'
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CXX
diff --git a/t/yacc-d-basic.sh b/t/yacc-d-basic.sh
index 97155a2..a03065d 100755
--- a/t/yacc-d-basic.sh
+++ b/t/yacc-d-basic.sh
@@ -19,7 +19,7 @@
 # Keep in sync with sister test 'yacc-d-cxx.sh'.
 
 required='cc yacc'
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
@@ -59,8 +59,10 @@ END
 # the conversion from y.tab.c to parse.c.  This was OK when Bison was
 # not issuing such an #include (up to 2.6).
 #
-# To make sure that we perform this conversion, in bar/parse.y, use
-# y.tab.h instead of parse.c.
+# To make sure that we perform this conversion even with version of
+# Bison that do not generate this include, in bar/parse.y, use y.tab.h
+# instead of parse.h, and check the ylwrap does replace "y.tab.h" with
+# "parse.h".
 sed -e 's/parse\.h/y.tab.h/' <foo/parse.y >bar/parse.y
 
 cat > foo/main.c << 'END'
@@ -107,12 +109,21 @@ $AUTOMAKE baz/Makefile
 
 $MAKE
 
-test -f foo/parse.c
-test -f foo/parse.h
-test -f bar/parse.c
-test -f bar/parse.h
-test -f baz/zardoz-parse.c
-test -f baz/zardoz-parse.h
+generated="
+  foo/parse.c
+  foo/parse.h
+  bar/parse.c
+  bar/parse.h
+  baz/zardoz-parse.c
+  baz/zardoz-parse.h
+"
+
+for i in $generated; do
+  test -f $i
+done
+
+# There must remain no obsolete header guard.
+grep Y_TAB_H $generated && exit 1
 
 # The generated C source and header files must be shipped.
 for dir in foo bar; do
@@ -130,12 +141,9 @@ cd ..
 
 $MAKE distdir
 ls -l $distdir
-test -f $distdir/foo/parse.c
-test -f $distdir/foo/parse.h
-test -f $distdir/bar/parse.c
-test -f $distdir/bar/parse.h
-test -f $distdir/baz/zardoz-parse.c
-test -f $distdir/baz/zardoz-parse.h
+for i in $generated; do
+  test -f $distdir/$i
+done
 
 # Sanity check the distribution.
 yl_distcheck
@@ -143,19 +151,13 @@ yl_distcheck
 # While we are at it, make sure that 'parse.c' and 'parse.h' are erased
 # by maintainer-clean, and not by distclean.
 $MAKE distclean
-test -f foo/parse.c
-test -f foo/parse.h
-test -f bar/parse.c
-test -f bar/parse.h
-test -f baz/zardoz-parse.c
-test -f baz/zardoz-parse.h
+for i in $generated; do
+  test -f $i
+done
 ./configure # Re-create 'Makefile'.
 $MAKE maintainer-clean
-test ! -e foo/parse.c
-test ! -e foo/parse.h
-test ! -e bar/parse.c
-test ! -e bar/parse.h
-test ! -e baz/zardoz-parse.c
-test ! -e baz/zardoz-parse.h
+for i in $generated; do
+  test ! -e $i
+done
 
 :
diff --git a/t/yacc-d-cxx.sh b/t/yacc-d-cxx.sh
index 5bd284e..a7b4aaa 100755
--- a/t/yacc-d-cxx.sh
+++ b/t/yacc-d-cxx.sh
@@ -19,7 +19,7 @@
 # Keep in sync with sister test 'yacc-d-basic.sh'.
 
 required='c++ yacc'
-. ./defs || exit 1
+. test-init.sh
 
 write_parse ()
 {
diff --git a/t/yacc-d-vpath.sh b/t/yacc-d-vpath.sh
index 05019fb..483330e 100755
--- a/t/yacc-d-vpath.sh
+++ b/t/yacc-d-vpath.sh
@@ -23,7 +23,7 @@
 # Please keep this in sync with sister test 'yaccvpath.sh'.
 
 required='cc yacc'
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/yacc-deleted-headers.sh b/t/yacc-deleted-headers.sh
index 952560d..7dd9ded 100755
--- a/t/yacc-deleted-headers.sh
+++ b/t/yacc-deleted-headers.sh
@@ -17,7 +17,7 @@
 # Tests that we can recover from deleted headers generated by 'yacc -d'.
 
 required='cc yacc'
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/yacc-depend.sh b/t/yacc-depend.sh
index f7254a2..3730abb 100755
--- a/t/yacc-depend.sh
+++ b/t/yacc-depend.sh
@@ -18,7 +18,7 @@
 # Report from Paolo Bonzini.
 
 required='cc yacc'
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/yacc-depend2.sh b/t/yacc-depend2.sh
index 70f3f14..f20604d 100755
--- a/t/yacc-depend2.sh
+++ b/t/yacc-depend2.sh
@@ -19,7 +19,7 @@
 # with NetBSD make).
 
 required='cc yacc'
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/yacc-dist-nobuild-subdir.sh b/t/yacc-dist-nobuild-subdir.sh
index 0160c10..f6064e7 100755
--- a/t/yacc-dist-nobuild-subdir.sh
+++ b/t/yacc-dist-nobuild-subdir.sh
@@ -19,7 +19,7 @@
 # Exposes automake bug#8485.
 
 required='cc yacc'
-. ./defs || exit 1
+. test-init.sh
 
 # This test is bounded to fail for any implementation that
 # triggers automake bug#7884.
diff --git a/t/yacc-dist-nobuild.sh b/t/yacc-dist-nobuild.sh
index 40b8332..f23591e 100755
--- a/t/yacc-dist-nobuild.sh
+++ b/t/yacc-dist-nobuild.sh
@@ -19,7 +19,7 @@
 # See automake bug#7884.
 
 required='cc yacc'
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/yacc-grepping.sh b/t/yacc-grepping.sh
index 19036c4..546f4ad 100755
--- a/t/yacc-grepping.sh
+++ b/t/yacc-grepping.sh
@@ -23,7 +23,7 @@
 #    if (AM_)?YFLAGS do not contain '-d'.
 #    Requested by Jim Meyering.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/yacc-grepping2.sh b/t/yacc-grepping2.sh
index 4382ded..f8dc920 100755
--- a/t/yacc-grepping2.sh
+++ b/t/yacc-grepping2.sh
@@ -17,7 +17,7 @@
 # Test of yacc functionality, derived from GNU binutils
 # by Tim Van Holder.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/yacc-headers-and-dist-pr47.sh b/t/yacc-headers-and-dist-pr47.sh
index 5d7be75..49458bc 100755
--- a/t/yacc-headers-and-dist-pr47.sh
+++ b/t/yacc-headers-and-dist-pr47.sh
@@ -21,7 +21,7 @@
 # PR/47.
 
 required='cc yacc'
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/yacc-line.sh b/t/yacc-line.sh
index 525a455..1b2b484 100755
--- a/t/yacc-line.sh
+++ b/t/yacc-line.sh
@@ -20,7 +20,7 @@
 # See also sister test 'lex-line.sh'.
 
 required='cc yacc'
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_CONFIG_FILES([sub/Makefile])
diff --git a/t/yacc-mix-c-cxx.sh b/t/yacc-mix-c-cxx.sh
index fbc49d6..0ba3e45 100755
--- a/t/yacc-mix-c-cxx.sh
+++ b/t/yacc-mix-c-cxx.sh
@@ -18,7 +18,7 @@
 # in the same directory.
 
 required='cc c++ yacc'
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/yacc-nodist.sh b/t/yacc-nodist.sh
index 97aa8e5..de2f449 100755
--- a/t/yacc-nodist.sh
+++ b/t/yacc-nodist.sh
@@ -21,7 +21,7 @@
 # for lex-generated .c files.
 
 required='cc yacc'
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/yacc-pr204.sh b/t/yacc-pr204.sh
index babd2c9..d45a303 100755
--- a/t/yacc-pr204.sh
+++ b/t/yacc-pr204.sh
@@ -21,7 +21,7 @@
 # for lex-generated C files.
 
 required='cc yacc'
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac <<'EOF'
 AM_MAINTAINER_MODE
diff --git a/t/yacc-subdir.sh b/t/yacc-subdir.sh
index 3f12c54..465f828 100755
--- a/t/yacc-subdir.sh
+++ b/t/yacc-subdir.sh
@@ -18,7 +18,7 @@
 
 required='cc yacc'
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/yacc-weirdnames.sh b/t/yacc-weirdnames.sh
index ab43af3..028d9fa 100755
--- a/t/yacc-weirdnames.sh
+++ b/t/yacc-weirdnames.sh
@@ -17,7 +17,7 @@
 # Check that yacc sources with many dots in their name are handled
 # correctly.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/yacc4.sh b/t/yacc4.sh
index a0e121f..a4802d5 100755
--- a/t/yacc4.sh
+++ b/t/yacc4.sh
@@ -17,7 +17,7 @@
 # Some simple tests of ylwrap functionality.
 
 required='cc yacc'
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/yaccdry.sh b/t/yaccdry.sh
index 8e5af56..bbfda87 100755
--- a/t/yaccdry.sh
+++ b/t/yaccdry.sh
@@ -17,7 +17,7 @@
 # Removal recovery rules for headers should not remove files with 'make -n'.
 
 required='cc yacc'
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/yaccpp.sh b/t/yaccpp.sh
index 30ad7bc..1bcf379 100755
--- a/t/yaccpp.sh
+++ b/t/yaccpp.sh
@@ -19,7 +19,7 @@
 # which does much more in-depth checks (but requires an actual
 # Yacc program and a working C++ compiler).
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CXX
diff --git a/t/yaccvpath.sh b/t/yaccvpath.sh
index e56ca8e..c881f07 100755
--- a/t/yaccvpath.sh
+++ b/t/yaccvpath.sh
@@ -23,7 +23,7 @@
 # Please keep this in sync with sister test 'yacc-d-vpath.sh'.
 
 required='cc yacc'
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
diff --git a/t/yflags-cmdline-override.sh b/t/yflags-cmdline-override.sh
index e53358a..367a0c6 100755
--- a/t/yflags-cmdline-override.sh
+++ b/t/yflags-cmdline-override.sh
@@ -18,7 +18,7 @@
 # at configure time and/or at make time.
 
 required='cc yacc'
-. ./defs || exit 1
+. test-init.sh
 
 unset YFLAGS || :
 
diff --git a/t/yflags-conditional.sh b/t/yflags-conditional.sh
index 6765613..d7fc7e0 100755
--- a/t/yflags-conditional.sh
+++ b/t/yflags-conditional.sh
@@ -17,7 +17,7 @@
 # Check that automake complains about *_YFLAGS variables which have
 # conditional content.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac <<'END'
 AC_PROG_CC
diff --git a/t/yflags-d-false-positives.sh b/t/yflags-d-false-positives.sh
index 5b120dd..0cae14f 100755
--- a/t/yflags-d-false-positives.sh
+++ b/t/yflags-d-false-positives.sh
@@ -16,7 +16,7 @@
 
 # Check for false positives in automake recognition of '-d' in YFLAGS.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac <<'END'
 AC_PROG_CC
diff --git a/t/yflags-force-conditional.sh b/t/yflags-force-conditional.sh
index a8404b7..96455bb 100755
--- a/t/yflags-force-conditional.sh
+++ b/t/yflags-force-conditional.sh
@@ -17,7 +17,7 @@
 # Check that the user can force automake to use *_YFLAGS variables
 # which have conditional content.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac <<'END'
 AC_SUBST([CC], [false])
diff --git a/t/yflags-force-override.sh b/t/yflags-force-override.sh
index 8682637..d7ed7a1 100755
--- a/t/yflags-force-override.sh
+++ b/t/yflags-force-override.sh
@@ -19,7 +19,7 @@
 # variable is user-reserved).
 
 required='cc yacc'
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac <<'END'
 AC_PROG_CC
diff --git a/t/yflags-var-expand.sh b/t/yflags-var-expand.sh
index 789cc2c..23aea14 100755
--- a/t/yflags-var-expand.sh
+++ b/t/yflags-var-expand.sh
@@ -19,7 +19,7 @@
 #  foo_flags = -d
 #  AM_YFLAGS = $(foo_flags)
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >> configure.ac <<'END'
 AC_PROG_CC
diff --git a/t/yflags.sh b/t/yflags.sh
index 6a6bea7..bb453ed 100755
--- a/t/yflags.sh
+++ b/t/yflags.sh
@@ -19,7 +19,7 @@
 # Please keep this in sync with the sister tests yflags2.sh, lflags.sh
 # and lflags2.sh.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >fake-yacc <<'END'
 #!/bin/sh
diff --git a/t/yflags2.sh b/t/yflags2.sh
index d9b913c..b2a8114 100755
--- a/t/yflags2.sh
+++ b/t/yflags2.sh
@@ -19,7 +19,7 @@
 # Please keep this in sync with the sister tests yflags.sh, lflags.sh
 # and lflags2.sh.
 
-. ./defs || exit 1
+. test-init.sh
 
 cat >fake-yacc <<'END'
 #!/bin/sh


hooks/post-receive
-- 
GNU Automake



reply via email to

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