automake-commit
[Top][All Lists]
Advanced

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

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


From: Stefano Lattarini
Subject: [Automake-commit] [SCM] GNU Automake branch, master, updated. v1.11-1108-g38e1b39
Date: Thu, 03 Nov 2011 13:41:39 +0000

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

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

The branch, master has been updated
       via  38e1b39d77ad4a22c85d5ad7b2fde4fd51bfd1b5 (commit)
       via  2270535f37084e0e2febed21cd808da75b0f3451 (commit)
       via  821f88c3c7db37413c1e70722dad4a30a6c83afb (commit)
       via  91ab753b7b654934aaa34006067a92993bb53c09 (commit)
       via  cc2202a6b0d5a7dc2f8af17e4ac2fdd3fe46d267 (commit)
       via  c7a6a92ea100e3c78c7f48bd6a672da3ad46fc7f (commit)
       via  b07777bd6da63018e845e18ce96c4168343b47b6 (commit)
      from  a778e9e1dcf606c9cee31009c982daa748438b39 (commit)

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

- Log -----------------------------------------------------------------
commit 38e1b39d77ad4a22c85d5ad7b2fde4fd51bfd1b5
Merge: a778e9e 2270535
Author: Stefano Lattarini <address@hidden>
Date:   Thu Nov 3 13:50:06 2011 +0100

    Merge branch 'msvc' into master
    
    Commits merged from msvc:
     - tests: few improvements to some `ar-lib' related tests
     - warnings: new 'extra-portability' category, for AM_PROG_AR
     - ar-lib: new 'AM_PROG_AR' macro, triggering the 'ar-lib' script
    
    Extra changes required by the testsuite:
    * tests/instspc-tests.sh: Adjust to new portability requirements
    due to the new AM_PROG_AR macro.
    * tests/libobj-basic.test: Likewise.
    * tests/libobj2.test: Likewise.
    * tests/libobj15a.test: Likewise.
    * tests/libobj15b.test: Likewise.
    * tests/libobj15c.test: Likewise.
    * tests/libobj16a.test: Likewise.
    * tests/libobj16b.test: Likewise.
    * tests/libobj17.test: Likewise.
    * tests/libobj18.test: Likewise.
    * tests/libobj19.test: Likewise.
    * tests/libobj20a.test: Likewise.
    * tests/libobj20b.test: Likewise.
    * tests/libobj20c.test: Likewise.
    * tests/canon6.test: Likewise.
    * tests/canon6.test: Likewise.
    * tests/canon7.tests: Likewise.
    * tests/extra9.test: Likewise.
    * tests/extradep.test: Likewise.
    * tests/extradep2.test: Likewise.
    * tests/posixsubst-ldadd.test: Likewise.
    * tests/posixsubst-libraries.test: Likewise.
    * tests/posixsubst-ltlibraries.test: Likewise.
    * tests/python-virtualenv.test: Likewise.
    * tests/vartypos.test: Likewise.
    * tests/vartypo2.test: Likewise.
    * tests/suffix.test: Update to take into account previous
    master-only changes.
    * tests/suffix2.test: Likewise.
    * tests/libobj7.test: Call automake with the `--add-missing'
    option, instead of creating a dummy `ar-lib' file, since this
    test now also runs "./configure" and "make".
    * tests/suffix5.test: Copy the real `ar-lib' script file,
    instead of creating a dummy one, since this test now also
    runs "./configure" and "make".
    * tests/extra-portability2.test: Fix this test not to rely
    on the older, faulty semantics of "strictness specification
    always reset warning level", which has been fixed in commit
    v1.11-623-g1609491 (see also automake bug#7669 a.k.a. PR/547).
    Since we are at it, throw inf few other minor unrelated
    improvements.
    * tests/extra-portability.test: Explicitly pass `-Wall' to
    automake calls, for clarity.

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

Summary of changes:
 ChangeLog                                          |  147 ++++++++++++++++++++
 NEWS                                               |    8 +
 automake.in                                        |   22 +++
 doc/automake.texi                                  |   33 ++++-
 lib/Automake/ChannelDefs.pm                        |   13 ++
 m4/Makefile.am                                     |    1 +
 m4/Makefile.in                                     |    1 +
 m4/ar-lib.m4                                       |   58 ++++++++
 tests/Makefile.am                                  |   13 ++
 tests/Makefile.in                                  |   13 ++
 tests/aclocal4.test                                |    3 +-
 tests/{subobj7.test => ar-lib2.test}               |   21 ++--
 tests/{library.test => ar-lib3.test}               |   24 ++-
 tests/{libtool2.test => ar-lib4.test}              |   35 +++--
 tests/ar-lib5a.test                                |   75 ++++++++++
 tests/ar-lib5b.test                                |   99 +++++++++++++
 ...{check-tests_environment.test => ar-lib6a.test} |   32 ++---
 tests/{libtoo11.test => ar-lib6b.test}             |   25 ++--
 tests/{confvar2.test => ar-lib7.test}              |   19 ++--
 tests/ar.test                                      |    3 +
 tests/ar2.test                                     |    2 +-
 tests/{ar2.test => ar3.test}                       |   15 ++-
 tests/{help-python.test => ar4.test}               |   16 +-
 tests/{cscope2.test => ar5.test}                   |   15 +-
 tests/canon4.test                                  |    3 +
 tests/canon6.test                                  |    2 +
 tests/canon7.test                                  |    1 +
 tests/compile4.test                                |    1 +
 tests/cond13.test                                  |    3 +
 tests/condlib.test                                 |    3 +
 tests/defs                                         |    8 +
 tests/depcomp4.test                                |    1 +
 tests/depcomp6.test                                |    1 +
 tests/depcomp7.test                                |    1 +
 tests/depcomp8b.test                               |    1 +
 tests/extra-portability.test                       |   69 +++++++++
 tests/{ar2.test => extra-portability2.test}        |   30 +++-
 tests/extra9.test                                  |    3 +
 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-tests.sh                             |    1 +
 tests/ldflags.test                                 |    2 +
 tests/libobj-basic.test                            |    4 +
 tests/libobj10.test                                |    3 +
 tests/libobj12.test                                |    2 +
 tests/libobj13.test                                |    1 +
 tests/libobj15a.test                               |    3 +
 tests/libobj15b.test                               |    3 +
 tests/libobj15c.test                               |    3 +
 tests/libobj16a.test                               |    3 +-
 tests/libobj16b.test                               |    4 +-
 tests/libobj17.test                                |    3 +-
 tests/libobj18.test                                |    1 +
 tests/libobj19.test                                |    4 +
 tests/libobj2.test                                 |    3 +-
 tests/libobj20a.test                               |    2 +
 tests/libobj20b.test                               |    3 +
 tests/libobj20c.test                               |    3 +
 tests/libobj7.test                                 |    3 +-
 tests/library.test                                 |    2 +
 tests/libtoo10.test                                |    1 +
 tests/libtool2.test                                |    1 +
 tests/libtool3.test                                |    1 +
 tests/libtool5.test                                |    1 +
 tests/libtool6.test                                |    1 +
 tests/libtool7.test                                |    1 +
 tests/libtool8.test                                |    1 +
 tests/libtool9.test                                |    1 +
 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/posixsubst-ldadd.test                        |    3 +-
 tests/posixsubst-libraries.test                    |    3 +-
 tests/posixsubst-ltlibraries.test                  |    1 +
 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/python-virtualenv.test                       |    1 +
 tests/silent3.test                                 |    1 +
 tests/silent4.test                                 |    1 +
 tests/silent9.test                                 |    1 +
 tests/specflg-dummy.test                           |    1 +
 tests/specflg2.test                                |    3 +
 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/suffix.test                                  |   30 +++--
 tests/suffix10.test                                |    1 +
 tests/suffix2.test                                 |    5 +-
 tests/suffix5.test                                 |    7 +-
 tests/suffix8.test                                 |    1 +
 tests/vala.test                                    |    1 +
 tests/vala1.test                                   |    1 +
 tests/vartypo2.test                                |    1 +
 tests/vartypos.test                                |    4 +-
 128 files changed, 890 insertions(+), 150 deletions(-)
 create mode 100644 m4/ar-lib.m4
 copy tests/{subobj7.test => ar-lib2.test} (69%)
 copy tests/{library.test => ar-lib3.test} (75%)
 copy tests/{libtool2.test => ar-lib4.test} (70%)
 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/{confvar2.test => ar-lib7.test} (74%)
 copy tests/{ar2.test => ar3.test} (78%)
 copy tests/{help-python.test => ar4.test} (72%)
 copy tests/{cscope2.test => ar5.test} (75%)
 create mode 100755 tests/extra-portability.test
 copy tests/{ar2.test => extra-portability2.test} (56%)

diff --git a/ChangeLog b/ChangeLog
index 051e7fa..b79cae0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,127 @@
+2011-11-03  Stefano Lattarini  <address@hidden>
+
+       Merge branch 'msvc' into master
+
+       * tests/instspc-tests.sh: Adjust to new portability requirements
+       due to the new AM_PROG_AR macro.
+       * tests/libobj-basic.test: Likewise.
+       * tests/libobj2.test: Likewise.
+       * tests/libobj15a.test: Likewise.
+       * tests/libobj15b.test: Likewise.
+       * tests/libobj15c.test: Likewise.
+       * tests/libobj16a.test: Likewise.
+       * tests/libobj16b.test: Likewise.
+       * tests/libobj17.test: Likewise.
+       * tests/libobj18.test: Likewise.
+       * tests/libobj19.test: Likewise.
+       * tests/libobj20a.test: Likewise.
+       * tests/libobj20b.test: Likewise.
+       * tests/libobj20c.test: Likewise.
+       * tests/canon6.test: Likewise.
+       * tests/canon6.test: Likewise.
+       * tests/canon7.tests: Likewise.
+       * tests/extra9.test: Likewise.
+       * tests/extradep.test: Likewise.
+       * tests/extradep2.test: Likewise.
+       * tests/posixsubst-ldadd.test: Likewise.
+       * tests/posixsubst-libraries.test: Likewise.
+       * tests/posixsubst-ltlibraries.test: Likewise.
+       * tests/python-virtualenv.test: Likewise.
+       * tests/vartypos.test: Likewise.
+       * tests/vartypo2.test: Likewise.
+       * tests/suffix.test: Update to take into account previous
+       master-only changes.
+       * tests/suffix2.test: Likewise.
+       * tests/libobj7.test: Call automake with the `--add-missing'
+       option, instead of creating a dummy `ar-lib' file, since this
+       test now also runs "./configure" and "make".
+       * tests/suffix5.test: Copy the real `ar-lib' script file,
+       instead of creating a dummy one, since this test now also
+       runs "./configure" and "make".
+       * tests/extra-portability2.test: Fix this test not to rely
+       on the older, faulty semantics of "strictness specification
+       always reset warning level", which has been fixed in commit
+       v1.11-623-g1609491 (see also automake bug#7669 a.k.a. PR/547).
+       Since we are at it, throw inf few other minor unrelated
+       improvements.
+       * tests/extra-portability.test: Explicitly pass `-Wall' to
+       automake calls, for clarity.
+
+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-11-03  Zack Weinberg <address@hidden>  (tiny change)
            Stefano Lattarini  <address@hidden>
 
@@ -55,6 +179,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
diff --git a/NEWS b/NEWS
index 3852abf..6c548d1 100644
--- a/NEWS
+++ b/NEWS
@@ -58,6 +58,9 @@ New in 1.11a:
   - C source and header files derived from non-distributed Yacc sources are
     now removed by "make clean", not only by "make maintainer-clean".
 
+  - 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
@@ -71,6 +74,11 @@ New in 1.11a:
     user; still, the old Makefile.am files that used to define it should
     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 found 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)'.
diff --git a/automake.in b/automake.in
index cbbdd53..0b6d014 100644
--- a/automake.in
+++ b/automake.in
@@ -389,6 +389,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;
 
@@ -2652,6 +2655,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'")
+       }
     }
 }
 
@@ -2891,6 +2901,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'")
+       }
     }
 }
 
@@ -5168,6 +5185,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,
@@ -5357,6 +5375,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 378b82f..ad04ad9 100644
--- a/doc/automake.texi
+++ b/doc/automake.texi
@@ -2680,6 +2680,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
@@ -2702,6 +2705,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
@@ -3980,6 +3989,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
@@ -4594,6 +4612,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
@@ -5038,12 +5057,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 470e6c7..de3970c 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;
@@ -184,6 +189,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
@@ -288,6 +294,10 @@ sub switch_warning ($)
       setup_channel $cat, silent => $has_no;
       setup_channel 'portability-recursive', silent => $has_no
         if $cat eq 'portability';
+      setup_channel 'extra-portability', silent => $has_no
+        if ($cat eq 'portability' && $has_no);
+      setup_channel 'portability', silent => $has_no
+        if ($cat eq 'extra-portability' && ! $has_no);
     }
   else
     {
@@ -349,6 +359,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')
@@ -357,6 +368,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')
@@ -365,6 +377,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
diff --git a/m4/Makefile.am b/m4/Makefile.am
index 143df71..eebf04e 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/Makefile.in b/m4/Makefile.in
index 8bc9b70..9765440 100644
--- a/m4/Makefile.in
+++ b/m4/Makefile.in
@@ -203,6 +203,7 @@ automake_acdir = $(datadir)/aclocal-$(APIVERSION)
 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..822ca60
--- /dev/null
+++ b/m4/ar-lib.m4
@@ -0,0 +1,58 @@
+##                                                          -*- 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
+          m4_default([$1],
+            [AC_MSG_ERROR([could not determine $AR interface])])
+        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"
+  ;;
+esac
+AC_SUBST([AR])dnl
+])
diff --git a/tests/Makefile.am b/tests/Makefile.am
index d900b41..b5ad95a 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -167,8 +167,19 @@ amopts-variable-expansion.test \
 amsubst.test \
 ansi2knr-no-more.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 \
@@ -467,6 +478,8 @@ extra11.test \
 extra12.test \
 extradep.test \
 extradep2.test \
+extra-portability.test \
+extra-portability2.test \
 f90only.test \
 flavor.test \
 flibs.test \
diff --git a/tests/Makefile.in b/tests/Makefile.in
index e1f91d0..babba97 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -443,8 +443,19 @@ amopts-variable-expansion.test \
 amsubst.test \
 ansi2knr-no-more.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 \
@@ -743,6 +754,8 @@ extra11.test \
 extra12.test \
 extradep.test \
 extradep2.test \
+extra-portability.test \
+extra-portability2.test \
 f90only.test \
 flavor.test \
 flibs.test \
diff --git a/tests/aclocal4.test b/tests/aclocal4.test
index e18684b..10b2080 100755
--- a/tests/aclocal4.test
+++ b/tests/aclocal4.test
@@ -23,6 +23,7 @@ required=GNUmake
 
 cat >>configure.in <<EOF
 AC_PROG_RANLIB
+AM_PROG_AR
 AC_PROG_CC
 MY_MACRO
 AC_CONFIG_FILES([lib/Makefile])
@@ -58,7 +59,7 @@ EOF
 
 $ACLOCAL -I m4
 $AUTOCONF
-$AUTOMAKE
+$AUTOMAKE --add-missing
 ./configure
 $MAKE check-not-foo
 
diff --git a/tests/subobj7.test b/tests/ar-lib2.test
similarity index 69%
copy from tests/subobj7.test
copy to tests/ar-lib2.test
index ff36d6c..67a64e9 100755
--- a/tests/subobj7.test
+++ b/tests/ar-lib2.test
@@ -1,6 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2001, 2002, 2004, 2010, 2011 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
@@ -15,25 +14,27 @@
 # 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
 
+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/library.test b/tests/ar-lib3.test
similarity index 75%
copy from tests/library.test
copy to tests/ar-lib3.test
index e3a9813..6bcf6c2 100755
--- a/tests/library.test
+++ b/tests/ar-lib3.test
@@ -1,6 +1,5 @@
 #! /bin/sh
-# Copyright (C) 1998, 2001, 2002, 2008, 2010, 2011 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
@@ -15,23 +14,32 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Test for _DEPENDENCIES with libraries.
+# Test if lib_LIBRARIES requests AM_PROG_AR.
 
 . ./defs || Exit 1
 
+set -e
+
 cat >> configure.in << 'END'
-AC_PROG_RANLIB
-AM_MAINTAINER_MODE
 AC_PROG_CC
+AC_PROG_RANLIB
 END
 
 cat > Makefile.am << 'END'
-AUTOMAKE_OPTIONS = dejagnu cygnus
 lib_LIBRARIES = libfoo.a
-libfoo_a_DEPENDENCIES = libzot.a
+libfoo_a_SOURCES = foo.c
+END
+
+$ACLOCAL
+AUTOMAKE_fails
+
+grep 'requires.*AM_PROG_AR' stderr
+
+cat >> configure.in << 'END'
+AM_PROG_AR
 END
 
 $ACLOCAL
-$AUTOMAKE
+$AUTOMAKE --add-missing
 
 :
diff --git a/tests/libtool2.test b/tests/ar-lib4.test
similarity index 70%
copy from tests/libtool2.test
copy to tests/ar-lib4.test
index 6e268dd..e05a8c2 100755
--- a/tests/libtool2.test
+++ b/tests/ar-lib4.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2001, 2002, 2010, 2011 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,35 +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 libtool clean targets exist.
-# Report from Eric Magnien.
+# 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_CONFIG_FILES([sub/Makefile])
 AC_OUTPUT
 END
 
 cat > Makefile.am << 'END'
-SUBDIR = subdir
 lib_LTLIBRARIES = libfoo.la
 libfoo_la_SOURCES = foo.c
 END
 
-mkdir sub
-cat > sub/Makefile.am << 'END'
-lib_LTLIBRARIES = libfoo.la
-libfoo_la_SOURCES = foo.c
+libtoolize
+$ACLOCAL
+AUTOMAKE_fails
+
+grep 'requires.*AM_PROG_AR' stderr
+
+cp X configure.in
+
+cat >> configure.in << 'END'
+AC_PROG_CC
+AM_PROG_AR
+AC_PROG_RANLIB
+AC_PROG_LIBTOOL
+AC_OUTPUT
 END
 
 $ACLOCAL
-: > ltmain.sh
-$AUTOMAKE -a
-
-grep 'rm -f .*\.lo' sub/Makefile.in
+$AUTOMAKE --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 e3dc76a..f1b982c 100755
--- a/tests/check-tests_environment.test
+++ b/tests/ar-lib6a.test
@@ -14,32 +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
 
-cat >> configure.in << 'END'
-AC_OUTPUT
-END
-
-cat > Makefile.am << 'END'
-TESTS = foo.test
-EXTRA_DIST = $(TESTS)
-END
+set -e
 
-cat > foo.test << 'END'
-#! /bin/sh
-test x"$FOO" = x"ok"
+cat >> configure.in << 'END'
+AC_PROG_CC
+AC_PROG_RANLIB
+m4_ifdef([LT_INIT], [LT_INIT], [AC_PROG_LIBTOOL])
+AM_PROG_AR
 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 4cfcda5..5487add 100755
--- a/tests/libtoo11.test
+++ b/tests/ar-lib6b.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2008, 2011 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,23 +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/confvar2.test b/tests/ar-lib7.test
similarity index 74%
copy from tests/confvar2.test
copy to tests/ar-lib7.test
index ca11568..3f758a9 100755
--- a/tests/confvar2.test
+++ b/tests/ar-lib7.test
@@ -1,6 +1,5 @@
 #! /bin/sh
-# Copyright (C) 1996, 2001, 2002, 2010, 2011 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
@@ -15,21 +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/>.
 
-# Test for bug reported by Jim Meyering.
+# Test if automake warns if ar-lib is missing when AM_PROG_AR is used.
 
 . ./defs || Exit 1
 
+set -e
+
 cat >> configure.in << 'END'
-AC_SUBST([OTHER_SCRIPTS])
+AM_PROG_AR
 END
 
-cat > Makefile.am << 'END'
-bin_SCRIPTS = foo
-END
+:> Makefile.am
 
 $ACLOCAL
-$AUTOMAKE
+AUTOMAKE_fails
+
+grep '^configure\.in:.*ar-lib.*not found' stderr
 
-grep '^OTHER_SCRIPTS =' Makefile.in
+$AUTOMAKE --add-missing
 
 :
diff --git a/tests/ar.test b/tests/ar.test
index 4a69c34..b0b02a4 100755
--- a/tests/ar.test
+++ b/tests/ar.test
@@ -20,6 +20,7 @@
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
+AM_PROG_AR
 AC_SUBST([AR], ['echo it works'])
 AC_SUBST([ARFLAGS], ['>'])
 AC_SUBST([RANLIB], ['echo really works >>'])
@@ -31,6 +32,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 a614949..289c469 100755
--- a/tests/ar2.test
+++ b/tests/ar2.test
@@ -31,7 +31,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 78%
copy from tests/ar2.test
copy to tests/ar3.test
index a614949..1d5e84e 100755
--- a/tests/ar2.test
+++ b/tests/ar3.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2004, 2010, 2011 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,13 +14,16 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# 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
 
+set -e
+
 cat >> configure.in << 'END'
 AC_PROG_CC
+AM_PROG_AR
 AC_PROG_RANLIB
 AC_OUTPUT
 END
@@ -30,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/help-python.test b/tests/ar4.test
similarity index 72%
copy from tests/help-python.test
copy to tests/ar4.test
index e6a6fd3..ebd8c57 100755
--- a/tests/help-python.test
+++ b/tests/ar4.test
@@ -14,22 +14,22 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Make sure that macro `AM_PATH_PYTHON' adds proper text to the
-# configure help screen.
+# Test if configure bails out if $AR does not work and AM_PROG_AR is used.
 
 . ./defs || Exit 1
 
-cat > configure.in <<END
-AC_INIT([$me], [1.0])
-AM_PATH_PYTHON
+set -e
+
+cat >> configure.in << 'END'
+AM_PROG_AR
 END
 
 $ACLOCAL
 $AUTOCONF
 
-./configure --help >stdout || { cat stdout; Exit 1; }
-cat stdout
+./configure AR=/bin/false 2>stderr && { cat stderr >&2; Exit 1; }
+cat stderr >&2
 
-grep '^  *PYTHON  *the Python interpreter$' stdout
+grep 'configure: error: could not determine /bin/false interface' stderr
 
 :
diff --git a/tests/cscope2.test b/tests/ar5.test
similarity index 75%
copy from tests/cscope2.test
copy to tests/ar5.test
index a7fa993..d00f421 100755
--- a/tests/cscope2.test
+++ b/tests/ar5.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2009, 2011 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,21 +14,20 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# The `cscope' target should not fail if there are no sources.
+# Test the optional argument of AM_PROG_AR.
 
-required=
 . ./defs || Exit 1
 
+set -e
+
 cat >> configure.in << 'END'
-AC_OUTPUT
+AM_PROG_AR([echo spy > bad-archiver-interface-detected])
 END
-: >Makefile.am
 
 $ACLOCAL
 $AUTOCONF
-$AUTOMAKE
 
-./configure
-$MAKE cscope
+./configure AR=/bin/false
+test -f bad-archiver-interface-detected
 
 :
diff --git a/tests/canon4.test b/tests/canon4.test
index 733ea70..c6b7296 100755
--- a/tests/canon4.test
+++ b/tests/canon4.test
@@ -22,6 +22,7 @@
 
 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/canon6.test b/tests/canon6.test
index a24e2eb..dd2e44e 100755
--- a/tests/canon6.test
+++ b/tests/canon6.test
@@ -23,6 +23,7 @@ required='libtoolize'
 
 cat >> configure.in << 'END'
 AC_PROG_CC
+AM_PROG_AR
 AC_PROG_LIBTOOL
 END
 
@@ -32,6 +33,7 @@ libx_y_la_SOURCES = xy.c
 END
 
 : > ltmain.sh
+: > ar-lib
 
 $ACLOCAL
 $AUTOMAKE -a
diff --git a/tests/canon7.test b/tests/canon7.test
index 4e700df..c399cd5 100755
--- a/tests/canon7.test
+++ b/tests/canon7.test
@@ -21,6 +21,7 @@ required='libtool libtoolize'
 
 cat >> configure.in << 'END'
 AC_PROG_CC
+AM_PROG_AR
 AC_PROG_RANLIB  dnl: for static libraries
 AC_PROG_LIBTOOL dnl: for libtool libraries
 AC_OUTPUT
diff --git a/tests/compile4.test b/tests/compile4.test
index cf8d6cb..66879a5 100755
--- a/tests/compile4.test
+++ b/tests/compile4.test
@@ -46,6 +46,7 @@ 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
diff --git a/tests/cond13.test b/tests/cond13.test
index 193b02d..83c6505 100755
--- a/tests/cond13.test
+++ b/tests/cond13.test
@@ -22,6 +22,7 @@
 cat >> configure.in << 'END'
 AC_PROG_CC
 AC_PROG_CXX
+AM_PROG_AR
 AC_PROG_RANLIB
 AM_CONDITIONAL(COND1, true)
 AM_CONDITIONAL(COND2, true)
@@ -47,6 +48,8 @@ endif
 libtest_a_SOURCES = $(TESTSOURCES)
 END
 
+: > ar-lib
+
 $ACLOCAL
 $AUTOMAKE
 
diff --git a/tests/condlib.test b/tests/condlib.test
index 390de75..58e22b0 100755
--- a/tests/condlib.test
+++ b/tests/condlib.test
@@ -23,6 +23,7 @@
 cat >> configure.in << 'END'
 AC_PROG_RANLIB
 AM_MAINTAINER_MODE
+AM_PROG_AR
 AC_PROG_CC
 END
 
@@ -35,6 +36,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 b/tests/defs
index ba4e9cc..1c9dd90 100644
--- a/tests/defs
+++ b/tests/defs
@@ -410,6 +410,14 @@ do
       echo "$me: running java -version -help"
       java -version -help || skip_ "java interpreter not found"
       ;;
+    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
diff --git a/tests/depcomp4.test b/tests/depcomp4.test
index b995c08..80c9043 100755
--- a/tests/depcomp4.test
+++ b/tests/depcomp4.test
@@ -21,6 +21,7 @@ required='libtoolize gcc makedepend'
 
 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 b937b9f..6c6a23a 100755
--- a/tests/depcomp6.test
+++ b/tests/depcomp6.test
@@ -21,6 +21,7 @@
 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 f404039..160ec0b 100755
--- a/tests/depcomp7.test
+++ b/tests/depcomp7.test
@@ -22,6 +22,7 @@ required='libtoolize'
 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 c67c3a8..1cd61a3 100755
--- a/tests/depcomp8b.test
+++ b/tests/depcomp8b.test
@@ -24,6 +24,7 @@ required=libtoolize
 
 cat >> configure.in << 'END'
 AC_PROG_CC
+AM_PROG_AR
 AC_PROG_LIBTOOL
 AC_OUTPUT
 END
diff --git a/tests/extra-portability.test b/tests/extra-portability.test
new file mode 100755
index 0000000..353141f
--- /dev/null
+++ b/tests/extra-portability.test
@@ -0,0 +1,69 @@
+#! /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'.
+
+. ./defs || Exit 1
+
+set -e
+
+cat >>configure.in <<END
+AC_PROG_CC
+AC_PROG_RANLIB
+AC_OUTPUT
+END
+
+cat >Makefile.am <<END
+EXTRA_LIBRARIES = libfoo.a
+libfoo_a_SOURCES = sub/foo.c
+libfoo_a_CPPFLAGS = -Dwhatever
+END
+
+$ACLOCAL
+
+# 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
+
+# Disabling extra-portability leaves portability intact.
+AUTOMAKE_fails -Wall -Wno-extra-portability
+# The expected diagnostic is
+#    Makefile.am:2: compiling `foo.c' with per-target flags requires 
`AM_PROG_CC_C_O' 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 && Exit 1
+
+# Enabling portability does not enable extra-portability.
+AUTOMAKE_fails -Wnone -Wportability
+# The expected diagnostic is
+#    Makefile.am:2: compiling `foo.c' with per-target flags requires 
`AM_PROG_CC_C_O' 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 && Exit 1
+
+# Disabling portability disables extra-portability.
+$AUTOMAKE -Wall -Wno-portability
+
+:
diff --git a/tests/ar2.test b/tests/extra-portability2.test
similarity index 56%
copy from tests/ar2.test
copy to tests/extra-portability2.test
index a614949..9e7212a 100755
--- a/tests/ar2.test
+++ b/tests/extra-portability2.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2004, 2010, 2011 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,39 @@
 # 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 extra-portability warnings are not enabled by --gnits,
+# --gnu and --foreign.
 
 . ./defs || Exit 1
 
-cat >> configure.in << 'END'
+set -e
+
+# We want complete control over automake options.
+AUTOMAKE=$original_AUTOMAKE
+
+cat >>configure.in <<END
 AC_PROG_CC
 AC_PROG_RANLIB
 AC_OUTPUT
 END
 
-cat > Makefile.am << 'END'
+cat >Makefile.am <<END
 EXTRA_LIBRARIES = libfoo.a
 libfoo_a_SOURCES = foo.c
 END
 
 $ACLOCAL
-$AUTOMAKE
-grep '^ARFLAGS =' Makefile.in
-grep '^AR =' Makefile.in
+
+# Make sure the test is useful.
+AUTOMAKE_fails -Wextra-portability \
+  || fatal_ "setup doesn't trigger \`extra-portability' warnings"
+
+$AUTOMAKE --foreign
+
+touch INSTALL NEWS README AUTHORS ChangeLog COPYING # Satisfy --gnu.
+$AUTOMAKE --gnu
+
+touch THANKS # Satisfy also --gnits.
+$AUTOMAKE --gnits
 
 :
diff --git a/tests/extra9.test b/tests/extra9.test
index 1446a4d..7a9cdaa 100755
--- a/tests/extra9.test
+++ b/tests/extra9.test
@@ -26,6 +26,7 @@
 
 cat >>configure.in <<'END'
 AC_PROG_CC
+AM_PROG_AR
 AC_PROG_RANLIB
 AC_SUBST([lib_LIBRARIES])
 AC_SUBST([bins])
@@ -36,6 +37,8 @@ cat >Makefile.am <<'END'
 bin_PROGRAMS = @bins@
 END
 
+: > ar-lib
+
 $ACLOCAL
 AUTOMAKE_fails
 grep 'bin_PROGRAMS.*contains configure substitution' stderr
diff --git a/tests/extradep.test b/tests/extradep.test
index 623d73a..636d9b2 100755
--- a/tests/extradep.test
+++ b/tests/extradep.test
@@ -20,6 +20,7 @@
 
 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 9a97de4..97f485d 100755
--- a/tests/extradep2.test
+++ b/tests/extradep2.test
@@ -21,6 +21,7 @@ required=libtoolize
 
 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 c4a4b55..ad266a4 100755
--- a/tests/fort5.test
+++ b/tests/fort5.test
@@ -54,6 +54,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 25f68dd..d02359b 100755
--- a/tests/instdir-ltlib.test
+++ b/tests/instdir-ltlib.test
@@ -24,6 +24,7 @@ required=libtoolize
 cat >>configure.in <<'END'
 AC_PROG_CC
 AM_PROG_CC_C_O
+AM_PROG_AR
 AC_PROG_LIBTOOL
 AM_PATH_PYTHON
 AC_OUTPUT
diff --git a/tests/instdir-prog.test b/tests/instdir-prog.test
index 77fc2a0..0311613 100755
--- a/tests/instdir-prog.test
+++ b/tests/instdir-prog.test
@@ -23,6 +23,7 @@
 cat >>configure.in <<'END'
 AC_PROG_CC
 AM_PROG_CC_C_O
+AM_PROG_AR
 AC_PROG_RANLIB
 AM_PATH_PYTHON
 AC_OUTPUT
diff --git a/tests/instfail-libtool.test b/tests/instfail-libtool.test
index b580c40..d4ee994 100755
--- a/tests/instfail-libtool.test
+++ b/tests/instfail-libtool.test
@@ -23,6 +23,7 @@ required='libtool libtoolize'
 . ./defs || Exit 1
 
 cat >>configure.in <<END
+AM_PROG_AR
 AC_PROG_LIBTOOL
 AC_OUTPUT
 END
diff --git a/tests/instfail.test b/tests/instfail.test
index d7fa736..022d71d 100755
--- a/tests/instfail.test
+++ b/tests/instfail.test
@@ -23,6 +23,7 @@
 
 cat >>configure.in <<END
 AC_PROG_CC
+AM_PROG_AR
 AC_PROG_RANLIB
 AM_PATH_LISPDIR
 AC_OUTPUT
diff --git a/tests/instspc-tests.sh b/tests/instspc-tests.sh
index 2c4089f..d3824a1 100755
--- a/tests/instspc-tests.sh
+++ b/tests/instspc-tests.sh
@@ -111,6 +111,7 @@ create_input_data ()
     AC_CONFIG_FILES([Makefile])
     AC_PROG_CC
     AC_PROG_RANLIB
+    AM_PROG_AR
     AC_OUTPUT
 EOF
 
diff --git a/tests/ldflags.test b/tests/ldflags.test
index 96fb213..92fb42c 100755
--- a/tests/ldflags.test
+++ b/tests/ldflags.test
@@ -23,6 +23,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], [:])
@@ -39,6 +40,7 @@ END
 
 : > ltconfig
 : > ltmain.sh
+: > ar-lib
 : > config.guess
 : > config.sub
 : > q.c
diff --git a/tests/libobj-basic.test b/tests/libobj-basic.test
index 0fe0278..f87660e 100755
--- a/tests/libobj-basic.test
+++ b/tests/libobj-basic.test
@@ -21,6 +21,7 @@
 mv configure.in configure.proto
 cat >> configure.proto << 'END'
 AC_PROG_CC
+AM_PROG_AR
 AC_PROG_RANLIB
 AC_OUTPUT
 END
@@ -76,6 +77,9 @@ cat > extra-checks.am << 'END'
 extra_checks = maude-src maude-dist liver-not-dist
 END
 
+# FIXME: improve support for "installcheck" here.
+cp "$top_testsrcdir/lib/ar-lib" . || Exit 99
+
 $ACLOCAL
 $AUTOCONF
 $AUTOMAKE
diff --git a/tests/libobj10.test b/tests/libobj10.test
index f891e85..2eabb5c 100755
--- a/tests/libobj10.test
+++ b/tests/libobj10.test
@@ -22,6 +22,7 @@
 
 cat >> configure.in << 'END'
 AC_PROG_CC
+AM_PROG_AR
 AC_PROG_RANLIB
 AC_LIBOBJ([foo])
 AC_OUTPUT
@@ -37,6 +38,8 @@ foo.c:
        echo 'extern int dummy;' > $@
 END
 
+: > ar-lib
+
 $ACLOCAL
 $AUTOCONF
 $AUTOMAKE
diff --git a/tests/libobj12.test b/tests/libobj12.test
index 89b70cf..73b1b61 100755
--- a/tests/libobj12.test
+++ b/tests/libobj12.test
@@ -21,6 +21,7 @@
 
 cat >> configure.in << 'END'
 AC_PROG_CC
+AM_PROG_AR
 AC_PROG_RANLIB
 AC_LIBOBJ([foo])
 AC_LIBOBJ([bar])
@@ -42,6 +43,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 c572dd4..0022ea0 100755
--- a/tests/libobj13.test
+++ b/tests/libobj13.test
@@ -22,6 +22,7 @@ required='libtoolize'
 
 cat >> configure.in << 'END'
 AC_PROG_CC
+AM_PROG_AR
 AC_PROG_LIBTOOL
 AC_LIBOBJ([foo])
 AC_OUTPUT
diff --git a/tests/libobj15a.test b/tests/libobj15a.test
index 044e3db..1889d63 100755
--- a/tests/libobj15a.test
+++ b/tests/libobj15a.test
@@ -20,6 +20,7 @@
 
 cat >> configure.in << 'END'
 AC_PROG_CC
+AM_PROG_AR
 AC_PROG_RANLIB
 AC_LIBOBJ([foobar])
 END
@@ -30,6 +31,8 @@ libtu_a_SOURCES =
 libtu_a_LIBADD = $(LIBOBJS)
 END
 
+: > ar-lib
+
 $ACLOCAL
 AUTOMAKE_fails
 grep 'configure\.in:.*required file.*foobar\.c.*' stderr
diff --git a/tests/libobj15b.test b/tests/libobj15b.test
index 4548a2a..03415c2 100755
--- a/tests/libobj15b.test
+++ b/tests/libobj15b.test
@@ -20,6 +20,7 @@
 
 cat >> configure.in << 'END'
 AC_PROG_CC
+AM_PROG_AR
 AC_PROG_RANLIB
 AC_LIBSOURCE([foobar.c])
 # NOTE: this call to AC_OUTPUT is really needed; see Automake bug #7635
@@ -33,6 +34,8 @@ libtu_a_SOURCES =
 libtu_a_LIBADD = $(LIBOBJS)
 END
 
+: > ar-lib
+
 $ACLOCAL
 AUTOMAKE_fails
 grep 'configure\.in:.*required file.*foobar\.c.*' stderr
diff --git a/tests/libobj15c.test b/tests/libobj15c.test
index c39ac99..603e2eb 100755
--- a/tests/libobj15c.test
+++ b/tests/libobj15c.test
@@ -33,6 +33,9 @@ libtu_a_SOURCES =
 libtu_a_LIBADD = $(LIBOBJS)
 END
 
+# Don't trip on errors due to missing `AM_PROG_AR'.
+AUTOMAKE="$AUTOMAKE -Wno-extra-portability"
+
 $ACLOCAL
 
 AUTOMAKE_fails
diff --git a/tests/libobj16a.test b/tests/libobj16a.test
index 9946bc5..a1ae93b 100755
--- a/tests/libobj16a.test
+++ b/tests/libobj16a.test
@@ -22,6 +22,7 @@
 mv configure.in configure.proto
 cat >> configure.proto << 'END'
 AC_PROG_CC
+AM_PROG_AR
 AC_PROG_RANLIB
 %LIBOBJ-STUFF% # will be activated later
 AC_OUTPUT
@@ -84,7 +85,7 @@ END
 
 $ACLOCAL
 $AUTOCONF
-$AUTOMAKE
+$AUTOMAKE --add-missing
 
 ./configure
 
diff --git a/tests/libobj16b.test b/tests/libobj16b.test
index 1039558..6adfce3 100755
--- a/tests/libobj16b.test
+++ b/tests/libobj16b.test
@@ -84,7 +84,7 @@ END
 
 $ACLOCAL
 $AUTOCONF
-$AUTOMAKE
+$AUTOMAKE -Wno-extra-portability
 
 ./configure
 
@@ -121,7 +121,7 @@ cat configure.in # for debugging
 
 $ACLOCAL
 $AUTOCONF
-$AUTOMAKE
+$AUTOMAKE -Wno-extra-portability
 
 ./configure MAUDE=yes
 $MAKE
diff --git a/tests/libobj17.test b/tests/libobj17.test
index 4f9db57..a570e12 100755
--- a/tests/libobj17.test
+++ b/tests/libobj17.test
@@ -21,6 +21,7 @@
 cat >> configure.in << 'END'
 AC_PROG_CC
 AC_PROG_RANLIB
+AM_PROG_AR
 foo=${FOO-oops}
 AC_LIBSOURCES([quux.c, zardoz.c])
 AC_LIBOBJ([$foo])
@@ -43,7 +44,7 @@ END
 
 # These might print warnings, but should not error out.
 $ACLOCAL
-$AUTOMAKE
+$AUTOMAKE -a
 $AUTOCONF
 
 ./configure FOO=quux
diff --git a/tests/libobj18.test b/tests/libobj18.test
index 5fba780..66188c6 100755
--- a/tests/libobj18.test
+++ b/tests/libobj18.test
@@ -20,6 +20,7 @@
 
 cat >> configure.in << 'END'
 AC_PROG_CC
+AM_PROG_AR
 AC_PROG_RANLIB
 foo=dummy bar=dummy baz=dummy
 AC_LIBSOURCE([$foo.c])
diff --git a/tests/libobj19.test b/tests/libobj19.test
index bc495b5..205bc48 100755
--- a/tests/libobj19.test
+++ b/tests/libobj19.test
@@ -21,6 +21,7 @@
 cat >> configure.in << 'END'
 AC_CONFIG_LIBOBJ_DIR([libobj-dir])
 AC_PROG_CC
+AM_PROG_AR
 AC_PROG_RANLIB
 AC_LIBOBJ([foobar])
 AC_OUTPUT
@@ -47,6 +48,9 @@ cat > libobj-dir/foobar.c << 'END'
 extern int dummy;
 END
 
+# FIXME: improve support for "installcheck" here.
+cp "$top_testsrcdir/lib/ar-lib" . || Exit 99
+
 $ACLOCAL
 $AUTOCONF
 $AUTOMAKE
diff --git a/tests/libobj2.test b/tests/libobj2.test
index 66ca0d0..1359bd4 100755
--- a/tests/libobj2.test
+++ b/tests/libobj2.test
@@ -23,6 +23,7 @@
 cat >> configure.in << 'END'
 AC_CONFIG_FILES([subdir/Makefile])
 AC_PROG_CC
+AM_PROG_AR
 AC_PROG_RANLIB
 AC_CHECK_TOOLS([AR], [ar])
 AC_LIBOBJ([fsusage])
@@ -54,7 +55,7 @@ END
 
 $ACLOCAL
 $AUTOCONF
-$AUTOMAKE
+$AUTOMAKE -a
 
 # Older grepping check, kept "just to be sure".
 $FGREP 'fsusage.c' subdir/Makefile.in
diff --git a/tests/libobj20a.test b/tests/libobj20a.test
index 2f90c84..b2f7063 100755
--- a/tests/libobj20a.test
+++ b/tests/libobj20a.test
@@ -22,6 +22,7 @@
 cat >> configure.in << 'END'
 AC_CONFIG_LIBOBJ_DIR([libobj-dir])
 AC_PROG_CC
+AM_PROG_AR
 AC_PROG_RANLIB
 AC_LIBOBJ([foo])
 END
@@ -34,6 +35,7 @@ END
 
 mkdir libobj-dir
 : > libobj-dir/foo.c
+: > ar-lib
 
 $ACLOCAL
 AUTOMAKE_fails
diff --git a/tests/libobj20b.test b/tests/libobj20b.test
index d130a8a..374c8d9 100755
--- a/tests/libobj20b.test
+++ b/tests/libobj20b.test
@@ -22,6 +22,7 @@
 cat >> configure.in << 'END'
 AC_CONFIG_LIBOBJ_DIR([libobj-dir])
 AC_PROG_CC
+AM_PROG_AR
 AC_PROG_RANLIB
 AC_LIBSOURCE([foobar.c])
 # NOTE: this call to AC_OUTPUT is really needed; see Automake bug #7635
@@ -36,6 +37,8 @@ libtu_a_SOURCES =
 libtu_a_LIBADD = $(LIBOBJS)
 END
 
+: > ar-lib
+
 $ACLOCAL
 
 AUTOMAKE_fails
diff --git a/tests/libobj20c.test b/tests/libobj20c.test
index 1fb1f9d..c4d9a12 100755
--- a/tests/libobj20c.test
+++ b/tests/libobj20c.test
@@ -35,6 +35,9 @@ END
 
 $ACLOCAL
 
+# Don't trip on errors due to missing `AM_PROG_AR'.
+AUTOMAKE="$AUTOMAKE -Wno-extra-portability"
+
 AUTOMAKE_fails
 grep 'configure\.in:.*required directory.*\./libobj-dir' stderr
 
diff --git a/tests/libobj7.test b/tests/libobj7.test
index b7556b7..14b0571 100755
--- a/tests/libobj7.test
+++ b/tests/libobj7.test
@@ -21,6 +21,7 @@
 
 cat >> configure.in << 'END'
 AC_PROG_CC
+AM_PROG_AR
 AC_PROG_RANLIB
 # `am__dummy_function' is there to ensure that at least one function is
 # replaced, to avoid creating an empty archive which can cause problems
@@ -60,7 +61,7 @@ END
 
 $ACLOCAL
 $AUTOCONF
-$AUTOMAKE
+$AUTOMAKE --add-missing
 
 ./configure
 
diff --git a/tests/library.test b/tests/library.test
index e3a9813..8ad40f1 100755
--- a/tests/library.test
+++ b/tests/library.test
@@ -23,6 +23,7 @@ cat >> configure.in << 'END'
 AC_PROG_RANLIB
 AM_MAINTAINER_MODE
 AC_PROG_CC
+AM_PROG_AR
 END
 
 cat > Makefile.am << 'END'
@@ -31,6 +32,7 @@ lib_LIBRARIES = libfoo.a
 libfoo_a_DEPENDENCIES = libzot.a
 END
 
+: > ar-lib
 $ACLOCAL
 $AUTOMAKE
 
diff --git a/tests/libtoo10.test b/tests/libtoo10.test
index 72310bb..4f1a60e 100755
--- a/tests/libtoo10.test
+++ b/tests/libtoo10.test
@@ -20,6 +20,7 @@
 required=libtoolize
 . ./defs || Exit 1
 cat >> configure.in << 'END'
+AM_PROG_AR
 AC_PROG_LIBTOOL
 AC_OUTPUT
 END
diff --git a/tests/libtool2.test b/tests/libtool2.test
index 6e268dd..f2fe1af 100755
--- a/tests/libtool2.test
+++ b/tests/libtool2.test
@@ -22,6 +22,7 @@ required=libtoolize
 
 cat >> configure.in << 'END'
 AC_PROG_CC
+AM_PROG_AR
 AC_PROG_LIBTOOL
 AC_CONFIG_FILES([sub/Makefile])
 AC_OUTPUT
diff --git a/tests/libtool3.test b/tests/libtool3.test
index 3a6a40e..dd8a67b 100755
--- a/tests/libtool3.test
+++ b/tests/libtool3.test
@@ -22,6 +22,7 @@ required='libtoolize gcc'
 
 cat >> configure.in << 'END'
 AC_PROG_CC
+AM_PROG_AR
 AM_PROG_LIBTOOL
 AC_OUTPUT
 END
diff --git a/tests/libtool5.test b/tests/libtool5.test
index 4bec20d..23cf062 100755
--- a/tests/libtool5.test
+++ b/tests/libtool5.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/libtool6.test b/tests/libtool6.test
index a17e4ee..c4ae469 100755
--- a/tests/libtool6.test
+++ b/tests/libtool6.test
@@ -24,6 +24,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 9700628..9cba6d1 100755
--- a/tests/libtool7.test
+++ b/tests/libtool7.test
@@ -22,6 +22,7 @@ required='libtoolize gcc'
 
 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 d539dc4..3aefcf8 100755
--- a/tests/libtool8.test
+++ b/tests/libtool8.test
@@ -23,6 +23,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 46009c1..b5ce709 100755
--- a/tests/libtool9.test
+++ b/tests/libtool9.test
@@ -24,6 +24,7 @@ required='libtoolize gcc'
 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/listval.test b/tests/listval.test
index 677fe3f..6bd933d 100755
--- a/tests/listval.test
+++ b/tests/listval.test
@@ -23,6 +23,7 @@ required=libtool
 
 cat >> configure.in << 'END'
 AC_SUBST([LTLIBOBJS])
+AM_PROG_AR
 AC_PROG_LIBTOOL
 END
 
@@ -36,6 +37,7 @@ END
 
 : > ltconfig
 : > ltmain.sh
+: > ar-lib
 : > config.guess
 : > config.sub
 
diff --git a/tests/location.test b/tests/location.test
index 9013e31..7eb6549 100755
--- a/tests/location.test
+++ b/tests/location.test
@@ -22,6 +22,7 @@ cat >> configure.in << 'END'
 AM_CONDITIONAL([COND1], [true])
 AM_CONDITIONAL([COND2], [true])
 AC_PROG_CC
+AM_PROG_AR
 AC_PROG_RANLIB
 END
 
@@ -42,6 +43,8 @@ VAR = 1 \
       3
 END
 
+: > ar-lib
+
 $ACLOCAL
 AUTOMAKE_fails -Wno-error
 
diff --git a/tests/ltcond.test b/tests/ltcond.test
index 8ede51b..35b954e 100755
--- a/tests/ltcond.test
+++ b/tests/ltcond.test
@@ -25,6 +25,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 d4bf064..95b985a 100755
--- a/tests/ltcond2.test
+++ b/tests/ltcond2.test
@@ -21,6 +21,7 @@ required='libtoolize gcc'
 
 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 2ea2705..afd2716 100755
--- a/tests/ltconv.test
+++ b/tests/ltconv.test
@@ -22,6 +22,7 @@ required='libtoolize gcc'
 
 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 3c41ec3..8f47402 100755
--- a/tests/ltdeps.test
+++ b/tests/ltdeps.test
@@ -20,6 +20,7 @@ required=libtool
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
+AM_PROG_AR
 AC_PROG_LIBTOOL
 AC_PROG_CXX
 AM_CONDITIONAL(HACKING_COMPACT_BUILD, whatever)
@@ -49,6 +50,7 @@ END
 
 : > ltconfig
 : > ltmain.sh
+: > ar-lib
 : > config.guess
 : > config.sub
 
diff --git a/tests/ltinit.test b/tests/ltinit.test
index 42c3913..7b32430 100755
--- a/tests/ltinit.test
+++ b/tests/ltinit.test
@@ -23,6 +23,7 @@ required='libtoolize'
 
 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 dd1c5d6..506ae8d 100755
--- a/tests/ltinstloc.test
+++ b/tests/ltinstloc.test
@@ -22,6 +22,7 @@ required='libtoolize'
 
 cat >>configure.in <<'END'
 AC_PROG_CC
+AM_PROG_AR
 AC_PROG_LIBTOOL
 AM_CONDITIONAL([COND], [:])
 AC_OUTPUT
@@ -44,7 +45,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: error: sub/liba2.la multiply defined in condition COND
diff --git a/tests/ltlibobjs.test b/tests/ltlibobjs.test
index 9a3d830..e430cdd 100755
--- a/tests/ltlibobjs.test
+++ b/tests/ltlibobjs.test
@@ -22,6 +22,7 @@ required=libtool
 
 cat >> configure.in << 'END'
 AC_SUBST([LTLIBOBJS])
+AM_PROG_AR
 AC_PROG_LIBTOOL
 END
 
@@ -33,6 +34,7 @@ END
 
 : > ltconfig
 : > ltmain.sh
+: > ar-lib
 : > config.guess
 : > config.sub
 
diff --git a/tests/ltlibsrc.test b/tests/ltlibsrc.test
index 78ac8e2..1cdf06a 100755
--- a/tests/ltlibsrc.test
+++ b/tests/ltlibsrc.test
@@ -21,6 +21,7 @@ required='libtool gcc'
 
 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 c411341..d249596 100755
--- a/tests/ltorder.test
+++ b/tests/ltorder.test
@@ -21,6 +21,7 @@ required='libtoolize'
 
 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 e2ab6f3..f8021eb 100755
--- a/tests/multlib.test
+++ b/tests/multlib.test
@@ -65,6 +65,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])
@@ -88,6 +89,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 15d1b49..3a5a713 100755
--- a/tests/nobase-libtool.test
+++ b/tests/nobase-libtool.test
@@ -24,6 +24,7 @@ required='libtoolize gcc'
 
 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 2fa9a60..fd2fe28 100755
