summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefano Lattarini <stefano.lattarini@gmail.com>2011-11-03 13:50:06 +0100
committerStefano Lattarini <stefano.lattarini@gmail.com>2011-11-03 14:36:42 +0100
commit38e1b39d77ad4a22c85d5ad7b2fde4fd51bfd1b5 (patch)
tree66c54e66ce86b30d8225294e68ce6a84669e9ab4
parenta778e9e1dcf606c9cee31009c982daa748438b39 (diff)
parent2270535f37084e0e2febed21cd808da75b0f3451 (diff)
downloadautomake-38e1b39d77ad4a22c85d5ad7b2fde4fd51bfd1b5.tar.gz
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.
-rw-r--r--ChangeLog147
-rw-r--r--NEWS8
-rw-r--r--automake.in22
-rw-r--r--doc/automake.texi33
-rw-r--r--lib/Automake/ChannelDefs.pm13
-rw-r--r--m4/Makefile.am1
-rw-r--r--m4/Makefile.in1
-rw-r--r--m4/ar-lib.m458
-rw-r--r--tests/Makefile.am13
-rw-r--r--tests/Makefile.in13
-rwxr-xr-xtests/aclocal4.test3
-rwxr-xr-xtests/ar-lib2.test40
-rwxr-xr-xtests/ar-lib3.test45
-rwxr-xr-xtests/ar-lib4.test57
-rwxr-xr-xtests/ar-lib5a.test75
-rwxr-xr-xtests/ar-lib5b.test99
-rwxr-xr-xtests/ar-lib6a.test39
-rwxr-xr-xtests/ar-lib6b.test39
-rwxr-xr-xtests/ar-lib7.test36
-rwxr-xr-xtests/ar.test3
-rwxr-xr-xtests/ar2.test2
-rwxr-xr-xtests/ar3.test43
-rwxr-xr-xtests/ar4.test35
-rwxr-xr-xtests/ar5.test33
-rwxr-xr-xtests/canon4.test3
-rwxr-xr-xtests/canon6.test2
-rwxr-xr-xtests/canon7.test1
-rwxr-xr-xtests/compile4.test1
-rwxr-xr-xtests/cond13.test3
-rwxr-xr-xtests/condlib.test3
-rw-r--r--tests/defs8
-rwxr-xr-xtests/depcomp4.test1
-rwxr-xr-xtests/depcomp6.test1
-rwxr-xr-xtests/depcomp7.test1
-rwxr-xr-xtests/depcomp8b.test1
-rwxr-xr-xtests/extra-portability.test69
-rwxr-xr-xtests/extra-portability2.test52
-rwxr-xr-xtests/extra9.test3
-rwxr-xr-xtests/extradep.test1
-rwxr-xr-xtests/extradep2.test1
-rwxr-xr-xtests/fort5.test1
-rwxr-xr-xtests/instdir-ltlib.test1
-rwxr-xr-xtests/instdir-prog.test1
-rwxr-xr-xtests/instfail-libtool.test1
-rwxr-xr-xtests/instfail.test1
-rwxr-xr-xtests/instspc-tests.sh1
-rwxr-xr-xtests/ldflags.test2
-rwxr-xr-xtests/libobj-basic.test4
-rwxr-xr-xtests/libobj10.test3
-rwxr-xr-xtests/libobj12.test2
-rwxr-xr-xtests/libobj13.test1
-rwxr-xr-xtests/libobj15a.test3
-rwxr-xr-xtests/libobj15b.test3
-rwxr-xr-xtests/libobj15c.test3
-rwxr-xr-xtests/libobj16a.test3
-rwxr-xr-xtests/libobj16b.test4
-rwxr-xr-xtests/libobj17.test3
-rwxr-xr-xtests/libobj18.test1
-rwxr-xr-xtests/libobj19.test4
-rwxr-xr-xtests/libobj2.test3
-rwxr-xr-xtests/libobj20a.test2
-rwxr-xr-xtests/libobj20b.test3
-rwxr-xr-xtests/libobj20c.test3
-rwxr-xr-xtests/libobj7.test3
-rwxr-xr-xtests/library.test2
-rwxr-xr-xtests/libtoo10.test1
-rwxr-xr-xtests/libtool2.test1
-rwxr-xr-xtests/libtool3.test1
-rwxr-xr-xtests/libtool5.test1
-rwxr-xr-xtests/libtool6.test1
-rwxr-xr-xtests/libtool7.test1
-rwxr-xr-xtests/libtool8.test1
-rwxr-xr-xtests/libtool9.test1
-rwxr-xr-xtests/listval.test2
-rwxr-xr-xtests/location.test3
-rwxr-xr-xtests/ltcond.test1
-rwxr-xr-xtests/ltcond2.test1
-rwxr-xr-xtests/ltconv.test1
-rwxr-xr-xtests/ltdeps.test2
-rwxr-xr-xtests/ltinit.test1
-rwxr-xr-xtests/ltinstloc.test3
-rwxr-xr-xtests/ltlibobjs.test2
-rwxr-xr-xtests/ltlibsrc.test1
-rwxr-xr-xtests/ltorder.test1
-rwxr-xr-xtests/multlib.test2
-rwxr-xr-xtests/nobase-libtool.test1
-rwxr-xr-xtests/nobase.test1
-rwxr-xr-xtests/noinstdir.test3
-rwxr-xr-xtests/posixsubst-ldadd.test3
-rwxr-xr-xtests/posixsubst-libraries.test3
-rwxr-xr-xtests/posixsubst-ltlibraries.test1
-rwxr-xr-xtests/pr300-lib.test2
-rwxr-xr-xtests/pr300-ltlib.test2
-rwxr-xr-xtests/pr307.test2
-rwxr-xr-xtests/pr401.test10
-rwxr-xr-xtests/pr401b.test10
-rwxr-xr-xtests/pr401c.test10
-rwxr-xr-xtests/pr72.test2
-rwxr-xr-xtests/primary-prefix-couples-documented-valid.test1
-rwxr-xr-xtests/primary-prefix-couples-force-valid.test3
-rwxr-xr-xtests/primary-prefix-invalid-couples.test2
-rwxr-xr-xtests/primary-prefix-valid-couples.test2
-rwxr-xr-xtests/python-virtualenv.test1
-rwxr-xr-xtests/silent3.test1
-rwxr-xr-xtests/silent4.test1
-rwxr-xr-xtests/silent9.test1
-rwxr-xr-xtests/specflg-dummy.test1
-rwxr-xr-xtests/specflg2.test3
-rwxr-xr-xtests/stdlib2.test1
-rwxr-xr-xtests/strip2.test1
-rwxr-xr-xtests/strip3.test1
-rwxr-xr-xtests/subdir4.test3
-rwxr-xr-xtests/subdirbuiltsources.test1
-rwxr-xr-xtests/subobj10.test1
-rwxr-xr-xtests/subobj9.test1
-rwxr-xr-xtests/subpkg-yacc.test1
-rwxr-xr-xtests/subpkg.test1
-rwxr-xr-xtests/subst3.test1
-rwxr-xr-xtests/substtarg.test3
-rwxr-xr-xtests/suffix.test30
-rwxr-xr-xtests/suffix10.test1
-rwxr-xr-xtests/suffix2.test5
-rwxr-xr-xtests/suffix5.test7
-rwxr-xr-xtests/suffix8.test1
-rwxr-xr-xtests/vala.test1
-rwxr-xr-xtests/vala1.test1
-rwxr-xr-xtests/vartypo2.test1
-rwxr-xr-xtests/vartypos.test4
128 files changed, 1176 insertions, 51 deletions
diff --git a/ChangeLog b/ChangeLog
index 051e7fa5f..b79cae064 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,127 @@
+2011-11-03 Stefano Lattarini <stefano.lattarini@gmail.com>
+
+ 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 <peda@lysator.liu.se>
+
+ 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 <peda@lysator.liu.se>
+ Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+ Stefano Lattarini <stefano.lattarini@gmail.com>
+
+ 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 <zackw@panix.com> (tiny change)
Stefano Lattarini <stefano.lattarini@gmail.com>
@@ -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 <stefano.lattarini@gmail.com>
+
+ 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 <peda@lysator.liu.se>
+
+ 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 <stefano.lattarini@gmail.com>
dejagnu: allow the package developer to extend site.exp
diff --git a/NEWS b/NEWS
index 3852abfab..6c548d1f7 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 cbbdd5308..0b6d014f4 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 378b82f48..ad04ad946 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)
+@item 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.
+@c 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
+@samp{portability}. 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).
+@item AM_PROG_AR(@ovar{act-if-fail})
+@acindex AM_PROG_AR
+@vindex 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
-@code{RANLIB} (Automake will complain otherwise). @code{AR} and
-@code{ARFLAGS} default to @code{ar} and @code{cru} respectively; you
-can override these two variables my setting them in your
-@file{Makefile.am}, by @code{AC_SUBST}ing them from your
-@file{configure.ac}, or by defining a per-library @code{maude_AR}
-variable (@pxref{Program and Library Variables}).
+@code{RANLIB} (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
+@code{cru}; you can override this variable by setting it in your
+@file{Makefile.am} or by @code{AC_SUBST}ing it from your
+@file{configure.ac}. 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 470e6c72a..de3970ca2 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 143df71f0..eebf04e27 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 8bc9b701c..97654404c 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 000000000..822ca6085
--- /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 d900b41b9..b5ad95a10 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 e1f91d039..babba97f3 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 e18684b7c..10b208034 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/ar-lib2.test b/tests/ar-lib2.test
new file mode 100755
index 000000000..67a64e958
--- /dev/null
+++ b/tests/ar-lib2.test
@@ -0,0 +1,40 @@
+#! /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 installs ar-lib.
+
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_PROG_CC
+AM_PROG_AR
+END
+
+cat > Makefile.am << 'END'
+bin_PROGRAMS = wish
+wish_SOURCES = a.c
+END
+
+$ACLOCAL
+$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/ar-lib3.test b/tests/ar-lib3.test
new file mode 100755
index 000000000..6bcf6c263
--- /dev/null
+++ b/tests/ar-lib3.test
@@ -0,0 +1,45 @@
+#! /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 lib_LIBRARIES requests AM_PROG_AR.
+
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_PROG_CC
+AC_PROG_RANLIB
+END
+
+cat > Makefile.am << 'END'
+lib_LIBRARIES = libfoo.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 --add-missing
+
+:
diff --git a/tests/ar-lib4.test b/tests/ar-lib4.test
new file mode 100755
index 000000000..e05a8c2f9
--- /dev/null
+++ b/tests/ar-lib4.test
@@ -0,0 +1,57 @@
+#! /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 lib_LTLIBRARIES requests AM_PROG_AR.
+
+required=libtoolize
+. ./defs || Exit 1
+
+set -e
+
+cp configure.in X
+
+cat >> configure.in << 'END'
+AC_PROG_CC
+AC_PROG_RANLIB
+AC_PROG_LIBTOOL
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+lib_LTLIBRARIES = libfoo.la
+libfoo_la_SOURCES = foo.c
+END
+
+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
+$AUTOMAKE --add-missing
+
+:
diff --git a/tests/ar-lib5a.test b/tests/ar-lib5a.test
new file mode 100755
index 000000000..d1de98b32
--- /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 000000000..52deab5fd
--- /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/ar-lib6a.test b/tests/ar-lib6a.test
new file mode 100755
index 000000000..f1b982c3a
--- /dev/null
+++ b/tests/ar-lib6a.test
@@ -0,0 +1,39 @@
+#! /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 AM_PROG_AR ordering requirements
+# Keep this test in sync with sister test `ar-lib6b.test'.
+
+required=libtoolize
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_PROG_CC
+AC_PROG_RANLIB
+m4_ifdef([LT_INIT], [LT_INIT], [AC_PROG_LIBTOOL])
+AM_PROG_AR
+END
+
+libtoolize
+$ACLOCAL
+$AUTOCONF 2>stderr || { cat stderr >&2; Exit 1; }
+cat stderr >&2
+
+$EGREP '(AC_PROG_LIBTOOL|LT_INIT).*before.*AM_PROG_AR' stderr
+
+:
diff --git a/tests/ar-lib6b.test b/tests/ar-lib6b.test
new file mode 100755
index 000000000..5487adde2
--- /dev/null
+++ b/tests/ar-lib6b.test
@@ -0,0 +1,39 @@
+#! /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 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
+AM_PROG_AR
+END
+
+libtoolize
+$ACLOCAL
+$AUTOCONF 2>stderr || { cat stderr >&2; Exit 1; }
+cat stderr >&2
+
+$EGREP 'AC_PROG_LIBTOOL.*before.*AM_PROG_AR' stderr
+
+:
diff --git a/tests/ar-lib7.test b/tests/ar-lib7.test
new file mode 100755
index 000000000..3f758a9ac
--- /dev/null
+++ b/tests/ar-lib7.test
@@ -0,0 +1,36 @@
+#! /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 automake warns if ar-lib is missing when AM_PROG_AR is used.
+
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AM_PROG_AR
+END
+
+:> Makefile.am
+
+$ACLOCAL
+AUTOMAKE_fails
+
+grep '^configure\.in:.*ar-lib.*not found' stderr
+
+$AUTOMAKE --add-missing
+
+:
diff --git a/tests/ar.test b/tests/ar.test
index 4a69c34f4..b0b02a43d 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 a6149496b..289c46920 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/ar3.test b/tests/ar3.test
new file mode 100755
index 000000000..1d5e84ef2
--- /dev/null
+++ b/tests/ar3.test
@@ -0,0 +1,43 @@
+#! /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/>.
+
+# 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
+
+cat > Makefile.am << 'END'
+EXTRA_LIBRARIES = libfoo.a
+libfoo_a_SOURCES = foo.c
+END
+
+: > ar-lib
+
+$ACLOCAL
+$AUTOMAKE
+$EGREP '^ARFLAGS =' Makefile.in
+$EGREP '^AR =' Makefile.in
+
+:
diff --git a/tests/ar4.test b/tests/ar4.test
new file mode 100755
index 000000000..ebd8c576f
--- /dev/null
+++ b/tests/ar4.test
@@ -0,0 +1,35 @@
+#! /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 configure bails out if $AR does not work and AM_PROG_AR is used.
+
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AM_PROG_AR
+END
+
+$ACLOCAL
+$AUTOCONF
+
+./configure AR=/bin/false 2>stderr && { cat stderr >&2; Exit 1; }
+cat stderr >&2
+
+grep 'configure: error: could not determine /bin/false interface' stderr
+
+:
diff --git a/tests/ar5.test b/tests/ar5.test
new file mode 100755
index 000000000..d00f421bd
--- /dev/null
+++ b/tests/ar5.test
@@ -0,0 +1,33 @@
+#! /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 the optional argument of AM_PROG_AR.
+
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AM_PROG_AR([echo spy > bad-archiver-interface-detected])
+END
+
+$ACLOCAL
+$AUTOCONF
+
+./configure AR=/bin/false
+test -f bad-archiver-interface-detected
+
+:
diff --git a/tests/canon4.test b/tests/canon4.test
index 733ea7027..c6b7296dd 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 a24e2eb6f..dd2e44ea0 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 4e700df1e..c399cd5ac 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 cf8d6cb7d..66879a540 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 193b02d40..83c65053a 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 390de753f..58e22b0fe 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 ba4e9cc77..1c9dd908b 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 b995c0836..80c9043d4 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 b937b9fe8..6c6a23afd 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 f404039ea..160ec0bc0 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 c67c3a85b..1cd61a3cd 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 000000000..353141faa
--- /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/extra-portability2.test b/tests/extra-portability2.test
new file mode 100755
index 000000000..9e7212a2d
--- /dev/null
+++ b/tests/extra-portability2.test
@@ -0,0 +1,52 @@
+#! /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/>.
+
+# Make sure that extra-portability warnings are not enabled by --gnits,
+# --gnu and --foreign.
+
+. ./defs || Exit 1
+
+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
+EXTRA_LIBRARIES = libfoo.a
+libfoo_a_SOURCES = foo.c
+END
+
+$ACLOCAL
+
+# 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 1446a4d45..7a9cdaa25 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 623d73a62..636d9b282 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 9a97de4ec..97f485d38 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 c4a4b55ed..ad266a4e4 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 25f68dda3..d02359b79 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 77fc2a04c..0311613b6 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 b580c400e..d4ee994d0 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 d7fa73641..022d71da2 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 2c4089f50..d3824a11f 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 96fb21302..92fb42c08 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 0fe0278c7..f87660ef6 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 f891e85f4..2eabb5c45 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 89b70cfa1..73b1b61f2 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 c572dd45b..0022ea0a1 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 044e3db85..1889d637f 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 4548a2a2a..03415c2fc 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 c39ac996b..603e2ebe1 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 9946bc5b0..a1ae93b60 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 1039558e0..6adfce355 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 4f9db57f9..a570e1284 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 5fba7804f..66188c699 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 bc495b5b5..205bc48c0 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 66ca0d04e..1359bd424 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 2f90c843c..b2f70632a 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 d130a8abe..374c8d932 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 1fb1f9d97..c4d9a12b4 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 b7556b70b..14b0571a8 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 e3a981397..8ad40f1c4 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 72310bb72..4f1a60e5b 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 6e268dd60..f2fe1af32 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 3a6a40eab..dd8a67b4b 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 4bec20d09..23cf0623d 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 a17e4ee8f..c4ae469a0 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 970062862..9cba6d1a7 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 d539dc4f0..3aefcf8ec 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 46009c146..b5ce7099c 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 677fe3f0a..6bd933df6 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 9013e31d9..7eb6549bd 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 8ede51b22..35b954ed7 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 d4bf0647b..95b985ab7 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 2ea2705eb..afd271699 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 3c41ec317..8f4740200 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 42c39138e..7b324308e 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 dd1c5d6fd..506ae8ddd 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 9a3d830b5..e430cdde9 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 78ac8e2f7..1cdf06a64 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 c41134137..d249596c8 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 e2ab6f337..f8021ebfc 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, nobody@localhost)
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 15d1b4994..3a5a71354 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 2fa9a6059..fd2fe2807 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 92f59ffd7..329990e1d 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 a418fc26e..e3aef7a7f 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 418d24175..a5719bfb8 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 e95023c94..e3b3d0307 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 530f6c45a..8e2568c9f 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 1b3613682..35038d6f8 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 3db9f854c..f1ab9a983 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 35511a23a..4cd05fd8f 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 3997bc4b0..ed0d1f35a 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 960de8383..e8dd9bc82 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 8c52d2d80..20db128e3 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 645f318f2..c09e6cab2 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 315ee4ee8..d60ecbf0c 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 88e081729..16e9f4303 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 36ff5d888..13520f2ae 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 11055b0b3..87a0839b6 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 c0a9192cd..cb20b28f8 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 06a02ef94..961879186 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 cb62136e2..c9f69233b 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 0f4f33ad1..ce71b6851 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 1c4d69a4d..e246a2b31 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 b23e540b0..7ee99e20f 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 01f66f186..ea4b3a603 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 5f6f163d3..31e04e8ea 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 5dd516138..a298415f4 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 18cacd91d..63a6d269a 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 227e34d00..7d06ad537 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 a910d22d5..9b24445b9 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 ee8af66f3..011d5c247 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 a529867d5..879bffe16 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 c1b2dfc35..e64efdb94 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 ad94e3e84..f0d5aadea 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 @@ libfake@SUBST@.a: Makefile $(libfake@SUBST@_a_OBJECTS) $(libfake@SUBST@_a_DEPEND
@echo here we do some custom stuff, instead of invoking the linker
END
+: > ar-lib
+
$ACLOCAL
AUTOMAKE_fails
grep 'overrid.*libfake@SUBST@.a' stderr
diff --git a/tests/suffix.test b/tests/suffix.test
index bb8b82ec6..3701b0c38 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 091ca9f95..b4e8eb0f2 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 b1212a8ac..434077b58 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 60417e46e..48e905944 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 99582d764..8a29b8b3f 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 3e1ef65aa..6954dbd4e 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 5030f7232..7eb8d71d3 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 f811bbcb4..624e86bfc 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 03747ed87..cd8f71886 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
: