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.11-745-g


From: Peter Rosin
Subject: [Automake-commit] [SCM] GNU Automake branch, maint, updated. v1.11-745-g3a81460
Date: Wed, 07 Mar 2012 20:15:52 +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=3a8146089834c5187d0b0795b9fa71a0f9bba132

The branch, maint has been updated
       via  3a8146089834c5187d0b0795b9fa71a0f9bba132 (commit)
       via  24ab98457ee12a58dc070a3748cf3fd56f1c4c18 (commit)
       via  8902f83dcd7874d57d88f742bd4c62724634cc82 (commit)
       via  54a402e5e624bebdfef421512faecf5e4f3463ab (commit)
       via  8be5d254bc1534436571aeeca0ad76bf6058e7f1 (commit)
       via  aadd78e9ce1407d49af2e690c2f230ef468fba82 (commit)
       via  6fca3afa13f5b9ccdc9990e769793b0d9f31f5db (commit)
       via  81193035cee80eab1dca5d34d2a8f5f011bc4f57 (commit)
       via  1e2ced5c2e6a6be7c45349dc728ba2012eb6aa0a (commit)
       via  2a2f57fc8b5a10d82c6797b62b2c9244144c300e (commit)
       via  41404a8feb40b1d5853a45e6f8306daee6dc6607 (commit)
       via  6bb56e40bd31baa2488f0975e9d03e69ba7e963e (commit)
       via  7db422b23f1921c94a6eea7489b10b98fc7ef183 (commit)
       via  01fef4ae9e0ea43fba4a5cc836ad42f45805c6b8 (commit)
       via  4f3e5b5c883fb2cf867e9d7734690a283a1165ee (commit)
       via  da14dc7d8a597bf0960cc565f16b728955f4ebe4 (commit)
       via  3cec0f63c97df20bb559851ed04186dbb902cc07 (commit)
       via  d2fc8246603a665891b673d4a3b759e846232ff0 (commit)
       via  54af9ca84664208507afed2ee2707145b2d2890a (commit)
       via  b722b10866f0d67c053e3dc8079b81127b9a451b (commit)
       via  14cc1b8d4bc61f8be0a8bfd2d1a2f505ad3f0328 (commit)
       via  620ba14f54a994d3b695001546a4734282902bba (commit)
       via  eea57793c7dde8b836ff1e6f8e232747a85b5dba (commit)
       via  db93b31d81c7809e49fa874acfd5e3aa3504dc48 (commit)
       via  f23d5a15269c722c8cd136827a3b021a29814cb0 (commit)
       via  005000e7a47e75d051473ad326983be6448738b6 (commit)
       via  2270535f37084e0e2febed21cd808da75b0f3451 (commit)
       via  821f88c3c7db37413c1e70722dad4a30a6c83afb (commit)
       via  91ab753b7b654934aaa34006067a92993bb53c09 (commit)
       via  cc2202a6b0d5a7dc2f8af17e4ac2fdd3fe46d267 (commit)
       via  c7a6a92ea100e3c78c7f48bd6a672da3ad46fc7f (commit)
       via  b07777bd6da63018e845e18ce96c4168343b47b6 (commit)
       via  38846c5f1cb8ad3745bc9a37816fb1cb7d75b399 (commit)
       via  f4610768555fa588dd2d25e77651dd3a22540108 (commit)
       via  d164eb55a41ec2fc48b402b276749f4b7d72dc91 (commit)
       via  89bf665808e6ed7a68957342e6343cf3261ebf14 (commit)
       via  17a7a6fc74a440b8bc5c02d0089ebdafe000ca62 (commit)
       via  c35a65c05d1cf4f8d95ce546ae4c7b2d6bd19ac5 (commit)
       via  0431dc4403e5c611bc1009f0cf47b20f26407994 (commit)
       via  0a99a243f943f02f97e9fc2df5020d33997a76d0 (commit)
       via  8429d356654fe5248f039e57f5532b5aa68aee24 (commit)
       via  77f0a9fd4265f5b22d5686e3da27c86aee496b6d (commit)
       via  a89953333a36b8b8ebce393fe74034e4bfb739ab (commit)
       via  8c406f64b66aedee8359ddf1383e087faa2ba233 (commit)
       via  9533d1f026a1ca8a3f77f64bc710f13cdaa1b410 (commit)
       via  265e34202672a00d701fe337076451ae89010e59 (commit)
       via  da15b997559fa4f64d6adb300fd95515adceb9ff (commit)
      from  94d56e80384e3ae80e2817aa12adae8ad7f3d1ed (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:
 ChangeLog.11                                       |  287 ++++++++++++++++++++
 HACKING                                            |    3 +
 NEWS                                               |   18 ++
 automake.in                                        |   28 ++-
 doc/automake.texi                                  |   55 +++-
 lib/Automake/ChannelDefs.pm                        |   28 ++
 lib/Makefile.am                                    |    5 +-
 lib/ar-lib                                         |  270 ++++++++++++++++++
 lib/compile                                        |  228 +++++++++++++++-
 lib/depcomp                                        |  138 +++++++---
 m4/Makefile.am                                     |    1 +
 m4/ar-lib.m4                                       |   61 ++++
 m4/depend.m4                                       |    2 +-
 tests/Makefile.am                                  |    3 +
 tests/aclibobj.test                                |    2 +
 tests/aclocal4.test                                |    3 +-
 tests/alloca.test                                  |    4 +-
 tests/alloca2.test                                 |    4 +-
 tests/ansi10.test                                  |    1 +
 tests/ar-lib.test                                  |  113 ++++++++
 tests/{subobj7.test => ar-lib2.test}               |   18 +-
 tests/{ar2.test => ar-lib3.test}                   |   22 +-
 tests/{aclibobj.test => ar-lib4.test}              |   42 ++--
 tests/ar-lib5a.test                                |   75 +++++
 tests/ar-lib5b.test                                |   99 +++++++
 ...{check-tests_environment.test => ar-lib6a.test} |   30 +--
 tests/{libtoo11.test => ar-lib6b.test}             |   23 +-
 tests/{makefile-deps.test => ar-lib7.test}         |   15 +-
 tests/ar.test                                      |    3 +
 tests/ar2.test                                     |    2 +-
 tests/{ar2.test => ar3.test}                       |   13 +-
 tests/{check-tests_environment.test => ar4.test}   |   26 +--
 tests/{check-tests_environment.test => ar5.test}   |   31 +--
 tests/canon4.test                                  |    3 +
 tests/compile3.test                                |   59 ++++
 tests/compile4.test                                |   93 +++++++
 tests/compile5.test                                |   86 ++++++
 tests/compile6.test                                |  106 +++++++
 tests/cond13.test                                  |    3 +
 tests/condlib.test                                 |    3 +
 tests/defs.in                                      |   23 ++
 tests/depcomp4.test                                |    1 +
 tests/depcomp6.test                                |    1 +
 tests/depcomp7.test                                |    1 +
 tests/depcomp8b.test                               |    1 +
 tests/discover.test                                |    4 +-
 tests/dollarvar2.test                              |   65 ++++-
 tests/extra-portability.test                       |  105 +++++++
 tests/{version2.test => extra-portability2.test}   |   42 ++-
 tests/extra-portability3.test                      |   63 +++++
 tests/extradep.test                                |    1 +
 tests/extradep2.test                               |    1 +
 tests/fort5.test                                   |    1 +
 tests/instdir-ltlib.test                           |    1 +
 tests/instdir-prog.test                            |    1 +
 tests/instfail-libtool.test                        |    1 +
 tests/instfail.test                                |    1 +
 tests/instspc.test                                 |    1 +
 tests/ldadd.test                                   |    7 +-
 tests/ldflags.test                                 |    2 +
 tests/libobj10.test                                |    3 +
 tests/libobj11.test                                |    2 +
 tests/libobj12.test                                |    2 +
 tests/libobj13.test                                |    1 +
 tests/libobj2.test                                 |    2 +
 tests/libobj3.test                                 |    6 +-
 tests/libobj7.test                                 |    2 +
 tests/libobj8.test                                 |    2 +
 tests/library.test                                 |    3 +
 tests/library2.test                                |    8 +-
 tests/libtoo10.test                                |    1 +
 tests/libtool2.test                                |    1 +
 tests/libtool3.test                                |    1 +
 tests/libtool4.test                                |    5 +-
 tests/libtool5.test                                |    1 +
 tests/libtool6.test                                |    1 +
 tests/libtool7.test                                |    1 +
 tests/libtool8.test                                |    1 +
 tests/libtool9.test                                |    1 +
 tests/list-of-tests.mk                             |   22 ++
 tests/listval.test                                 |    2 +
 tests/location.test                                |    3 +
 tests/ltcond.test                                  |    1 +
 tests/ltcond2.test                                 |    1 +
 tests/ltconv.test                                  |    1 +
 tests/ltdeps.test                                  |    2 +
 tests/ltinit.test                                  |    1 +
 tests/ltinstloc.test                               |    3 +-
 tests/ltlibobjs.test                               |    2 +
 tests/ltlibsrc.test                                |    1 +
 tests/ltorder.test                                 |    1 +
 tests/multlib.test                                 |    2 +
 tests/nobase-libtool.test                          |    1 +
 tests/nobase.test                                  |    1 +
 tests/noinstdir.test                               |    3 +
 tests/parse.test                                   |    4 +-
 tests/pluseq7.test                                 |    9 +-
 tests/pr211.test                                   |    2 +-
 tests/pr300-lib.test                               |    2 +-
 tests/pr300-ltlib.test                             |    2 +-
 tests/pr307.test                                   |    2 +-
 tests/pr401.test                                   |   10 +-
 tests/pr401b.test                                  |   10 +-
 tests/pr401c.test                                  |   10 +-
 tests/pr72.test                                    |    2 +-
 tests/primary-prefix-couples-documented-valid.test |    1 +
 tests/primary-prefix-couples-force-valid.test      |    3 +-
 tests/primary-prefix-invalid-couples.test          |    2 +
 tests/primary-prefix-valid-couples.test            |    2 +
 tests/reqd2.test                                   |    6 +-
 tests/silent3.test                                 |    1 +
 tests/silent4.test                                 |    1 +
 tests/silent9.test                                 |    1 +
 tests/specflg-dummy.test                           |    1 +
 tests/specflg2.test                                |    3 +
 tests/stdlib.test                                  |   25 ++-
 tests/stdlib2.test                                 |    1 +
 tests/strip2.test                                  |    1 +
 tests/strip3.test                                  |    1 +
 tests/subdir4.test                                 |    3 +
 tests/subdirbuiltsources.test                      |    1 +
 tests/subobj10.test                                |    1 +
 tests/subobj9.test                                 |    1 +
 tests/subpkg-yacc.test                             |    1 +
 tests/subpkg.test                                  |    1 +
 tests/subst3.test                                  |    1 +
 tests/substtarg.test                               |    3 +
 tests/suffix10.test                                |    1 +
 tests/suffix2.test                                 |    1 +
 tests/suffix5.test                                 |    2 +
 tests/suffix8.test                                 |    1 +
 tests/syntax.test                                  |   11 +-
 tests/vala.test                                    |    1 +
 tests/vala1.test                                   |    1 +
 134 files changed, 2300 insertions(+), 252 deletions(-)
 create mode 100755 lib/ar-lib
 create mode 100644 m4/ar-lib.m4
 create mode 100755 tests/ar-lib.test
 copy tests/{subobj7.test => ar-lib2.test} (70%)
 copy tests/{ar2.test => ar-lib3.test} (72%)
 copy tests/{aclibobj.test => ar-lib4.test} (65%)
 create mode 100755 tests/ar-lib5a.test
 create mode 100755 tests/ar-lib5b.test
 copy tests/{check-tests_environment.test => ar-lib6a.test} (67%)
 copy tests/{libtoo11.test => ar-lib6b.test} (69%)
 copy tests/{makefile-deps.test => ar-lib7.test} (76%)
 copy tests/{ar2.test => ar3.test} (79%)
 copy tests/{check-tests_environment.test => ar4.test} (68%)
 copy tests/{check-tests_environment.test => ar5.test} (63%)
 create mode 100755 tests/compile3.test
 create mode 100755 tests/compile4.test
 create mode 100755 tests/compile5.test
 create mode 100755 tests/compile6.test
 create mode 100755 tests/extra-portability.test
 copy tests/{version2.test => extra-portability2.test} (60%)
 create mode 100755 tests/extra-portability3.test

diff --git a/ChangeLog.11 b/ChangeLog.11
index 234bf2f..ba43734 100644
--- a/ChangeLog.11
+++ b/ChangeLog.11
@@ -1,5 +1,7 @@
 2011-12-27  Stefano Lattarini  <address@hidden>
 
+2011-12-27  Stefano Lattarini  <address@hidden>
+
        tests: drop unnecessary requirement in 'subpkg.test'
        * tests/subpkg.test ($required): Drop "bison", it is not required
        anymore since commit `v1.11-502-g7e5ae80'.
@@ -851,6 +853,71 @@
        Yikes.  Cater to this incompatibility, by relaxing the test when
        a faulty `rm' is detected.
 
+2011-11-10  Stefano Lattarini  <address@hidden>
+
+       tests: various minor tweakings, mostly related to AM_PROG_AR
+       * tests/alloca2.test: Ensure we don't experience a spurious failure
+       due to a missing `AM_PROG_AR' macro or a missing `ar-lib' auxiliary
+       script.
+       * tests/libtool4.test: Likewise.
+       * tests/ldadd.test: Likewise.  Since we are at it, make grepping of
+       automake stderr stricter.
+       * tests/reqd2.test: Likewise.
+       * tests/pr211.test: Ensure automake fails also with `-Wnone', since
+       the error we are testing for is an hard error, not a mere warning.
+       * tests/syntax.test: Likewise, and ensure we don't fail to other
+       errors by removing use of `lib_LTLIBRARIES' in Makefile.am.  Since
+       we are at it, make grepping of automake stderr stricter.
+
+2011-11-05  Stefano Lattarini  <address@hidden>
+
+       ar-lib: fix configure output for "unrecognized archiver interface"
+       * m4/ar-lib.m4: Ensure that, even when an error is hit while trying
+       to determine the archiver interface kind, the "checking archiver
+       interface" message from configure is properly terminated before
+       an error message is printed, to avoid slightly garbled output.
+       * tests/ar4.test: Enhance.
+       * tests/ar5.test: Likewise.
+
+2011-11-04  Stefano Lattarini  <address@hidden>
+
+       warnings: fix buglets for portability warnings
+       * lib/Automake/ChannelDefs.pm (switch_warning): Ensure the
+       correct implications and inter-dependencies between warnings
+       in the categories `portability', `extra-portability' and
+       `recursive-portability' are respected.  Also add detailed
+       explicative comments, and references to the relevant tests.
+       * tests/dollarvar2.test: Update and extend.  Also, remove
+       some unnecessary uses of `--force' option in automake calls.
+       * tests/extra-portability3.test: New test.
+       * tests/Makefile.am (TESTS): Add it.
+
+2011-11-04  Stefano Lattarini  <address@hidden>
+
+       tests: extend tests on 'extra-portability' warning category
+       * tests/extra-portability.test: Redefine `$AUTOMAKE' to ensure we
+       have complete control over the automake options.  Extend by using
+       also a setup where no `portability' warning is present (only an
+       `extra-portability' warning is).  Other minor extensions.  Remove
+       some redundant, verbose comments about the expected diagnostic.
+
+2011-11-03  Stefano Lattarini  <address@hidden>
+
+       tests: various minor tweakings, mostly related to AM_PROG_AR
+       * tests/alloca.test: Adjust to new portability requirements due
+       to the new AM_PROG_AR macro.
+       * tests/discover.test: Likewise.
+       * tests/libobj3.test: Likewise.
+       * tests/pluseq7.test: Likewise.  Also, make grepping of automake
+       expected error message stricter.
+       * tests/stdlib.test: Likewise, and extend the test a bit.
+       * tests/parse.test (configure.in): Remove redundant call to
+       AC_PROG_RANLIB.
+       * tests/library2.test: Adjust to new portability requirements
+       due to the new AM_PROG_AR macro.  Also ...
+       (configure.in): ... add call to AC_PROG_CC, to ensure automake
+       really fails for the expected reason.
+
 2011-11-03  Zack Weinberg <address@hidden>  (tiny change)
            Stefano Lattarini  <address@hidden>
 
@@ -908,6 +975,29 @@
        * tests/Makefile.am (XFAIL_TESTS): Add lex-subobj-nodep.test,
        remove yacc-dist-nobuild-subdir.test.
 
+2011-10-25  Stefano Lattarini  <address@hidden>
+
+       tests: few improvements to some `ar-lib' related tests
+
+       * tests/ar-lib5a.test (Makefile.am): Also check that the target
+       library has truly been created.
+       (ar-lib): Use the real `ar-lib' script (mildly patched) rather
+       than a dummy one, to ensure better "real-life coverage".  Fix
+       botched shebang line.
+       * tests/ar-lib5b.test: Extend the PATH variable to make the dummy
+       `lib' script accessible, instead of explicitly calling it by its
+       relative/absolute path.
+       (ar-lib): Fix botched shebang line.
+       (bin/lib): Likewise.  Also, add explicative comments, and make
+       slightly stricter.
+
+2011-10-24  Peter Rosin  <address@hidden>
+
+       Merge branch 'maint' into msvc
+
+       * tests/subpkg-yacc.test: Adjust to new portability requirements due
+       to the new AM_PROG_AR macro.
+
 2011-10-19  Stefano Lattarini  <address@hidden>
 
        dejagnu: allow the package developer to extend site.exp
@@ -1394,6 +1484,81 @@
        * NEWS, bootstrap: Update.
        * doc/automake.texi (aclocal Options, Macro Search Path): Update.
 
+2011-10-21  Peter Rosin  <address@hidden>
+
+       warnings: new 'extra-portability' category, for AM_PROG_AR
+       * lib/Automake/ChannelDefs.pm: Register new extra-portability
+       warning channel.
+       (switch_warning): Turn off extra-portability if portability is
+       turned off, and turn on portability if extra-portability is
+       turned on.
+       (set_strictness): Silence extra-portability for --gnits, --gnu
+       and --foreign.
+       * tests/extra-portability2.test: New test, checking that the
+       extra-portability channel is silenced by --gnits, --gnu and
+       --foreign.
+       * doc/automake.texi (Invoking Automake): Document the new warning
+       category and its interaction with the portability category.
+       * tests/extra-portability.test: New test, checking the interaction
+       between the portability and extra-portability warning categories.
+       * automake.in (handle_libraries, handle_ltlibraries): Move the
+       AM_PROG_AR warnings to the new extra-portability channel.
+       * tests/ar2.test: Adjust to the new warning channel.
+       * tests/pr300-lib.test: Likewise.
+       * tests/pr300-ltlib.test: Likewise.
+       * tests/pr307.test: Likewise.
+       * tests/pr401.test: Likewise.
+       * tests/pr401b.test: Likewise.
+       * tests/pr401c.test: Likewise.
+       * tests/pr72.test: Likewise.
+       * NEWS: Likewise.
+       * tests/Makefile.am (TESTS): Update.
+
+2011-10-21  Peter Rosin  <address@hidden>
+           Ralf Wildenhues  <address@hidden>
+           Stefano Lattarini  <address@hidden>
+
+       Add new 'AM_PROG_AR' macro, triggering the 'ar-lib' script.
+       * m4/ar-lib.m4: New macro AM_PROG_AR, which locates an
+       archiver and triggers the auxiliary 'ar-lib' script if needed.
+       * m4/Makefile.am (dist_m4data_DATA): Update.
+       * automake.in ($seen_ar): New variable.
+       (scan_autoconf_traces): Set it.
+       (handle_libraries, handle_ltlibraries): Require AM_PROG_AR for
+       portability.
+       * doc/automake.texi (Public Macros): Mention the new
+       'AM_PROG_AR' macro.
+       (Subpackages): Add AM_PROG_AR to the example.
+       (A Library): Adjust recommendations for AR given the new
+       AM_PROG_AR macro.
+       * All relevant tests: Adjust to new portability requirements due
+       to the new AM_PROG_AR macro.
+       * tests/ar-lib2.test: New test, checking that AM_PROG_AR triggers
+       install of ar-lib.
+       * tests/ar-lib3.test: New test, checking that lib_LIBRARIES
+       requires AM_PROG_AR.
+       * tests/ar-lib4.test: New test, checking that lib_LTLIBRARIES
+       requires AM_PROG_AR.
+       * tests/ar-lib5a.test: New test, checking that AM_PROG_AR triggers
+       use of ar-lib when the archiver is Microsoft lib.
+       * tests/ar-lib5b.test: New test, checking that AM_PROG_AR triggers
+       use of ar-lib when the archiver is a faked lib.
+       * tests/ar-lib6a.test: New test, checking the ordering of
+       AM_PROG_AR and LT_INIT.
+       * tests/ar-lib6b.test: New test, checking the ordering of
+       AM_PROG_AR and AC_PROG_LIBTOOL.
+       * tests/ar-lib7.test: New test, checking that automake warns
+       if ar-lib is missing.
+       * tests/ar3.test: New test, checking that AR and ARFLAGS may
+       be overridden by the user even if AM_PROG_AR is used.
+       * tests/ar4.test: New test, checking that AM_PROG_AR bails out
+       if it cannot determine the archiver interface.
+       * tests/ar5.test: New test, checking that AM_PROG_AR runs its
+       optional argument if it cannot determine the archiver interface.
+       * tests/defs.in: New required entry 'lib'.
+       * tests/Makefile.am (TESTS): Update.
+       * NEWS: Update.
+
 2011-09-05  Peter Rosin  <address@hidden>
 
        * tests/amhello-binpkg.test: Add missing $EXEEXT usage.
@@ -3720,6 +3885,128 @@
        * tests/cond5.test: Add delay before the first kill attempt to
        cater for problems with MSYS bash.
 
+2010-11-16  Peter Rosin  <address@hidden>
+
+       Skip MSVC oriented tests if the shell is not capable.
+       * tests/defs: New required entry 'xsi-shell'.
+       * tests/ar-lib.test, tests/compile3.test, tests/compile6.test:
+       Require a XSI capable shell.
+       Reported by Ralf Wildenhues.
+
+2010-11-15  Peter Rosin  <address@hidden>
+
+       compile: clear the `eat' variable earlier.
+       * lib/compile: Clear the `eat' variable earlier.
+       ($scriptversion): Update.
+       * tests/compile3.test: Prevent regressions.
+
+2010-10-07  Peter Rosin  <address@hidden>
+
+       depcomp: add new one-pass depmode for MSVC 7 and later.
+       * lib/depcomp: Add new depmodes 'msvc7' and 'msvc7msys' which
+       make use of the -showIncludes option added in MSVC 7.
+       * m4/depend.m4 (_AM_DEPENDENCIES): Handle the new depmodes
+       similarly to 'msvisualcpp' and 'msvcmsys' as MSVC does not
+       support the -o option.
+
+2010-10-03  Ralf Wildenhues  <address@hidden>
+
+       tests: fix ar-lib.test for echo that interprets backslashes.
+       * tests/ar-lib.test: Use printf instead of echo.  Avoid test -a.
+       More robust quoting.
+
+2010-09-21  Peter Rosin  <address@hidden>
+
+       compile: implement library search to support MSVC static linking
+       * lib/compile (func_cl_wrapper): Implement library search and
+       -static option so that the user can select whether to prefer
+       dll import libraries or static libraries.  This enables MSVC to
+       link against dlls generated by libtool without requiring libtool
+       or workarounds such as -lfoo.dll etc.  Makes the tests/static.at
+       test case in libtool pass.
+       * tests/compile3.test: Don't trip up if there happens to exist
+       a "foo" library in the library search path.
+       * tests/compile6.test: New test, verifying the library search.
+       * tests/Makefile.am (TESTS): Update.
+
+2010-09-02  Peter Rosin  <address@hidden>
+
+       Make ar-lib support backslashed files in archives.
+       * lib/ar-lib: If an archive member contains a backslash, make sure
+       it is escaped when the archive member is extracted.
+       * tests/ar-lib.test: Test the above.
+
+2010-08-31  Peter Rosin  <address@hidden>
+
+       Do file name conversion for object files in the compile wrapper.
+       * lib/compile (func_cl_wrapper): Do file name conversion for object
+       files (i.e. extensions .obj, .OBJ, .o and .O) if needed.
+       * tests/compile4.test: Test the above.
+
+2010-08-16  Peter Rosin  <address@hidden>
+
+       Optimize compile script on MSYS.
+       * lib/compile (func_file_conv): Add new argument 'lazy' which
+       takes an optional list of conversion types where the requested
+       conversion isn't needed.
+       (func_cl_wrapper): Take advantage of the above for cases where
+       MSYS is doing the conversion for us.
+       Suggested by Ralf Wildenhues.
+
+2010-08-16  Peter Rosin  <address@hidden>
+
+       Support more C++ file extensions for MSVC in the compile script.
+       * lib/compile (func_cl_wrapper): MSVC only recognizes the .cpp
+       file extension as C++, unless it's given a hint. So hint about
+       .cc, .CC, .cxx, .CXX, c++ and C++. Also do path conversion on
+       .c, .cpp, .CPP, .lib, .LIB and .Lib files.
+       * tests/compile3.test: Test the C++ hinting.
+
+2010-08-12  Peter Rosin  <address@hidden>
+
+       Enable the use of "link -lib" as the wrapped archiver.
+       * lib/ar-lib: Enable the use of "link -lib" as the wrapped
+       archiver, as well as allowing some other options to be passed
+       through to the wrapped archiver.
+       * tests/ar-lib.test: Test the above.
+
+2010-08-06  Peter Rosin  <address@hidden>
+
+       Add new auxiliary 'ar-lib' script, wrapping Microsoft lib.
+       * lib/ar-lib: New auxiliary script.
+       * lib/Makefile.am: Add above.
+       * tests/ar-lib.test: New test.
+       * tests/Makefile.am: Add above.
+       * automake.in (@common_files): Distribute the 'ar-lib' script.
+       * doc/automake.texi (Auxiliary Programs): Mention the new
+       'ar-lib' script.
+       (Optional): Mention 'ar-lib' in AC_CONFIG_AUX_DIR.
+       * NEWS: Update.
+
+2010-08-07  Ralf Wildenhues  <address@hidden>
+
+       Fix shell pattern negation in compile script.
+       * lib/compile (func_file_conv): Use `!' not `^' for pattern
+       negation.
+
+2010-08-01  Peter Rosin  <address@hidden>
+
+       Wrap some MSVC options in the compile script.
+       * lib/compile: MSVC supports naming the output file, the option
+       is just not called -o, so transform -o into the appropriate form
+       for MSVC. Also wrap some other options while at it (-L, -l, -Wl,
+       -Xlinker and -I) and convert file names to windows form where
+       needed for those options to make MSVC more usable in an
+       autotooled environment.
+       * doc/automake.texi (Auxiliary Programs): Document the above
+       extension of the compile script.
+       * NEWS: Updated.
+       * tests/defs.in: New required entry 'cl'.
+       * tests/compile3.test: New test.
+       * tests/compile4.test: New test.
+       * tests/compile5.test: New test.
+       * tests/Makefile.am: Update.
+
 2010-07-31  Ralf Wildenhues  <address@hidden>
 
        Add example git work flow; discuss merge --log in HACKING.
diff --git a/HACKING b/HACKING
index 26f1d91..5420fbc 100644
--- a/HACKING
+++ b/HACKING
@@ -174,6 +174,9 @@
 * Use `keep_testdirs=yes' to keep test directories for successful
   tests also.
 
+* Use perl coverage information to ensure your new code is thoroughly
+  tested by your new tests.
+
 * See file `tests/README' for more information.
 
 ================================================================
diff --git a/NEWS b/NEWS
index 68d2929..3a6d2c4 100644
--- a/NEWS
+++ b/NEWS
@@ -78,6 +78,9 @@ New in 1.11.0a:
     specify a different level via the XZ_OPT and BZIP2 envvars respectively.
     E.g., "make dist-xz XZ_OPT=-7" or "make dist-bzip2 BZIP2=-5"
 
+  - The `compile' script now converts some options for MSVC for a better
+    user experience.  Similarly, the new `ar-lib' script wraps Microsoft lib.
+
   - The py-compile script now accepts empty arguments passed to the options
     `--destdir' and `--basedir', and complains about unrecognized options.
     Moreover, a non-option argument or a special `--' argument terminates
@@ -91,6 +94,11 @@ New in 1.11.0a:
     user; still, the old Makefile.am files that used to define it will
     still continue to work as before.
 
+  - New macro AM_PROG_AR that looks for an archiver and wraps it in the new
+    'ar-lib' auxiliary script if the selected archiver is Microsoft lib.
+    This new macro is required for LIBRARIES and LTLIBRARIES when automake
+    is run with -Wextra-portability (or -Wall) and -Werror.
+
   - When using DejaGnu-based testsuites, the user can extend the `site.exp'
     file generated by automake-provided rules by defining the special make
     variable `$(EXTRA_DEJAGNU_SITE_CONFIG)'.
@@ -104,6 +112,16 @@ New in 1.11.0a:
     overwriting the foo_DEPENDENCIES variable, which is normally computed
     by automake.
 
+  - The 'ar-lib' script now ignores the "s" (symbol index) and "S" (no
+    symbol index) modifiers as well as the "s" action, as the symbol index
+    is created unconditionally by Microsoft lib.  Also, the "q" (quick)
+    action is now a synonym for "r" (replace).  Also, the script has been
+    ignoring the "v" (verbose) modifier already since Automake 1.11.3.
+
+  - When the 'compile' script is used to wrap MSVC, it now accepts an
+    optional space between the -I, -L and -l options and their respective
+    arguments, for better POSIX compliance.
+
 Bugs fixed in 1.11.0a:
 
 * Bugs introduced by 1.11.2:
diff --git a/automake.in b/automake.in
index 5ae151b..08b3300 100644
--- a/automake.in
+++ b/automake.in
@@ -235,9 +235,9 @@ my @libtool_sometimes = qw(ltconfig ltcf-c.sh ltcf-cxx.sh 
ltcf-gcj.sh);
 my @common_files =
     (qw(ABOUT-GNU ABOUT-NLS AUTHORS BACKLOG COPYING COPYING.DOC COPYING.LIB
        COPYING.LESSER ChangeLog INSTALL NEWS README THANKS TODO
-       ansi2knr.1 ansi2knr.c compile config.guess config.rpath config.sub
-       depcomp elisp-comp install-sh libversion.in mdate-sh missing
-       mkinstalldirs py-compile texinfo.tex ylwrap),
+       ansi2knr.1 ansi2knr.c ar-lib compile config.guess config.rpath
+       config.sub depcomp elisp-comp install-sh libversion.in mdate-sh
+       missing mkinstalldirs py-compile texinfo.tex ylwrap),
      @libtool_files, @libtool_sometimes);
 
 # Commonly used files we auto-include, but only sometimes.  This list
@@ -396,6 +396,9 @@ my $package_version_location;
 # TRUE if we've seen AM_ENABLE_MULTILIB.
 my $seen_multilib = 0;
 
+# TRUE if we've seen AM_PROG_AR
+my $seen_ar = 0;
+
 # TRUE if we've seen AM_PROG_CC_C_O
 my $seen_cc_c_o = 0;
 
@@ -2816,6 +2819,13 @@ sub handle_libraries
              &check_libobjs_sources ($xlib, $xlib . '_LIBADD');
            }
        }
+
+      if (! $seen_ar)
+       {
+         msg ('extra-portability', $where,
+              "`$onelib': linking libraries using a non-POSIX\n"
+              . "archiver requires `AM_PROG_AR' in `$configure_ac'")
+       }
     }
 }
 
@@ -3054,6 +3064,13 @@ sub handle_ltlibraries
              &check_libobjs_sources ($xlib, $xlib . '_LIBADD');
            }
        }
+
+      if (! $seen_ar)
+       {
+         msg ('extra-portability', $where,
+              "`$onelib': linking libtool libraries using a non-POSIX\n"
+              . "archiver requires `AM_PROG_AR' in `$configure_ac'")
+       }
     }
 }
 
@@ -5309,6 +5326,7 @@ sub scan_autoconf_traces ($)
                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,
@@ -5500,6 +5518,10 @@ sub scan_autoconf_traces ($)
        {
          $seen_maint_mode = $where;
        }
+      elsif ($macro eq 'AM_PROG_AR')
+       {
+         $seen_ar = $where;
+       }
       elsif ($macro eq 'AM_PROG_CC_C_O')
        {
          $seen_cc_c_o = $where;
diff --git a/doc/automake.texi b/doc/automake.texi
index fb0e5e7..7421029 100644
--- a/doc/automake.texi
+++ b/doc/automake.texi
@@ -2246,6 +2246,10 @@ copies are updated before each release, but we mention 
the original
 source in case you need more recent versions.
 
 @table @code
address@hidden ar-lib
+This is a wrapper primarily for the Microsoft lib archiver, to make
+it more POSIX-like.
+
 @item ansi2knr.c
 @itemx ansi2knr.1
 These two files are used for de-ANSI-fication support (they are
@@ -2255,7 +2259,11 @@ release; @pxref{ANSI}).
 @item compile
 This is a wrapper for compilers that do not accept options @option{-c}
 and @option{-o} at the same time.  It is only used when absolutely
-required.  Such compilers are rare.
+required.  Such compilers are rare, with the Microsoft C/C++ Compiler
+as the most notable exception. This wrapper also makes the following
+common options available for that compiler, while performing file name
+translation where needed: @option{-I}, @option{-L}, @option{-l},
address@hidden,} and @option{-Xlinker}.
 
 @item config.guess
 @itemx config.sub
@@ -2679,6 +2687,9 @@ user redefinitions of Automake rules or variables
 @item portability
 portability issues (e.g., use of @command{make} features that are
 known to be not portable)
address@hidden extra-portability
+extra portability issues related to obscure tools.  One example of such
+a tool is the Microsoft @command{lib} archiver.
 @item syntax
 weird syntax, unused variables, typos
 @item unsupported
@@ -2701,6 +2712,12 @@ 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.
 
address@hidden Checked by extra-portability.test
+Turning off @samp{portability} will also turn off @samp{extra-portability},
+and similarly turning on @samp{extra-portability} will also turn on
address@hidden  However, turning on @samp{portability} or turning
+off @samp{extra-portability} will not affect the other category.
+
 @vindex WARNINGS
 The environment variable @env{WARNINGS} can contain a comma separated
 list of categories to enable.  It will be taken into account before the
@@ -2922,12 +2939,12 @@ The Autoconf Manual}.
 Automake will look for various helper scripts, such as
 @file{install-sh}, in the directory named in this macro invocation.
 @c This list is accurate relative to version 1.8
-(The full list of scripts is: @file{config.guess}, @file{config.sub},
address@hidden, @file{elisp-comp}, @file{compile}, @file{install-sh},
address@hidden, @file{mdate-sh}, @file{missing}, @file{mkinstalldirs},
address@hidden, @file{texinfo.tex}, and @file{ylwrap}.)  Not all
-scripts are always searched for; some scripts will only be sought if the
-generated @file{Makefile.in} requires them.
+(The full list of scripts is: @file{ar-lib}, @file{config.guess},
address@hidden, @file{depcomp}, @file{elisp-comp}, @file{compile},
address@hidden, @file{ltmain.sh}, @file{mdate-sh}, @file{missing},
address@hidden, @file{py-compile}, @file{texinfo.tex}, and
address@hidden)  Not all scripts are always searched for; some scripts
+will only be sought if the generated @file{Makefile.in} requires them.
 
 If @code{AC_CONFIG_AUX_DIR} is not given, the scripts are looked for in
 their standard locations.  For @file{mdate-sh},
@@ -4000,6 +4017,15 @@ environment, or use the @option{--with-lispdir} option to
 @command{configure} to explicitly set the correct path (if you're sure
 you have an @command{emacs} that supports Emacs Lisp).
 
address@hidden AM_PROG_AR(@ovar{act-if-fail})
address@hidden AM_PROG_AR
address@hidden AR
+You must use this macro when you use the archiver in your project, if
+you want support for unusual archivers such as Microsoft @command{lib}.
+The content of the optional argument is executed if the archiver
+interface is not recognized; the default action is to abort configure
+with an error message.
+
 @item AM_PROG_AS
 @acindex AM_PROG_AS
 @vindex CCAS
@@ -4625,6 +4651,7 @@ AC_INIT([hand], [1.2])
 AC_CONFIG_AUX_DIR([.])
 AM_INIT_AUTOMAKE
 AC_PROG_CC
+AM_PROG_AR
 AC_PROG_RANLIB
 AC_CONFIG_FILES([Makefile])
 AC_OUTPUT
@@ -5070,12 +5097,14 @@ by invoking @samp{$(AR) $(ARFLAGS)} followed by the 
name of the
 library and the list of objects, and finally by calling
 @samp{$(RANLIB)} on that library.  You should call
 @code{AC_PROG_RANLIB} from your @file{configure.ac} to define
address@hidden (Automake will complain otherwise).  @code{AR} and
address@hidden default to @code{ar} and @code{cru} respectively; you
-can override these two variables my setting them in your
address@hidden, by @code{AC_SUBST}ing them from your
address@hidden, or by defining a per-library @code{maude_AR}
-variable (@pxref{Program and Library Variables}).
address@hidden (Automake will complain otherwise).  You should also
+call @code{AM_PROG_AR} to define @code{AR}, in order to support unusual
+archivers such as Microsoft lib.  @code{ARFLAGS} will default to
address@hidden; you can override this variable by setting it in your
address@hidden or by @code{AC_SUBST}ing it from your
address@hidden  You can override the @code{AR} variable by
+defining a per-library @code{maude_AR} variable (@pxref{Program and
+Library Variables}).
 
 @cindex Empty libraries
 Be careful when selecting library components conditionally.  Because
diff --git a/lib/Automake/ChannelDefs.pm b/lib/Automake/ChannelDefs.pm
index aaca979..9b6d3a5 100644
--- a/lib/Automake/ChannelDefs.pm
+++ b/lib/Automake/ChannelDefs.pm
@@ -115,6 +115,10 @@ variables (silent by default).
 
 Warnings about non-portable constructs.
 
+=item C<extra-portability>
+
+Extra warnings about non-portable constructs covering obscure tools.
+
 =item C<syntax>
 
 Warnings about weird syntax, unused variables, typos...
@@ -151,6 +155,7 @@ register_channel 'automake', type => 'fatal', backtrace => 
1,
   footer => "\nPlease contact <$PACKAGE_BUGREPORT>.",
   uniq_part => UP_NONE, ordered => 0;
 
+register_channel 'extra-portability', type => 'warning', silent => 1;
 register_channel 'gnu', type => 'warning';
 register_channel 'obsolete', type => 'warning', silent => 1;
 register_channel 'override', type => 'warning', silent => 1;
@@ -180,6 +185,7 @@ sub usage ()
   `obsolete'      obsolete features or constructions
   `override'      user redefinitions of Automake rules or variables
   `portability'   portability issues (default in gnu and gnits modes)
+  `extra-portability'  extra portability issues related to obscure tools
   `syntax'        dubious syntactic constructs (default)
   `unsupported'   unsupported or incomplete features (default)
   `all'           all the warnings
@@ -252,6 +258,10 @@ Else handle C<all> and C<none> for completeness.
 
 =cut
 
+# HACK to have `-Wextra-portability' *not* implied by `-Wall'.
+# This will go away in automake 1.12.
+my $have_extra_portability = 0;
+
 sub switch_warning ($)
 {
   my ($cat) = @_;
@@ -266,6 +276,8 @@ sub switch_warning ($)
   if ($cat eq 'all')
     {
       setup_channel_type 'warning', silent => $has_no;
+      setup_channel 'extra-portability', silent => 1
+        unless $have_extra_portability;
     }
   elsif ($cat eq 'none')
     {
@@ -284,6 +296,17 @@ sub switch_warning ($)
       setup_channel $cat, silent => $has_no;
       setup_channel 'portability-recursive', silent => $has_no
         if $cat eq 'portability';
+      if ($cat eq 'portability' && $has_no)
+        {
+          setup_channel 'extra-portability', silent => 1;
+          $have_extra_portability = 0;
+        }
+      if ($cat eq 'extra-portability' && ! $has_no)
+        {
+          setup_channel 'portability', silent => 0;
+          setup_channel 'portability-recursive', silent => 0;
+          $have_extra_portability = 1;
+        }
     }
   else
     {
@@ -345,6 +368,7 @@ sub set_strictness ($)
       setup_channel 'error-gnu/warn', silent => 0, type => 'error';
       setup_channel 'error-gnits', silent => 1;
       setup_channel 'portability', silent => 0;
+      setup_channel 'extra-portability', silent => 1;
       setup_channel 'gnu', silent => 0;
     }
   elsif ($name eq 'gnits')
@@ -353,6 +377,7 @@ sub set_strictness ($)
       setup_channel 'error-gnu/warn', silent => 0, type => 'error';
       setup_channel 'error-gnits', silent => 0;
       setup_channel 'portability', silent => 0;
+      setup_channel 'extra-portability', silent => 1;
       setup_channel 'gnu', silent => 0;
     }
   elsif ($name eq 'foreign')
@@ -361,6 +386,7 @@ sub set_strictness ($)
       setup_channel 'error-gnu/warn', silent => 0, type => 'warning';
       setup_channel 'error-gnits', silent => 1;
       setup_channel 'portability', silent => 1;
+      setup_channel 'extra-portability', silent => 1;
       setup_channel 'gnu', silent => 1;
     }
   else
@@ -369,6 +395,8 @@ sub set_strictness ($)
     }
 }
 
+1;
+
 =back
 
 =head1 SEE ALSO
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 9ef9cc7..d9dabb6 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -2,7 +2,8 @@
 
 ## Makefile for Automake lib.
 
-# Copyright (C) 2001, 2003, 2004, 2009 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2003, 2004, 2009, 2010 Free Software Foundation,
+# Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -28,7 +29,7 @@ dist_pkgvdata_DATA = COPYING INSTALL texinfo.tex ansi2knr.c 
ansi2knr.1 \
 scriptdir = $(pkgvdatadir)
 dist_script_DATA = config.guess config.sub install-sh mdate-sh missing \
   mkinstalldirs elisp-comp ylwrap acinstall depcomp compile py-compile \
-  symlink-tree
+  symlink-tree ar-lib
 
 EXTRA_DIST = gnupload gitlog-to-changelog update-copyright
 
diff --git a/lib/ar-lib b/lib/ar-lib
new file mode 100755
index 0000000..0f62c6f
--- /dev/null
+++ b/lib/ar-lib
@@ -0,0 +1,270 @@
+#! /bin/sh
+# Wrapper for Microsoft lib.exe
+
+me=ar-lib
+scriptversion=2012-03-01.08; # UTC
+
+# Copyright (C) 2010, 2012 Free Software Foundation, Inc.
+# Written by Peter Rosin <address@hidden>.
+#
+# This 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>.
+
+
+# func_error message
+func_error ()
+{
+  echo "$me: $1" 1>&2
+  exit 1
+}
+
+file_conv=
+
+# func_file_conv build_file
+# Convert a $build file to $host form and store it in $file
+# Currently only supports Windows hosts.
+func_file_conv ()
+{
+  file=$1
+  case $file in
+    / | /[!/]*) # absolute file, and not a UNC file
+      if test -z "$file_conv"; then
+       # lazily determine how to convert abs files
+       case `uname -s` in
+         MINGW*)
+           file_conv=mingw
+           ;;
+         CYGWIN*)
+           file_conv=cygwin
+           ;;
+         *)
+           file_conv=wine
+           ;;
+       esac
+      fi
+      case $file_conv in
+       mingw)
+         file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
+         ;;
+       cygwin)
+         file=`cygpath -m "$file" || echo "$file"`
+         ;;
+       wine)
+         file=`winepath -w "$file" || echo "$file"`
+         ;;
+      esac
+      ;;
+  esac
+}
+
+# func_at_file at_file operation archive
+# Iterate over all members in AT_FILE performing OPERATION on ARCHIVE
+# for each of them.
+# When interpreting the content of the @FILE, do NOT use func_file_conv,
+# since the user would need to supply preconverted file names to
+# binutils ar, at least for MinGW.
+func_at_file ()
+{
+  operation=$2
+  archive=$3
+  at_file_contents=`cat "$1"`
+  eval set x "$at_file_contents"
+  shift
+
+  for member
+  do
+    $AR -NOLOGO $operation:"$member" "$archive" || exit $?
+  done
+}
+
+case $1 in
+  '')
+     func_error "no command.  Try '$0 --help' for more information."
+     ;;
+  -h | --h*)
+    cat <<EOF
+Usage: $me [--help] [--version] PROGRAM ACTION ARCHIVE [MEMBER...]
+
+Members may be specified in a file named with @FILE.
+EOF
+    exit $?
+    ;;
+  -v | --v*)
+    echo "$me, version $scriptversion"
+    exit $?
+    ;;
+esac
+
+if test $# -lt 3; then
+  func_error "you must specify a program, an action and an archive"
+fi
+
+AR=$1
+shift
+while :
+do
+  if test $# -lt 2; then
+    func_error "you must specify a program, an action and an archive"
+  fi
+  case $1 in
+    -lib | -LIB \
+    | -ltcg | -LTCG \
+    | -machine* | -MACHINE* \
+    | -subsystem* | -SUBSYSTEM* \
+    | -verbose | -VERBOSE \
+    | -wx* | -WX* )
+      AR="$AR $1"
+      shift
+      ;;
+    *)
+      action=$1
+      shift
+      break
+      ;;
+  esac
+done
+orig_archive=$1
+shift
+func_file_conv "$orig_archive"
+archive=$file
+
+# strip leading dash in $action
+action=${action#-}
+
+delete=
+extract=
+list=
+quick=
+replace=
+index=
+create=
+
+while test -n "$action"
+do
+  case $action in
+    d*) delete=yes  ;;
+    x*) extract=yes ;;
+    t*) list=yes    ;;
+    q*) quick=yes   ;;
+    r*) replace=yes ;;
+    s*) index=yes   ;;
+    S*)             ;; # the index is always updated implicitly
+    c*) create=yes  ;;
+    u*)             ;; # TODO: don't ignore the update modifier
+    v*)             ;; # TODO: don't ignore the verbose modifier
+    *)
+      func_error "unknown action specified"
+      ;;
+  esac
+  action=${action#?}
+done
+
+case $delete$extract$list$quick$replace,$index in
+  yes,* | ,yes)
+    ;;
+  yesyes*)
+    func_error "more than one action specified"
+    ;;
+  *)
+    func_error "no action specified"
+    ;;
+esac
+
+if test -n "$delete"; then
+  if test ! -f "$orig_archive"; then
+    func_error "archive not found"
+  fi
+  for member
+  do
+    case $1 in
+      @*)
+        func_at_file "address@hidden" -REMOVE "$archive"
+        ;;
+      *)
+        func_file_conv "$1"
+        $AR -NOLOGO -REMOVE:"$file" "$archive" || exit $?
+        ;;
+    esac
+  done
+
+elif test -n "$extract"; then
+  if test ! -f "$orig_archive"; then
+    func_error "archive not found"
+  fi
+  if test $# -gt 0; then
+    for member
+    do
+      case $1 in
+        @*)
+          func_at_file "address@hidden" -EXTRACT "$archive"
+          ;;
+        *)
+          func_file_conv "$1"
+          $AR -NOLOGO -EXTRACT:"$file" "$archive" || exit $?
+          ;;
+      esac
+    done
+  else
+    $AR -NOLOGO -LIST "$archive" | sed -e 's/\\/\\\\/g' | while read member
+    do
+      $AR -NOLOGO -EXTRACT:"$member" "$archive" || exit $?
+    done
+  fi
+
+elif test -n "$quick$replace"; then
+  if test ! -f "$orig_archive"; then
+    if test -z "$create"; then
+      echo "$me: creating $orig_archive"
+    fi
+    orig_archive=
+  else
+    orig_archive=$archive
+  fi
+
+  for member
+  do
+    case $1 in
+    @*)
+      func_file_conv "address@hidden"
+      set x "$@" "@$file"
+      ;;
+    *)
+      func_file_conv "$1"
+      set x "$@" "$file"
+      ;;
+    esac
+    shift
+    shift
+  done
+
+  if test -n "$orig_archive"; then
+    $AR -NOLOGO -OUT:"$archive" "$orig_archive" "$@" || exit $?
+  else
+    $AR -NOLOGO -OUT:"$archive" "$@" || exit $?
+  fi
+
+elif test -n "$list"; then
+  if test ! -f "$orig_archive"; then
+    func_error "archive not found"
+  fi
+  $AR -NOLOGO -LIST "$archive" || exit $?
+fi
diff --git a/lib/compile b/lib/compile
index c0096a7..862a14e 100755
--- a/lib/compile
+++ b/lib/compile
@@ -1,10 +1,10 @@
 #! /bin/sh
-# Wrapper for compilers which do not understand `-c -o'.
+# Wrapper for compilers which do not understand '-c -o'.
 
-scriptversion=2009-10-06.20; # UTC
+scriptversion=2012-03-05.13; # UTC
 
-# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009  Free Software
-# Foundation, Inc.
+# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009, 2010, 2012 Free
+# Software Foundation, Inc.
 # Written by Tom Tromey <address@hidden>.
 #
 # This program is free software; you can redistribute it and/or modify
@@ -29,21 +29,219 @@ scriptversion=2009-10-06.20; # UTC
 # bugs to <address@hidden> or send patches to
 # <address@hidden>.
 
+nl='
+'
+
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent tools from complaining about whitespace usage.
+IFS=" ""       $nl"
+
+file_conv=
+
+# func_file_conv build_file lazy
+# Convert a $build file to $host form and store it in $file
+# Currently only supports Windows hosts. If the determined conversion
+# type is listed in (the comma separated) LAZY, no conversion will
+# take place.
+func_file_conv ()
+{
+  file=$1
+  case $file in
+    / | /[!/]*) # absolute file, and not a UNC file
+      if test -z "$file_conv"; then
+       # lazily determine how to convert abs files
+       case `uname -s` in
+         MINGW*)
+           file_conv=mingw
+           ;;
+         CYGWIN*)
+           file_conv=cygwin
+           ;;
+         *)
+           file_conv=wine
+           ;;
+       esac
+      fi
+      case $file_conv/,$2, in
+       *,$file_conv,*)
+         ;;
+       mingw/*)
+         file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
+         ;;
+       cygwin/*)
+         file=`cygpath -m "$file" || echo "$file"`
+         ;;
+       wine/*)
+         file=`winepath -w "$file" || echo "$file"`
+         ;;
+      esac
+      ;;
+  esac
+}
+
+# func_cl_dashL linkdir
+# Make cl look for libraries in LINKDIR
+func_cl_dashL ()
+{
+  func_file_conv "$1"
+  if test -z "$lib_path"; then
+    lib_path=$file
+  else
+    lib_path="$lib_path;$file"
+  fi
+  linker_opts="$linker_opts -LIBPATH:$file"
+}
+
+# func_cl_dashl library
+# Do a library search-path lookup for cl
+func_cl_dashl ()
+{
+  lib=$1
+  found=no
+  save_IFS=$IFS
+  IFS=';'
+  for dir in $lib_path $LIB
+  do
+    IFS=$save_IFS
+    if $shared && test -f "$dir/$lib.dll.lib"; then
+      found=yes
+      lib=$dir/$lib.dll.lib
+      break
+    fi
+    if test -f "$dir/$lib.lib"; then
+      found=yes
+      lib=$dir/$lib.lib
+      break
+    fi
+  done
+  IFS=$save_IFS
+
+  if test "$found" != yes; then
+    lib=$lib.lib
+  fi
+}
+
+# func_cl_wrapper cl arg...
+# Adjust compile command to suit cl
+func_cl_wrapper ()
+{
+  # Assume a capable shell
+  lib_path=
+  shared=:
+  linker_opts=
+  for arg
+  do
+    if test -n "$eat"; then
+      eat=
+    else
+      case $1 in
+       -o)
+         # configure might choose to run compile as 'compile cc -o foo foo.c'.
+         eat=1
+         case $2 in
+           *.o | *.[oO][bB][jJ])
+             func_file_conv "$2"
+             set x "$@" -Fo"$file"
+             shift
+             ;;
+           *)
+             func_file_conv "$2"
+             set x "$@" -Fe"$file"
+             shift
+             ;;
+         esac
+         ;;
+       -I)
+         eat=1
+         func_file_conv "$2" mingw
+         set x "$@" -I"$file"
+         shift
+         ;;
+       -I*)
+         func_file_conv "${1#-I}" mingw
+         set x "$@" -I"$file"
+         shift
+         ;;
+       -l)
+         eat=1
+         func_cl_dashl "$2"
+         set x "$@" "$lib"
+         shift
+         ;;
+       -l*)
+         func_cl_dashl "${1#-l}"
+         set x "$@" "$lib"
+         shift
+         ;;
+       -L)
+         eat=1
+         func_cl_dashL "$2"
+         ;;
+       -L*)
+         func_cl_dashL "${1#-L}"
+         ;;
+       -static)
+         shared=false
+         ;;
+       -Wl,*)
+         arg=${1#-Wl,}
+         save_ifs="$IFS"; IFS=','
+         for flag in $arg; do
+           IFS="$save_ifs"
+           linker_opts="$linker_opts $flag"
+         done
+         IFS="$save_ifs"
+         ;;
+       -Xlinker)
+         eat=1
+         linker_opts="$linker_opts $2"
+         ;;
+       -*)
+         set x "$@" "$1"
+         shift
+         ;;
+       *.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
+         func_file_conv "$1"
+         set x "$@" -Tp"$file"
+         shift
+         ;;
+       *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
+         func_file_conv "$1" mingw
+         set x "$@" "$file"
+         shift
+         ;;
+       *)
+         set x "$@" "$1"
+         shift
+         ;;
+      esac
+    fi
+    shift
+  done
+  if test -n "$linker_opts"; then
+    linker_opts="-link$linker_opts"
+  fi
+  exec "$@" $linker_opts
+  exit 1
+}
+
+eat=
+
 case $1 in
   '')
-     echo "$0: No command.  Try \`$0 --help' for more information." 1>&2
+     echo "$0: No command.  Try '$0 --help' for more information." 1>&2
      exit 1;
      ;;
   -h | --h*)
     cat <<\EOF
 Usage: compile [--help] [--version] PROGRAM [ARGS]
 
-Wrapper for compilers which do not understand `-c -o'.
-Remove `-o dest.o' from ARGS, run PROGRAM with the remaining
+Wrapper for compilers which do not understand '-c -o'.
+Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
 arguments, and rename the output as expected.
 
 If you are trying to build a whole package this is not the
-right script to run: please start by reading the file `INSTALL'.
+right script to run: please start by reading the file 'INSTALL'.
 
 Report bugs to <address@hidden>.
 EOF
@@ -53,11 +251,13 @@ EOF
     echo "compile $scriptversion"
     exit $?
     ;;
+  cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
+    func_cl_wrapper "$@"      # Doesn't return...
+    ;;
 esac
 
 ofile=
 cfile=
-eat=
 
 for arg
 do
@@ -66,8 +266,8 @@ do
   else
     case $1 in
       -o)
-       # configure might choose to run compile as `compile cc -o foo foo.c'.
-       # So we strip `-o arg' only if arg is an object.
+       # configure might choose to run compile as 'compile cc -o foo foo.c'.
+       # So we strip '-o arg' only if arg is an object.
        eat=1
        case $2 in
          *.o | *.obj)
@@ -94,10 +294,10 @@ do
 done
 
 if test -z "$ofile" || test -z "$cfile"; then
-  # If no `-o' option was seen then we might have been invoked from a
+  # If no '-o' option was seen then we might have been invoked from a
   # pattern rule where we don't need one.  That is ok -- this is a
   # normal compilation that the losing compiler can handle.  If no
-  # `.c' file was seen then we are probably linking.  That is also
+  # '.c' file was seen then we are probably linking.  That is also
   # ok.
   exec "$@"
 fi
@@ -106,7 +306,7 @@ fi
 cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
 
 # Create the lock directory.
-# Note: use `[/\\:.-]' here to ensure that we don't use the same name
+# Note: use '[/\\:.-]' here to ensure that we don't use the same name
 # that we are using for the .o file.  Also, base the name on the expected
 # object file name, since that is what matters with a parallel build.
 lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
diff --git a/lib/depcomp b/lib/depcomp
index 0122c04..58fe52c 100755
--- a/lib/depcomp
+++ b/lib/depcomp
@@ -1,10 +1,10 @@
 #! /bin/sh
 # depcomp - compile a program generating dependencies as side-effects
 
-scriptversion=2011-12-04.11; # UTC
+scriptversion=2012-02-03.15; # UTC
 
-# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009, 2011,
-# Free Software Foundation, Inc.
+# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009, 2010,
+# 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
@@ -28,7 +28,7 @@ scriptversion=2011-12-04.11; # UTC
 
 case $1 in
   '')
-     echo "$0: No command.  Try \`$0 --help' for more information." 1>&2
+     echo "$0: No command.  Try '$0 --help' for more information." 1>&2
      exit 1;
      ;;
   -h | --h*)
@@ -40,8 +40,8 @@ as side-effects.
 
 Environment variables:
   depmode     Dependency tracking mode.
-  source      Source file read by `PROGRAMS ARGS'.
-  object      Object file output by `PROGRAMS ARGS'.
+  source      Source file read by 'PROGRAMS ARGS'.
+  object      Object file output by 'PROGRAMS ARGS'.
   DEPDIR      directory where to store dependencies.
   depfile     Dependency file to output.
   tmpdepfile  Temporary file to use when outputting dependencies.
@@ -57,6 +57,12 @@ EOF
     ;;
 esac
 
+# A tabulation character.
+tab='  '
+# A newline character.
+nl='
+'
+
 if test -z "$depmode" || test -z "$source" || test -z "$object"; then
   echo "depcomp: Variables source, object and depmode must be set" 1>&2
   exit 1
@@ -90,10 +96,18 @@ if test "$depmode" = msvcmsys; then
    # This is just like msvisualcpp but w/o cygpath translation.
    # Just convert the backslash-escaped backslashes to single forward
    # slashes to satisfy depend.m4
-   cygpath_u="sed s,\\\\\\\\,/,g"
+   cygpath_u='sed s,\\\\,/,g'
    depmode=msvisualcpp
 fi
 
+if test "$depmode" = msvc7msys; then
+   # This is just like msvc7 but w/o cygpath translation.
+   # Just convert the backslash-escaped backslashes to single forward
+   # slashes to satisfy depend.m4
+   cygpath_u='sed s,\\\\,/,g'
+   depmode=msvc7
+fi
+
 if test "$depmode" = xlc; then
    # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency informations.
    gccflag=-qmakedep=gcc,-MF
@@ -154,15 +168,14 @@ gcc)
 ## 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.
+## This next piece of magic avoids the "deleted header file" problem.
 ## The problem is that when a header file which appears in a .P file
 ## is deleted, the dependency causes make to die (because there is
 ## 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 ' ' '
-' < "$tmpdepfile" |
-## Some versions of gcc put a space before the `:'.  On the theory
+  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.
@@ -201,18 +214,15 @@ sgi)
     # clever and replace this with sed code, as IRIX sed won't handle
     # lines with more than a fixed number of characters (4096 in
     # IRIX 6.2 sed, 8192 in IRIX 6.5).  We also remove comment lines;
-    # the IRIX cc adds comments like `#:fec' to the end of the
+    # the IRIX cc adds comments like '#:fec' to the end of the
     # dependency line.
-    tr ' ' '
-' < "$tmpdepfile" \
+    tr ' ' "$nl" < "$tmpdepfile" \
     | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
-    tr '
-' ' ' >> "$depfile"
+    tr "$nl" ' ' >> "$depfile"
     echo >> "$depfile"
 
     # The second pass generates a dummy entry for each header file.
-    tr ' ' '
-' < "$tmpdepfile" \
+    tr ' ' "$nl" < "$tmpdepfile" \
    | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
    >> "$depfile"
   else
@@ -234,7 +244,7 @@ xlc)
 aix)
   # The C for AIX Compiler uses -M and outputs the dependencies
   # in a .u file.  In older versions, this file always lives in the
-  # current directory.  Also, the AIX compiler puts `$object:' at the
+  # 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|/[^/]*$|/|'`
@@ -264,12 +274,11 @@ aix)
     test -f "$tmpdepfile" && break
   done
   if test -f "$tmpdepfile"; then
-    # Each line is of the form `foo.o: dependent.h'.
+    # 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:'.
+    # '$object: dependent.h' and one to simply 'dependent.h:'.
     sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
-    # That's a tab and a space in the [].
-    sed -e 's,^.*\.[a-z]*:[     ]*,,' -e 's,$,:,' < "$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
@@ -280,7 +289,7 @@ aix)
   ;;
 
 icc)
-  # Intel's C compiler understands `-MD -MF file'.  However on
+  # Intel's C compiler understands '-MD -MF file'.  However on
   #    icc -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
@@ -305,10 +314,10 @@ icc)
     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 \'.
+  # 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:'.
+  # '$object: dependent.h' and one to simply 'dependent.h:'.
   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.
@@ -349,7 +358,7 @@ hp2)
   done
   if test -f "$tmpdepfile"; then
     sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
-    # Add `dependent.h:' lines.
+    # Add 'dependent.h:' lines.
     sed -ne '2,${
               s/^ *//
               s/ \\*$//
@@ -364,9 +373,9 @@ hp2)
 
 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'.
+   # 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.
+   # 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=
@@ -412,14 +421,59 @@ tru64)
    done
    if test -f "$tmpdepfile"; then
       sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
-      # That's a tab and a space in the [].
-      sed -e 's,^.*\.[a-z]*:[   ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
+      sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> 
"$depfile"
    else
       echo "#dummy" > "$depfile"
    fi
    rm -f "$tmpdepfile"
    ;;
 
+msvc7)
+  if test "$libtool" = yes; then
+    showIncludes=-Wc,-showIncludes
+  else
+    showIncludes=-showIncludes
+  fi
+  "$@" $showIncludes > "$tmpdepfile"
+  stat=$?
+  grep -v '^Note: including file: ' "$tmpdepfile"
+  if test "$stat" = 0; then :
+  else
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  # The first sed program below extracts the file names and escapes
+  # backslashes for cygpath.  The second sed program outputs the file
+  # name when reading, but also accumulates all include files in the
+  # hold buffer in order to output them again at the end.  This only
+  # works with sed implementations that can handle large buffers.
+  sed < "$tmpdepfile" -n '
+/^Note: including file:  *\(.*\)/ {
+  s//\1/
+  s/\\/\\\\/g
+  p
+}' | $cygpath_u | sort -u | sed -n '
+s/ /\\ /g
+s/\(.*\)/'"$tab"'\1 \\/p
+s/.\(.*\) \\/\1:/
+H
+$ {
+  s/.*/'"$tab"'/
+  G
+  p
+}' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+msvc7msys)
+  # This case exists only to let depend.m4 do its work.  It works by
+  # looking at the text of this script.  This case will never be run,
+  # since it is checked for above.
+  exit 1
+  ;;
+
 #nosideeffect)
   # This comment above is used by automake to tell side-effect
   # dependency tracking mechanisms from slower ones.
@@ -437,7 +491,7 @@ dashmstdout)
     shift
   fi
 
-  # Remove `-o $object'.
+  # Remove '-o $object'.
   IFS=" "
   for arg
   do
@@ -457,15 +511,14 @@ dashmstdout)
   done
 
   test -z "$dashmflag" && dashmflag=-M
-  # Require at least two characters before searching for `:'
+  # Require at least two characters before searching for ':'
   # 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.
+  # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.
   "$@" $dashmflag |
-    sed 's:^[  ]*[^: ][^:][^:]*\:[    ]*:'"$object"'\: :' > "$tmpdepfile"
+    sed 's:^['"$tab"' ]*[^:'"$tab"' ][^:][^:]*\:['"$tab"' ]*:'"$object"'\: :' 
> "$tmpdepfile"
   rm -f "$depfile"
   cat < "$tmpdepfile" > "$depfile"
-  tr ' ' '
-' < "$tmpdepfile" | \
+  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"
@@ -521,8 +574,7 @@ 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 ' ' '
-' | \
+  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"
@@ -542,7 +594,7 @@ cpp)
     shift
   fi
 
-  # Remove `-o $object'.
+  # Remove '-o $object'.
   IFS=" "
   for arg
   do
@@ -611,8 +663,8 @@ msvisualcpp)
   sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > 
"$tmpdepfile"
   rm -f "$depfile"
   echo "$object : \\" > "$depfile"
-  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::     \1 \\:p' >> 
"$depfile"
-  echo "       " >> "$depfile"
+  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> 
"$depfile"
+  echo "$tab" >> "$depfile"
   sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
   rm -f "$tmpdepfile"
   ;;
diff --git a/m4/Makefile.am b/m4/Makefile.am
index b0e0d84..c1442f6 100644
--- a/m4/Makefile.am
+++ b/m4/Makefile.am
@@ -23,6 +23,7 @@ system_acdir = $(datadir)/aclocal
 
 dist_automake_ac_DATA = \
 $(top_srcdir)/m4/amversion.m4 \
+ar-lib.m4 \
 as.m4 \
 auxdir.m4 \
 ccstdc.m4 \