--- a/tests/nobase.test
+++ b/tests/nobase.test
@@ -22,6 +22,7 @@ required='gcc'
 
 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 92f59ff..329990e 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
 $AUTOMAKE
 
diff --git a/tests/posixsubst-ldadd.test b/tests/posixsubst-ldadd.test
index a418fc2..e3aef7a 100755
--- a/tests/posixsubst-ldadd.test
+++ b/tests/posixsubst-ldadd.test
@@ -22,6 +22,7 @@
 cat >> configure.in << 'END'
 AC_PROG_CC
 AC_PROG_RANLIB
+AM_PROG_AR
 AC_OUTPUT
 END
 
@@ -66,7 +67,7 @@ echo 'int quux3(void) { return 0; }' > libquux3.c
 
 $ACLOCAL
 $AUTOCONF
-$AUTOMAKE
+$AUTOMAKE -a
 
 ./configure
 $MAKE
diff --git a/tests/posixsubst-libraries.test b/tests/posixsubst-libraries.test
index 418d241..a5719bf 100755
--- a/tests/posixsubst-libraries.test
+++ b/tests/posixsubst-libraries.test
@@ -23,6 +23,7 @@
 cat >> configure.in << 'END'
 AC_PROG_CC
 AC_PROG_RANLIB
+AM_PROG_AR
 AC_OUTPUT
 END
 
