summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.am19
-rwxr-xr-xtests/aclibobj.test2
-rwxr-xr-xtests/aclocal4.test3
-rwxr-xr-xtests/alloca.test4
-rwxr-xr-xtests/alloca2.test4
-rwxr-xr-xtests/ansi10.test1
-rwxr-xr-xtests/ar-lib.test87
-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.test39
-rwxr-xr-xtests/ar5.test42
-rwxr-xr-xtests/canon4.test3
-rwxr-xr-xtests/compile3.test54
-rwxr-xr-xtests/compile4.test86
-rwxr-xr-xtests/compile5.test81
-rwxr-xr-xtests/compile6.test99
-rwxr-xr-xtests/cond13.test3
-rwxr-xr-xtests/condlib.test3
-rw-r--r--tests/defs.in23
-rwxr-xr-xtests/depcomp4.test1
-rwxr-xr-xtests/depcomp6.test1
-rwxr-xr-xtests/depcomp7.test1
-rwxr-xr-xtests/depcomp8b.test1
-rwxr-xr-xtests/discover.test4
-rwxr-xr-xtests/dollarvar2.test65
-rwxr-xr-xtests/extra-portability.test95
-rwxr-xr-xtests/extra-portability2.test53
-rwxr-xr-xtests/extra-portability3.test63
-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.test1
-rwxr-xr-xtests/ldadd.test7
-rwxr-xr-xtests/ldflags.test2
-rwxr-xr-xtests/libobj10.test3
-rwxr-xr-xtests/libobj11.test2
-rwxr-xr-xtests/libobj12.test2
-rwxr-xr-xtests/libobj13.test1
-rwxr-xr-xtests/libobj2.test2
-rwxr-xr-xtests/libobj3.test6
-rwxr-xr-xtests/libobj7.test2
-rwxr-xr-xtests/libobj8.test2
-rwxr-xr-xtests/library.test3
-rwxr-xr-xtests/library2.test8
-rwxr-xr-xtests/libtoo10.test1
-rwxr-xr-xtests/libtool2.test1
-rwxr-xr-xtests/libtool3.test1
-rwxr-xr-xtests/libtool4.test5
-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/parse.test4
-rwxr-xr-xtests/pluseq7.test9
-rwxr-xr-xtests/pr211.test2
-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/reqd2.test6
-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/stdlib.test25
-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/suffix10.test1
-rwxr-xr-xtests/suffix2.test1
-rwxr-xr-xtests/suffix5.test2
-rwxr-xr-xtests/suffix8.test1
-rwxr-xr-xtests/syntax.test11
-rwxr-xr-xtests/vala.test1
-rwxr-xr-xtests/vala1.test1
118 files changed, 1478 insertions, 53 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 5ac0e4826..b481d1ad8 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -118,8 +118,20 @@ ansi7.test \
ansi8.test \
ansi9.test \
ansi10.test \
+ar-lib.test \
+ar-lib2.test \
+ar-lib3.test \
+ar-lib4.test \
+ar-lib5a.test \
+ar-lib5b.test \
+ar-lib6a.test \
+ar-lib6b.test \
+ar-lib7.test \
ar.test \
ar2.test \
+ar3.test \
+ar4.test \
+ar5.test \
asm.test \
asm2.test \
asm3.test \
@@ -204,6 +216,10 @@ commen11.test \
comments-in-var-def.test \
compile.test \
compile2.test \
+compile3.test \
+compile4.test \
+compile5.test \
+compile6.test \
compile_f90_c_cxx.test \
compile_f_c_cxx.test \
cond.test \
@@ -385,6 +401,9 @@ extra8.test \
extra10.test \
extra11.test \
extra12.test \
+extra-portability.test \
+extra-portability2.test \
+extra-portability3.test \
f90only.test \
flavor.test \
flibs.test \
diff --git a/tests/aclibobj.test b/tests/aclibobj.test
index 6ef6f6bcf..a40baa40d 100755
--- a/tests/aclibobj.test
+++ b/tests/aclibobj.test
@@ -20,6 +20,7 @@
cat >> configure.in << 'END'
AC_PROG_CC
+AM_PROG_AR
AC_PROG_RANLIB
AC_OUTPUT
END
@@ -32,6 +33,7 @@ END
: > maude.c
: > liver.c
+: > ar-lib
$ACLOCAL
diff --git a/tests/aclocal4.test b/tests/aclocal4.test
index 9fa96ece8..eab8ca806 100755
--- a/tests/aclocal4.test
+++ b/tests/aclocal4.test
@@ -25,6 +25,7 @@ set -e
cat >>configure.in <<EOF
AC_PROG_RANLIB
+AM_PROG_AR
AC_PROG_CC
MY_MACRO
AC_CONFIG_FILES([lib/Makefile])
@@ -60,7 +61,7 @@ EOF
$ACLOCAL -I m4
$AUTOCONF
-$AUTOMAKE
+$AUTOMAKE --add-missing
./configure
$MAKE check-not-foo
diff --git a/tests/alloca.test b/tests/alloca.test
index 8a1e06e37..630400215 100755
--- a/tests/alloca.test
+++ b/tests/alloca.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 2003 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2011 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -21,6 +21,7 @@
set -e
cat >> configure.in <<'END'
+AM_PROG_AR
AC_PROG_CC
END
@@ -31,6 +32,7 @@ libtu_a_LIBADD = @ALLOCA@
END
: > alloca.c
+: > ar-lib
$ACLOCAL
AUTOMAKE_fails
diff --git a/tests/alloca2.test b/tests/alloca2.test
index caf11a34d..a459338f5 100755
--- a/tests/alloca2.test
+++ b/tests/alloca2.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 2003 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2011 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -22,6 +22,7 @@ set -e
cat >> configure.in <<'END'
AC_PROG_CC
+AM_PROG_AR
END
cat > Makefile.am << 'END'
@@ -31,6 +32,7 @@ libtu_la_LIBADD = @LTALLOCA@
END
: > alloca.c
+: > ar-lib
$ACLOCAL
AUTOMAKE_fails
diff --git a/tests/ansi10.test b/tests/ansi10.test
index 4ff2c8633..68e12498f 100755
--- a/tests/ansi10.test
+++ b/tests/ansi10.test
@@ -25,6 +25,7 @@ cat >> configure.in << 'END'
AC_PROG_CC
AC_PROG_CC_STDC
AM_C_PROTOTYPES
+AM_PROG_AR
AC_PROG_RANLIB
AC_LIBOBJ([hello])
AC_CONFIG_FILES([dir/Makefile])
diff --git a/tests/ar-lib.test b/tests/ar-lib.test
new file mode 100755
index 000000000..a929ea4d6
--- /dev/null
+++ b/tests/ar-lib.test
@@ -0,0 +1,87 @@
+#! /bin/sh
+# Copyright (C) 2010 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Make sure `ar-lib' wraps the Microsoft Library Manager (lib) correctly
+
+required=xsi-shell
+. ./defs || Exit 1
+
+set -e
+
+cp "$testsrcdir/../lib/ar-lib" .
+# Use a dummy lib, since lib isn't readily available on all systems.
+cat >lib <<'END'
+#! /bin/sh
+if test x"$2" = x-LIST && test x"$3" = xfake.lib; then
+ echo fake.obj
+elif test x"$2" = x-LIST && test x"$3" = xfake2.lib; then
+ printf "%s\n" "dir\\fake2.obj"
+else
+ printf "%s\n" "lib $*"
+fi
+END
+
+chmod +x ./lib
+
+# Check if ar-lib can create an archive with "cr"
+opts=`./ar-lib ./lib cr foo.lib foo.obj`
+test x"$opts" = x"lib -NOLOGO -OUT:foo.lib foo.obj"
+
+# Check if ar-lib can update an existing archive with "r"
+touch foo.lib
+opts=`./ar-lib ./lib r foo.lib foo.obj`
+test x"$opts" = x"lib -NOLOGO -OUT:foo.lib foo.lib foo.obj"
+
+# Check if ar-lib passes on @FILE with "r"
+opts=`./ar-lib ./lib r foo.lib @list`
+test x"$opts" = x"lib -NOLOGO -OUT:foo.lib foo.lib @list"
+
+# Check if ar-lib can delete a member from an archive with "d"
+opts=`./ar-lib ./lib d foo.lib foo.obj`
+test x"$opts" = x"lib -NOLOGO -REMOVE:foo.obj foo.lib"
+
+# Check if ar-lib can delete members in an @FILE
+echo foo.obj > foolist
+opts=`./ar-lib ./lib d foo.lib @foolist`
+test x"$opts" = x"lib -NOLOGO -REMOVE:foo.obj foo.lib"
+
+# Check if ar-lib can list archive members with "t"
+opts=`./ar-lib ./lib t foo.lib`
+test x"$opts" = x"lib -NOLOGO -LIST foo.lib"
+
+# Check if ar-lib can extract archive members with "x"
+touch fake.lib
+opts=`./ar-lib ./lib x fake.lib`
+test x"$opts" = x"lib -NOLOGO -EXTRACT:fake.obj fake.lib"
+
+# Check if ar-lib can extract specified archive members with "x"
+opts=`./ar-lib ./lib x foo.lib foo.obj`
+test x"$opts" = x"lib -NOLOGO -EXTRACT:foo.obj foo.lib"
+
+# Check if ar-lib can extract members in an @FILE
+opts=`./ar-lib ./lib x foo.lib @foolist`
+test x"$opts" = x"lib -NOLOGO -EXTRACT:foo.obj foo.lib"
+
+# Check if ar-lib passes -lib and -LTCG through to the wrappee
+opts=`./ar-lib ./lib -lib -LTCG x foo.lib foo.obj`
+test x"$opts" = x"lib -lib -LTCG -NOLOGO -EXTRACT:foo.obj foo.lib"
+
+# Check if ar-lib can extract backslashed members
+touch fake2.lib
+opts=`./ar-lib ./lib x fake2.lib`
+test x"$opts" = x"lib -NOLOGO -EXTRACT:dir\\fake2.obj fake2.lib"
+
+:
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 dbdf24657..06dcde384 100755
--- a/tests/ar.test
+++ b/tests/ar.test
@@ -21,6 +21,7 @@
set -e
cat >> configure.in << 'END'
+AM_PROG_AR
AC_SUBST([AR], ['echo it works'])
AC_SUBST([ARFLAGS], ['>'])
AC_SUBST([RANLIB], ['echo really works >>'])
@@ -32,6 +33,8 @@ lib_LIBRARIES = libfoo.a
libfoo_a_SOURCES =
END
+:> ar-lib
+
$ACLOCAL
$AUTOCONF
$AUTOMAKE
diff --git a/tests/ar2.test b/tests/ar2.test
index 329f80491..f37f51450 100755
--- a/tests/ar2.test
+++ b/tests/ar2.test
@@ -33,7 +33,7 @@ libfoo_a_SOURCES = foo.c
END
$ACLOCAL
-$AUTOMAKE
+$AUTOMAKE -Wno-extra-portability
grep '^ARFLAGS =' Makefile.in
grep '^AR =' Makefile.in
diff --git a/tests/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..bb181118b
--- /dev/null
+++ b/tests/ar4.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 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
+
+st=0; ./configure AR=/bin/false >stdout 2>stderr || st=$?
+cat stdout
+cat stderr >&2
+test $st -eq 1
+
+grep '^checking.* archiver .*interface.*\.\.\. unknown' stdout
+grep '^configure: error: could not determine /bin/false interface' stderr
+ls *conftest* && Exit 1
+
+:
diff --git a/tests/ar5.test b/tests/ar5.test
new file mode 100755
index 000000000..865e0bf81
--- /dev/null
+++ b/tests/ar5.test
@@ -0,0 +1,42 @@
+#! /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
+ AC_MSG_CHECKING([for something else])
+ AC_MSG_RESULT([found it])
+ echo Grep This
+])
+END
+
+$ACLOCAL
+$AUTOCONF
+
+./configure AR=/bin/false >stdout || { cat stdout; Exit 1; }
+cat stdout
+grep '^checking.* archiver .*interface.*\.\.\. unknown$' stdout
+grep '^checking for something else\.\.\. found it$' stdout
+grep '^Grep This$' stdout
+test -f bad-archiver-interface-detected
+
+:
diff --git a/tests/canon4.test b/tests/canon4.test
index 52e968dc5..d98636f32 100755
--- a/tests/canon4.test
+++ b/tests/canon4.test
@@ -22,6 +22,7 @@ set -e
cat >> configure.in << 'END'
AC_PROG_CC
+AM_PROG_AR
AC_PROG_RANLIB
END
@@ -30,6 +31,8 @@ noinst_LIBRARIES = libx-y.a
libx_y_a_SOURCES = xy.c
END
+: > ar-lib
+
$ACLOCAL
$AUTOMAKE
diff --git a/tests/compile3.test b/tests/compile3.test
new file mode 100755
index 000000000..15064a6fd
--- /dev/null
+++ b/tests/compile3.test
@@ -0,0 +1,54 @@
+#! /bin/sh
+# Copyright (C) 2010 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Make sure `compile' wraps the Microsoft C/C++ compiler (cl) correctly
+
+required=xsi-shell
+. ./defs || Exit 1
+
+set -e
+
+cp "$testsrcdir/../lib/compile" .
+
+# Use a dummy cl, since cl isn't readily available on all systems
+cat >cl <<'END'
+#! /bin/sh
+echo "$@"
+END
+
+chmod +x ./cl
+
+# Check if compile handles "-o foo", -I, -l, -L, -Xlinker -Wl,
+opts=`LIB= ./compile ./cl foo.c -o foo -lbar -Lgazonk -Ibaz -Xlinker foobar -Wl,-foo,bar`
+test x"$opts" = x"foo.c -Fefoo bar.lib -Ibaz -link -LIBPATH:gazonk foobar -foo bar"
+
+# Check if compile handles "-o foo.obj"
+opts=`./compile ./cl -c foo.c -o foo.obj -Ibaz`
+test x"$opts" = x"-c foo.c -Fofoo.obj -Ibaz"
+
+# Check if compile handles "-o foo.o"
+opts=`./compile ./cl -c foo.c -o foo.o -Ibaz`
+test x"$opts" = x"-c foo.c -Fofoo.o -Ibaz"
+
+# Check if compile handles "foo.cc" as C++.
+opts=`./compile ./cl -c foo.cc -o foo.o -Ibaz`
+test x"$opts" = x"-c -Tpfoo.cc -Fofoo.o -Ibaz"
+
+# Check if compile clears the "eat" variable properly.
+opts=`eat=1 ./compile ./cl -c foo.c -o foo.obj -Ibaz`
+test x"$opts" = x"-c foo.c -Fofoo.obj -Ibaz"
+
+:
diff --git a/tests/compile4.test b/tests/compile4.test
new file mode 100755
index 000000000..0b3e98171
--- /dev/null
+++ b/tests/compile4.test
@@ -0,0 +1,86 @@
+#! /bin/sh
+# Copyright (C) 2010 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Make sure `compile' wraps the Microsoft C/C++ compiler (cl) correctly
+# with respect to absolute paths.
+
+required='cl'
+. ./defs || Exit 1
+
+set -e
+
+mkdir sub
+
+cat >sub/foo.c <<'EOF'
+int
+foo ()
+{
+ return 0;
+}
+EOF
+
+cat >main.c <<'EOF'
+extern int foo ();
+int
+main ()
+{
+ return foo ();
+}
+EOF
+
+absfoodir=`pwd`/sub
+absmainc=`pwd`/main.c
+absmainobj=`pwd`/main.obj
+
+cat >> configure.in << 'END'
+AC_PROG_CC
+AM_PROG_CC_C_O
+AM_PROG_AR
+AC_PROG_RANLIB
+AC_CONFIG_FILES([sub/Makefile])
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+SUBDIRS = sub
+END
+
+cat > sub/Makefile.am << 'END'
+lib_LIBRARIES = libfoo.a
+libfoo_a_SOURCES = foo.c
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
+./configure
+$MAKE
+
+./compile cl $CPPFLAGS $CFLAGS -c -o "$absmainobj" "$absmainc"
+
+# cl expects archives to be named foo.lib, not libfoo.a so
+# make a simple copy here if needed. This is a severe case
+# of badness, but ignore that since this is not what is
+# being tested here...
+if test -f sub/libfoo.a; then
+ cp sub/libfoo.a sub/foo.lib
+fi
+
+./compile cl $CFLAGS $LDFLAGS -L"$absfoodir" "$absmainobj" -o main -lfoo
+
+./main
+
+:
diff --git a/tests/compile5.test b/tests/compile5.test
new file mode 100755
index 000000000..cd1468fa7
--- /dev/null
+++ b/tests/compile5.test
@@ -0,0 +1,81 @@
+#! /bin/sh
+# Copyright (C) 2010 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Make sure the file name translation in the `compile' script works
+# correctly
+
+. ./defs || Exit 1
+
+set -e
+
+cp "$testsrcdir/../lib/compile" .
+
+# Use a dummy cl, since cl isn't readily available on all systems
+cat >cl <<'END'
+#! /bin/sh
+echo "$@"
+END
+
+chmod +x ./cl
+
+cat >>configure.in << 'END'
+AC_CANONICAL_HOST
+AC_CONFIG_FILES([check_host], [chmod +x check_host])
+AC_OUTPUT
+END
+
+: >Makefile.am
+
+cat >check_host.in << 'END'
+#! /bin/sh
+case @host_os@ in
+ mingw*)
+ ;;
+ *)
+ exit 77
+ ;;
+esac
+case @build_os@ in
+ mingw* | cygwin*)
+ ;;
+ *)
+ winepath -w / || exit 77
+ ;;
+esac
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
+./configure
+./check_host
+
+pwd=`pwd`
+
+# Check if "compile cl" transforms absolute file names to
+# host format (e.g /somewhere -> c:/msys/1.0/somewhere).
+
+res=`./compile ./cl -L"$pwd" | sed -e 's/-link -LIBPATH://'`
+
+case $res in
+ ?:[\\/]*)
+ ;;
+ *)
+ Exit 1
+ ;;
+esac
+
+:
diff --git a/tests/compile6.test b/tests/compile6.test
new file mode 100755
index 000000000..f45a5342f
--- /dev/null
+++ b/tests/compile6.test
@@ -0,0 +1,99 @@
+#! /bin/sh
+# Copyright (C) 2010 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Make sure `compile' searches libraries correctly
+
+required=xsi-shell
+. ./defs || Exit 1
+
+set -e
+
+cp "$testsrcdir/../lib/compile" .
+
+# Use a dummy cl, since cl isn't readily available on all systems
+cat >cl <<'END'
+#! /bin/sh
+echo "$@"
+END
+
+chmod +x ./cl
+
+mkdir syslib
+:> syslib/foo.lib
+
+syslib=`pwd`/syslib
+LIB=$syslib
+export LIB
+
+mkdir lib
+:> lib/bar.lib
+:> lib/bar.dll.lib
+
+# Check if compile library search correctly
+opts=`./compile ./cl foo.c -o foo -Llib -lbar -lfoo`
+test x"$opts" = x"foo.c -Fefoo lib/bar.dll.lib $syslib/foo.lib -link -LIBPATH:lib"
+
+# Check if -static makes compile avoid bar.dll.lib
+opts=`./compile ./cl foo.c -o foo -Llib -static -lbar -lfoo`
+test x"$opts" = x"foo.c -Fefoo lib/bar.lib $syslib/foo.lib -link -LIBPATH:lib"
+
+:> syslib/bar.lib
+:> syslib/bar.dll.lib
+
+# Check if compile finds bar.dll.lib in syslib
+opts=`./compile ./cl foo.c -o foo -lbar -lfoo`
+test x"$opts" = x"foo.c -Fefoo $syslib/bar.dll.lib $syslib/foo.lib"
+
+# Check if compile prefers -L over $LIB
+opts=`./compile ./cl foo.c -o foo -Llib -lbar -lfoo`
+test x"$opts" = x"foo.c -Fefoo lib/bar.dll.lib $syslib/foo.lib -link -LIBPATH:lib"
+
+mkdir lib2
+:> lib2/bar.dll.lib
+
+# Check if compile avoids bar.dll.lib in lib2 when -static
+opts=`./compile ./cl foo.c -o foo -Llib2 -static -lbar -lfoo`
+test x"$opts" = x"foo.c -Fefoo $syslib/bar.lib $syslib/foo.lib -link -LIBPATH:lib2"
+
+# Check if compile gets two different bar libraries when -static
+# is added in the middle
+opts=`./compile ./cl foo.c -o foo -Llib2 -Llib -lbar -static -lbar`
+test x"$opts" = x"foo.c -Fefoo lib2/bar.dll.lib lib/bar.lib -link -LIBPATH:lib2 -LIBPATH:lib"
+
+# Check if compile gets the correct bar.dll.lib
+opts=`./compile ./cl foo.c -o foo -Llib -Llib2 -lbar -lfoo`
+test x"$opts" = x"foo.c -Fefoo lib/bar.dll.lib $syslib/foo.lib -link -LIBPATH:lib -LIBPATH:lib2"
+
+# Check if compile gets the correct bar.dll.lib
+opts=`./compile ./cl foo.c -o foo -Llib2 -Llib -lbar -lfoo`
+test x"$opts" = x"foo.c -Fefoo lib2/bar.dll.lib $syslib/foo.lib -link -LIBPATH:lib2 -LIBPATH:lib"
+
+mkdir "sys lib2"
+:> "sys lib2/foo.dll.lib"
+
+syslib2="`pwd`/sys lib2"
+LIB="$syslib2;$LIB"
+
+# Check if compile handles spaces in $LIB and that it prefers the order
+# in a multi-component $LIB.
+opts=`./compile ./cl foo.c -o foo -lfoo`
+test x"$opts" = x"foo.c -Fefoo $syslib2/foo.dll.lib"
+
+# Check if compile handles the 2nd directory in a multi-component $LIB.
+opts=`./compile ./cl foo.c -o foo -static -lfoo`
+test x"$opts" = x"foo.c -Fefoo $syslib/foo.lib"
+
+:
diff --git a/tests/cond13.test b/tests/cond13.test
index e5f6be9c5..28f6cd3e8 100755
--- a/tests/cond13.test
+++ b/tests/cond13.test
@@ -24,6 +24,7 @@ set -e
cat >> configure.in << 'END'
AC_PROG_CC
AC_PROG_CXX
+AM_PROG_AR
AC_PROG_RANLIB
AM_CONDITIONAL(COND1, true)
AM_CONDITIONAL(COND2, true)
@@ -49,6 +50,8 @@ endif
libtest_a_SOURCES = $(TESTSOURCES)
END
+: > ar-lib
+
$ACLOCAL
$AUTOMAKE
diff --git a/tests/condlib.test b/tests/condlib.test
index b6c998d71..88ef3086b 100755
--- a/tests/condlib.test
+++ b/tests/condlib.test
@@ -24,6 +24,7 @@ set -e
cat >> configure.in << 'END'
AC_PROG_RANLIB
AM_MAINTAINER_MODE
+AM_PROG_AR
AC_PROG_CC
END
@@ -36,6 +37,8 @@ nodist_librsaref_a_SOURCES = desc.c digit.c
BUILT_SOURCES = $(nodist_librsaref_a_SOURCES)
END
+: > ar-lib
+
$ACLOCAL
$AUTOMAKE
diff --git a/tests/defs.in b/tests/defs.in
index aa8eb6335..6481ef601 100644
--- a/tests/defs.in
+++ b/tests/defs.in
@@ -203,6 +203,12 @@ do
echo "$me: running bzip2 --help"
( bzip2 --help ) || exit 77
;;
+ cl)
+ CC=cl
+ export CC
+ echo "$me: running $CC -?"
+ ( $CC -? ) || exit 77
+ ;;
etags)
# Exuberant Ctags will create a TAGS file even
# when asked for --help or --version. (Emacs's etags
@@ -283,6 +289,14 @@ do
echo "$me: running javac -version -help"
javac -version -help || exit 77
;;
+ lib)
+ AR=lib
+ export AR
+ # Attempting to create an empty archive will actually not
+ # create the archive, but lib will output its version.
+ echo "$me: running $AR -out:defstest.lib"
+ $AR -out:defstest.lib || skip_ "Microsoft \`lib' utility not available"
+ ;;
makedepend)
echo "$me: running makedepend -f-"
( makedepend -f- ) || exit 77
@@ -349,6 +363,15 @@ do
echo "$me: running texi2dvi -o /dev/null --version"
( texi2dvi -o /dev/null --version ) || exit 77
;;
+ xsi-shell)
+ # Try some XSI features.
+ echo "$me: trying some XSI constructs"
+ ( _am_dummy="a/b/c"
+ test "${_am_dummy##*/},${_am_dummy%/*},${_am_dummy#??}"${_am_dummy%"$_am_dummy"}, \
+ = c,a/b,b/c, \
+ && eval 'test $(( 1 + 1 )) -eq 2 \
+ && test "${#_am_dummy}" -eq 5' ) || exit 77
+ ;;
# Generic case: the tool must support --version.
*)
echo "$me: running $tool --version"
diff --git a/tests/depcomp4.test b/tests/depcomp4.test
index 4f2df974c..3c3602f58 100755
--- a/tests/depcomp4.test
+++ b/tests/depcomp4.test
@@ -23,6 +23,7 @@ set -e
cat >> configure.in << 'END'
AC_PROG_CC
+AM_PROG_AR
AC_PROG_LIBTOOL
AC_OUTPUT
END
diff --git a/tests/depcomp6.test b/tests/depcomp6.test
index ea15e20ad..c7734b138 100755
--- a/tests/depcomp6.test
+++ b/tests/depcomp6.test
@@ -23,6 +23,7 @@ set -e
cat >> configure.in << 'END'
AC_PROG_CC
AM_PROG_CC_C_O
+AM_PROG_AR
AC_PROG_RANLIB
AC_CONFIG_FILES([sub2/Makefile])
AC_OUTPUT
diff --git a/tests/depcomp7.test b/tests/depcomp7.test
index 47f09fc4a..9b0ed220d 100755
--- a/tests/depcomp7.test
+++ b/tests/depcomp7.test
@@ -24,6 +24,7 @@ set -e
cat >> configure.in << 'END'
AC_PROG_CC
AM_PROG_CC_C_O
+AM_PROG_AR
AM_PROG_LIBTOOL
AC_CONFIG_FILES([sub2/Makefile])
AC_OUTPUT
diff --git a/tests/depcomp8b.test b/tests/depcomp8b.test
index d36e75462..56514792d 100755
--- a/tests/depcomp8b.test
+++ b/tests/depcomp8b.test
@@ -26,6 +26,7 @@ set -e
cat >> configure.in << 'END'
AC_PROG_CC
+AM_PROG_AR
AC_PROG_LIBTOOL
AC_OUTPUT
END
diff --git a/tests/discover.test b/tests/discover.test
index 0e4faa3b1..41b11f51e 100755
--- a/tests/discover.test
+++ b/tests/discover.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 1996, 1997, 2000, 2001, 2002, 2010 Free Software
+# Copyright (C) 1996, 1997, 2000, 2001, 2002, 2010, 2011 Free Software
# Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
@@ -21,6 +21,7 @@
cat >> configure.in << 'END'
AC_PROG_RANLIB
+AM_PROG_AR
AC_PROG_CC
AC_LIBOBJ([fsusage])
AC_OUTPUT
@@ -33,6 +34,7 @@ libtu_a_LIBADD = @LIBOBJS@
END
: > fsusage.c
+: > ar-lib
$ACLOCAL
AUTOMAKE_fails
diff --git a/tests/dollarvar2.test b/tests/dollarvar2.test
index 6fc27379b..7a6db3794 100755
--- a/tests/dollarvar2.test
+++ b/tests/dollarvar2.test
@@ -21,6 +21,11 @@
set -e
+#
+# First, try a setup where we have a `portability-recursive' warning,
+# but no "simple" `portability' warning.
+#
+
cat >Makefile.am <<'EOF'
x = 1
bla = $(foo$(x))
@@ -28,11 +33,61 @@ EOF
$ACLOCAL
-# $AUTOMAKE already contains -Wall -Werror.
-AUTOMAKE_fails -Wportability
-$AUTOMAKE --force -Wno-all
-$AUTOMAKE --force -Wno-portability
+# Enabling `portability' warnings should enable `portability-recursive'
+# warnings.
+AUTOMAKE_fails -Wnone -Wportability
+grep 'recursive variable expansion' stderr
+# `portability-recursive' warnings can be enabled by themselves.
+AUTOMAKE_fails -Wnone -Wportability-recursive
+grep 'recursive variable expansion' stderr
+
+# Various ways to disable `portability-recursive'.
+$AUTOMAKE -Wno-all
+$AUTOMAKE -Wno-portability
+$AUTOMAKE -Wall -Wno-portability-recursive
+
+# `-Wno-portability-recursive' after `-Wportability' correctly disables
+# `portability-recursive' warnings.
+$AUTOMAKE -Wportability -Wno-portability-recursive
+
+# `-Wno-portability' disables `portability-recursive' warnings; but
+# a later `-Wportability-recursive' re-enables them. This time, we
+# use AUTOMAKE_OPTIONS to specify the warning levels.
echo 'AUTOMAKE_OPTIONS = -Wno-portability' >> Makefile.am
-$AUTOMAKE --force
+$AUTOMAKE
+echo 'AUTOMAKE_OPTIONS += -Wportability-recursive' >> Makefile.am
+AUTOMAKE_fails
+grep 'recursive variable expansion' stderr
+
+#
+# Now try a setup where we have both a `portability' warning and
+# a `portability-recursive' one.
+#
+
+cat >Makefile.am <<'EOF'
+x = 1
+bla = $(foo$(x))
+noinst_PROGRAMS = foo
+foo_CPPFLAGS = -Dwhatever
+EOF
+
+echo AC_PROG_CC >> configure.in
+
+$ACLOCAL --force
+
+# Can disable both `portability' and `portability-recursive' warnings.
+$AUTOMAKE -Wno-portability
+
+# Disabling `portability-recursive' warnings should not disable
+# `portability' warnings.
+AUTOMAKE_fails -Wportability -Wno-portability-recursive
+grep AM_PROG_CC_C_O stderr
+grep 'recursive variable expansion' stderr && Exit 1
+
+# Enabling `portability-recursive' warnings should not enable
+# all the `portability' warning.
+AUTOMAKE_fails -Wno-portability -Wportability-recursive
+grep AM_PROG_CC_C_O stderr && Exit 1
+grep 'recursive variable expansion' stderr
:
diff --git a/tests/extra-portability.test b/tests/extra-portability.test
new file mode 100755
index 000000000..51a9b4f3c
--- /dev/null
+++ b/tests/extra-portability.test
@@ -0,0 +1,95 @@
+#! /bin/sh
+# Copyright (C) 2011 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Check interactions between the `portability' and `extra-portability'
+# warning categories:
+# 1. `-Wextra-portability' must imply `-Wportability'.
+# 2. `-Wno-portability' must imply `-Wno-extra-portability'.
+# 3. `-Wall' must imply `-Wextra-portability'.
+
+. ./defs || Exit 1
+
+set -e
+
+# We want (almost) complete control over automake options.
+# FIXME: use $original_AUTOMAKE here once we are merged into master.
+AUTOMAKE="`(set $AUTOMAKE && echo $1)` --foreign -Werror"
+
+cat >>configure.in <<END
+AC_PROG_CC
+AC_PROG_RANLIB
+AC_OUTPUT
+END
+
+$ACLOCAL
+
+#
+# First, a setup where only an extra-portability warning is present
+# (no "simple" portability-warnings are).
+#
+
+cat >Makefile.am <<END
+EXTRA_LIBRARIES = libfoo.a
+libfoo_a_SOURCES = sub/foo.c
+END
+
+# Sanity check: extra-portability warnings causes the expected error.
+AUTOMAKE_fails -Wextra-portability
+grep 'requires.*AM_PROG_AR' stderr
+
+# Warnings in extra-portability category are not enabled by default.
+$AUTOMAKE
+
+# -Wall enables extra-portability.
+AUTOMAKE_fails -Wall
+grep 'requires.*AM_PROG_AR' stderr
+
+# Disabling portability disables extra-portability as well.
+$AUTOMAKE -Wextra-portability -Wno-portability
+$AUTOMAKE -Wall -Wno-portability
+
+#
+# Now, a setup where also a "simple" portability warning is present.
+#
+
+# Per-target flags require the use of AM_PROG_CC_C_O in configure.ac.
+echo libfoo_a_CPPFLAGS = -Dwhatever >> Makefile.am
+
+# Enabling extra-portability enables portability as well ...
+AUTOMAKE_fails -Wextra-portability
+grep 'requires.*AM_PROG_CC_C_O' stderr
+grep 'requires.*AM_PROG_AR' stderr
+# ... even if it had been previously disabled.
+AUTOMAKE_fails -Wno-portability -Wextra-portability
+grep 'requires.*AM_PROG_CC_C_O' stderr
+grep 'requires.*AM_PROG_AR' stderr
+
+# Disabling extra-portability leaves portability intact.
+AUTOMAKE_fails -Wportability -Wno-extra-portability
+grep 'requires.*AM_PROG_CC_C_O' stderr
+grep 'requires.*AM_PROG_AR' stderr && Exit 1
+
+# Enabling portability does not enable extra-portability.
+AUTOMAKE_fails -Wnone -Wportability
+grep 'requires.*AM_PROG_CC_C_O' stderr
+grep 'requires.*AM_PROG_AR' stderr && Exit 1
+
+# Disabling portability disables extra-portability.
+$AUTOMAKE -Wno-portability
+$AUTOMAKE -Wextra-portability -Wno-portability
+$AUTOMAKE -Wall -Wno-portability
+
+:
diff --git a/tests/extra-portability2.test b/tests/extra-portability2.test
new file mode 100755
index 000000000..a44b14427
--- /dev/null
+++ b/tests/extra-portability2.test
@@ -0,0 +1,53 @@
+#! /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
+
+# Satisfy --gnits and --gnu.
+: > INSTALL
+: > NEWS
+: > README
+: > AUTHORS
+: > ChangeLog
+: > COPYING
+: > THANKS
+
+cat >>configure.in <<END
+AC_PROG_CC
+AC_PROG_RANLIB
+AC_OUTPUT
+END
+
+cat >Makefile.am <<END
+EXTRA_LIBRARIES = libfoo.a
+libfoo_a_SOURCES = foo.c
+END
+
+$ACLOCAL
+
+# Make sure the test is useful.
+AUTOMAKE_fails
+
+$AUTOMAKE --foreign
+$AUTOMAKE --gnu
+$AUTOMAKE --gnits
+
+:
diff --git a/tests/extra-portability3.test b/tests/extra-portability3.test
new file mode 100755
index 000000000..7ca19b1d7
--- /dev/null
+++ b/tests/extra-portability3.test
@@ -0,0 +1,63 @@
+#! /bin/sh
+# Copyright (C) 2011 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Check interactions between the `portability-recursive' and
+# `extra-portability' warning categories.
+
+. ./defs || Exit 1
+
+set -e
+
+# We want (almost) complete control over automake options.
+# FIXME: use $original_AUTOMAKE here once we are merged into master.
+AUTOMAKE="`(set $AUTOMAKE && echo $1)` --foreign -Werror"
+
+cat >>configure.in <<END
+AC_PROG_CC
+AC_PROG_RANLIB
+AC_OUTPUT
+END
+
+$ACLOCAL
+
+cat >Makefile.am <<'END'
+baz = $(foo$(bar))
+lib_LIBRARIES = libfoo.a
+libfoo_a_SOURCES = foo.c
+END
+
+# 'extra-portability' implies 'portability-recursive'.
+AUTOMAKE_fails -Wextra-portability
+grep 'requires.*AM_PROG_AR' stderr
+grep 'recursive variable expansion' stderr
+
+# We can disable 'extra-portability' while leaving
+# 'portability-recursive' intact.
+AUTOMAKE_fails -Wportability-recursive -Wno-extra-portability
+grep 'requires.*AM_PROG_AR' stderr && Exit 1
+grep 'recursive variable expansion' stderr
+
+# We can disable 'portability-recursive' while leaving
+# 'extra-portability' intact.
+AUTOMAKE_fails -Wextra-portability -Wno-portability-recursive
+grep 'requires.*AM_PROG_AR' stderr
+grep 'recursive variable expansion' stderr && Exit 1
+
+# Disabling 'portability' disables 'portability-recursive' and
+# 'extra-portability'.
+$AUTOMAKE -Wextra-portability -Wno-portability
+
+:
diff --git a/tests/fort5.test b/tests/fort5.test
index d6151a714..cc9340319 100755
--- a/tests/fort5.test
+++ b/tests/fort5.test
@@ -56,6 +56,7 @@ AC_PROG_FC
AC_FC_SRCEXT([f90], [],
[AC_MSG_FAILURE([$FC compiler cannot create executables], 77)])
AC_FC_LIBRARY_LDFLAGS
+AM_PROG_AR
LT_PREREQ([2.0])
AC_PROG_LIBTOOL
AC_OUTPUT
diff --git a/tests/instdir-ltlib.test b/tests/instdir-ltlib.test
index 1fb4f37a8..f4003775a 100755
--- a/tests/instdir-ltlib.test
+++ b/tests/instdir-ltlib.test
@@ -25,6 +25,7 @@ set -e
cat >>configure.in <<'END'
AC_PROG_CC
AM_PROG_CC_C_O
+AM_PROG_AR
AC_PROG_LIBTOOL
AC_OUTPUT
END
diff --git a/tests/instdir-prog.test b/tests/instdir-prog.test
index 6a73b7572..66a489227 100755
--- a/tests/instdir-prog.test
+++ b/tests/instdir-prog.test
@@ -24,6 +24,7 @@ set -e
cat >>configure.in <<'END'
AC_PROG_CC
AM_PROG_CC_C_O
+AM_PROG_AR
AC_PROG_RANLIB
AC_OUTPUT
END
diff --git a/tests/instfail-libtool.test b/tests/instfail-libtool.test
index 1e756a676..2e5e312f6 100755
--- a/tests/instfail-libtool.test
+++ b/tests/instfail-libtool.test
@@ -25,6 +25,7 @@ required='libtool libtoolize'
set -e
cat >>configure.in <<END
+AM_PROG_AR
AC_PROG_LIBTOOL
AC_OUTPUT
END
diff --git a/tests/instfail.test b/tests/instfail.test
index 38a1c9c99..3fb60b538 100755
--- a/tests/instfail.test
+++ b/tests/instfail.test
@@ -25,6 +25,7 @@ set -e
cat >>configure.in <<END
AC_PROG_CC
+AM_PROG_AR
AC_PROG_RANLIB
AM_PATH_LISPDIR
AC_OUTPUT
diff --git a/tests/instspc.test b/tests/instspc.test
index 7d007884f..c30546196 100755
--- a/tests/instspc.test
+++ b/tests/instspc.test
@@ -33,6 +33,7 @@ set -e
cat >> configure.in <<'EOF'
AC_PROG_CC
+AM_PROG_AR
AC_PROG_RANLIB
AC_OUTPUT
EOF
diff --git a/tests/ldadd.test b/tests/ldadd.test
index 7f4fce89a..3515a4e74 100755
--- a/tests/ldadd.test
+++ b/tests/ldadd.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 1997, 1999, 2000, 2001, 2002, 2010 Free Software
+# Copyright (C) 1997, 1999, 2000, 2001, 2002, 2010, 2011 Free Software
# Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
@@ -42,6 +42,7 @@ END
: > q.c
$ACLOCAL || Exit 1
-AUTOMAKE_fails
-grep LDADD stderr || Exit 1
+AUTOMAKE_fails -Wno-extra-portability
+grep "libtu_la_LDADD" stderr
+grep " use [\`"']libtu_la_LIBADD' stderr
Exit 0
diff --git a/tests/ldflags.test b/tests/ldflags.test
index 39ca27464..c00f227d7 100755
--- a/tests/ldflags.test
+++ b/tests/ldflags.test
@@ -21,6 +21,7 @@ required=libtool
cat >> configure.in << 'END'
AC_PROG_CC
+AM_PROG_AR
AC_PROG_LIBTOOL
AC_SUBST([LTLIBOBJS], [q.o])
AM_CONDITIONAL(USE_SWIG, :)
@@ -37,6 +38,7 @@ END
: > ltconfig
: > ltmain.sh
+: > ar-lib
: > config.guess
: > config.sub
: > q.c
diff --git a/tests/libobj10.test b/tests/libobj10.test
index 0d2474162..97dffecd0 100755
--- a/tests/libobj10.test
+++ b/tests/libobj10.test
@@ -23,6 +23,7 @@ set -e
cat >> configure.in << 'END'
AC_PROG_CC
+AM_PROG_AR
AC_PROG_RANLIB
AC_LIBOBJ([foo])
AC_OUTPUT
@@ -33,6 +34,8 @@ noinst_LIBRARIES = libfoo.a
libfoo_a_LIBADD = @LIBOBJS@
END
+: > ar-lib
+
$ACLOCAL
AUTOMAKE_fails
grep 'Makefile.am:2:.*foo\.c' stderr
diff --git a/tests/libobj11.test b/tests/libobj11.test
index 204ff8bb4..fc7f17372 100755
--- a/tests/libobj11.test
+++ b/tests/libobj11.test
@@ -22,6 +22,7 @@ cat > configure.in << 'END'
AC_INIT
AM_INIT_AUTOMAKE(nonesuch, nonesuch)
AC_PROG_CC
+AM_PROG_AR
AC_PROG_RANLIB
AC_LIBOBJ([mountlist])
AC_OUTPUT(Makefile)
@@ -33,6 +34,7 @@ libtu_a_SOURCES =
libtu_a_LIBADD = @LIBOBJS@
END
+: > ar-lib
: > mountlist.c
$ACLOCAL || Exit 1
diff --git a/tests/libobj12.test b/tests/libobj12.test
index 5f1d02908..e4522bc10 100755
--- a/tests/libobj12.test
+++ b/tests/libobj12.test
@@ -23,6 +23,7 @@ set -e
cat >> configure.in << 'END'
AC_PROG_CC
+AM_PROG_AR
AC_PROG_RANLIB
AC_LIBOBJ([foo])
AC_LIBOBJ([bar])
@@ -44,6 +45,7 @@ p1_LDADD = @LIBOBJS@
p2_SOURCES = bar.c
END
+: > ar-lib
: > foo.c
: > bar.c
diff --git a/tests/libobj13.test b/tests/libobj13.test
index 6ca68c9e6..fc3112b2d 100755
--- a/tests/libobj13.test
+++ b/tests/libobj13.test
@@ -24,6 +24,7 @@ set -e
cat >> configure.in << 'END'
AC_PROG_CC
+AM_PROG_AR
AC_PROG_LIBTOOL
AC_LIBOBJ([foo])
AC_OUTPUT
diff --git a/tests/libobj2.test b/tests/libobj2.test
index 81b0e7222..36c01b3ba 100755
--- a/tests/libobj2.test
+++ b/tests/libobj2.test
@@ -24,6 +24,7 @@ cat > configure.in << 'END'
AC_INIT
AM_INIT_AUTOMAKE(nonesuch, nonesuch)
AC_PROG_CC
+AM_PROG_AR
AC_PROG_RANLIB
AC_LIBOBJ([fsusage])
AC_OUTPUT(subdir/Makefile)
@@ -37,6 +38,7 @@ libtu_a_SOURCES =
libtu_a_LIBADD = @LIBOBJS@
END
+: > ar-lib
: > subdir/fsusage.c
$ACLOCAL || Exit 1
diff --git a/tests/libobj3.test b/tests/libobj3.test
index 0aeced91b..7304b0937 100755
--- a/tests/libobj3.test
+++ b/tests/libobj3.test
@@ -1,5 +1,6 @@
#! /bin/sh
-# Copyright (C) 1996, 1997, 2001, 2002, 2003 Free Software Foundation, Inc.
+# Copyright (C) 1996, 1997, 2001, 2002, 2003, 2011 Free Software
+# Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -22,6 +23,7 @@ set -e
cat >> configure.in << 'END'
AC_PROG_RANLIB
+AM_PROG_AR
END
cat > Makefile.am << 'END'
@@ -30,6 +32,8 @@ libtu_a_SOURCES =
libtu_a_LIBADD = @LIBOBJS@
END
+: > ar-lib
+
$ACLOCAL
AUTOMAKE_fails
grep 'Makefile.am:3:.*LIBOBJS' stderr
diff --git a/tests/libobj7.test b/tests/libobj7.test
index 73a8ab0e2..1ff36c455 100755
--- a/tests/libobj7.test
+++ b/tests/libobj7.test
@@ -22,6 +22,7 @@ cat > configure.in << 'END'
AC_INIT
AM_INIT_AUTOMAKE(nonesuch, nonesuch)
AC_PROG_CC
+AM_PROG_AR
AC_PROG_RANLIB
AC_REPLACE_FUNCS(basename dirname strsignal)
AC_OUTPUT(Makefile)
@@ -33,6 +34,7 @@ libtu_a_SOURCES =
libtu_a_LIBADD = @LIBOBJS@
END
+: > ar-lib
: > basename.c
: > dirname.c
: > strsignal.c
diff --git a/tests/libobj8.test b/tests/libobj8.test
index 206bca6e6..e14375361 100755
--- a/tests/libobj8.test
+++ b/tests/libobj8.test
@@ -24,6 +24,7 @@ AC_INIT
AM_INIT_AUTOMAKE(nonesuch, nonesuch)
AC_PROG_CC
AC_PROG_CC_STDC
+AM_PROG_AR
AC_PROG_RANLIB
AC_REPLACE_FUNCS(basename dirname strsignal)
AM_C_PROTOTYPES
@@ -43,6 +44,7 @@ END
: > ansi2knr.1
: > ansi2knr.c
+: > ar-lib
$ACLOCAL || Exit 1
$AUTOMAKE -Wno-obsolete || Exit 1
diff --git a/tests/library.test b/tests/library.test
index 1e2b58b9e..8adc575c1 100755
--- a/tests/library.test
+++ b/tests/library.test
@@ -22,6 +22,7 @@ cat >> configure.in << 'END'
AC_PROG_RANLIB
AM_MAINTAINER_MODE
AC_PROG_CC
+AM_PROG_AR
END
cat > Makefile.am << 'END'
@@ -30,5 +31,7 @@ lib_LIBRARIES = libfoo.a
libfoo_a_DEPENDENCIES = libzot.a
END
+: > ar-lib
+
$ACLOCAL || Exit 1
$AUTOMAKE
diff --git a/tests/library2.test b/tests/library2.test
index 0dbff2899..d30c504d5 100755
--- a/tests/library2.test
+++ b/tests/library2.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003, 2011 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -20,10 +20,14 @@
set -e
+cat >> configure.in << 'END'
+AC_PROG_CC
+END
+
cat > Makefile.am << 'END'
EXTRA_LIBRARIES = libfoo.a
END
$ACLOCAL
-AUTOMAKE_fails
+AUTOMAKE_fails -Wno-portability
grep AC_PROG_RANLIB stderr
diff --git a/tests/libtoo10.test b/tests/libtoo10.test
index 51a68d487..44c072685 100755
--- a/tests/libtoo10.test
+++ b/tests/libtoo10.test
@@ -22,6 +22,7 @@ required=libtoolize
set -e
cat >> configure.in << 'END'
+AM_PROG_AR
AC_PROG_LIBTOOL
AC_OUTPUT
END
diff --git a/tests/libtool2.test b/tests/libtool2.test
index a50f6a444..0120fa9e0 100755
--- a/tests/libtool2.test
+++ b/tests/libtool2.test
@@ -24,6 +24,7 @@ AC_INIT
AM_INIT_AUTOMAKE(mypackage,0.1)
AC_PROG_CC
+AM_PROG_AR
AC_PROG_LIBTOOL
AC_CONFIG_FILES([
diff --git a/tests/libtool3.test b/tests/libtool3.test
index 3427f2892..1643f31eb 100755
--- a/tests/libtool3.test
+++ b/tests/libtool3.test
@@ -24,6 +24,7 @@ set -e
cat >> configure.in << 'END'
AC_PROG_CC
+AM_PROG_AR
AM_PROG_LIBTOOL
AC_OUTPUT
END
diff --git a/tests/libtool4.test b/tests/libtool4.test
index 9f6a7301e..814b537d6 100755
--- a/tests/libtool4.test
+++ b/tests/libtool4.test
@@ -1,5 +1,5 @@
#!/bin/sh
-# Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003, 2011 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -22,12 +22,15 @@ set -e
cat >> configure.in <<'END'
AC_PROG_CC
+AM_PROG_AR
END
cat > Makefile.am << 'END'
EXTRA_LTLIBRARIES = liblib.la
END
+: > ar-lib
+
$ACLOCAL
AUTOMAKE_fails
grep '[Ll]ibtool library .*LIBTOOL.* undefined' stderr
diff --git a/tests/libtool5.test b/tests/libtool5.test
index c7f0476db..820838812 100755
--- a/tests/libtool5.test
+++ b/tests/libtool5.test
@@ -27,6 +27,7 @@ cat >>configure.in <<'END'
AM_CONDITIONAL([COND1], [true])
AM_CONDITIONAL([COND2], [false])
AC_PROG_CC
+AM_PROG_AR
AC_PROG_LIBTOOL
AC_OUTPUT
END
diff --git a/tests/libtool6.test b/tests/libtool6.test
index ad01b149a..ea5fd9c2c 100755
--- a/tests/libtool6.test
+++ b/tests/libtool6.test
@@ -26,6 +26,7 @@ cat >>configure.in <<'END'
AM_CONDITIONAL([COND1], [true])
AM_CONDITIONAL([COND2], [false])
AC_PROG_CC
+AM_PROG_AR
AC_PROG_LIBTOOL
AC_OUTPUT
END
diff --git a/tests/libtool7.test b/tests/libtool7.test
index a2f912f43..8ebce0a2d 100755
--- a/tests/libtool7.test
+++ b/tests/libtool7.test
@@ -24,6 +24,7 @@ set -e
cat >> configure.in << 'END'
AC_PROG_CC
+AM_PROG_AR
AC_LIBTOOL_DLOPEN
AM_PROG_LIBTOOL
AC_OUTPUT
diff --git a/tests/libtool8.test b/tests/libtool8.test
index a1bb88a5c..ed1b6cf70 100755
--- a/tests/libtool8.test
+++ b/tests/libtool8.test
@@ -25,6 +25,7 @@ cat >>configure.in <<'END'
AM_CONDITIONAL([COND1], [true])
AM_CONDITIONAL([COND2], [false])
AC_PROG_CC
+AM_PROG_AR
AC_PROG_LIBTOOL
AC_OUTPUT
END
diff --git a/tests/libtool9.test b/tests/libtool9.test
index c0d9688a8..a27a1da05 100755
--- a/tests/libtool9.test
+++ b/tests/libtool9.test
@@ -26,6 +26,7 @@ set -e
cat >> configure.in << 'END'
AC_PROG_CC
AM_PROG_CC_C_O
+AM_PROG_AR
AC_LIBTOOL_DLOPEN
AM_PROG_LIBTOOL
AC_OUTPUT
diff --git a/tests/listval.test b/tests/listval.test
index 5ff75db4d..d7cc884a0 100755
--- a/tests/listval.test
+++ b/tests/listval.test
@@ -21,6 +21,7 @@ required=libtool
cat >> configure.in << 'END'
AC_SUBST(LTLIBOBJS)
+AM_PROG_AR
AC_PROG_LIBTOOL
END
@@ -34,6 +35,7 @@ END
: > ltconfig
: > ltmain.sh
+: > ar-lib
: > config.guess
: > config.sub
diff --git a/tests/location.test b/tests/location.test
index 13a21836a..609879638 100755
--- a/tests/location.test
+++ b/tests/location.test
@@ -24,6 +24,7 @@ cat >> configure.in << 'END'
AM_CONDITIONAL([COND1], [true])
AM_CONDITIONAL([COND2], [true])
AC_PROG_CC
+AM_PROG_AR
AC_PROG_RANLIB
END
@@ -44,6 +45,8 @@ VAR = 1 \
3
END
+: > ar-lib
+
$ACLOCAL
AUTOMAKE_fails
diff --git a/tests/ltcond.test b/tests/ltcond.test
index 0350a3d8a..401572be9 100755
--- a/tests/ltcond.test
+++ b/tests/ltcond.test
@@ -27,6 +27,7 @@ AM_CONDITIONAL([WANT_LIBFOO], [true])
AM_CONDITIONAL([WANT_LIBBAR], [false])
AC_SUBST([WANTEDLIBS], ['lib1foo.la lib1bar.la'])
AC_PROG_CC
+AM_PROG_AR
AC_PROG_LIBTOOL
AC_OUTPUT
END
diff --git a/tests/ltcond2.test b/tests/ltcond2.test
index 1687513cd..898c97138 100755
--- a/tests/ltcond2.test
+++ b/tests/ltcond2.test
@@ -23,6 +23,7 @@ set -e
cat >> configure.in << 'END'
AC_PROG_CC
+AM_PROG_AR
AC_PROG_LIBTOOL
AC_SUBST([HELLO_SYSTEM], [hello-generic.lo])
AM_CONDITIONAL([LINUX], true)
diff --git a/tests/ltconv.test b/tests/ltconv.test
index 0ec2132d2..a130b9437 100755
--- a/tests/ltconv.test
+++ b/tests/ltconv.test
@@ -24,6 +24,7 @@ set -e
cat >>configure.in <<'END'
AC_PROG_CC
+AM_PROG_AR
AC_PROG_LIBTOOL
AC_CONFIG_FILES(sub1/Makefile
sub2/Makefile
diff --git a/tests/ltdeps.test b/tests/ltdeps.test
index 43d0ae3cf..7ece4d493 100755
--- a/tests/ltdeps.test
+++ b/tests/ltdeps.test
@@ -22,6 +22,7 @@ required=libtool
set -e
cat >> configure.in << 'END'
+AM_PROG_AR
AC_PROG_LIBTOOL
AC_PROG_CXX
AM_CONDITIONAL(HACKING_COMPACT_BUILD, whatever)
@@ -51,6 +52,7 @@ END
: > ltconfig
: > ltmain.sh
+: > ar-lib
: > config.guess
: > config.sub
diff --git a/tests/ltinit.test b/tests/ltinit.test
index 85705e005..58f192618 100755
--- a/tests/ltinit.test
+++ b/tests/ltinit.test
@@ -25,6 +25,7 @@ set -e
cat >>configure.in <<'END'
AC_PROG_CC
+AM_PROG_AR
dnl Older libtool versions don't define LT_PREREQ :-(
m4_ifdef([LT_PREREQ],
[LT_PREREQ([2.0])],
diff --git a/tests/ltinstloc.test b/tests/ltinstloc.test
index bb3203af1..a4d715e52 100755
--- a/tests/ltinstloc.test
+++ b/tests/ltinstloc.test
@@ -24,6 +24,7 @@ set -e
cat >>configure.in <<'END'
AC_PROG_CC
+AM_PROG_AR
AC_PROG_LIBTOOL
AM_CONDITIONAL([COND], [:])
AC_OUTPUT
@@ -46,7 +47,7 @@ AUTOMAKE_fails --add-missing
# libtoolize might have installed config.guess and config.sub already,
# and autom4te might warn about bugs in Libtool macro files, so filter
# out warnings about Makefile.am only. We don't care in this test
-# whether automake installs config.guess and config.sub.
+# whether automake installs config.guess, config.sub and ar-lib.
cat >expected <<'END'
Makefile.am:5: sub/liba2.la multiply defined in condition COND
diff --git a/tests/ltlibobjs.test b/tests/ltlibobjs.test
index fd6647324..2df001721 100755
--- a/tests/ltlibobjs.test
+++ b/tests/ltlibobjs.test
@@ -21,6 +21,7 @@ required=libtool
cat >> configure.in << 'END'
AC_SUBST(LTLIBOBJS)
+AM_PROG_AR
AC_PROG_LIBTOOL
END
@@ -32,6 +33,7 @@ END
: > ltconfig
: > ltmain.sh
+: > ar-lib
: > config.guess
: > config.sub
diff --git a/tests/ltlibsrc.test b/tests/ltlibsrc.test
index 2c9911d0f..e8fa6f0c7 100755
--- a/tests/ltlibsrc.test
+++ b/tests/ltlibsrc.test
@@ -23,6 +23,7 @@ set -e
cat >> configure.in << 'END'
AC_PROG_CC
+AM_PROG_AR
AC_PROG_LIBTOOL
AC_OUTPUT
END
diff --git a/tests/ltorder.test b/tests/ltorder.test
index 0f6921136..ef4a5f71c 100755
--- a/tests/ltorder.test
+++ b/tests/ltorder.test
@@ -23,6 +23,7 @@ set -e
cat >>configure.in <<'END'
AC_PROG_CC
+AM_PROG_AR
AC_PROG_LIBTOOL
AC_OUTPUT
END
diff --git a/tests/multlib.test b/tests/multlib.test
index 3f88be30a..1072a5745 100755
--- a/tests/multlib.test
+++ b/tests/multlib.test
@@ -66,6 +66,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])
@@ -89,6 +90,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 12b055ec9..2a0cf68b3 100755
--- a/tests/nobase-libtool.test
+++ b/tests/nobase-libtool.test
@@ -26,6 +26,7 @@ set -e
cat >> configure.in <<'EOF'
AC_PROG_CC
+AM_PROG_AR
AC_PROG_LIBTOOL
AC_OUTPUT
EOF
diff --git a/tests/nobase.test b/tests/nobase.test
index 8b0dc6e90..cac875627 100755
--- a/tests/nobase.test
+++ b/tests/nobase.test
@@ -24,6 +24,7 @@ set -e
cat >> configure.in <<'EOF'
AC_PROG_CC
+AM_PROG_AR
AC_PROG_RANLIB
AC_OUTPUT
EOF
diff --git a/tests/noinstdir.test b/tests/noinstdir.test
index 3f33c3210..b04bb0d62 100755
--- a/tests/noinstdir.test
+++ b/tests/noinstdir.test
@@ -34,9 +34,12 @@ END
cat >> configure.in << 'END'
AC_PROG_CC
+AM_PROG_AR
AC_PROG_RANLIB
END
+: > ar-lib
+
$ACLOCAL || Exit 1
$AUTOMAKE || Exit 1
diff --git a/tests/parse.test b/tests/parse.test
index e7dcbe5df..bf5b63a26 100755
--- a/tests/parse.test
+++ b/tests/parse.test
@@ -1,5 +1,6 @@
#! /bin/sh
-# Copyright (C) 1998, 2000, 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1998, 2000, 2001, 2002, 2011 Free Software Foundation,
+# Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -22,7 +23,6 @@ cat > configure.in << 'END'
AC_INIT
AM_INIT_AUTOMAKE(nonesuch, nonesuch)
AC_PROG_CC
-AC_PROG_RANLIB
AC_OUTPUT(Makefile)
END
diff --git a/tests/pluseq7.test b/tests/pluseq7.test
index 071646208..31a42464d 100755
--- a/tests/pluseq7.test
+++ b/tests/pluseq7.test
@@ -1,6 +1,6 @@
#! /bin/sh
-# Copyright (C) 1999, 2001, 2002, 2003, 2010 Free Software Foundation,
-# Inc.
+# Copyright (C) 1999, 2001, 2002, 2003, 2010, 2011 Free Software
+# Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -34,7 +34,8 @@ AR += qq
END
$ACLOCAL
-AUTOMAKE_fails
-grep 'Makefile.am:3:.*AR' stderr
+AUTOMAKE_fails -Wno-portability
+q="[\`'\"]"
+grep "^Makefile\.am:3:.* AR .* with $q=$q before .*$q+=$q" stderr
:
diff --git a/tests/pr211.test b/tests/pr211.test
index 6778f7a06..798e4f670 100755
--- a/tests/pr211.test
+++ b/tests/pr211.test
@@ -47,7 +47,7 @@ END
libtoolize
$ACLOCAL
-AUTOMAKE_fails -a
+AUTOMAKE_fails -Wnone -a
$FGREP 'foo.$(OBJEXT)' stderr
:
diff --git a/tests/pr300-lib.test b/tests/pr300-lib.test
index ee46b4b44..e10be2427 100755
--- a/tests/pr300-lib.test
+++ b/tests/pr300-lib.test
@@ -45,7 +45,7 @@ END
$ACLOCAL
$AUTOCONF
-$AUTOMAKE --copy --add-missing
+$AUTOMAKE -Wno-extra-portability --copy --add-missing
./configure --prefix "`pwd`/inst"
diff --git a/tests/pr300-ltlib.test b/tests/pr300-ltlib.test
index c47f32eba..5e8c052c6 100755
--- a/tests/pr300-ltlib.test
+++ b/tests/pr300-ltlib.test
@@ -47,7 +47,7 @@ END
libtoolize
$ACLOCAL
$AUTOCONF
-$AUTOMAKE --copy --add-missing
+$AUTOMAKE -Wno-extra-portability --copy --add-missing
./configure --prefix "`pwd`/inst"
diff --git a/tests/pr307.test b/tests/pr307.test
index 7676c4bc6..349681741 100755
--- a/tests/pr307.test
+++ b/tests/pr307.test
@@ -68,7 +68,7 @@ done
libtoolize --force
$ACLOCAL
$AUTOCONF
-$AUTOMAKE -a
+$AUTOMAKE -Wno-extra-portability -a
# Sanity check: make sure the variable we are attempting to force
# is used by configure
diff --git a/tests/pr401.test b/tests/pr401.test
index 88f773380..600931546 100755
--- a/tests/pr401.test
+++ b/tests/pr401.test
@@ -81,7 +81,7 @@ EOF
$ACLOCAL
$AUTOCONF
-$AUTOMAKE
+$AUTOMAKE -Wno-extra-portability
./configure
$MAKE distcheck
@@ -97,7 +97,7 @@ mv -f configure.int configure.in
$ACLOCAL
$AUTOCONF
-$AUTOMAKE
+$AUTOMAKE -Wno-extra-portability
./configure
test ! -d lib/lib
$MAKE distcheck
@@ -108,7 +108,7 @@ $MAKE distcheck
mv -f src/Makefile.am src/t
sed 's/LDADD = .*/LDADD = @LIBOBJS@/' src/t > src/Makefile.am
-AUTOMAKE_fails
+AUTOMAKE_fails -Wno-extra-portability
grep 'cannot be used outside.*lib' stderr
mv -f src/t src/Makefile.am
@@ -139,7 +139,7 @@ EOF
$ACLOCAL
$AUTOCONF
-$AUTOMAKE --add-missing
+$AUTOMAKE -Wno-extra-portability --add-missing
./configure
test ! -d src/lib
test ! -d 'src/$(top_builddir)'
@@ -176,7 +176,7 @@ EOF
$ACLOCAL
$AUTOCONF
-$AUTOMAKE
+$AUTOMAKE -Wno-extra-portability
./configure
$MAKE distcheck
diff --git a/tests/pr401b.test b/tests/pr401b.test
index 0af46467a..4bd2f36b6 100755
--- a/tests/pr401b.test
+++ b/tests/pr401b.test
@@ -82,7 +82,7 @@ EOF
libtoolize
$ACLOCAL
$AUTOCONF
-$AUTOMAKE -a
+$AUTOMAKE -Wno-extra-portability -a
./configure
$MAKE distcheck
@@ -99,7 +99,7 @@ mv -f configure.int configure.in
$ACLOCAL
$AUTOCONF
-$AUTOMAKE -a
+$AUTOMAKE -Wno-extra-portability -a
./configure
test ! -d lib/lib
$MAKE distcheck
@@ -110,7 +110,7 @@ $MAKE distcheck
mv -f src/Makefile.am src/t
sed 's/LDADD = .*/LDADD = @LTLIBOBJS@/' src/t > src/Makefile.am
-AUTOMAKE_fails
+AUTOMAKE_fails -Wno-extra-portability
grep 'cannot be used outside.*lib' stderr
mv -f src/t src/Makefile.am
@@ -140,7 +140,7 @@ EOF
$ACLOCAL
$AUTOCONF
-$AUTOMAKE --add-missing
+$AUTOMAKE -Wno-extra-portability --add-missing
./configure
test ! -d src/lib
test ! -d 'src/$(top_builddir)'
@@ -177,7 +177,7 @@ EOF
$ACLOCAL
$AUTOCONF
-$AUTOMAKE
+$AUTOMAKE -Wno-extra-portability
./configure
$MAKE distcheck
diff --git a/tests/pr401c.test b/tests/pr401c.test
index b94bc1660..1d0511f6b 100755
--- a/tests/pr401c.test
+++ b/tests/pr401c.test
@@ -83,7 +83,7 @@ EOF
$ACLOCAL
$AUTOCONF
-$AUTOMAKE
+$AUTOMAKE -Wno-extra-portability
./configure
$MAKE distcheck
@@ -100,7 +100,7 @@ mv -f configure.int configure.in
$ACLOCAL
$AUTOCONF
-$AUTOMAKE
+$AUTOMAKE -Wno-extra-portability
./configure
test ! -d lib/lib
$MAKE distcheck
@@ -111,7 +111,7 @@ $MAKE distcheck
mv -f src/Makefile.am src/t
sed 's/LDADD = .*/LDADD = @ALLOCA@/' src/t > src/Makefile.am
-AUTOMAKE_fails
+AUTOMAKE_fails -Wno-extra-portability
grep 'cannot be used outside.*lib' stderr
mv -f src/t src/Makefile.am
@@ -142,7 +142,7 @@ EOF
$ACLOCAL
$AUTOCONF
-$AUTOMAKE --add-missing
+$AUTOMAKE -Wno-extra-portability --add-missing
./configure
$MAKE
test ! -d src/lib
@@ -179,7 +179,7 @@ EOF
$ACLOCAL
$AUTOCONF
-$AUTOMAKE
+$AUTOMAKE -Wno-extra-portability
./configure
$MAKE distcheck
diff --git a/tests/pr72.test b/tests/pr72.test
index ab911ad15..5af32ec98 100755
--- a/tests/pr72.test
+++ b/tests/pr72.test
@@ -39,7 +39,7 @@ END
: > config.sub
$ACLOCAL
-$AUTOMAKE
+$AUTOMAKE -Wno-extra-portability
grep '^LINK =' Makefile.in
diff --git a/tests/primary-prefix-couples-documented-valid.test b/tests/primary-prefix-couples-documented-valid.test
index 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/reqd2.test b/tests/reqd2.test
index b47ef156d..1bf81236e 100755
--- a/tests/reqd2.test
+++ b/tests/reqd2.test
@@ -29,6 +29,7 @@ AC_CONFIG_AUX_DIR([autoconf])
AM_INIT_AUTOMAKE
AC_CONFIG_FILES([Makefile])
AC_PROG_CC
+AM_PROG_AR
AM_PROG_LIBTOOL
AC_CONFIG_FILES([autoconf/Makefile main/Makefile])
AC_OUTPUT
@@ -45,6 +46,7 @@ lib_LTLIBRARIES = lib0.la
lib0_la_SOURCES = 0.c
END
+: > ar-lib
libtoolize --force --copy
$ACLOCAL
$AUTOCONF
@@ -52,4 +54,6 @@ $AUTOCONF
test -f autoconf/ltmain.sh # Sanity check.
rm -f autoconf/ltmain.sh
AUTOMAKE_fails --add-missing --copy
-grep 'autoconf/ltmain.sh' stderr
+grep '^configure\.in:7:.* required file.*autoconf/ltmain\.sh' stderr
+
+:
diff --git a/tests/silent3.test b/tests/silent3.test
index 17f195980..4d66a0a99 100755
--- a/tests/silent3.test
+++ b/tests/silent3.test
@@ -29,6 +29,7 @@ cat >>configure.in <<'EOF'
AM_SILENT_RULES
AC_CONFIG_FILES([sub/Makefile])
AC_PROG_CC
+AM_PROG_AR
AM_PROG_CC_C_O
AC_PROG_LIBTOOL
AC_OUTPUT
diff --git a/tests/silent4.test b/tests/silent4.test
index 9c343c0d7..4ef4653fe 100755
--- a/tests/silent4.test
+++ b/tests/silent4.test
@@ -30,6 +30,7 @@ cat >>configure.in <<'EOF'
AM_SILENT_RULES
AC_CONFIG_FILES([sub/Makefile])
AC_PROG_CC
+AM_PROG_AR
AM_PROG_CC_C_O
AC_PROG_LIBTOOL
AC_OUTPUT
diff --git a/tests/silent9.test b/tests/silent9.test
index f0abb2902..76d97fcf7 100755
--- a/tests/silent9.test
+++ b/tests/silent9.test
@@ -30,6 +30,7 @@ AM_SILENT_RULES
AC_CONFIG_FILES([sub/Makefile])
AC_PROG_CC
AM_PROG_CC_C_O
+AM_PROG_AR
AC_PROG_LIBTOOL
AC_OUTPUT
EOF
diff --git a/tests/specflg-dummy.test b/tests/specflg-dummy.test
index 614d6c25e..d0c8ba660 100755
--- a/tests/specflg-dummy.test
+++ b/tests/specflg-dummy.test
@@ -61,6 +61,7 @@ AC_PROG_LEX
AC_PROG_F77
AC_PROG_FC
AM_PROG_GCJ
+AM_PROG_AR
AC_PROG_RANLIB
AC_PROG_LIBTOOL
AM_PROG_UPC
diff --git a/tests/specflg2.test b/tests/specflg2.test
index 0dc7fccc4..f67fd7b70 100755
--- a/tests/specflg2.test
+++ b/tests/specflg2.test
@@ -24,6 +24,7 @@ cat >> configure.in << 'END'
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_CXX
+AM_PROG_AR
AC_PROG_RANLIB
END
@@ -35,6 +36,8 @@ libfoo_a_CFLAGS = -DBAR
libfoo_a_CXXFLAGS = -DZOT
END
+: > ar-lib
+
# Make sure `compile' is required.
$ACLOCAL
AUTOMAKE_fails
diff --git a/tests/stdlib.test b/tests/stdlib.test
index 48f56fc25..5ca9a7ff2 100755
--- a/tests/stdlib.test
+++ b/tests/stdlib.test
@@ -1,5 +1,6 @@
#! /bin/sh
-# Copyright (C) 1996, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+# Copyright (C) 1996, 2001, 2002, 2003, 2004, 2011 Free Software
+# Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -22,15 +23,33 @@ set -e
cat >> configure.in << 'END'
AC_PROG_CC
+AM_PROG_AR
AC_PROG_RANLIB
END
cat > Makefile.am << 'END'
noinst_LIBRARIES = sub/foo
+include $(srcdir)/foo.mk
END
+cat > foo.mk << 'END'
+## A dummy automake comment.
+a = x \
+ y
+# A dummy make comment.
+lib_LIBRARIES = zardoz.a
+END
+
+: > ar-lib
+
$ACLOCAL
AUTOMAKE_fails
+q="[\`'\"]"
+badname='not a standard library name'
# We're specifically testing for line-number information.
-grep 'Makefile.am:1:.*sub/foo.*standard library name' stderr
-grep 'Makefile.am:1:.*sub/libfoo.a.*' stderr
+grep "^Makefile\\.am:1:.*${q}sub/foo${q}.*$badname" stderr
+grep "^Makefile\\.am:1:.*sub/libfoo\\.a" stderr
+grep "^foo\\.mk:5:.*${q}zardoz\\.a${q}.*$badname" stderr
+grep "^foo\\.mk:5:.*libzardoz\\.a" stderr
+
+:
diff --git a/tests/stdlib2.test b/tests/stdlib2.test
index c5d543c23..5da42adaf 100755
--- a/tests/stdlib2.test
+++ b/tests/stdlib2.test
@@ -32,6 +32,7 @@ set -e
cat >> configure.in << 'END'
AC_PROG_CC
+AM_PROG_AR
AC_PROG_LIBTOOL
AC_OUTPUT
END
diff --git a/tests/strip2.test b/tests/strip2.test
index 5786ded89..bab0a38e0 100755
--- a/tests/strip2.test
+++ b/tests/strip2.test
@@ -24,6 +24,7 @@ set -e
cat >> configure.in << 'END'
AC_PROG_CC
+AM_PROG_AR
AC_PROG_RANLIB
AC_OUTPUT
END
diff --git a/tests/strip3.test b/tests/strip3.test
index b15967334..34b02545f 100755
--- a/tests/strip3.test
+++ b/tests/strip3.test
@@ -24,6 +24,7 @@ set -e
cat >> configure.in << 'END'
AC_PROG_CC
+AM_PROG_AR
AC_PROG_LIBTOOL
AC_OUTPUT
END
diff --git a/tests/subdir4.test b/tests/subdir4.test
index 7ea10f894..9d4efec34 100755
--- a/tests/subdir4.test
+++ b/tests/subdir4.test
@@ -26,6 +26,7 @@ mkdir lib src
cat >> configure.in << 'END'
AC_PROG_RANLIB
AC_PROG_CC
+AM_PROG_AR
AC_CONFIG_FILES([lib/Makefile src/Makefile])
AC_OUTPUT
END
@@ -56,6 +57,8 @@ cat > src/Makefile.am << 'END'
pkgdata_DATA =
END
+: > ar-lib
+
$ACLOCAL
$AUTOMAKE --gnu
diff --git a/tests/subdirbuiltsources.test b/tests/subdirbuiltsources.test
index a84f28e9c..a6a0035b8 100755
--- a/tests/subdirbuiltsources.test
+++ b/tests/subdirbuiltsources.test
@@ -28,6 +28,7 @@ cat >> configure.in << 'END'
AC_CONFIG_FILES([lib/Makefile])
AC_PROG_RANLIB
AC_PROG_CC
+AM_PROG_AR
AC_OUTPUT
END
diff --git a/tests/subobj10.test b/tests/subobj10.test
index dbddf29c1..e446fba7a 100755
--- a/tests/subobj10.test
+++ b/tests/subobj10.test
@@ -26,6 +26,7 @@ AC_INIT([$me], [1.0])
AM_INIT_AUTOMAKE([subdir-objects])
AM_PROG_AS
+AM_PROG_AR
AC_PROG_RANLIB
AC_CONFIG_FILES([Makefile])
diff --git a/tests/subobj9.test b/tests/subobj9.test
index 83f3a31ef..39ba33e3a 100755
--- a/tests/subobj9.test
+++ b/tests/subobj9.test
@@ -25,6 +25,7 @@ cat > configure.in << END
AC_INIT([$me], [1.0])
AM_INIT_AUTOMAKE([subdir-objects])
AC_PROG_CXX
+AM_PROG_AR
AM_PROG_LIBTOOL
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
diff --git a/tests/subpkg-yacc.test b/tests/subpkg-yacc.test
index 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 f197ad45e..cfa5acb46 100755
--- a/tests/subpkg.test
+++ b/tests/subpkg.test
@@ -66,6 +66,7 @@ mkdir lib/src
cat >lib/configure.ac <<'EOF'
AC_INIT([lib], [2.3])
AM_INIT_AUTOMAKE
+AM_PROG_AR
AC_PROG_RANLIB
AC_CONFIG_HEADERS([config.h:config.hin])
AC_CONFIG_FILES([Makefile])
diff --git a/tests/subst3.test b/tests/subst3.test
index 1bcb17060..c7adc8c21 100755
--- a/tests/subst3.test
+++ b/tests/subst3.test
@@ -24,6 +24,7 @@ set -e
cat >> configure.in <<'EOF'
AC_PROG_CC
+AM_PROG_AR
AC_PROG_RANLIB
if test -n "$doit"; then
AC_SUBST([basehdr], [sub/base.h])
diff --git a/tests/substtarg.test b/tests/substtarg.test
index d82895470..34db19fcb 100755
--- a/tests/substtarg.test
+++ b/tests/substtarg.test
@@ -25,6 +25,7 @@ set -e
cat >> configure.in << 'END'
AC_CONFIG_SOURCE([fakelib.c])
AC_PROG_CC
+AM_PROG_AR
RANLIB=:
AC_SUBST([RANLIB])
SUBST=hei
@@ -42,6 +43,8 @@ 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/suffix10.test b/tests/suffix10.test
index 131359c8f..bdc4928e6 100755
--- a/tests/suffix10.test
+++ b/tests/suffix10.test
@@ -25,6 +25,7 @@ set -e
cat >>configure.in <<EOF
AC_PROG_CC
AC_PROG_YACC
+AM_PROG_AR
AC_PROG_LIBTOOL
AC_OUTPUT
EOF
diff --git a/tests/suffix2.test b/tests/suffix2.test
index 405ce90c5..f55d965c0 100755
--- a/tests/suffix2.test
+++ b/tests/suffix2.test
@@ -24,6 +24,7 @@ set -e
cat >> configure.in << 'END'
AC_PROG_CC
+AM_PROG_AR
AC_PROG_LIBTOOL
END
diff --git a/tests/suffix5.test b/tests/suffix5.test
index b3b36aaea..2cf0afa7c 100755
--- a/tests/suffix5.test
+++ b/tests/suffix5.test
@@ -24,6 +24,7 @@ required=libtool
set -e
cat >> configure.in << 'END'
+AM_PROG_AR
AC_PROG_LIBTOOL
END
@@ -38,6 +39,7 @@ END
: > ltmain.sh
: > config.guess
: > config.sub
+: > ar-lib
$ACLOCAL
$AUTOMAKE
diff --git a/tests/suffix8.test b/tests/suffix8.test
index 70ff3a590..d2ba0d4ab 100755
--- a/tests/suffix8.test
+++ b/tests/suffix8.test
@@ -23,6 +23,7 @@ required='gcc libtoolize'
set -e
cat >>configure.in <<'END'
+AM_PROG_AR
AM_PROG_LIBTOOL
AC_OUTPUT
END
diff --git a/tests/syntax.test b/tests/syntax.test
index 505486f0d..23fa79255 100755
--- a/tests/syntax.test
+++ b/tests/syntax.test
@@ -1,5 +1,6 @@
#! /bin/sh
-# Copyright (C) 1998, 2001, 2002, 2003 Free Software Foundation, Inc.
+# Copyright (C) 1998, 2001, 2002, 2003, 2011 Free Software Foundation,
+# Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -23,9 +24,11 @@ set -e
cat > Makefile.am << 'END'
foo = q \
-lib_LTLIBRARIES = foo.la
+bin_SCRIPTS = foo.sh
END
$ACLOCAL
-AUTOMAKE_fails
-grep 'Makefile.am:2:.*blank line' stderr
+AUTOMAKE_fails -Wnone
+grep '^Makefile\.am:2:.*blank line following trailing backslash' stderr
+
+:
diff --git a/tests/vala.test b/tests/vala.test
index 3e9ae3648..34b71d4a4 100755
--- a/tests/vala.test
+++ b/tests/vala.test
@@ -28,6 +28,7 @@ set -e
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 d0cc24101..b2c9e1606 100755
--- a/tests/vala1.test
+++ b/tests/vala1.test
@@ -29,6 +29,7 @@ set -e
cat >> 'configure.in' << 'END'
AC_PROG_CC
+AM_PROG_AR
AC_PROG_LIBTOOL
AM_PROG_VALAC
AC_OUTPUT