diff --git a/m4/ar-lib.m4 b/m4/ar-lib.m4
new file mode 100644
index 0000000..e45c558
--- /dev/null
+++ b/m4/ar-lib.m4
@@ -0,0 +1,61 @@
+##                                                          -*- Autoconf -*-
+# Copyright (C) 2011 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 1
+
+# AM_PROG_AR([ACT-IF-FAIL])
+# -------------------------
+# Try to determine the archiver interface, and trigger the ar-lib wrapper
+# if it is needed.  If the detection of archiver interface fails, run
+# ACT-IF-FAIL (default is to abort configure with a proper error message).
+AC_DEFUN([AM_PROG_AR],
+[AC_BEFORE([$0], [LT_INIT])dnl
+AC_BEFORE([$0], [AC_PROG_LIBTOOL])dnl
+AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([ar-lib])dnl
+AC_CHECK_TOOLS([AR], [ar lib "link -lib"], [false])
+: ${AR=ar}
+
+AC_CACHE_CHECK([the archiver ($AR) interface], [am_cv_ar_interface],
+  [am_cv_ar_interface=ar
+   AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int some_variable = 0;]])],
+     [am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&AS_MESSAGE_LOG_FD'
+      AC_TRY_EVAL([am_ar_try])
+      if test "$ac_status" -eq 0; then
+        am_cv_ar_interface=ar
+      else
+        am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext 
>&AS_MESSAGE_LOG_FD'
+        AC_TRY_EVAL([am_ar_try])
+        if test "$ac_status" -eq 0; then
+          am_cv_ar_interface=lib
+        else
+          am_cv_ar_interface=unknown
+        fi
+      fi
+      rm -f conftest.lib libconftest.a
+     ])
+   ])
+
+case $am_cv_ar_interface in
+ar)
+  ;;
+lib)
+  # Microsoft lib, so override with the ar-lib wrapper script.
+  # FIXME: It is wrong to rewrite AR.
+  # But if we don't then we get into trouble of one sort or another.
+  # A longer-term fix would be to have automake use am__AR in this case,
+  # and then we could set am__AR="$am_aux_dir/ar-lib \$(AR)" or something
+  # similar.
+  AR="$am_aux_dir/ar-lib $AR"
+  ;;
+unknown)
+  m4_default([$1],
+             [AC_MSG_ERROR([could not determine $AR interface])])
+  ;;
+esac
+AC_SUBST([AR])dnl
+])
diff --git a/m4/depend.m4 b/m4/depend.m4
index 89d37b2..359c349 100644
--- a/m4/depend.m4
+++ b/m4/depend.m4
@@ -111,7 +111,7 @@ AC_CACHE_CHECK([dependency style of $depcc],
        break
       fi
       ;;
-    msvisualcpp | msvcmsys)
+    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
       # This compiler won't grok `-c -o', but also, the minuso test has
       # not run yet.  These depmodes are late enough in the game, and
       # so weak that their functioning should not be impacted.
diff --git a/tests/Makefile.am b/tests/Makefile.am
index eab45dc..d909942 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -63,6 +63,9 @@ TESTS = $(handwritten_TESTS) $(parallel_tests)
 
 # FIXME: make these automatically computed once we are merged into
 # FIXME: the `testsuite-work' branch.
+ar-lib4.log: libtool-macros.log
+ar-lib6a.log: libtool-macros.log
+ar-lib6b.log: libtool-macros.log
 depcomp4.log: libtool-macros.log
 depcomp7.log: libtool-macros.log
 depcomp8b.log: libtool-macros.log
diff --git a/tests/aclibobj.test b/tests/aclibobj.test
index 6ef6f6b..a40baa4 100755
--- a/tests/aclibobj.test
+++ b/tests/aclibobj.test
@@ -20,6 +20,7 @@
 
 cat >> configure.in << 'END'
 AC_PROG_CC
+AM_PROG_AR
 AC_PROG_RANLIB
 AC_OUTPUT
 END
@@ -32,6 +33,7 @@ END
 
 : > maude.c
 : > liver.c
+: > ar-lib
 
 $ACLOCAL
 
diff --git a/tests/aclocal4.test b/tests/aclocal4.test
index 9fa96ec..eab8ca8 100755
--- a/tests/aclocal4.test
+++ b/tests/aclocal4.test
@@ -25,6 +25,7 @@ set -e
 
 cat >>configure.in <<EOF
 AC_PROG_RANLIB
+AM_PROG_AR
 AC_PROG_CC
 MY_MACRO
 AC_CONFIG_FILES([lib/Makefile])
@@ -60,7 +61,7 @@ EOF
 
 $ACLOCAL -I m4
 $AUTOCONF
-$AUTOMAKE
+$AUTOMAKE --add-missing
 ./configure
 $MAKE check-not-foo
 
diff --git a/tests/alloca.test b/tests/alloca.test
index 8a1e06e..6304002 100755
--- a/tests/alloca.test
+++ b/tests/alloca.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2003  Free Software Foundation, Inc.
+# Copyright (C) 2003, 2011 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -21,6 +21,7 @@
 set -e
 
 cat >> configure.in <<'END'
+AM_PROG_AR
 AC_PROG_CC
 END
 
@@ -31,6 +32,7 @@ libtu_a_LIBADD = @ALLOCA@
 END
 
 : > alloca.c
+: > ar-lib
 
 $ACLOCAL
 AUTOMAKE_fails
diff --git a/tests/alloca2.test b/tests/alloca2.test
index caf11a3..a459338 100755
--- a/tests/alloca2.test
+++ b/tests/alloca2.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2003  Free Software Foundation, Inc.
+# Copyright (C) 2003, 2011 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -22,6 +22,7 @@ set -e
 
 cat >> configure.in <<'END'
 AC_PROG_CC
+AM_PROG_AR
 END
 
 cat > Makefile.am << 'END'
@@ -31,6 +32,7 @@ libtu_la_LIBADD = @LTALLOCA@
 END
 
 : > alloca.c
+: > ar-lib
 
 $ACLOCAL
 AUTOMAKE_fails
diff --git a/tests/ansi10.test b/tests/ansi10.test
index 4ff2c86..68e1249 100755
--- a/tests/ansi10.test
+++ b/tests/ansi10.test
@@ -25,6 +25,7 @@ cat >> configure.in << 'END'
 AC_PROG_CC
 AC_PROG_CC_STDC
 AM_C_PROTOTYPES
+AM_PROG_AR
 AC_PROG_RANLIB
 AC_LIBOBJ([hello])
 AC_CONFIG_FILES([dir/Makefile])
diff --git a/tests/ar-lib.test b/tests/ar-lib.test
new file mode 100755
index 0000000..1bb46b1
--- /dev/null
+++ b/tests/ar-lib.test
@@ -0,0 +1,113 @@
+#! /bin/sh
+# Copyright (C) 2010 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Make sure `ar-lib' wraps the Microsoft Library Manager (lib) correctly
+
+required=xsi-shell
+. ./defs || Exit 1
+
+set -e
+
+cp "$testsrcdir/../lib/ar-lib" .
+# Use a dummy lib, since lib isn't readily available on all systems.
+cat >lib <<'END'
+#! /bin/sh
+if test x"$2" = x-LIST && test x"$3" = xfake.lib; then
+  echo fake.obj
+elif test x"$2" = x-LIST && test x"$3" = xfake2.lib; then
+  printf "%s\n" "dir\\fake2.obj"
+else
+  printf "%s\n" "lib $*"
+fi
+END
+
+chmod +x ./lib
+
+# Check if ar-lib can create an archive with "cr"
+opts=`./ar-lib ./lib cr foo.lib foo.obj`
+test x"$opts" = x"lib -NOLOGO -OUT:foo.lib foo.obj"
+
+# Check if ar-lib can update an existing archive with "r"
+touch foo.lib
+opts=`./ar-lib ./lib r foo.lib foo.obj`
+test x"$opts" = x"lib -NOLOGO -OUT:foo.lib foo.lib foo.obj"
+
+# Check if ar-lib can update an existing archive with "q".
+opts=`./ar-lib ./lib q foo.lib foo.obj`
+test x"$opts" = x"lib -NOLOGO -OUT:foo.lib foo.lib foo.obj"
+
+# Check if ar-lib accepts "u" as a modifier.
+# NOTE: "u" should have an effect, but currently doesn't.
+opts=`./ar-lib ./lib ru foo.lib foo.obj`
+test x"$opts" = x"lib -NOLOGO -OUT:foo.lib foo.lib foo.obj"
+
+# Check if ar-lib accepts "s" as a modifier.
+opts=`./ar-lib ./lib rs foo.lib foo.obj`
+test x"$opts" = x"lib -NOLOGO -OUT:foo.lib foo.lib foo.obj"
+
+# Check if ar-lib accepts "S" as a modifier.
+opts=`./ar-lib ./lib rS foo.lib foo.obj`
+test x"$opts" = x"lib -NOLOGO -OUT:foo.lib foo.lib foo.obj"
+
+# Check if ar-lib passes on @FILE with "r"
+opts=`./ar-lib ./lib r foo.lib @list`
+test x"$opts" = x"lib -NOLOGO -OUT:foo.lib foo.lib @list"
+
+# Check if ar-lib can delete a member from an archive with "d"
+opts=`./ar-lib ./lib d foo.lib foo.obj`
+test x"$opts" = x"lib -NOLOGO -REMOVE:foo.obj foo.lib"
+
+# Check if ar-lib can delete members in an @FILE
+echo foo.obj > foolist
+opts=`./ar-lib ./lib d foo.lib @foolist`
+test x"$opts" = x"lib -NOLOGO -REMOVE:foo.obj foo.lib"
+
+# Check if ar-lib can list archive members with "t"
+opts=`./ar-lib ./lib t foo.lib`
+test x"$opts" = x"lib -NOLOGO -LIST foo.lib"
+
+# Check if ar-lib accepts "v" as a modifier.
+# NOTE: "v" should have an effect, but currently doesn't.
+opts=`./ar-lib ./lib tv foo.lib`
+test x"$opts" = x"lib -NOLOGO -LIST foo.lib"
+
+# Check if ar-lib can extract archive members with "x"
+touch fake.lib
+opts=`./ar-lib ./lib x fake.lib`
+test x"$opts" = x"lib -NOLOGO -EXTRACT:fake.obj fake.lib"
+
+# Check if ar-lib can extract specified archive members with "x"
+opts=`./ar-lib ./lib x foo.lib foo.obj`
+test x"$opts" = x"lib -NOLOGO -EXTRACT:foo.obj foo.lib"
+
+# Check if ar-lib can extract members in an @FILE
+opts=`./ar-lib ./lib x foo.lib @foolist`
+test x"$opts" = x"lib -NOLOGO -EXTRACT:foo.obj foo.lib"
+
+# Check if ar-lib passes -lib and -LTCG through to the wrappee
+opts=`./ar-lib ./lib -lib -LTCG x foo.lib foo.obj`
+test x"$opts" = x"lib -lib -LTCG -NOLOGO -EXTRACT:foo.obj foo.lib"
+
+# Check if ar-lib can extract backslashed members
+touch fake2.lib
+opts=`./ar-lib ./lib x fake2.lib`
+test x"$opts" = x"lib -NOLOGO -EXTRACT:dir\\fake2.obj fake2.lib"
+
+# Check if ar-lib accepts "s" as an action.
+opts=`./ar-lib ./lib s foo.lib`
+test x"$opts" = x
+
+:
diff --git a/tests/subobj7.test b/tests/ar-lib2.test
similarity index 70%
copy from tests/subobj7.test
copy to tests/ar-lib2.test
index dd1a8fe..67a64e9 100755
--- a/tests/subobj7.test
+++ b/tests/ar-lib2.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2001, 2002, 2004, 2010 Free Software Foundation, Inc.
+# Copyright (C) 2011 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -14,8 +14,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Test to make sure AM_CFLAGS appears in subdir compilation rule.
-# Report from Steve M. Robbins.
+# Test if AM_PROG_AR installs ar-lib.
 
 . ./defs || Exit 1
 
@@ -23,18 +22,19 @@ set -e
 
 cat >> configure.in << 'END'
 AC_PROG_CC
-AM_PROG_CC_C_O
-AC_OUTPUT
+AM_PROG_AR
 END
 
 cat > Makefile.am << 'END'
 bin_PROGRAMS = wish
-wish_SOURCES = foo.c generic/a.c
+wish_SOURCES = a.c
 END
 
 $ACLOCAL
-$AUTOMAKE --add-missing
-
-grep wish_CFLAGS Makefile.in && Exit 1
+$AUTOMAKE --add-missing 2>stderr || { cat stderr >&2; Exit 1; }
+cat stderr >&2
+# Make sure ar-lib is installed, and that Automake says so.
+grep '^configure\.in:.*install.*ar-lib' stderr
+test -f ar-lib
 
 :
diff --git a/tests/ar2.test b/tests/ar-lib3.test
similarity index 72%
copy from tests/ar2.test
copy to tests/ar-lib3.test
index 329f804..8378e2a 100755
--- a/tests/ar2.test
+++ b/tests/ar-lib3.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2004, 2010 Free Software Foundation, Inc.
+# Copyright (C) 2011 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -14,8 +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/>.
 
-# Make sure AR and ARFLAGS are defined for EXTRA_LIBRARIES.
-# Report from Kevin Ryde.
+# Test if lib_LIBRARIES requests AM_PROG_AR.
 
 . ./defs || Exit 1
 
@@ -24,17 +23,24 @@ set -e
 cat >> configure.in << 'END'
 AC_PROG_CC
 AC_PROG_RANLIB
-AC_OUTPUT
 END
 
 cat > Makefile.am << 'END'
-EXTRA_LIBRARIES = libfoo.a
+lib_LIBRARIES = libfoo.a
 libfoo_a_SOURCES = foo.c
 END
 
 $ACLOCAL
-$AUTOMAKE
-grep '^ARFLAGS =' Makefile.in
-grep '^AR =' Makefile.in
+AUTOMAKE_fails -Wextra-portability
+
+grep 'requires.*AM_PROG_AR' stderr
+
+cat >> configure.in << 'END'
+AM_PROG_AR
+END
+
+rm -rf autom4te*.cache
+$ACLOCAL
+$AUTOMAKE --add-missing
 
 :
diff --git a/tests/aclibobj.test b/tests/ar-lib4.test
similarity index 65%
copy from tests/aclibobj.test
copy to tests/ar-lib4.test
index 6ef6f6b..9e01d6c 100755
--- a/tests/aclibobj.test
+++ b/tests/ar-lib4.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2001, 2002, 2003, 2008  Free Software Foundation, Inc.
+# Copyright (C) 2011 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -14,36 +14,44 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Make sure AC_LIBOBJ and friends work.
+# Test if lib_LTLIBRARIES requests AM_PROG_AR.
 
+required=libtoolize
 . ./defs || Exit 1
 
+set -e
+
+cp configure.in X
+
 cat >> configure.in << 'END'
 AC_PROG_CC
 AC_PROG_RANLIB
+AC_PROG_LIBTOOL
 AC_OUTPUT
 END
 
 cat > Makefile.am << 'END'
-noinst_LIBRARIES = libtu.a
-libtu_a_SOURCES =
-libtu_a_LIBADD = @LIBOBJS@
+lib_LTLIBRARIES = libfoo.la
+libfoo_la_SOURCES = foo.c
 END
 
-: > maude.c
-: > liver.c
-
+libtoolize
 $ACLOCAL
+AUTOMAKE_fails -Wextra-portability
 
-set -e
+grep 'requires.*AM_PROG_AR' stderr
 
-cp configure.in X
-echo 'AC_LIBSOURCE(maude.c)' >> configure.in
-$AUTOMAKE
+cp X configure.in
 
-# Avoid timestamp-related differences.
-rm -rf autom4te.cache
+cat >> configure.in << 'END'
+AC_PROG_CC
+AM_PROG_AR
+AC_PROG_RANLIB
+AC_PROG_LIBTOOL
+AC_OUTPUT
+END
 
-cp X configure.in
-echo 'AC_LIBSOURCES([maude.c, liver.c])' >> configure.in
-$AUTOMAKE
+$ACLOCAL
+$AUTOMAKE -Wextra-portability --add-missing
+
+:
diff --git a/tests/ar-lib5a.test b/tests/ar-lib5a.test
new file mode 100755
index 0000000..d1de98b
--- /dev/null
+++ b/tests/ar-lib5a.test
@@ -0,0 +1,75 @@
+#! /bin/sh
+# Copyright (C) 2011 Free Software Foundation, Inc.
+#
+# This 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 if AM_PROG_AR triggers the use of the ar-lib script.
+# This test requires Microsoft lib.
+# Keep this test in sync with sister test `ar-lib5b.test'.
+
+required=lib
+. ./defs || Exit 1
+
+set -e
+
+cat > configure.in << END
+AC_INIT([$me], [1.0])
+AC_CONFIG_AUX_DIR([auxdir])
+AM_INIT_AUTOMAKE
+AC_CONFIG_FILES([Makefile])
+AC_PROG_CC
+AM_PROG_AR
+AC_PROG_RANLIB
+# We want to test the content of am_cv_ar_interface in the Makefile.
+AC_SUBST([am_cv_ar_interface])
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+lib_LIBRARIES = libwish.a
+libwish_a_SOURCES = wish.c
+
+check-local:
+       test x'$(am_cv_ar_interface)' = x'lib'
+       test -f ar-lib-worked
+       test -f libwish.a
+MOSTLYCLEANFILES = ar-lib-worked
+END
+
+cat > wish.c << 'END'
+int wish(void) { return 0; }
+END
+
+mkdir auxdir
+# FIXME: make this "installcheck-aware" once we are merged into the
+#        'testsuite-work' branch.
+cat - "$testsrcdir"/../lib/ar-lib > auxdir/ar-lib << 'END'
+#! /bin/sh
+:> ar-lib-worked
+END
+chmod +x auxdir/ar-lib
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE --add-missing
+
+# Sanity check: test that it is ok to use `am_cv_ar_interface' as we do.
+$FGREP 'am_cv_ar_interface=' configure
+
+./configure AR=lib RANLIB=:
+
+$MAKE check
+$MAKE distcheck DISTCHECK_CONFIGURE_FLAGS='AR=lib RANLIB=:'
+
+:
diff --git a/tests/ar-lib5b.test b/tests/ar-lib5b.test
new file mode 100755
index 0000000..52deab5
--- /dev/null
+++ b/tests/ar-lib5b.test
@@ -0,0 +1,99 @@
+#! /bin/sh
+# Copyright (C) 2011 Free Software Foundation, Inc.
+#
+# This 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 if AM_PROG_AR triggers the use of the ar-lib script.
+# This test does not require Microsoft lib.
+# Keep this test in sync with sister test `ar-lib5a.test'.
+
+. ./defs || Exit 1
+
+set -e
+
+cat > configure.in << END
+AC_INIT([$me], [1.0])
+AC_CONFIG_AUX_DIR([auxdir])
+AM_INIT_AUTOMAKE
+AC_CONFIG_FILES([Makefile])
+AC_PROG_CC
+AM_PROG_AR
+AC_PROG_RANLIB
+# We want to test the content of am_cv_ar_interface in the Makefile.
+AC_SUBST([am_cv_ar_interface])
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+lib_LIBRARIES = libwish.a
+libwish_a_SOURCES = wish.c
+
+check-local:
+       test x'$(am_cv_ar_interface)' = x'lib'
+       test -f ar-lib-worked
+MOSTLYCLEANFILES = ar-lib-worked
+END
+
+cat > wish.c << 'END'
+int wish(void) { return 0; }
+END
+
+mkdir auxdir
+cat > auxdir/ar-lib << 'END'
+#! /bin/sh
+:> ar-lib-worked
+END
+chmod +x auxdir/ar-lib
+
+# Let's fake microsoft lib.
+mkdir bin
+cat > bin/lib << 'END'
+#! /bin/sh
+echo lib command line: $* >&2 # For debugging.
+case " $* " in
+  # The `-OUT:' option is used by tests in configure.  So don't create
+  # the `ar-lib-worked' file here, as that might cause spurious passes
+  # of this test; but don't fail either, as that would confuse said
+  # configure tests.
+  *' -OUT:'*) exit 0;;
+  # This means that $* looks like a command-line for `ar'.  We have to
+  # exit with failure here, to accomodate the two following ortoghonal
+  # scenarios:
+  #  1. when `lib' is tested by configure, this will tell that it does
+  #     not use the ar(1) interface, so that the `ar-lib' script will
+  #     get involved;
+  #  2. when `lib' is called by the Makefile, an ar-style command line
+  #     passed to it would mean that the `ar-lib' script has failed to
+  #     properly munge the command line, or hasn't been invoked to do so.
+  *\ c*) exit 1;;
+  # Assume everything else is OK.
+  *) : > ar-lib-worked;;
+esac
+END
+chmod +x bin/lib
+PATH=`pwd`/bin$PATH_SEPARATOR$PATH; export PATH
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE --add-missing
+
+# Sanity check: test that it is ok to use `am_cv_ar_interface' as we do.
+$FGREP 'am_cv_ar_interface=' configure
+
+./configure AR=lib RANLIB=:
+
+$MAKE check
+$MAKE distcheck DISTCHECK_CONFIGURE_FLAGS="AR=lib RANLIB=:"
+
+:
diff --git a/tests/check-tests_environment.test b/tests/ar-lib6a.test
similarity index 67%
copy from tests/check-tests_environment.test
copy to tests/ar-lib6a.test
index a07ab95..f1b982c 100755
--- a/tests/check-tests_environment.test
+++ b/tests/ar-lib6a.test
@@ -14,34 +14,26 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# "Simple Tests" testsuite driver: check TESTS_ENVIRONMENT support.
+# Test AM_PROG_AR ordering requirements
+# Keep this test in sync with sister test `ar-lib6b.test'.
 
+required=libtoolize
 . ./defs || Exit 1
 
 set -e
 
 cat >> configure.in << 'END'
-AC_OUTPUT
+AC_PROG_CC
+AC_PROG_RANLIB
+m4_ifdef([LT_INIT], [LT_INIT], [AC_PROG_LIBTOOL])
+AM_PROG_AR
 END
 
-cat > Makefile.am << 'END'
-TESTS = foo.test
-EXTRA_DIST = $(TESTS)
-END
-
-cat > foo.test << 'END'
-#! /bin/sh
-test x"$FOO" = x"ok"
-END
-chmod a+x foo.test
-
+libtoolize
 $ACLOCAL
-$AUTOCONF
-$AUTOMAKE -a
-
-./configure
+$AUTOCONF 2>stderr || { cat stderr >&2; Exit 1; }
+cat stderr >&2
 
-FOO=bad TESTS_ENVIRONMENT='FOO=ok'  $MAKE check
-FOO=ok  TESTS_ENVIRONMENT='FOO=bad' $MAKE check && Exit 1
+$EGREP '(AC_PROG_LIBTOOL|LT_INIT).*before.*AM_PROG_AR' stderr
 
 :
diff --git a/tests/libtoo11.test b/tests/ar-lib6b.test
similarity index 69%
copy from tests/libtoo11.test
copy to tests/ar-lib6b.test
index 850ca82..5487add 100755
--- a/tests/libtoo11.test
+++ b/tests/ar-lib6b.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2008  Free Software Foundation, Inc.
+# Copyright (C) 2011 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -14,25 +14,26 @@
 # 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 config.lt is removed with Libtool 2.2.x's LT_OUTPUT.
-# Report by Charles Wilson.
+# Test AM_PROG_AR ordering requirements for older Libtools
+# Keep this test in sync with sister test `ar-lib6a.test'.
 
 required=libtoolize
 . ./defs || Exit 1
+
 set -e
 
 cat >> configure.in << 'END'
+AC_PROG_CC
+AC_PROG_RANLIB
 AC_PROG_LIBTOOL
-m4_ifdef([LT_OUTPUT], [LT_OUTPUT])
-AC_OUTPUT
+AM_PROG_AR
 END
 
-: > Makefile.am
-
 libtoolize
 $ACLOCAL
-$AUTOMAKE --add-missing
-$AUTOCONF
-./configure
-$MAKE distcheck
+$AUTOCONF 2>stderr || { cat stderr >&2; Exit 1; }
+cat stderr >&2
+
+$EGREP 'AC_PROG_LIBTOOL.*before.*AM_PROG_AR' stderr
+
 :
diff --git a/tests/makefile-deps.test b/tests/ar-lib7.test
similarity index 76%
copy from tests/makefile-deps.test
copy to tests/ar-lib7.test
index 819c7d3..3f758a9 100755
--- a/tests/makefile-deps.test
+++ b/tests/ar-lib7.test
@@ -14,18 +14,23 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Make sure we don't emit a rule with empty target if list of
-# automatically-computed dependencies for Makefile.in is empty.
+# Test if automake warns if ar-lib is missing when AM_PROG_AR is used.
 
 . ./defs || Exit 1
 
 set -e
 
-: > Makefile.am
+cat >> configure.in << 'END'
+AM_PROG_AR
+END
+
+:> Makefile.am
 
 $ACLOCAL
-$AUTOMAKE
+AUTOMAKE_fails
+
+grep '^configure\.in:.*ar-lib.*not found' stderr
 
-grep "^ *:" Makefile.in && Exit 1
+$AUTOMAKE --add-missing
 
 :
diff --git a/tests/ar.test b/tests/ar.test
index dbdf246..06dcde3 100755
--- a/tests/ar.test
+++ b/tests/ar.test
@@ -21,6 +21,7 @@
 set -e
 
 cat >> configure.in << 'END'
+AM_PROG_AR
 AC_SUBST([AR], ['echo it works'])
 AC_SUBST([ARFLAGS], ['>'])
 AC_SUBST([RANLIB], ['echo really works >>'])
@@ -32,6 +33,8 @@ lib_LIBRARIES = libfoo.a
 libfoo_a_SOURCES =
 END
 
+:> ar-lib
+
 $ACLOCAL
 $AUTOCONF
 $AUTOMAKE
diff --git a/tests/ar2.test b/tests/ar2.test
index 329f804..f37f514 100755
--- a/tests/ar2.test
+++ b/tests/ar2.test
@@ -33,7 +33,7 @@ libfoo_a_SOURCES = foo.c
 END
 
 $ACLOCAL
-$AUTOMAKE
+$AUTOMAKE -Wno-extra-portability
 grep '^ARFLAGS =' Makefile.in
 grep '^AR =' Makefile.in
 
diff --git a/tests/ar2.test b/tests/ar3.test
similarity index 79%
copy from tests/ar2.test
copy to tests/ar3.test
index 329f804..1d5e84e 100755
--- a/tests/ar2.test
+++ b/tests/ar3.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2004, 2010 Free Software Foundation, Inc.
+# Copyright (C) 2011 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -14,8 +14,8 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Make sure AR and ARFLAGS are defined for EXTRA_LIBRARIES.
-# Report from Kevin Ryde.
+# Make sure that AR, ARFLAGS, etc. works also when the macro AM_PROG_AR
+# is used.
 
 . ./defs || Exit 1
 
@@ -23,6 +23,7 @@ set -e
 
 cat >> configure.in << 'END'
 AC_PROG_CC
+AM_PROG_AR
 AC_PROG_RANLIB
 AC_OUTPUT
 END
@@ -32,9 +33,11 @@ EXTRA_LIBRARIES = libfoo.a
 libfoo_a_SOURCES = foo.c
 END
 
+: > ar-lib
+
 $ACLOCAL
 $AUTOMAKE
-grep '^ARFLAGS =' Makefile.in
-grep '^AR =' Makefile.in
+$EGREP '^ARFLAGS =' Makefile.in
+$EGREP '^AR =' Makefile.in
 
 :
diff --git a/tests/check-tests_environment.test b/tests/ar4.test
similarity index 68%
copy from tests/check-tests_environment.test
copy to tests/ar4.test
index a07ab95..bb18111 100755
--- a/tests/check-tests_environment.test
+++ b/tests/ar4.test
@@ -14,34 +14,26 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# "Simple Tests" testsuite driver: check TESTS_ENVIRONMENT support.
+# Test if configure bails out if $AR does not work and AM_PROG_AR is used.
 
 . ./defs || Exit 1
 
 set -e
 
 cat >> configure.in << 'END'
-AC_OUTPUT
+AM_PROG_AR
 END
 
-cat > Makefile.am << 'END'
-TESTS = foo.test
-EXTRA_DIST = $(TESTS)
-END
-
-cat > foo.test << 'END'
-#! /bin/sh
-test x"$FOO" = x"ok"
-END
-chmod a+x foo.test
-
 $ACLOCAL
 $AUTOCONF
-$AUTOMAKE -a
 
-./configure
+st=0; ./configure AR=/bin/false >stdout 2>stderr || st=$?
+cat stdout
+cat stderr >&2
+test $st -eq 1
 
-FOO=bad TESTS_ENVIRONMENT='FOO=ok'  $MAKE check
-FOO=ok  TESTS_ENVIRONMENT='FOO=bad' $MAKE check && Exit 1
+grep '^checking.* archiver .*interface.*\.\.\. unknown' stdout
+grep '^configure: error: could not determine /bin/false interface' stderr
+ls *conftest* && Exit 1
 
 :
diff --git a/tests/check-tests_environment.test b/tests/ar5.test
similarity index 63%
copy from tests/check-tests_environment.test
copy to tests/ar5.test
index a07ab95..865e0bf 100755
--- a/tests/check-tests_environment.test
+++ b/tests/ar5.test
@@ -14,34 +14,29 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# "Simple Tests" testsuite driver: check TESTS_ENVIRONMENT support.
+# Test the optional argument of AM_PROG_AR.
 
 . ./defs || Exit 1
 
 set -e
 
 cat >> configure.in << 'END'
-AC_OUTPUT
+AM_PROG_AR([
+  echo spy > bad-archiver-interface-detected
+  AC_MSG_CHECKING([for something else])
+  AC_MSG_RESULT([found it])
+  echo Grep This
+])
 END
 
-cat > Makefile.am << 'END'
-TESTS = foo.test
-EXTRA_DIST = $(TESTS)
-END
-
-cat > foo.test << 'END'
-#! /bin/sh
-test x"$FOO" = x"ok"
-END
-chmod a+x foo.test
-
 $ACLOCAL
 $AUTOCONF
-$AUTOMAKE -a
-
-./configure
 
-FOO=bad TESTS_ENVIRONMENT='FOO=ok'  $MAKE check
-FOO=ok  TESTS_ENVIRONMENT='FOO=bad' $MAKE check && Exit 1
+./configure AR=/bin/false >stdout || { cat stdout; Exit 1; }
+cat stdout
+grep '^checking.* archiver .*interface.*\.\.\. unknown$' stdout
+grep '^checking for something else\.\.\. found it$' stdout
+grep '^Grep This$' stdout
+test -f bad-archiver-interface-detected
 
 :
diff --git a/tests/canon4.test b/tests/canon4.test
index 52e968d..d98636f 100755
--- a/tests/canon4.test
+++ b/tests/canon4.test
@@ -22,6 +22,7 @@ set -e
 
 cat >> configure.in << 'END'
 AC_PROG_CC
+AM_PROG_AR
 AC_PROG_RANLIB
 END
 
@@ -30,6 +31,8 @@ noinst_LIBRARIES = libx-y.a
 libx_y_a_SOURCES = xy.c
 END
 
+: > ar-lib
+
 $ACLOCAL
 $AUTOMAKE
 
diff --git a/tests/compile3.test b/tests/compile3.test
new file mode 100755
index 0000000..5f2df7d
--- /dev/null
+++ b/tests/compile3.test
@@ -0,0 +1,59 @@
+#! /bin/sh
+# Copyright (C) 2010 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Make sure `compile' wraps the Microsoft C/C++ compiler (cl) correctly
+
+required=xsi-shell
+. ./defs || Exit 1
+
+set -e
+
+cp "$testsrcdir/../lib/compile" .
+
+# Use a dummy cl, since cl isn't readily available on all systems
+cat >cl <<'END'
+#! /bin/sh
+echo "$@"
+END
+
+chmod +x ./cl
+
+# POSIX mandates that the compiler accepts a space between the -I,
+# -l and -L options and their respective arguments.  Traditionally,
+# this should work also without a space.  Try both usages.
+for sp in '' ' '; do
+  # Check if compile handles "-o foo", -I, -l, -L, -Xlinker -Wl,
+  opts=`LIB= ./compile ./cl foo.c -o foo -l${sp}bar -L${sp}gazonk -I${sp}baz 
-Xlinker foobar -Wl,-foo,bar`
+  test x"$opts" = x"foo.c -Fefoo bar.lib -Ibaz -link -LIBPATH:gazonk foobar 
-foo bar"
+
+  # Check if compile handles "-o foo.obj"
+  opts=`./compile ./cl -c foo.c -o foo.obj -I${sp}baz`
+  test x"$opts" = x"-c foo.c -Fofoo.obj -Ibaz"
+
+  # Check if compile handles "-o foo.o"
+  opts=`./compile ./cl -c foo.c -o foo.o -I${sp}baz`
+  test x"$opts" = x"-c foo.c -Fofoo.o -Ibaz"
+
+  # Check if compile handles "foo.cc" as C++.
+  opts=`./compile ./cl -c foo.cc -o foo.o -I${sp}baz`
+  test x"$opts" = x"-c -Tpfoo.cc -Fofoo.o -Ibaz"
+
+  # Check if compile clears the "eat" variable properly.
+  opts=`eat=1 ./compile ./cl -c foo.c -o foo.obj -I${sp}baz`
+  test x"$opts" = x"-c foo.c -Fofoo.obj -Ibaz"
+done
+
+:
diff --git a/tests/compile4.test b/tests/compile4.test
new file mode 100755
index 0000000..bac8a54
--- /dev/null
+++ b/tests/compile4.test
@@ -0,0 +1,93 @@
+#! /bin/sh
+# Copyright (C) 2010 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Make sure `compile' wraps the Microsoft C/C++ compiler (cl) correctly
+# with respect to absolute paths.
+
+required='cl'
+. ./defs || Exit 1
+
+set -e
+
+mkdir sub
+
+cat >sub/foo.c <<'EOF'
+int
+foo ()
+{
+  return 0;
+}
+EOF
+
+cat >main.c <<'EOF'
+extern int foo ();
+int
+main ()
+{
+  return foo ();
+}
+EOF
+
+absfoodir=`pwd`/sub
+absmainc=`pwd`/main.c
+absmainobj=`pwd`/main.obj
+
+cat >> configure.in << 'END'
+AC_PROG_CC
+AM_PROG_CC_C_O
+AM_PROG_AR
+AC_PROG_RANLIB
+AC_CONFIG_FILES([sub/Makefile])
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+SUBDIRS = sub
+END
+
+cat > sub/Makefile.am << 'END'
+lib_LIBRARIES = libfoo.a
+libfoo_a_SOURCES = foo.c
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
+./configure
+$MAKE
+
+./compile cl $CPPFLAGS $CFLAGS -c -o "$absmainobj" "$absmainc"
+
+# cl expects archives to be named foo.lib, not libfoo.a so
+# make a simple copy here if needed. This is a severe case
+# of badness, but ignore that since this is not what is
+# being tested here...
+if test -f sub/libfoo.a; then
+  cp sub/libfoo.a sub/foo.lib
+fi
+
+# POSIX mandates that the compiler accepts a space between the -I,
+# -l and -L options and their respective arguments.  Traditionally,
+# this should work also without a space.  Try both usages.
+for sp in '' ' '; do
+  rm -f main
+
+  ./compile cl $CFLAGS $LDFLAGS -L${sp}"$absfoodir" "$absmainobj" -o main 
-l${sp}foo
+
+  ./main
+done
+
+:
diff --git a/tests/compile5.test b/tests/compile5.test
new file mode 100755
index 0000000..e80a76f
--- /dev/null
+++ b/tests/compile5.test
@@ -0,0 +1,86 @@
+#! /bin/sh
+# Copyright (C) 2010 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Make sure the file name translation in the `compile' script works
+# correctly
+
+. ./defs || Exit 1
+
+set -e
+
+cp "$testsrcdir/../lib/compile" .
+
+# Use a dummy cl, since cl isn't readily available on all systems
+cat >cl <<'END'
+#! /bin/sh
+echo "$@"
+END
+
+chmod +x ./cl
+
+cat >>configure.in << 'END'
+AC_CANONICAL_HOST
+AC_CONFIG_FILES([check_host], [chmod +x check_host])
+AC_OUTPUT
+END
+
+: >Makefile.am
+
+cat >check_host.in << 'END'
+#! /bin/sh
+case @host_os@ in
+  mingw*)
+    ;;
+  *)
+    exit 77
+    ;;
+esac
+case @build_os@ in
+  mingw* | cygwin*)
+    ;;
+  *)
+    winepath -w / || exit 77
+    ;;
+esac
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
+./configure
+./check_host
+
+pwd=`pwd`
+
+# POSIX mandates that the compiler accepts a space between the -I,
+# -l and -L options and their respective arguments.  Traditionally,
+# this should work also without a space.  Try both usages.
+for sp in '' ' '; do
+  # Check if "compile cl" transforms absolute file names to
+  # host format (e.g /somewhere -> c:/msys/1.0/somewhere).
+
+  res=`./compile ./cl -L${sp}"$pwd" | sed -e 's/-link -LIBPATH://'`
+
+  case $res in
+    ?:[\\/]*)
+      ;;
+    *)
+      Exit 1
+      ;;
+  esac
+done
+
+:
diff --git a/tests/compile6.test b/tests/compile6.test
new file mode 100755
index 0000000..c2eadc0
--- /dev/null
+++ b/tests/compile6.test
@@ -0,0 +1,106 @@
+#! /bin/sh
+# Copyright (C) 2010 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Make sure `compile' searches libraries correctly
+
+required=xsi-shell
+. ./defs || Exit 1
+
+set -e
+
+cp "$testsrcdir/../lib/compile" .
+
+# Use a dummy cl, since cl isn't readily available on all systems
+cat >cl <<'END'
+#! /bin/sh
+echo "$@"
+END
+
+chmod +x ./cl
+
+# POSIX mandates that the compiler accepts a space between the -I,
+# -l and -L options and their respective arguments.  Traditionally,
+# this should work also without a space.  Try both usages.
+for sp in '' ' '; do
+  rm -rf lib lib2 syslib "sys  lib2"
+
+  mkdir syslib
+  :> syslib/foo.lib
+
+  syslib=`pwd`/syslib
+  LIB=$syslib
+  export LIB
+
+  mkdir lib
+  :> lib/bar.lib
+  :> lib/bar.dll.lib
+
+  # Check if compile library search correctly
+  opts=`./compile ./cl foo.c -o foo -L${sp}lib -l${sp}bar -l${sp}foo`
+  test x"$opts" = x"foo.c -Fefoo lib/bar.dll.lib $syslib/foo.lib -link 
-LIBPATH:lib"
+
+  # Check if -static makes compile avoid bar.dll.lib
+  opts=`./compile ./cl foo.c -o foo -L${sp}lib -static -l${sp}bar -l${sp}foo`
+  test x"$opts" = x"foo.c -Fefoo lib/bar.lib $syslib/foo.lib -link 
-LIBPATH:lib"
+
+  :> syslib/bar.lib
+  :> syslib/bar.dll.lib
+
+  # Check if compile finds bar.dll.lib in syslib
+  opts=`./compile ./cl foo.c -o foo -l${sp}bar -l${sp}foo`
+  test x"$opts" = x"foo.c -Fefoo $syslib/bar.dll.lib $syslib/foo.lib"
+
+  # Check if compile prefers -L over $LIB
+  opts=`./compile ./cl foo.c -o foo -L${sp}lib -l${sp}bar -l${sp}foo`
+  test x"$opts" = x"foo.c -Fefoo lib/bar.dll.lib $syslib/foo.lib -link 
-LIBPATH:lib"
+
+  mkdir lib2
+  :> lib2/bar.dll.lib
+
+  # Check if compile avoids bar.dll.lib in lib2 when -static
+  opts=`./compile ./cl foo.c -o foo -L${sp}lib2 -static -l${sp}bar -l${sp}foo`
+  test x"$opts" = x"foo.c -Fefoo $syslib/bar.lib $syslib/foo.lib -link 
-LIBPATH:lib2"
+
+  # Check if compile gets two different bar libraries when -static
+  # is added in the middle
+  opts=`./compile ./cl foo.c -o foo -L${sp}lib2 -L${sp}lib -l${sp}bar -static 
-l${sp}bar`
+  test x"$opts" = x"foo.c -Fefoo lib2/bar.dll.lib lib/bar.lib -link 
-LIBPATH:lib2 -LIBPATH:lib"
+
+  # Check if compile gets the correct bar.dll.lib
+  opts=`./compile ./cl foo.c -o foo -L${sp}lib -L${sp}lib2 -l${sp}bar 
-l${sp}foo`
+  test x"$opts" = x"foo.c -Fefoo lib/bar.dll.lib $syslib/foo.lib -link 
-LIBPATH:lib -LIBPATH:lib2"
+
+  # Check if compile gets the correct bar.dll.lib
+  opts=`./compile ./cl foo.c -o foo -L${sp}lib2 -L${sp}lib -l${sp}bar 
-l${sp}foo`
+  test x"$opts" = x"foo.c -Fefoo lib2/bar.dll.lib $syslib/foo.lib -link 
-LIBPATH:lib2 -LIBPATH:lib"
+
+  mkdir "sys  lib2"
+  :> "sys  lib2/foo.dll.lib"
+
+  syslib2="`pwd`/sys  lib2"
+  LIB="$syslib2;$LIB"
+
+  # Check if compile handles spaces in $LIB and that it prefers the order
+  # in a multi-component $LIB.
+  opts=`./compile ./cl foo.c -o foo -l${sp}foo`
+  test x"$opts" = x"foo.c -Fefoo $syslib2/foo.dll.lib"
+
+  # Check if compile handles the 2nd directory in a multi-component $LIB.
+  opts=`./compile ./cl foo.c -o foo -static -l${sp}foo`
+  test x"$opts" = x"foo.c -Fefoo $syslib/foo.lib"
+done
+
+:
diff --git a/tests/cond13.test b/tests/cond13.test
index e5f6be9..28f6cd3 100755
--- a/tests/cond13.test
+++ b/tests/cond13.test
@@ -24,6 +24,7 @@ set -e
 cat >> configure.in << 'END'
 AC_PROG_CC
 AC_PROG_CXX
+AM_PROG_AR
 AC_PROG_RANLIB
 AM_CONDITIONAL(COND1, true)
 AM_CONDITIONAL(COND2, true)
@@ -49,6 +50,8 @@ endif
 libtest_a_SOURCES = $(TESTSOURCES)
 END
 
+: > ar-lib
+
 $ACLOCAL
 $AUTOMAKE
 
diff --git a/tests/condlib.test b/tests/condlib.test
index b6c998d..88ef308 100755
--- a/tests/condlib.test
+++ b/tests/condlib.test
@@ -24,6 +24,7 @@ set -e
 cat >> configure.in << 'END'
 AC_PROG_RANLIB
 AM_MAINTAINER_MODE
+AM_PROG_AR
 AC_PROG_CC
 END
 
@@ -36,6 +37,8 @@ nodist_librsaref_a_SOURCES = desc.c digit.c
 BUILT_SOURCES = $(nodist_librsaref_a_SOURCES)
 END
 
+: > ar-lib
+
 $ACLOCAL
 $AUTOMAKE
 
diff --git a/tests/defs.in b/tests/defs.in
index 4990e30..6c7a168 100644
--- a/tests/defs.in
+++ b/tests/defs.in
@@ -203,6 +203,12 @@ do
       echo "$me: running bzip2 --help"
       ( bzip2 --help ) || exit 77
       ;;