@@ -50,7 +51,7 @@ echo 'int bar2(void) { return 0; }' > libfoo2.c
 
 $ACLOCAL
 $AUTOCONF
-$AUTOMAKE
+$AUTOMAKE -a
 
 cwd=`pwd` || Exit 1
 ./configure --prefix="$cwd/_inst"
diff --git a/tests/posixsubst-ltlibraries.test 
b/tests/posixsubst-ltlibraries.test
index e95023c..e3b3d03 100755
--- a/tests/posixsubst-ltlibraries.test
+++ b/tests/posixsubst-ltlibraries.test
@@ -23,6 +23,7 @@ required='libtool libtoolize'
 
 cat >> configure.in << 'END'
 AC_PROG_CC
+AM_PROG_AR
 AC_PROG_LIBTOOL
 AC_OUTPUT
 END
diff --git a/tests/pr300-lib.test b/tests/pr300-lib.test
index 530f6c4..8e2568c 100755
--- a/tests/pr300-lib.test
+++ b/tests/pr300-lib.test
@@ -43,7 +43,7 @@ END
 
 $ACLOCAL
 $AUTOCONF
-$AUTOMAKE --copy --add-missing
+$AUTOMAKE -Wno-extra-portability --copy --add-missing
 
 ./configure --prefix "`pwd`/inst"
 