+    cl)
+      CC=cl
+      export CC
+      echo "$me: running $CC -?"
+      ( $CC -? ) || exit 77
+      ;;
     etags)
       # Exuberant Ctags will create a TAGS file even
       # when asked for --help or --version.  (Emacs's etags
@@ -283,6 +289,14 @@ do
       echo "$me: running javac -version -help"
       javac -version -help || exit 77
       ;;
+    lib)
+      AR=lib
+      export AR
+      # Attempting to create an empty archive will actually not
+      # create the archive, but lib will output its version.
+      echo "$me: running $AR -out:defstest.lib"
+      $AR -out:defstest.lib || skip_ "Microsoft \`lib' utility not available"
+      ;;
     makedepend)
       echo "$me: running makedepend -f-"
       ( makedepend -f- ) || exit 77
@@ -349,6 +363,15 @@ do
       echo "$me: running texi2dvi -o /dev/null --version"
       ( texi2dvi -o /dev/null --version ) || exit 77
       ;;
+    xsi-shell)
+      # Try some XSI features.
+      echo "$me: trying some XSI constructs"
+      ( _am_dummy="a/b/c"
+       test 
"${_am_dummy##*/},${_am_dummy%/*},${_am_dummy#??}"${_am_dummy%"$_am_dummy"}, \
+               = c,a/b,b/c, \
+       && eval 'test $(( 1 + 1 )) -eq 2 \
+       && test "${#_am_dummy}" -eq 5' ) || exit 77
+      ;;
     # Generic case: the tool must support --version.
     *)
       echo "$me: running $tool --version"
diff --git a/tests/depcomp4.test b/tests/depcomp4.test
index 4f2df97..3c3602f 100755
--- a/tests/depcomp4.test
+++ b/tests/depcomp4.test
@@ -23,6 +23,7 @@ set -e
 
 cat >> configure.in << 'END'
 AC_PROG_CC
+AM_PROG_AR
 AC_PROG_LIBTOOL
 AC_OUTPUT
 END
diff --git a/tests/depcomp6.test b/tests/depcomp6.test
index ea15e20..c7734b1 100755
--- a/tests/depcomp6.test
+++ b/tests/depcomp6.test
@@ -23,6 +23,7 @@ set -e
 cat >> configure.in << 'END'
 AC_PROG_CC
 AM_PROG_CC_C_O
+AM_PROG_AR
 AC_PROG_RANLIB
 AC_CONFIG_FILES([sub2/Makefile])
 AC_OUTPUT
diff --git a/tests/depcomp7.test b/tests/depcomp7.test
index 47f09fc..9b0ed22 100755
--- a/tests/depcomp7.test
+++ b/tests/depcomp7.test
@@ -24,6 +24,7 @@ set -e
 cat >> configure.in << 'END'
 AC_PROG_CC
 AM_PROG_CC_C_O
+AM_PROG_AR
 AM_PROG_LIBTOOL
 AC_CONFIG_FILES([sub2/Makefile])
 AC_OUTPUT
diff --git a/tests/depcomp8b.test b/tests/depcomp8b.test
index 715d951..3a87d40 100755
--- a/tests/depcomp8b.test
+++ b/tests/depcomp8b.test
@@ -27,6 +27,7 @@ set -e
 cat >> configure.in << 'END'
 AC_PROG_CC
 #x AM_PROG_CC_C_O
+AM_PROG_AR
 AC_PROG_LIBTOOL
 AC_OUTPUT
 END
diff --git a/tests/discover.test b/tests/discover.test
index 0e4faa3..41b11f5 100755
--- a/tests/discover.test
+++ b/tests/discover.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 1996, 1997, 2000, 2001, 2002, 2010 Free Software
+# Copyright (C) 1996, 1997, 2000, 2001, 2002, 2010, 2011 Free Software
 # Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
@@ -21,6 +21,7 @@
 
 cat >> configure.in << 'END'
 AC_PROG_RANLIB
+AM_PROG_AR
 AC_PROG_CC
 AC_LIBOBJ([fsusage])
 AC_OUTPUT
@@ -33,6 +34,7 @@ libtu_a_LIBADD = @LIBOBJS@
 END
 
 : > fsusage.c
+: > ar-lib
 
 $ACLOCAL
 AUTOMAKE_fails
diff --git a/tests/dollarvar2.test b/tests/dollarvar2.test
index 6fc2737..7a6db37 100755
--- a/tests/dollarvar2.test
+++ b/tests/dollarvar2.test
@@ -21,6 +21,11 @@
 
 set -e
 
+#
+# First, try a setup where we have a `portability-recursive' warning,
+# but no "simple" `portability' warning.
+#
+
 cat >Makefile.am <<'EOF'
 x = 1
 bla = $(foo$(x))
@@ -28,11 +33,61 @@ EOF
 
 $ACLOCAL
 
-# $AUTOMAKE already contains -Wall -Werror.
-AUTOMAKE_fails -Wportability
-$AUTOMAKE --force -Wno-all
-$AUTOMAKE --force -Wno-portability
+# Enabling `portability' warnings should enable `portability-recursive'
+# warnings.
+AUTOMAKE_fails -Wnone -Wportability
+grep 'recursive variable expansion' stderr
+# `portability-recursive' warnings can be enabled by themselves.
+AUTOMAKE_fails -Wnone -Wportability-recursive
+grep 'recursive variable expansion' stderr
+
+# Various ways to disable `portability-recursive'.
+$AUTOMAKE -Wno-all
+$AUTOMAKE -Wno-portability
+$AUTOMAKE -Wall -Wno-portability-recursive
+
+# `-Wno-portability-recursive' after `-Wportability' correctly disables
+# `portability-recursive' warnings.
+$AUTOMAKE -Wportability -Wno-portability-recursive
+
+# `-Wno-portability' disables `portability-recursive' warnings; but
+# a later `-Wportability-recursive' re-enables them.  This time, we
+# use AUTOMAKE_OPTIONS to specify the warning levels.
 echo 'AUTOMAKE_OPTIONS = -Wno-portability' >> Makefile.am
-$AUTOMAKE --force
+$AUTOMAKE
+echo 'AUTOMAKE_OPTIONS += -Wportability-recursive' >> Makefile.am
+AUTOMAKE_fails
+grep 'recursive variable expansion' stderr
+
+#
+# Now try a setup where we have both a `portability' warning and
+# a `portability-recursive' one.
+#
+
+cat >Makefile.am <<'EOF'
+x = 1
+bla = $(foo$(x))
+noinst_PROGRAMS = foo
+foo_CPPFLAGS = -Dwhatever
+EOF
+
+echo AC_PROG_CC >> configure.in
+
+$ACLOCAL --force
+
+# Can disable both `portability' and `portability-recursive' warnings.
+$AUTOMAKE -Wno-portability
+
+# Disabling `portability-recursive' warnings should not disable
+# `portability' warnings.
+AUTOMAKE_fails -Wportability -Wno-portability-recursive
+grep AM_PROG_CC_C_O stderr
+grep 'recursive variable expansion' stderr && Exit 1
+
+# Enabling `portability-recursive' warnings should not enable
+# all the `portability' warning.
+AUTOMAKE_fails -Wno-portability -Wportability-recursive
+grep AM_PROG_CC_C_O stderr && Exit 1
+grep 'recursive variable expansion' stderr
 
 :
diff --git a/tests/extra-portability.test b/tests/extra-portability.test
new file mode 100755
index 0000000..62a6335
--- /dev/null
+++ b/tests/extra-portability.test
@@ -0,0 +1,105 @@
+#! /bin/sh
+# Copyright (C) 2011  Free Software Foundation, Inc.
+#
+# This 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 interactions between the `portability' and `extra-portability'
+# warning categories:
+#   1. `-Wextra-portability' must imply `-Wportability'.
+#   2. `-Wno-portability' must imply `-Wno-extra-portability'.
+#   3. `-Wall' does *not* imply `-Wextra-portability'.
+
+. ./defs || Exit 1
+
+set -e
+
+# We want (almost) complete control over automake options.
+# FIXME: use $original_AUTOMAKE here once we are merged into master.
+AUTOMAKE="`(set $AUTOMAKE && echo $1)` --foreign -Werror"
+
+cat >>configure.in <<END
+AC_PROG_CC
+AC_PROG_RANLIB
+AC_OUTPUT
+END
+
+$ACLOCAL
+
+#
+# First, a setup where only an extra-portability warning is present
+# (no "simple" portability-warnings are).
+#
+
+cat >Makefile.am <<END
+EXTRA_LIBRARIES = libfoo.a
+libfoo_a_SOURCES = sub/foo.c
+END
+
+# Sanity check: extra-portability warnings causes the expected error.
+AUTOMAKE_fails -Wextra-portability
+grep 'requires.*AM_PROG_AR' stderr
+
+# Warnings in extra-portability category are not enabled by default.
+$AUTOMAKE
+
+# `-Wall' does not enable extra-portability warnings.
+$AUTOMAKE -Wall -Werror
+
+# Enabling extra-portability works.
+AUTOMAKE_fails -Wnone -Wextra-portability
+grep 'requires.*AM_PROG_AR' stderr
+# Disabling portability disables extra-portability.
+$AUTOMAKE -Wno-portability -Wall
+$AUTOMAKE -Wextra-portability -Wno-portability -Wall
+
+echo libfoo_a_CPPFLAGS = -Dwhatever >> Makefile.am
+
+# Enabling extra-portability enables portability.
+AUTOMAKE_fails -Wnone -Wextra-portability
+# The expected diagnostic is
+#    Makefile.am:2: compiling `foo.c' with per-target flags requires 
`AM_PROG_CC_C_O' in `configure.in'
+#    .../lib/am/library.am: `libfoo.a': linking libraries using a non-POSIX
+#    .../lib/am/library.am: archiver requires `AM_PROG_AR' in `configure.in'
+#    Makefile.am:1:   while processing library `libfoo.a'
+grep 'requires.*AM_PROG_CC_C_O' stderr
+grep 'requires.*AM_PROG_AR' stderr
+
+# `-Wall' does not reset extra portability warnings to their
+# default (i.e., disabled).
+AUTOMAKE_fails -Wextra-portability -Wall
+grep 'requires.*AM_PROG_CC_C_O' stderr
+grep 'requires.*AM_PROG_AR' stderr
+
+# Disabling extra-portability leaves portability intact.
+AUTOMAKE_fails -Wportability -Wno-extra-portability
+grep 'requires.*AM_PROG_CC_C_O' stderr
+grep 'requires.*AM_PROG_AR' stderr && Exit 1
+
+# `-Wall' does not set extra portability warnings if they have
+# been previously disabled.
+AUTOMAKE_fails -Wno-extra-portability -Wall
+grep 'requires.*AM_PROG_CC_C_O' stderr
+grep 'requires.*AM_PROG_AR' stderr && Exit 1
+
+# Enabling portability does not enable extra-portability.
+AUTOMAKE_fails -Wnone -Wportability
+grep 'requires.*AM_PROG_CC_C_O' stderr
+grep 'requires.*AM_PROG_AR' stderr && Exit 1
+
+# Disabling portability disables extra-portability.
+$AUTOMAKE -Wno-portability
+$AUTOMAKE -Wextra-portability -Wno-portability
+$AUTOMAKE -Wall -Wno-portability
+
+:
diff --git a/tests/version2.test b/tests/extra-portability2.test
similarity index 60%
copy from tests/version2.test
copy to tests/extra-portability2.test
index a25b82b..9a01e74 100755
--- a/tests/version2.test
+++ b/tests/extra-portability2.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 1997, 2001, 2002, 2010 Free Software Foundation, Inc.
+# Copyright (C) 2011  Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -14,30 +14,44 @@
 # 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.
+# Make sure that extra-portability warnings are not enabled by --gnits,
+# --gnu and --foreign.
 
 . ./defs || Exit 1
 
 set -e
 
-cat > configure.in << 'END'
-AC_INIT
-AM_INIT_AUTOMAKE([sh-utils], [1.12o], [no])
-AC_CONFIG_FILES([Makefile])
-AC_OUTPUT
-END
-
-: > Makefile.am
-
-# Files required by Gnits.
+# Satisfy --gnits and --gnu.
 : > INSTALL
 : > NEWS
 : > README
-: > COPYING
 : > AUTHORS
 : > ChangeLog
+: > COPYING
 : > THANKS
 
+cat >>configure.in <<END
+AC_PROG_CC
+AC_PROG_RANLIB
+AC_OUTPUT
+END
+
+cat >Makefile.am <<END
+EXTRA_LIBRARIES = libfoo.a
+libfoo_a_SOURCES = foo.c
+END
+
 $ACLOCAL
+
+# In the 1.11.x series, `extra-portability' warnings are not enabled
+# by `-Wall'.
+AUTOMAKE="$AUTOMAKE -Wextra-portability"
+
+# Make sure the test is useful.
+AUTOMAKE_fails
+
+$AUTOMAKE --foreign
+$AUTOMAKE --gnu
 $AUTOMAKE --gnits
+
+:
diff --git a/tests/extra-portability3.test b/tests/extra-portability3.test
new file mode 100755
index 0000000..7ca19b1
--- /dev/null
+++ b/tests/extra-portability3.test
@@ -0,0 +1,63 @@
+#! /bin/sh
+# Copyright (C) 2011 Free Software Foundation, Inc.
+#
+# This 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 interactions between the `portability-recursive' and
+# `extra-portability' warning categories.
+
+. ./defs || Exit 1
+
+set -e
+
+# We want (almost) complete control over automake options.
+# FIXME: use $original_AUTOMAKE here once we are merged into master.
+AUTOMAKE="`(set $AUTOMAKE && echo $1)` --foreign -Werror"
+
+cat >>configure.in <<END
+AC_PROG_CC
+AC_PROG_RANLIB
+AC_OUTPUT
+END
+
+$ACLOCAL
+
+cat >Makefile.am <<'END'
+baz = $(foo$(bar))
+lib_LIBRARIES = libfoo.a
+libfoo_a_SOURCES = foo.c
+END
+
+# 'extra-portability' implies 'portability-recursive'.
+AUTOMAKE_fails -Wextra-portability
+grep 'requires.*AM_PROG_AR' stderr
+grep 'recursive variable expansion' stderr
+
+# We can disable 'extra-portability' while leaving
+# 'portability-recursive' intact.
+AUTOMAKE_fails -Wportability-recursive -Wno-extra-portability
+grep 'requires.*AM_PROG_AR' stderr && Exit 1
+grep 'recursive variable expansion' stderr
+
+# We can disable 'portability-recursive' while leaving
+# 'extra-portability' intact.
+AUTOMAKE_fails -Wextra-portability -Wno-portability-recursive
+grep 'requires.*AM_PROG_AR' stderr
+grep 'recursive variable expansion' stderr && Exit 1
+
+# Disabling 'portability' disables 'portability-recursive' and
+# 'extra-portability'.
+$AUTOMAKE -Wextra-portability -Wno-portability
+
+:
diff --git a/tests/extradep.test b/tests/extradep.test
index 4cbfda5..cdcb5e8 100755
--- a/tests/extradep.test
+++ b/tests/extradep.test
@@ -23,6 +23,7 @@ set -e
 
 cat >> configure.in << 'END'
 AC_PROG_CC
+AM_PROG_AR
 AC_PROG_RANLIB
 AC_SUBST([deps], [bardep])
 AM_CONDITIONAL([COND], [test -n "$cond"])
diff --git a/tests/extradep2.test b/tests/extradep2.test
index 3d44512..8f3f0cf 100755
--- a/tests/extradep2.test
+++ b/tests/extradep2.test
@@ -23,6 +23,7 @@ set -e
 
 cat >> configure.in << 'END'
 AC_PROG_CC
+AM_PROG_AR
 AC_PROG_LIBTOOL
 AC_SUBST([deps], [bardep])
 AC_OUTPUT
diff --git a/tests/fort5.test b/tests/fort5.test
index d6151a7..cc93403 100755
--- a/tests/fort5.test
+++ b/tests/fort5.test
@@ -56,6 +56,7 @@ AC_PROG_FC
 AC_FC_SRCEXT([f90], [],
   [AC_MSG_FAILURE([$FC compiler cannot create executables], 77)])
 AC_FC_LIBRARY_LDFLAGS
+AM_PROG_AR
 LT_PREREQ([2.0])
 AC_PROG_LIBTOOL
 AC_OUTPUT
diff --git a/tests/instdir-ltlib.test b/tests/instdir-ltlib.test
index 1fb4f37..f400377 100755
--- a/tests/instdir-ltlib.test
+++ b/tests/instdir-ltlib.test
@@ -25,6 +25,7 @@ set -e
 cat >>configure.in <<'END'
 AC_PROG_CC
 AM_PROG_CC_C_O
+AM_PROG_AR
 AC_PROG_LIBTOOL
 AC_OUTPUT
 END
diff --git a/tests/instdir-prog.test b/tests/instdir-prog.test
index 6a73b75..66a4892 100755
--- a/tests/instdir-prog.test
+++ b/tests/instdir-prog.test
@@ -24,6 +24,7 @@ set -e
 cat >>configure.in <<'END'
 AC_PROG_CC
 AM_PROG_CC_C_O
+AM_PROG_AR
 AC_PROG_RANLIB
 AC_OUTPUT
 END
diff --git a/tests/instfail-libtool.test b/tests/instfail-libtool.test
index 1e756a6..2e5e312 100755
--- a/tests/instfail-libtool.test
+++ b/tests/instfail-libtool.test
@@ -25,6 +25,7 @@ required='libtool libtoolize'
 set -e
 
 cat >>configure.in <<END
+AM_PROG_AR
 AC_PROG_LIBTOOL
 AC_OUTPUT
 END
diff --git a/tests/instfail.test b/tests/instfail.test
index 38a1c9c..3fb60b5 100755
--- a/tests/instfail.test
+++ b/tests/instfail.test
@@ -25,6 +25,7 @@ set -e
 
 cat >>configure.in <<END
 AC_PROG_CC
+AM_PROG_AR
 AC_PROG_RANLIB
 AM_PATH_LISPDIR
 AC_OUTPUT
diff --git a/tests/instspc.test b/tests/instspc.test
index 7d00788..c305461 100755
--- a/tests/instspc.test
+++ b/tests/instspc.test
@@ -33,6 +33,7 @@ set -e
 
 cat >> configure.in <<'EOF'
 AC_PROG_CC
+AM_PROG_AR
 AC_PROG_RANLIB
 AC_OUTPUT
 EOF
diff --git a/tests/ldadd.test b/tests/ldadd.test
index 7f4fce8..3515a4e 100755
--- a/tests/ldadd.test
+++ b/tests/ldadd.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 1997, 1999, 2000, 2001, 2002, 2010 Free Software
+# Copyright (C) 1997, 1999, 2000, 2001, 2002, 2010, 2011 Free Software
 # Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
@@ -42,6 +42,7 @@ END
 : > q.c
 
 $ACLOCAL || Exit 1
-AUTOMAKE_fails
-grep LDADD stderr || Exit 1
+AUTOMAKE_fails -Wno-extra-portability
+grep "libtu_la_LDADD" stderr
+grep " use [\`"']libtu_la_LIBADD' stderr
 Exit 0
diff --git a/tests/ldflags.test b/tests/ldflags.test
index 39ca274..c00f227 100755
--- a/tests/ldflags.test
+++ b/tests/ldflags.test
@@ -21,6 +21,7 @@ required=libtool
 
 cat >> configure.in << 'END'
 AC_PROG_CC
+AM_PROG_AR
 AC_PROG_LIBTOOL
 AC_SUBST([LTLIBOBJS], [q.o])
 AM_CONDITIONAL(USE_SWIG, :)
@@ -37,6 +38,7 @@ END
 
 : > ltconfig
 : > ltmain.sh
+: > ar-lib
 : > config.guess
 : > config.sub
 : > q.c
diff --git a/tests/libobj10.test b/tests/libobj10.test
index 0d24741..97dffec 100755
--- a/tests/libobj10.test
+++ b/tests/libobj10.test
@@ -23,6 +23,7 @@ set -e
 
 cat >> configure.in << 'END'
 AC_PROG_CC
+AM_PROG_AR
 AC_PROG_RANLIB
 AC_LIBOBJ([foo])
 AC_OUTPUT
@@ -33,6 +34,8 @@ noinst_LIBRARIES = libfoo.a
 libfoo_a_LIBADD = @LIBOBJS@
 END
 
+: > ar-lib
+
 $ACLOCAL
 AUTOMAKE_fails
 grep 'Makefile.am:2:.*foo\.c' stderr
diff --git a/tests/libobj11.test b/tests/libobj11.test
index 204ff8b..fc7f173 100755
--- a/tests/libobj11.test
+++ b/tests/libobj11.test
@@ -22,6 +22,7 @@ cat > configure.in << 'END'
 AC_INIT
 AM_INIT_AUTOMAKE(nonesuch, nonesuch)
 AC_PROG_CC
+AM_PROG_AR
 AC_PROG_RANLIB
 AC_LIBOBJ([mountlist])
 AC_OUTPUT(Makefile)
@@ -33,6 +34,7 @@ libtu_a_SOURCES =
 libtu_a_LIBADD = @LIBOBJS@
 END
 
+: > ar-lib
 : > mountlist.c
 
 $ACLOCAL || Exit 1
diff --git a/tests/libobj12.test b/tests/libobj12.test
index 5f1d029..e4522bc 100755
--- a/tests/libobj12.test
+++ b/tests/libobj12.test
@@ -23,6 +23,7 @@ set -e
 
 cat >> configure.in << 'END'
 AC_PROG_CC
+AM_PROG_AR
 AC_PROG_RANLIB
 AC_LIBOBJ([foo])
 AC_LIBOBJ([bar])
@@ -44,6 +45,7 @@ p1_LDADD = @LIBOBJS@
 p2_SOURCES = bar.c
 END
 
+: > ar-lib
 : > foo.c
 : > bar.c
 
diff --git a/tests/libobj13.test b/tests/libobj13.test
index 6ca68c9..fc3112b 100755
--- a/tests/libobj13.test
+++ b/tests/libobj13.test
@@ -24,6 +24,7 @@ set -e
 
 cat >> configure.in << 'END'
 AC_PROG_CC
+AM_PROG_AR
 AC_PROG_LIBTOOL
 AC_LIBOBJ([foo])
 AC_OUTPUT
diff --git a/tests/libobj2.test b/tests/libobj2.test
index 81b0e72..36c01b3 100755
--- a/tests/libobj2.test
+++ b/tests/libobj2.test
@@ -24,6 +24,7 @@ cat > configure.in << 'END'
 AC_INIT
 AM_INIT_AUTOMAKE(nonesuch, nonesuch)
 AC_PROG_CC
+AM_PROG_AR
 AC_PROG_RANLIB
 AC_LIBOBJ([fsusage])
 AC_OUTPUT(subdir/Makefile)
@@ -37,6 +38,7 @@ libtu_a_SOURCES =
 libtu_a_LIBADD = @LIBOBJS@
 END
 
+: > ar-lib
 : > subdir/fsusage.c
 
 $ACLOCAL || Exit 1
diff --git a/tests/libobj3.test b/tests/libobj3.test
index 0aeced9..7304b09 100755
--- a/tests/libobj3.test
+++ b/tests/libobj3.test
@@ -1,5 +1,6 @@
 #! /bin/sh
-# Copyright (C) 1996, 1997, 2001, 2002, 2003  Free Software Foundation, Inc.
+# Copyright (C) 1996, 1997, 2001, 2002, 2003, 2011 Free Software
+# Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -22,6 +23,7 @@ set -e
 
 cat >> configure.in << 'END'
 AC_PROG_RANLIB
+AM_PROG_AR
 END
 
 cat > Makefile.am << 'END'
@@ -30,6 +32,8 @@ libtu_a_SOURCES =
 libtu_a_LIBADD = @LIBOBJS@
 END
 
+: > ar-lib
+
 $ACLOCAL
 AUTOMAKE_fails
 grep 'Makefile.am:3:.*LIBOBJS' stderr
diff --git a/tests/libobj7.test b/tests/libobj7.test
index 73a8ab0..1ff36c4 100755
--- a/tests/libobj7.test
+++ b/tests/libobj7.test
@@ -22,6 +22,7 @@ cat > configure.in << 'END'
 AC_INIT
 AM_INIT_AUTOMAKE(nonesuch, nonesuch)
 AC_PROG_CC
+AM_PROG_AR
 AC_PROG_RANLIB
 AC_REPLACE_FUNCS(basename dirname strsignal)
 AC_OUTPUT(Makefile)
@@ -33,6 +34,7 @@ libtu_a_SOURCES =
 libtu_a_LIBADD = @LIBOBJS@
 END
 
+: > ar-lib
 : > basename.c
 : > dirname.c
 : > strsignal.c
diff --git a/tests/libobj8.test b/tests/libobj8.test
index 206bca6..e143753 100755
--- a/tests/libobj8.test
+++ b/tests/libobj8.test
@@ -24,6 +24,7 @@ AC_INIT
 AM_INIT_AUTOMAKE(nonesuch, nonesuch)
 AC_PROG_CC
 AC_PROG_CC_STDC
+AM_PROG_AR
 AC_PROG_RANLIB
 AC_REPLACE_FUNCS(basename dirname strsignal)
 AM_C_PROTOTYPES
@@ -43,6 +44,7 @@ END
 
 : > ansi2knr.1
 : > ansi2knr.c
+: > ar-lib
 
 $ACLOCAL || Exit 1
 $AUTOMAKE  -Wno-obsolete || Exit 1
diff --git a/tests/library.test b/tests/library.test
index 1e2b58b..8adc575 100755
--- a/tests/library.test
+++ b/tests/library.test
@@ -22,6 +22,7 @@ cat >> configure.in << 'END'
 AC_PROG_RANLIB
 AM_MAINTAINER_MODE
 AC_PROG_CC
+AM_PROG_AR
 END
 
 cat > Makefile.am << 'END'
@@ -30,5 +31,7 @@ lib_LIBRARIES = libfoo.a
 libfoo_a_DEPENDENCIES = libzot.a
 END
 
+: > ar-lib
+
 $ACLOCAL || Exit 1
 $AUTOMAKE
diff --git a/tests/library2.test b/tests/library2.test
index 0dbff28..d30c504 100755
--- a/tests/library2.test
+++ b/tests/library2.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2002, 2003  Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003, 2011 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -20,10 +20,14 @@
 
 set -e
 
+cat >> configure.in << 'END'
+AC_PROG_CC
+END
+
 cat > Makefile.am << 'END'
 EXTRA_LIBRARIES = libfoo.a
 END
 
 $ACLOCAL
-AUTOMAKE_fails
+AUTOMAKE_fails -Wno-portability
 grep AC_PROG_RANLIB stderr
diff --git a/tests/libtoo10.test b/tests/libtoo10.test
index 51a68d4..44c0726 100755
--- a/tests/libtoo10.test
+++ b/tests/libtoo10.test
@@ -22,6 +22,7 @@ required=libtoolize
 set -e
 
 cat >> configure.in << 'END'
+AM_PROG_AR
 AC_PROG_LIBTOOL
 AC_OUTPUT
 END
diff --git a/tests/libtool2.test b/tests/libtool2.test
index a50f6a4..0120fa9 100755
--- a/tests/libtool2.test
+++ b/tests/libtool2.test
@@ -24,6 +24,7 @@ AC_INIT
 AM_INIT_AUTOMAKE(mypackage,0.1)
 
 AC_PROG_CC