diff --git a/tests/pr300-ltlib.test b/tests/pr300-ltlib.test
index 1b36136..35038d6 100755
--- a/tests/pr300-ltlib.test
+++ b/tests/pr300-ltlib.test
@@ -45,7 +45,7 @@ END
 libtoolize
 $ACLOCAL
 $AUTOCONF
-$AUTOMAKE --copy --add-missing
+$AUTOMAKE -Wno-extra-portability --copy --add-missing
 
 ./configure --prefix "`pwd`/inst"
 
diff --git a/tests/pr307.test b/tests/pr307.test
index 3db9f85..f1ab9a9 100755
--- a/tests/pr307.test
+++ b/tests/pr307.test
@@ -66,7 +66,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 35511a2..4cd05fd 100755
--- a/tests/pr401.test
+++ b/tests/pr401.test
@@ -80,7 +80,7 @@ EOF
 
 $ACLOCAL
 $AUTOCONF
-$AUTOMAKE
+$AUTOMAKE -Wno-extra-portability
 ./configure
 $MAKE distcheck
 
@@ -96,7 +96,7 @@ mv -f configure.int configure.in
 
 $ACLOCAL
 $AUTOCONF
-$AUTOMAKE
+$AUTOMAKE -Wno-extra-portability
 ./configure
 test ! -d lib/lib
 $MAKE distcheck