+AM_PROG_AR
 AC_PROG_LIBTOOL
 
 AC_CONFIG_FILES([
diff --git a/tests/libtool3.test b/tests/libtool3.test
index 3427f28..1643f31 100755
--- a/tests/libtool3.test
+++ b/tests/libtool3.test
@@ -24,6 +24,7 @@ set -e
 
 cat >> configure.in << 'END'
 AC_PROG_CC
+AM_PROG_AR
 AM_PROG_LIBTOOL
 AC_OUTPUT
 END
diff --git a/tests/libtool4.test b/tests/libtool4.test
index 9f6a730..814b537 100755
--- a/tests/libtool4.test
+++ b/tests/libtool4.test
@@ -1,5 +1,5 @@
 #!/bin/sh
-# Copyright (C) 2002, 2003  Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003, 2011 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -22,12 +22,15 @@ set -e
 
 cat >> configure.in <<'END'
 AC_PROG_CC
+AM_PROG_AR
 END
 
 cat > Makefile.am << 'END'
 EXTRA_LTLIBRARIES = liblib.la
 END
 
+: > ar-lib
+
 $ACLOCAL
 AUTOMAKE_fails
 grep '[Ll]ibtool library .*LIBTOOL.* undefined' stderr
diff --git a/tests/libtool5.test b/tests/libtool5.test
index c7f0476..8208388 100755
--- a/tests/libtool5.test
+++ b/tests/libtool5.test
@@ -27,6 +27,7 @@ cat >>configure.in <<'END'
 AM_CONDITIONAL([COND1], [true])
 AM_CONDITIONAL([COND2], [false])
 AC_PROG_CC
+AM_PROG_AR
 AC_PROG_LIBTOOL
 AC_OUTPUT
 END
diff --git a/tests/libtool6.test b/tests/libtool6.test
index ad01b14..ea5fd9c 100755
--- a/tests/libtool6.test
+++ b/tests/libtool6.test
@@ -26,6 +26,7 @@ cat >>configure.in <<'END'
 AM_CONDITIONAL([COND1], [true])
 AM_CONDITIONAL([COND2], [false])
 AC_PROG_CC
+AM_PROG_AR
 AC_PROG_LIBTOOL
 AC_OUTPUT
 END
diff --git a/tests/libtool7.test b/tests/libtool7.test
index a2f912f..8ebce0a 100755
--- a/tests/libtool7.test
+++ b/tests/libtool7.test
@@ -24,6 +24,7 @@ set -e
 
 cat >> configure.in << 'END'
 AC_PROG_CC
+AM_PROG_AR
 AC_LIBTOOL_DLOPEN
 AM_PROG_LIBTOOL
 AC_OUTPUT
diff --git a/tests/libtool8.test b/tests/libtool8.test
index a1bb88a..ed1b6cf 100755
--- a/tests/libtool8.test
+++ b/tests/libtool8.test
@@ -25,6 +25,7 @@ cat >>configure.in <<'END'
 AM_CONDITIONAL([COND1], [true])
 AM_CONDITIONAL([COND2], [false])
 AC_PROG_CC
+AM_PROG_AR
 AC_PROG_LIBTOOL
 AC_OUTPUT
 END
diff --git a/tests/libtool9.test b/tests/libtool9.test
index c0d9688..a27a1da 100755
--- a/tests/libtool9.test
+++ b/tests/libtool9.test
@@ -26,6 +26,7 @@ set -e
 cat >> configure.in << 'END'
 AC_PROG_CC
 AM_PROG_CC_C_O
+AM_PROG_AR
 AC_LIBTOOL_DLOPEN
 AM_PROG_LIBTOOL
 AC_OUTPUT
diff --git a/tests/list-of-tests.mk b/tests/list-of-tests.mk
index 2b73de2..420b56b 100644
--- a/tests/list-of-tests.mk
+++ b/tests/list-of-tests.mk
@@ -98,8 +98,20 @@ ansi7.test \
 ansi8.test \
 ansi9.test \
 ansi10.test \
+ar-lib.test \
+ar-lib2.test \
+ar-lib3.test \
+ar-lib4.test \
+ar-lib5a.test \
+ar-lib5b.test \
+ar-lib6a.test \
+ar-lib6b.test \
+ar-lib7.test \
 ar.test \
 ar2.test \
+ar3.test \
+ar4.test \
+ar5.test \
 asm.test \
 asm2.test \
 asm3.test \
@@ -185,6 +197,10 @@ commen11.test \
 comments-in-var-def.test \
 compile.test \
 compile2.test \
+compile3.test \
+compile4.test \
+compile5.test \
+compile6.test \
 compile_f90_c_cxx.test \
 compile_f_c_cxx.test \
 cond.test \
@@ -360,6 +376,9 @@ exeext4.test \
 exsource.test \
 ext.test \
 ext2.test \
+extra-portability.test \
+extra-portability2.test \
+extra-portability3.test \
 extra.test \
 extra2.test \
 extra3.test \
@@ -371,6 +390,9 @@ extra8.test \
 extra10.test \
 extra11.test \
 extra12.test \
+extra-portability.test \
+extra-portability2.test \
+extra-portability3.test \
 extradep.test \
 extradep2.test \
 f90only.test \
diff --git a/tests/listval.test b/tests/listval.test
index 5ff75db..d7cc884 100755
--- a/tests/listval.test
+++ b/tests/listval.test
@@ -21,6 +21,7 @@ required=libtool
 
 cat >> configure.in << 'END'
 AC_SUBST(LTLIBOBJS)
+AM_PROG_AR
 AC_PROG_LIBTOOL
 END
 
@@ -34,6 +35,7 @@ END
 
 : > ltconfig
 : > ltmain.sh
+: > ar-lib
 : > config.guess
 : > config.sub
 
diff --git a/tests/location.test b/tests/location.test
index 13a2183..6098796 100755
--- a/tests/location.test
+++ b/tests/location.test
@@ -24,6 +24,7 @@ cat >> configure.in << 'END'
 AM_CONDITIONAL([COND1], [true])
 AM_CONDITIONAL([COND2], [true])
 AC_PROG_CC
+AM_PROG_AR
 AC_PROG_RANLIB
 END
 
@@ -44,6 +45,8 @@ VAR = 1 \
       3
 END
 
+: > ar-lib
+
 $ACLOCAL
 AUTOMAKE_fails
 
diff --git a/tests/ltcond.test b/tests/ltcond.test
index 0350a3d..401572b 100755
--- a/tests/ltcond.test
+++ b/tests/ltcond.test
@@ -27,6 +27,7 @@ AM_CONDITIONAL([WANT_LIBFOO], [true])
 AM_CONDITIONAL([WANT_LIBBAR], [false])
 AC_SUBST([WANTEDLIBS], ['lib1foo.la lib1bar.la'])
 AC_PROG_CC
+AM_PROG_AR
 AC_PROG_LIBTOOL
 AC_OUTPUT
 END
diff --git a/tests/ltcond2.test b/tests/ltcond2.test
index 1687513..898c971 100755
--- a/tests/ltcond2.test
+++ b/tests/ltcond2.test
@@ -23,6 +23,7 @@ set -e
 
 cat >> configure.in << 'END'
 AC_PROG_CC
+AM_PROG_AR
 AC_PROG_LIBTOOL
 AC_SUBST([HELLO_SYSTEM], [hello-generic.lo])
 AM_CONDITIONAL([LINUX], true)
diff --git a/tests/ltconv.test b/tests/ltconv.test
index 0ec2132..a130b94 100755
--- a/tests/ltconv.test
+++ b/tests/ltconv.test
@@ -24,6 +24,7 @@ set -e
 
 cat >>configure.in <<'END'
 AC_PROG_CC
+AM_PROG_AR
 AC_PROG_LIBTOOL
 AC_CONFIG_FILES(sub1/Makefile
                sub2/Makefile
diff --git a/tests/ltdeps.test b/tests/ltdeps.test
index 43d0ae3..7ece4d4 100755
--- a/tests/ltdeps.test
+++ b/tests/ltdeps.test
@@ -22,6 +22,7 @@ required=libtool
 set -e
 
 cat >> configure.in << 'END'
+AM_PROG_AR
 AC_PROG_LIBTOOL
 AC_PROG_CXX
 AM_CONDITIONAL(HACKING_COMPACT_BUILD, whatever)
@@ -51,6 +52,7 @@ END
 
 : > ltconfig
 : > ltmain.sh
+: > ar-lib
 : > config.guess
 : > config.sub
 
diff --git a/tests/ltinit.test b/tests/ltinit.test
index 85705e0..58f1926 100755
--- a/tests/ltinit.test
+++ b/tests/ltinit.test
@@ -25,6 +25,7 @@ set -e
 
 cat >>configure.in <<'END'
 AC_PROG_CC
+AM_PROG_AR
 dnl Older libtool versions don't define LT_PREREQ :-(
 m4_ifdef([LT_PREREQ],
     [LT_PREREQ([2.0])],
diff --git a/tests/ltinstloc.test b/tests/ltinstloc.test
index bb3203a..a4d715e 100755
--- a/tests/ltinstloc.test
+++ b/tests/ltinstloc.test
@@ -24,6 +24,7 @@ set -e
 
 cat >>configure.in <<'END'
 AC_PROG_CC
+AM_PROG_AR
 AC_PROG_LIBTOOL
 AM_CONDITIONAL([COND], [:])
 AC_OUTPUT
@@ -46,7 +47,7 @@ AUTOMAKE_fails --add-missing
 # libtoolize might have installed config.guess and config.sub already,
 # and autom4te might warn about bugs in Libtool macro files, so filter
 # out warnings about Makefile.am only.  We don't care in this test
-# whether automake installs config.guess and config.sub.
+# whether automake installs config.guess, config.sub and ar-lib.
 
 cat >expected <<'END'
 Makefile.am:5: sub/liba2.la multiply defined in condition COND
diff --git a/tests/ltlibobjs.test b/tests/ltlibobjs.test
index fd66473..2df0017 100755
--- a/tests/ltlibobjs.test
+++ b/tests/ltlibobjs.test
@@ -21,6 +21,7 @@ required=libtool
 
 cat >> configure.in << 'END'
 AC_SUBST(LTLIBOBJS)
+AM_PROG_AR
 AC_PROG_LIBTOOL
 END
 
@@ -32,6 +33,7 @@ END
 
 : > ltconfig
 : > ltmain.sh
+: > ar-lib
 : > config.guess
 : > config.sub
 
diff --git a/tests/ltlibsrc.test b/tests/ltlibsrc.test
index 2c9911d..e8fa6f0 100755
--- a/tests/ltlibsrc.test
+++ b/tests/ltlibsrc.test
@@ -23,6 +23,7 @@ set -e
 
 cat >> configure.in << 'END'
 AC_PROG_CC
+AM_PROG_AR
 AC_PROG_LIBTOOL
 AC_OUTPUT
 END
diff --git a/tests/ltorder.test b/tests/ltorder.test
index 0f69211..ef4a5f7 100755
--- a/tests/ltorder.test
+++ b/tests/ltorder.test
@@ -23,6 +23,7 @@ set -e
 
 cat >>configure.in <<'END'
 AC_PROG_CC
+AM_PROG_AR
 AC_PROG_LIBTOOL
 AC_OUTPUT
 END
diff --git a/tests/multlib.test b/tests/multlib.test
index 75ef952..59a2260 100755
--- a/tests/multlib.test
+++ b/tests/multlib.test
@@ -84,6 +84,7 @@ AC_CONFIG_SRCDIR(foo.c)
 AC_CONFIG_AUX_DIR(.)
 AM_INIT_AUTOMAKE
 AC_PROG_CC
+AM_PROG_AR
 AC_PROG_RANLIB
 AM_ENABLE_MULTILIB(Makefile,[..])
 AC_CONFIG_FILES([Makefile])
@@ -107,6 +108,7 @@ AC_INIT(libbar, 0.1, address@hidden)
 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])
diff --git a/tests/nobase-libtool.test b/tests/nobase-libtool.test
index 12b055e..2a0cf68 100755
--- a/tests/nobase-libtool.test
+++ b/tests/nobase-libtool.test
@@ -26,6 +26,7 @@ set -e
 
 cat >> configure.in <<'EOF'
 AC_PROG_CC
+AM_PROG_AR
 AC_PROG_LIBTOOL
 AC_OUTPUT
 EOF
diff --git a/tests/nobase.test b/tests/nobase.test
index 8b0dc6e..cac8756 100755
--- a/tests/nobase.test
+++ b/tests/nobase.test
@@ -24,6 +24,7 @@ set -e
 
 cat >> configure.in <<'EOF'
 AC_PROG_CC
+AM_PROG_AR
 AC_PROG_RANLIB
 AC_OUTPUT
 EOF
diff --git a/tests/noinstdir.test b/tests/noinstdir.test
index 3f33c32..b04bb0d 100755
--- a/tests/noinstdir.test
+++ b/tests/noinstdir.test
@@ -34,9 +34,12 @@ END
 
 cat >> configure.in << 'END'
 AC_PROG_CC
+AM_PROG_AR
 AC_PROG_RANLIB
 END
 
+: > ar-lib
+
 $ACLOCAL || Exit 1
 $AUTOMAKE || Exit 1
 
diff --git a/tests/parse.test b/tests/parse.test
index e7dcbe5..bf5b63a 100755
--- a/tests/parse.test
+++ b/tests/parse.test
@@ -1,5 +1,6 @@
 #! /bin/sh
-# Copyright (C) 1998, 2000, 2001, 2002  Free Software Foundation, Inc.
+# Copyright (C) 1998, 2000, 2001, 2002, 2011 Free Software Foundation,
+# Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -22,7 +23,6 @@ cat > configure.in << 'END'
 AC_INIT
 AM_INIT_AUTOMAKE(nonesuch, nonesuch)
 AC_PROG_CC
-AC_PROG_RANLIB
 AC_OUTPUT(Makefile)
 END
 
diff --git a/tests/pluseq7.test b/tests/pluseq7.test
index 0716462..31a4246 100755
--- a/tests/pluseq7.test
+++ b/tests/pluseq7.test
@@ -1,6 +1,6 @@
 #! /bin/sh
-# Copyright (C) 1999, 2001, 2002, 2003, 2010 Free Software Foundation,
-# Inc.
+# Copyright (C) 1999, 2001, 2002, 2003, 2010, 2011 Free Software
+# Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -34,7 +34,8 @@ AR += qq
 END
 
 $ACLOCAL
-AUTOMAKE_fails
-grep 'Makefile.am:3:.*AR' stderr
+AUTOMAKE_fails -Wno-portability
+q="[\`'\"]"
+grep "^Makefile\.am:3:.* AR .* with $q=$q before .*$q+=$q" stderr
 
 :
diff --git a/tests/pr211.test b/tests/pr211.test
index 6778f7a..798e4f6 100755
--- a/tests/pr211.test
+++ b/tests/pr211.test
@@ -47,7 +47,7 @@ END
 
 libtoolize
 $ACLOCAL
-AUTOMAKE_fails -a
+AUTOMAKE_fails -Wnone -a
 $FGREP 'foo.$(OBJEXT)' stderr
 
 :
diff --git a/tests/pr300-lib.test b/tests/pr300-lib.test
index 8f96db1..d2ea942 100755
--- a/tests/pr300-lib.test
+++ b/tests/pr300-lib.test
@@ -45,7 +45,7 @@ END
 
 $ACLOCAL
 $AUTOCONF
-$AUTOMAKE --copy --add-missing
+$AUTOMAKE -Wno-extra-portability --copy --add-missing
 
 # We pass '--libdir' explicitly, to avoid spurious failures due to users
 # or distributions possibly overriding '${libdir}' in their $CONFIG_SITE
diff --git a/tests/pr300-ltlib.test b/tests/pr300-ltlib.test
index 06d3c32..6976683 100755
--- a/tests/pr300-ltlib.test
+++ b/tests/pr300-ltlib.test
@@ -47,7 +47,7 @@ END
 libtoolize
 $ACLOCAL
 $AUTOCONF
-$AUTOMAKE --copy --add-missing
+$AUTOMAKE -Wno-extra-portability --copy --add-missing
 
 # We pass '--libdir' explicitly, to avoid spurious failures due to users
 # or distributions possibly overriding '${libdir}' in their $CONFIG_SITE
diff --git a/tests/pr307.test b/tests/pr307.test
index 7676c4b..3496817 100755
--- a/tests/pr307.test
+++ b/tests/pr307.test
@@ -68,7 +68,7 @@ done
 libtoolize --force
 $ACLOCAL
 $AUTOCONF
-$AUTOMAKE -a
+$AUTOMAKE -Wno-extra-portability -a
 
 # Sanity check: make sure the variable we are attempting to force
 # is used by configure
diff --git a/tests/pr401.test b/tests/pr401.test
index 88f7733..6009315 100755
--- a/tests/pr401.test
+++ b/tests/pr401.test
@@ -81,7 +81,7 @@ EOF
 
 $ACLOCAL
 $AUTOCONF
-$AUTOMAKE
+$AUTOMAKE -Wno-extra-portability
 ./configure
 $MAKE distcheck
 
@@ -97,7 +97,7 @@ mv -f configure.int configure.in
 
 $ACLOCAL
 $AUTOCONF
-$AUTOMAKE
+$AUTOMAKE -Wno-extra-portability
 ./configure
 test ! -d lib/lib
 $MAKE distcheck
@@ -108,7 +108,7 @@ $MAKE distcheck
 
 mv -f src/Makefile.am src/t
 sed 's/LDADD = .*/LDADD = @LIBOBJS@/' src/t > src/Makefile.am
-AUTOMAKE_fails
+AUTOMAKE_fails -Wno-extra-portability
 grep 'cannot be used outside.*lib' stderr
 mv -f src/t src/Makefile.am
 
@@ -139,7 +139,7 @@ EOF
 
 $ACLOCAL
 $AUTOCONF
-$AUTOMAKE --add-missing
+$AUTOMAKE -Wno-extra-portability --add-missing
 ./configure
 test ! -d src/lib
 test ! -d 'src/$(top_builddir)'
@@ -176,7 +176,7 @@ EOF
 
 $ACLOCAL
 $AUTOCONF
-$AUTOMAKE
+$AUTOMAKE -Wno-extra-portability
 ./configure
 $MAKE distcheck
 
diff --git a/tests/pr401b.test b/tests/pr401b.test
index 0af4646..4bd2f36 100755
--- a/tests/pr401b.test
+++ b/tests/pr401b.test
@@ -82,7 +82,7 @@ EOF
 libtoolize
 $ACLOCAL
 $AUTOCONF
-$AUTOMAKE -a
+$AUTOMAKE -Wno-extra-portability -a
 ./configure
 $MAKE distcheck
 
@@ -99,7 +99,7 @@ mv -f configure.int configure.in
 
 $ACLOCAL
 $AUTOCONF
-$AUTOMAKE -a
+$AUTOMAKE -Wno-extra-portability -a
 ./configure
 test ! -d lib/lib
 $MAKE distcheck
@@ -110,7 +110,7 @@ $MAKE distcheck
 
 mv -f src/Makefile.am src/t
 sed 's/LDADD = .*/LDADD = @LTLIBOBJS@/' src/t > src/Makefile.am
-AUTOMAKE_fails
+AUTOMAKE_fails -Wno-extra-portability
 grep 'cannot be used outside.*lib' stderr
 mv -f src/t src/Makefile.am
 
@@ -140,7 +140,7 @@ EOF
 
 $ACLOCAL
 $AUTOCONF
-$AUTOMAKE --add-missing
+$AUTOMAKE -Wno-extra-portability --add-missing
 ./configure
 test ! -d src/lib
 test ! -d 'src/$(top_builddir)'
@@ -177,7 +177,7 @@ EOF
 
 $ACLOCAL
 $AUTOCONF
-$AUTOMAKE
+$AUTOMAKE -Wno-extra-portability
 ./configure
 $MAKE distcheck
 
diff --git a/tests/pr401c.test b/tests/pr401c.test
index b94bc16..1d0511f 100755
--- a/tests/pr401c.test
+++ b/tests/pr401c.test
@@ -83,7 +83,7 @@ EOF
 
 $ACLOCAL
 $AUTOCONF
-$AUTOMAKE
+$AUTOMAKE -Wno-extra-portability
 ./configure
 $MAKE distcheck
 
@@ -100,7 +100,7 @@ mv -f configure.int configure.in
 
 $ACLOCAL
 $AUTOCONF
-$AUTOMAKE
+$AUTOMAKE -Wno-extra-portability
 ./configure
 test ! -d lib/lib
 $MAKE distcheck
@@ -111,7 +111,7 @@ $MAKE distcheck
 
 mv -f src/Makefile.am src/t
 sed 's/LDADD = .*/LDADD = @ALLOCA@/' src/t > src/Makefile.am
-AUTOMAKE_fails
+AUTOMAKE_fails -Wno-extra-portability
 grep 'cannot be used outside.*lib' stderr
 mv -f src/t src/Makefile.am
 
@@ -142,7 +142,7 @@ EOF
 
 $ACLOCAL
 $AUTOCONF
-$AUTOMAKE --add-missing
+$AUTOMAKE -Wno-extra-portability --add-missing
 ./configure
 $MAKE
 test ! -d src/lib
@@ -179,7 +179,7 @@ EOF
 
 $ACLOCAL
 $AUTOCONF
-$AUTOMAKE
+$AUTOMAKE -Wno-extra-portability
 ./configure
 $MAKE distcheck
 
diff --git a/tests/pr72.test b/tests/pr72.test
index ab911ad..5af32ec 100755
--- a/tests/pr72.test
+++ b/tests/pr72.test
@@ -39,7 +39,7 @@ END
 : > config.sub
 
 $ACLOCAL
-$AUTOMAKE
+$AUTOMAKE -Wno-extra-portability
 
 grep '^LINK =' Makefile.in
 
diff --git a/tests/primary-prefix-couples-documented-valid.test 
b/tests/primary-prefix-couples-documented-valid.test
index 645f318..c09e6ca 100755
--- a/tests/primary-prefix-couples-documented-valid.test
+++ b/tests/primary-prefix-couples-documented-valid.test
@@ -24,6 +24,7 @@ set -e
 
 cat >> configure.in <<'END'
 AC_PROG_CC
+AM_PROG_AR
 AC_PROG_RANLIB
 AC_PROG_LIBTOOL
 AM_PROG_GCJ
diff --git a/tests/primary-prefix-couples-force-valid.test 
b/tests/primary-prefix-couples-force-valid.test
index 315ee4e..d60ecbf 100755
--- a/tests/primary-prefix-couples-force-valid.test
+++ b/tests/primary-prefix-couples-force-valid.test
@@ -30,6 +30,7 @@ set -e
 
 cat >> configure.in <<'END'
 AC_PROG_CC
+AM_PROG_AR
 AC_PROG_RANLIB
 AC_OUTPUT
 END
@@ -75,7 +76,7 @@ END
 : > bar.h
 
 $ACLOCAL
-$AUTOMAKE
+$AUTOMAKE -a
 $AUTOCONF
 
 cwd=`pwd` || fatal_ "cannot get current working directory"
diff --git a/tests/primary-prefix-invalid-couples.test 
b/tests/primary-prefix-invalid-couples.test
index c3d6471..60d509b 100755
--- a/tests/primary-prefix-invalid-couples.test
+++ b/tests/primary-prefix-invalid-couples.test
@@ -26,6 +26,7 @@ set -e
 
 oIFS=$IFS # Saved for later.
 
+: > ar-lib
 : > ltmain.sh
 : > texinfo.tex
 : > elisp-comp
@@ -35,6 +36,7 @@ oIFS=$IFS # Saved for later.
 
 cat >> configure.in <<'END'
 AC_PROG_CC
+AM_PROG_AR
 AC_PROG_RANLIB
 AC_SUBST([LIBTOOL], [:]) dnl So that we don't have to require Libtool.
 AM_PROG_GCJ
diff --git a/tests/primary-prefix-valid-couples.test 
b/tests/primary-prefix-valid-couples.test
index 6eb4149..47aac5e 100755
--- a/tests/primary-prefix-valid-couples.test
+++ b/tests/primary-prefix-valid-couples.test
@@ -23,6 +23,7 @@ set -e
 
 cat >> configure.in <<'END'
 AC_PROG_CC
+AM_PROG_AR
 AC_PROG_RANLIB
 AC_PROG_LIBTOOL
 AM_PATH_PYTHON
@@ -43,6 +44,7 @@ echo '@setfilename foo' > foo.texi
 : > texinfo.tex
 : > py-compile
 : > elisp-comp
+: > ar-lib
 
 # Setup Makefile.am.
 
diff --git a/tests/reqd2.test b/tests/reqd2.test
index b47ef15..1bf8123 100755
--- a/tests/reqd2.test
+++ b/tests/reqd2.test
@@ -29,6 +29,7 @@ AC_CONFIG_AUX_DIR([autoconf])
 AM_INIT_AUTOMAKE
 AC_CONFIG_FILES([Makefile])
 AC_PROG_CC
+AM_PROG_AR
 AM_PROG_LIBTOOL
 AC_CONFIG_FILES([autoconf/Makefile main/Makefile])
 AC_OUTPUT
@@ -45,6 +46,7 @@ lib_LTLIBRARIES = lib0.la
 lib0_la_SOURCES = 0.c
 END
 
+: > ar-lib
 libtoolize --force --copy
 $ACLOCAL
 $AUTOCONF
@@ -52,4 +54,6 @@ $AUTOCONF
 test -f autoconf/ltmain.sh # Sanity check.
 rm -f autoconf/ltmain.sh
 AUTOMAKE_fails --add-missing --copy
-grep 'autoconf/ltmain.sh' stderr
+grep '^configure\.in:7:.* required file.*autoconf/ltmain\.sh' stderr
+
+:
diff --git a/tests/silent3.test b/tests/silent3.test
index 17f1959..4d66a0a 100755
--- a/tests/silent3.test
+++ b/tests/silent3.test
@@ -29,6 +29,7 @@ cat >>configure.in <<'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
diff --git a/tests/silent4.test b/tests/silent4.test
index 9c343c0..4ef4653 100755
--- a/tests/silent4.test
+++ b/tests/silent4.test
@@ -30,6 +30,7 @@ cat >>configure.in <<'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
diff --git a/tests/silent9.test b/tests/silent9.test
index f0abb29..76d97fc 100755
--- a/tests/silent9.test
+++ b/tests/silent9.test
@@ -30,6 +30,7 @@ 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
diff --git a/tests/specflg-dummy.test b/tests/specflg-dummy.test
index 614d6c2..d0c8ba6 100755
--- a/tests/specflg-dummy.test
+++ b/tests/specflg-dummy.test
@@ -61,6 +61,7 @@ AC_PROG_LEX
 AC_PROG_F77
 AC_PROG_FC
 AM_PROG_GCJ
+AM_PROG_AR
 AC_PROG_RANLIB
 AC_PROG_LIBTOOL
 AM_PROG_UPC
diff --git a/tests/specflg2.test b/tests/specflg2.test
index 0dc7fcc..f67fd7b 100755
--- a/tests/specflg2.test
+++ b/tests/specflg2.test
@@ -24,6 +24,7 @@ cat >> configure.in << 'END'
 AC_PROG_CC
 AM_PROG_CC_C_O
 AC_PROG_CXX
+AM_PROG_AR
 AC_PROG_RANLIB
 END
 
@@ -35,6 +36,8 @@ libfoo_a_CFLAGS = -DBAR
 libfoo_a_CXXFLAGS = -DZOT
 END
 
+: > ar-lib
+
 # Make sure `compile' is required.
 $ACLOCAL
 AUTOMAKE_fails
diff --git a/tests/stdlib.test b/tests/stdlib.test
index 48f56fc..5ca9a7f 100755
--- a/tests/stdlib.test
+++ b/tests/stdlib.test
@@ -1,5 +1,6 @@
 #! /bin/sh
-# Copyright (C) 1996, 2001, 2002, 2003, 2004  Free Software Foundation, Inc.
+# Copyright (C) 1996, 2001, 2002, 2003, 2004, 2011 Free Software
+# Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -22,15 +23,33 @@ set -e
 
 cat >> configure.in << 'END'
 AC_PROG_CC
+AM_PROG_AR
 AC_PROG_RANLIB
 END
 
 cat > Makefile.am << 'END'
 noinst_LIBRARIES = sub/foo
+include $(srcdir)/foo.mk
 END
 
+cat > foo.mk << 'END'
+## A dummy automake comment.
+a = x \
+    y
+# A dummy make comment.
+lib_LIBRARIES = zardoz.a
+END
+
+: > ar-lib
+
 $ACLOCAL
 AUTOMAKE_fails
+q="[\`'\"]"
+badname='not a standard library name'
 # We're specifically testing for line-number information.
-grep 'Makefile.am:1:.*sub/foo.*standard library name' stderr
-grep 'Makefile.am:1:.*sub/libfoo.a.*' stderr
+grep "^Makefile\\.am:1:.*${q}sub/foo${q}.*$badname" stderr
+grep "^Makefile\\.am:1:.*sub/libfoo\\.a" stderr
+grep "^foo\\.mk:5:.*${q}zardoz\\.a${q}.*$badname" stderr
+grep "^foo\\.mk:5:.*libzardoz\\.a" stderr
+
+:
diff --git a/tests/stdlib2.test b/tests/stdlib2.test
index c5d543c..5da42ad 100755
--- a/tests/stdlib2.test
+++ b/tests/stdlib2.test
@@ -32,6 +32,7 @@ set -e
 
 cat >> configure.in << 'END'
 AC_PROG_CC
+AM_PROG_AR
 AC_PROG_LIBTOOL
 AC_OUTPUT
 END
diff --git a/tests/strip2.test b/tests/strip2.test
index 5786ded..bab0a38 100755
--- a/tests/strip2.test
+++ b/tests/strip2.test
@@ -24,6 +24,7 @@ set -e
 
 cat >> configure.in << 'END'
 AC_PROG_CC
+AM_PROG_AR
 AC_PROG_RANLIB
 AC_OUTPUT
 END
diff --git a/tests/strip3.test b/tests/strip3.test
index b159673..34b0254 100755
--- a/tests/strip3.test
+++ b/tests/strip3.test
@@ -24,6 +24,7 @@ set -e
 
 cat >> configure.in << 'END'
 AC_PROG_CC
+AM_PROG_AR
 AC_PROG_LIBTOOL
 AC_OUTPUT
 END
diff --git a/tests/subdir4.test b/tests/subdir4.test
index 7ea10f8..9d4efec 100755
--- a/tests/subdir4.test
+++ b/tests/subdir4.test
@@ -26,6 +26,7 @@ mkdir lib src
 cat >> configure.in << 'END'
 AC_PROG_RANLIB
 AC_PROG_CC
+AM_PROG_AR
 AC_CONFIG_FILES([lib/Makefile src/Makefile])
 AC_OUTPUT
 END
@@ -56,6 +57,8 @@ cat > src/Makefile.am << 'END'
 pkgdata_DATA =
 END
 
+: > ar-lib
+
 $ACLOCAL
 $AUTOMAKE --gnu
 
diff --git a/tests/subdirbuiltsources.test b/tests/subdirbuiltsources.test
index a84f28e..a6a0035 100755
--- a/tests/subdirbuiltsources.test
+++ b/tests/subdirbuiltsources.test
@@ -28,6 +28,7 @@ cat >> configure.in << 'END'
 AC_CONFIG_FILES([lib/Makefile])
 AC_PROG_RANLIB
 AC_PROG_CC
+AM_PROG_AR
 AC_OUTPUT
 END
 
diff --git a/tests/subobj10.test b/tests/subobj10.test
index dbddf29..e446fba 100755
--- a/tests/subobj10.test
+++ b/tests/subobj10.test
@@ -26,6 +26,7 @@ AC_INIT([$me], [1.0])
 AM_INIT_AUTOMAKE([subdir-objects])
 
 AM_PROG_AS
+AM_PROG_AR
 AC_PROG_RANLIB
 
 AC_CONFIG_FILES([Makefile])
diff --git a/tests/subobj9.test b/tests/subobj9.test
index 83f3a31..39ba33e 100755
--- a/tests/subobj9.test
+++ b/tests/subobj9.test
@@ -25,6 +25,7 @@ cat > configure.in << END
 AC_INIT([$me], [1.0])
 AM_INIT_AUTOMAKE([subdir-objects])
 AC_PROG_CXX
+AM_PROG_AR
 AM_PROG_LIBTOOL
 AC_CONFIG_FILES([Makefile])
 AC_OUTPUT
diff --git a/tests/subpkg-yacc.test b/tests/subpkg-yacc.test
index ee8af66..011d5c2 100755
--- a/tests/subpkg-yacc.test
+++ b/tests/subpkg-yacc.test
@@ -57,6 +57,7 @@ AC_PROG_RANLIB
 AC_PROG_YACC
 dnl This comes after YACC and RANLIB checks, deliberately.
 AC_PROG_CC
+AM_PROG_AR
 AC_CONFIG_HEADERS([config.h:config.hin])
 AC_CONFIG_FILES([Makefile])
 AC_OUTPUT
diff --git a/tests/subpkg.test b/tests/subpkg.test
index 579a0a4..381fc54 100755
--- a/tests/subpkg.test
+++ b/tests/subpkg.test
@@ -66,6 +66,7 @@ mkdir lib/src
 cat >lib/configure.ac <<'EOF'
 AC_INIT([lib], [2.3])
 AM_INIT_AUTOMAKE
+AM_PROG_AR
 AC_PROG_RANLIB
 AC_CONFIG_HEADERS([config.h:config.hin])
 AC_CONFIG_FILES([Makefile])
diff --git a/tests/subst3.test b/tests/subst3.test
index 1bcb170..c7adc8c 100755
--- a/tests/subst3.test
+++ b/tests/subst3.test
@@ -24,6 +24,7 @@ set -e
 
 cat >> configure.in <<'EOF'
 AC_PROG_CC
+AM_PROG_AR
 AC_PROG_RANLIB
 if test -n "$doit"; then
   AC_SUBST([basehdr], [sub/base.h])
diff --git a/tests/substtarg.test b/tests/substtarg.test
index d828954..34db19f 100755
--- a/tests/substtarg.test
+++ b/tests/substtarg.test
@@ -25,6 +25,7 @@ set -e
 cat >> configure.in << 'END'
 AC_CONFIG_SOURCE([fakelib.c])
 AC_PROG_CC
+AM_PROG_AR
 RANLIB=:
 AC_SUBST([RANLIB])
 SUBST=hei
@@ -42,6 +43,8 @@ address@hidden@.a: Makefile $(address@hidden@_a_OBJECTS) 
$(address@hidden@_a_DEPEND
        @echo here we do some custom stuff, instead of invoking the linker
 END
 
+: > ar-lib
+
 $ACLOCAL
 AUTOMAKE_fails
 grep 'address@hidden@.a' stderr
diff --git a/tests/suffix10.test b/tests/suffix10.test
index 131359c..bdc4928 100755
--- a/tests/suffix10.test
+++ b/tests/suffix10.test
@@ -25,6 +25,7 @@ set -e
 cat >>configure.in <<EOF
 AC_PROG_CC
 AC_PROG_YACC
+AM_PROG_AR
 AC_PROG_LIBTOOL
 AC_OUTPUT
 EOF
diff --git a/tests/suffix2.test b/tests/suffix2.test
index 405ce90..f55d965 100755
--- a/tests/suffix2.test
+++ b/tests/suffix2.test
@@ -24,6 +24,7 @@ set -e
 
 cat >> configure.in << 'END'
 AC_PROG_CC
+AM_PROG_AR
 AC_PROG_LIBTOOL
 END
 
diff --git a/tests/suffix5.test b/tests/suffix5.test
index b3b36aa..2cf0afa 100755
--- a/tests/suffix5.test
+++ b/tests/suffix5.test
@@ -24,6 +24,7 @@ required=libtool
 set -e
 
 cat >> configure.in << 'END'
+AM_PROG_AR
 AC_PROG_LIBTOOL
 END
 
@@ -38,6 +39,7 @@ END
 : > ltmain.sh
 : > config.guess
 : > config.sub
+: > ar-lib
 
 $ACLOCAL
 $AUTOMAKE
diff --git a/tests/suffix8.test b/tests/suffix8.test
index 4279ad6..4110056 100755
--- a/tests/suffix8.test
+++ b/tests/suffix8.test
@@ -23,6 +23,7 @@ required='gcc libtoolize'
 set -e
 
 cat >>configure.in <<'END'
+AM_PROG_AR
 AM_PROG_LIBTOOL
 AC_OUTPUT
 END
diff --git a/tests/syntax.test b/tests/syntax.test
index 505486f..23fa792 100755
--- a/tests/syntax.test
+++ b/tests/syntax.test
@@ -1,5 +1,6 @@
 #! /bin/sh
-# Copyright (C) 1998, 2001, 2002, 2003  Free Software Foundation, Inc.
+# Copyright (C) 1998, 2001, 2002, 2003, 2011 Free Software Foundation,
+# Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -23,9 +24,11 @@ set -e
 cat > Makefile.am << 'END'
 foo = q \
 
-lib_LTLIBRARIES = foo.la
+bin_SCRIPTS = foo.sh
 END
 
 $ACLOCAL
-AUTOMAKE_fails
-grep 'Makefile.am:2:.*blank line' stderr
+AUTOMAKE_fails -Wnone
+grep '^Makefile\.am:2:.*blank line following trailing backslash' stderr
+
+:
diff --git a/tests/vala.test b/tests/vala.test
index 70122c3..2c7dae1 100755
--- a/tests/vala.test
+++ b/tests/vala.test
@@ -34,6 +34,7 @@ END
 cat >> configure.in <<'END'
 AC_PROG_CC
 AC_PROG_CXX
+AM_PROG_AR
 AC_PROG_LIBTOOL
 AM_PROG_VALAC
 AC_CONFIG_FILES([sub/Makefile])
diff --git a/tests/vala1.test b/tests/vala1.test
index d0cc241..b2c9e16 100755
--- a/tests/vala1.test
+++ b/tests/vala1.test
@@ -29,6 +29,7 @@ set -e
 
 cat >> 'configure.in' << 'END'
 AC_PROG_CC
+AM_PROG_AR
 AC_PROG_LIBTOOL
 AM_PROG_VALAC
 AC_OUTPUT


hooks/post-receive
-- 
GNU Automake



reply via email to

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