@@ -107,7 +107,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
 
@@ -138,7 +138,7 @@ EOF
 
 $ACLOCAL
 $AUTOCONF
-$AUTOMAKE --add-missing
+$AUTOMAKE -Wno-extra-portability --add-missing
 ./configure
 test ! -d src/lib
 test ! -d 'src/$(top_builddir)'
@@ -175,7 +175,7 @@ EOF
 
 $ACLOCAL
 $AUTOCONF
-$AUTOMAKE
+$AUTOMAKE -Wno-extra-portability
 ./configure
 $MAKE distcheck
 
diff --git a/tests/pr401b.test b/tests/pr401b.test
index 3997bc4..ed0d1f3 100755
--- a/tests/pr401b.test
+++ b/tests/pr401b.test
@@ -81,7 +81,7 @@ EOF
 libtoolize
 $ACLOCAL
 $AUTOCONF
-$AUTOMAKE -a
+$AUTOMAKE -Wno-extra-portability -a
 ./configure
 $MAKE distcheck
 
@@ -98,7 +98,7 @@ mv -f configure.int configure.in
 
 $ACLOCAL
 $AUTOCONF
-$AUTOMAKE -a
+$AUTOMAKE -Wno-extra-portability -a
 ./configure
 test ! -d lib/lib
 $MAKE distcheck
@@ -109,7 +109,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
 
@@ -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/pr401c.test b/tests/pr401c.test
index 960de83..e8dd9bc 100755
--- a/tests/pr401c.test
+++ b/tests/pr401c.test
@@ -82,7 +82,7 @@ EOF
 
 $ACLOCAL
 $AUTOCONF
-$AUTOMAKE
+$AUTOMAKE -Wno-extra-portability
 ./configure
 $MAKE distcheck
 
@@ -99,7 +99,7 @@ mv -f configure.int configure.in
 
 $ACLOCAL
 $AUTOCONF
-$AUTOMAKE
+$AUTOMAKE -Wno-extra-portability
 ./configure
 test ! -d lib/lib
 $MAKE distcheck
@@ -110,7 +110,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
 
@@ -141,7 +141,7 @@ EOF
 
 $ACLOCAL
 $AUTOCONF
-$AUTOMAKE --add-missing
+$AUTOMAKE -Wno-extra-portability --add-missing
 ./configure
 $MAKE
 test ! -d src/lib
@@ -178,7 +178,7 @@ EOF
 
 $ACLOCAL
 $AUTOCONF
-$AUTOMAKE
+$AUTOMAKE -Wno-extra-portability
 ./configure
 $MAKE distcheck
 
diff --git a/tests/pr72.test b/tests/pr72.test
index 8c52d2d..20db128 100755
--- a/tests/pr72.test
+++ b/tests/pr72.test
@@ -38,7 +38,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 88e0817..16e9f43 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 36ff5d8..13520f2 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/python-virtualenv.test b/tests/python-virtualenv.test
index 11055b0..87a0839 100755
--- a/tests/python-virtualenv.test
+++ b/tests/python-virtualenv.test
@@ -43,6 +43,7 @@ AM_INIT_AUTOMAKE
 AC_CONFIG_FILES([Makefile])
 AC_SUBST([MY_VIRTENV], ['$cwd/virtenv'])
 AC_PROG_CC
+AM_PROG_AR
 AC_PROG_RANLIB
 AM_PATH_PYTHON
 AC_OUTPUT
diff --git a/tests/silent3.test b/tests/silent3.test
index c0a9192..cb20b28 100755
--- a/tests/silent3.test
+++ b/tests/silent3.test
@@ -27,6 +27,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 06a02ef..9618791 100755
--- a/tests/silent4.test
+++ b/tests/silent4.test
@@ -28,6 +28,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 cb62136..c9f6923 100755
--- a/tests/silent9.test
+++ b/tests/silent9.test
@@ -28,6 +28,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 0f4f33a..ce71b68 100755
--- a/tests/specflg-dummy.test
+++ b/tests/specflg-dummy.test
@@ -59,6 +59,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 1c4d69a..e246a2b 100755
--- a/tests/specflg2.test
+++ b/tests/specflg2.test
@@ -23,6 +23,7 @@ cat >> configure.in << 'END'
 AC_PROG_CC
 AM_PROG_CC_C_O
 AC_PROG_CXX
+AM_PROG_AR
 AC_PROG_RANLIB
 END
 
@@ -34,6 +35,8 @@ libfoo_a_CFLAGS = -DBAR
 libfoo_a_CXXFLAGS = -DZOT
 END
 
+: > ar-lib
+
 # Make sure `compile' is required.
 $ACLOCAL
 AUTOMAKE_fails
diff --git a/tests/stdlib2.test b/tests/stdlib2.test
index b23e540..7ee99e2 100755
--- a/tests/stdlib2.test
+++ b/tests/stdlib2.test
@@ -30,6 +30,7 @@ required=libtool
 
 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 01f66f1..ea4b3a6 100755
--- a/tests/strip2.test
+++ b/tests/strip2.test
@@ -22,6 +22,7 @@ required=strip
 
 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 5f6f163..31e04e8 100755
--- a/tests/strip3.test
+++ b/tests/strip3.test
@@ -22,6 +22,7 @@ required='libtoolize strip'
 
 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 5dd5161..a298415 100755
--- a/tests/subdir4.test
+++ b/tests/subdir4.test
@@ -25,6 +25,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
@@ -55,6 +56,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 18cacd9..63a6d26 100755
--- a/tests/subdirbuiltsources.test
+++ b/tests/subdirbuiltsources.test
@@ -26,6 +26,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 227e34d..7d06ad5 100755
--- a/tests/subobj10.test
+++ b/tests/subobj10.test
@@ -24,6 +24,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 a910d22..9b24445 100755
--- a/tests/subobj9.test
+++ b/tests/subobj9.test
@@ -24,6 +24,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 a529867..879bffe 100755
--- a/tests/subpkg.test
+++ b/tests/subpkg.test
@@ -65,6 +65,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 c1b2dfc..e64efdb 100755
--- a/tests/subst3.test
+++ b/tests/subst3.test
@@ -22,6 +22,7 @@ required='gcc'
 
 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 ad94e3e..f0d5aad 100755
--- a/tests/substtarg.test
+++ b/tests/substtarg.test
@@ -23,6 +23,7 @@
 cat >> configure.in << 'END'
 AC_CONFIG_SOURCE([fakelib.c])
 AC_PROG_CC
+AM_PROG_AR
 RANLIB=:
 AC_SUBST([RANLIB])
 SUBST=hei
@@ -40,6 +41,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/suffix.test b/tests/suffix.test
index bb8b82e..3701b0c 100755
--- a/tests/suffix.test
+++ b/tests/suffix.test
@@ -31,16 +31,28 @@ noinst_PROGRAMS = foo
 noinst_LIBRARIES = libbar.a
 END
 
-$ACLOCAL
+for use_arlib in false :; do
 
-$AUTOMAKE -i
-grep '^ *\.c' Makefile.in # for debugging
-test `grep -c '^\.c\.o:' Makefile.in` -eq 1
-test `grep -c '^\.c\.obj:' Makefile.in` -eq 1
+  if $use_arlib; then
+    am_warns=
+    echo AM_PROG_AR >> configure.in
+    : > ar-lib
+  else
+    am_warns=-Wno-extra-portability
+  fi
 
-$AUTOMAKE
-grep '^ *\.c' Makefile.in # for debugging
-test `grep -c '^\.c\.o:' Makefile.in` -eq 1
-test `grep -c '^\.c\.obj:' Makefile.in` -eq 1
+  $ACLOCAL --force
+
+  $AUTOMAKE $am_warns -i
+  grep '^ *\.c' Makefile.in # for debugging
+  test `grep -c '^\.c\.o:' Makefile.in` -eq 1
+  test `grep -c '^\.c\.obj:' Makefile.in` -eq 1
+
+  $AUTOMAKE $am_warns
+  grep '^ *\.c' Makefile.in # for debugging
+  test `grep -c '^\.c\.o:' Makefile.in` -eq 1
+  test `grep -c '^\.c\.obj:' Makefile.in` -eq 1
+
+done
 
 :
diff --git a/tests/suffix10.test b/tests/suffix10.test
index 091ca9f..b4e8eb0 100755
--- a/tests/suffix10.test
+++ b/tests/suffix10.test
@@ -23,6 +23,7 @@ required='libtoolize yacc'
 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 b1212a8..434077b 100755
--- a/tests/suffix2.test
+++ b/tests/suffix2.test
@@ -24,6 +24,7 @@ required=libtoolize
 
 cat >> configure.in << 'END'
 AC_PROG_CC
+AM_PROG_AR
 AC_PROG_LIBTOOL
 END
 
@@ -41,12 +42,12 @@ END
 
 $ACLOCAL
 
-$AUTOMAKE -i
+$AUTOMAKE -a
 grep '^ *\.c' Makefile.in # for debugging
 test `grep -c '^\.c\.o:' Makefile.in` -eq 1
 test `grep -c '^\.c\.obj:' Makefile.in` -eq 1
 
-$AUTOMAKE
+$AUTOMAKE -i
 grep '^ *\.c' Makefile.in # for debugging
 test `grep -c '^\.c\.o:' Makefile.in` -eq 1
 test `grep -c '^\.c\.obj:' Makefile.in` -eq 1
diff --git a/tests/suffix5.test b/tests/suffix5.test
index 60417e4..48e9059 100755
--- a/tests/suffix5.test
+++ b/tests/suffix5.test
@@ -23,6 +23,7 @@ required=libtool
 
 cat >> configure.in << 'END'
 AC_SUBST([LINK], [:])
+AM_PROG_AR
 AC_PROG_LIBTOOL
 AC_OUTPUT
 END
@@ -45,7 +46,11 @@ END
 
 : > ltmain.sh
 
-cp "$testsrcdir/../lib/config.guess" "$testsrcdir/../lib/config.sub" .
+# FIXME: better support for installcheck.
+for auxscript in ar-lib config.guess config.sub; do
+  cp "$top_testsrcdir/lib/$auxscript" . \
+    || fatal_ "fetching auxiliary script \`$auxscript'"
+done
 
 $ACLOCAL
 $AUTOMAKE
diff --git a/tests/suffix8.test b/tests/suffix8.test
index 99582d7..8a29b8b 100755
--- a/tests/suffix8.test
+++ b/tests/suffix8.test
@@ -22,6 +22,7 @@ required=libtoolize
 . ./defs || Exit 1
 
 cat >>configure.in <<'END'
+AM_PROG_AR
 AM_PROG_LIBTOOL
 AC_OUTPUT
 END
diff --git a/tests/vala.test b/tests/vala.test
index 3e1ef65..6954dbd 100755
--- a/tests/vala.test
+++ b/tests/vala.test
@@ -26,6 +26,7 @@ required="libtool"
 
 cat >> 'configure.in' << 'END'
 AC_PROG_CC
+AM_PROG_AR
 AC_PROG_LIBTOOL
 AM_PROG_VALAC
 AC_OUTPUT
diff --git a/tests/vala1.test b/tests/vala1.test
index 5030f72..7eb8d71 100755
--- a/tests/vala1.test
+++ b/tests/vala1.test
@@ -27,6 +27,7 @@ required="libtool"
 
 cat >> 'configure.in' << 'END'
 AC_PROG_CC
+AM_PROG_AR
 AC_PROG_LIBTOOL
 AM_PROG_VALAC
 AC_OUTPUT
diff --git a/tests/vartypo2.test b/tests/vartypo2.test
index f811bbc..624e86b 100755
--- a/tests/vartypo2.test
+++ b/tests/vartypo2.test
@@ -21,6 +21,7 @@ required=libtoolize
 . ./defs || Exit 1
 
 cat >>configure.in <<'END'
+AM_PROG_AR
 AC_PROG_LIBTOOL
 AC_OUTPUT
 END
diff --git a/tests/vartypos.test b/tests/vartypos.test
index 03747ed..cd8f718 100755
--- a/tests/vartypos.test
+++ b/tests/vartypos.test
@@ -41,7 +41,7 @@ EXTRA_libfoo_a_DEPENDENCIES = unused
 END
 
 $ACLOCAL
-AUTOMAKE_fails
+AUTOMAKE_fails -Wno-extra-portability
 # The expected diagnostic is:
 # automake: warnings are treated as errors
 # Makefile.am:2: warning: variable `nodist_foo_SOURCES' is defined but no 
program or
@@ -84,6 +84,6 @@ bin_PROGRAMS = foo
 lib_LIBRARIES = libfoo.a
 END
 
-$AUTOMAKE
+$AUTOMAKE -Wno-extra-portability
 
 :


hooks/post-receive
-- 
GNU Automake



reply via email to

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