]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
Extend tests on AC_LIBOBJ and friends.
authorStefano Lattarini <stefano.lattarini@gmail.com>
Tue, 31 Aug 2010 13:14:29 +0000 (15:14 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Thu, 9 Dec 2010 20:20:58 +0000 (21:20 +0100)
* tests/aclibobj.test: Removed, superseded by ...
* tests/libobj1.test: ... this new test, which runs autoconf,
./configure and make, to ensure everything really works.
* tests/libobj3.test: Add trailing `:' command.  Quote literal dot
in grep regexp.
* tests/libobj4.test: Enable `errexit' shell flag, and related
changes.  Add trailing `:' command.  Use proper m4 quoting.
* tests/ltlibobjs.test: Likewise.
* tests/libobj5.test: Enable `errexit' shell flag, and related
changes.  Add trailing `:' command.  Make more robust by using
longer filenames to be grepped.
* tests/libobj8.test: Enable `errexit' shell flag, and related
changes.  Add trailing `:' command.  Use the configure.in
stub provided by ./defs, rather than writing it from scratch.
* tests/libobj2.test: Likewise.  Also, add calls to autoconf,
./configure and make, to ensure everything really works.
* tests/libobj7.test: Likewise, and ensure that at least one
function listed in AC_REPLACE_FUNCTIONS is truly replaced.
* tests/libobj13.test: Make grepping of Automake stderr slighty
stricter.  Add trailing `:' command.
* tests/libobj12.test: Likewise.  Also, prefer "cat + here-doc"
over "echo" to append to Makefile.am, and some cosmetic changes
in spacing.
* tests/libobj14.test: Call `Exit 1' if sourcing of ./defs fails.
Slighty improve m4 quoting.  Add trailing `:' command.
* tests/libobj10.test: Add calls to autoconf, ./configure and
make, to ensure everything really works.  Also, remove tests that
nonexistent source for AC_LIBOBJ cause an Automake failure: this
is already checked by ...
* tests/libobj15a.test: ... this new test.
* tests/libobj15b.test: New test, sister test of libobj15a.test,
checks AC_LIBSOURCE instead of AC_LIBOBJ.
* tests/libobj15c.test: New test, sister test of libobj15a.test,
checks AC_LIBSOURCES instead of AC_LIBOBJ.
* tests/libobj11.test: Removed, superseded by ...
* tests/libobj16a.test: ... this new test.
* tests/libobj16b.test: New test, sister test of libobj16a.test,
but using oldish/depracated idioms.
* tests/libobj17.test: New test.
* tests/libobj18.test: Likewise.
* tests/libobj19.test: Likewise.
* tests/libobj20a.test: Likewise.
* tests/libobj20b.test: Likewise.
* tests/libobj20c.test: Likewise.
* tests/Makefile.am (TESTS): Updated.

26 files changed:
ChangeLog
tests/Makefile.am
tests/Makefile.in
tests/libobj-basic.test [new file with mode: 0755]
tests/libobj10.test
tests/libobj12.test
tests/libobj13.test
tests/libobj14.test
tests/libobj15a.test [moved from tests/libobj11.test with 71% similarity]
tests/libobj15b.test [new file with mode: 0755]
tests/libobj15c.test [new file with mode: 0755]
tests/libobj16a.test [new file with mode: 0755]
tests/libobj16b.test [new file with mode: 0755]
tests/libobj17.test [new file with mode: 0755]
tests/libobj18.test [new file with mode: 0755]
tests/libobj19.test [new file with mode: 0755]
tests/libobj2.test
tests/libobj20a.test [moved from tests/aclibobj.test with 67% similarity]
tests/libobj20b.test [new file with mode: 0755]
tests/libobj20c.test [new file with mode: 0755]
tests/libobj3.test
tests/libobj4.test
tests/libobj5.test
tests/libobj7.test
tests/libobj8.test
tests/ltlibobjs.test

index e8864f1256205950e1439880ba9e5d1f9af5f28b..59635e2005bd7c7b8179c8b94b36bc55d2283a79 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,52 @@
+2010-12-09  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       Extend tests on AC_LIBOBJ and friends.
+       * tests/aclibobj.test: Removed, superseded by ...
+       * tests/libobj-basic.test: ... this new test, which runs autoconf,
+       ./configure and make, to ensure everything really works.
+       * tests/libobj3.test: Add trailing `:' command.  Escape literal
+       dot in grep regexp.
+       * tests/libobj4.test: Enable `errexit' shell flag, and related
+       changes.  Add trailing `:' command.  Use proper m4 quoting.
+       * tests/ltlibobjs.test: Likewise.
+       * tests/libobj5.test: Enable `errexit' shell flag, and related
+       changes.  Add trailing `:' command.  Make more robust by using
+       longer filenames to be grepped.
+       * tests/libobj8.test: Enable `errexit' shell flag, and related
+       changes.  Add trailing `:' command.  Use the configure.in
+       stub provided by ./defs, rather than writing it from scratch.
+       * tests/libobj2.test: Likewise.  Also, add calls to autoconf,
+       ./configure and make, to ensure everything really works.
+       * tests/libobj7.test: Likewise, and ensure that at least one
+       function listed in AC_REPLACE_FUNCTIONS is truly replaced.
+       * tests/libobj13.test: Make grepping of Automake stderr slightly
+       stricter.  Add trailing `:' command.
+       * tests/libobj12.test: Likewise.  Also, prefer "cat + here-doc"
+       over "echo" to append to Makefile.am, and some cosmetic changes
+       in spacing.
+       * tests/libobj14.test: Call `Exit 1' if sourcing of ./defs fails.
+       Slighty improve m4 quoting.  Add trailing `:' command.
+       * tests/libobj10.test: Add calls to autoconf, ./configure and
+       make, to ensure everything really works.  Also, remove tests that
+       nonexistent source for AC_LIBOBJ cause an Automake failure: this
+       is already checked by ...
+       * tests/libobj15a.test: ... this new test.
+       * tests/libobj15b.test: New test, sister test of libobj15a.test,
+       checks AC_LIBSOURCE instead of AC_LIBOBJ.
+       * tests/libobj15c.test: New test, sister test of libobj15a.test,
+       checks AC_LIBSOURCES instead of AC_LIBOBJ.
+       * tests/libobj11.test: Removed, superseded by ...
+       * tests/libobj16a.test: ... this new test.
+       * tests/libobj16b.test: New test, sister test of libobj16a.test,
+       but using oldish/deprecated idioms.
+       * tests/libobj17.test: New test.
+       * tests/libobj18.test: Likewise.
+       * tests/libobj19.test: Likewise.
+       * tests/libobj20a.test: Likewise.
+       * tests/libobj20b.test: Likewise.
+       * tests/libobj20c.test: Likewise.
+       * tests/Makefile.am (TESTS): Updated.
+
 2010-11-25  Stefano Lattarini  <stefano.lattarini@gmail.com>
 
        Fix spurious failures in `silent*.test' for $CC != gcc
index dab04e39336af6e94f6758b401366ee90e341e4b..e91551045b4f6234ab2b7ae35ae711f3f666b6cb 100644 (file)
@@ -37,7 +37,6 @@ $(parallel_tests): $(parallel_tests:-p.test=.test) Makefile.am
 MAINTAINERCLEANFILES = $(parallel_tests)
 
 TESTS = \
-aclibobj.test \
 aclocal.test \
 aclocal3.test \
 aclocal4.test \
@@ -416,6 +415,7 @@ lex5.test \
 lflags.test \
 lflags2.test \
 libexec.test \
+libobj-basic.test \
 libobj2.test \
 libobj3.test \
 libobj4.test \
@@ -423,10 +423,20 @@ libobj5.test \
 libobj7.test \
 libobj8.test \
 libobj10.test \
-libobj11.test \
 libobj12.test \
 libobj13.test \
 libobj14.test \
+libobj15a.test \
+libobj15b.test \
+libobj15c.test \
+libobj16a.test \
+libobj16b.test \
+libobj17.test \
+libobj18.test \
+libobj19.test \
+libobj20a.test \
+libobj20b.test \
+libobj20c.test \
 library.test \
 library2.test \
 library3.test \
index de21f4334e83da8adf72837774285defe8cbafe1..17b96916da56607f53b9701407c6b86f5dc165ee 100644 (file)
@@ -304,7 +304,6 @@ pr401c-p.test
 
 MAINTAINERCLEANFILES = $(parallel_tests)
 TESTS = \
-aclibobj.test \
 aclocal.test \
 aclocal3.test \
 aclocal4.test \
@@ -683,6 +682,7 @@ lex5.test \
 lflags.test \
 lflags2.test \
 libexec.test \
+libobj-basic.test \
 libobj2.test \
 libobj3.test \
 libobj4.test \
@@ -690,10 +690,20 @@ libobj5.test \
 libobj7.test \
 libobj8.test \
 libobj10.test \
-libobj11.test \
 libobj12.test \
 libobj13.test \
 libobj14.test \
+libobj15a.test \
+libobj15b.test \
+libobj15c.test \
+libobj16a.test \
+libobj16b.test \
+libobj17.test \
+libobj18.test \
+libobj19.test \
+libobj20a.test \
+libobj20b.test \
+libobj20c.test \
 library.test \
 library2.test \
 library3.test \
diff --git a/tests/libobj-basic.test b/tests/libobj-basic.test
new file mode 100755 (executable)
index 0000000..64b9c2b
--- /dev/null
@@ -0,0 +1,110 @@
+#! /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 AC_LIBSOURCE and AC_LIBSOURCES work.
+
+. ./defs || Exit 1
+
+set -e
+
+mv configure.in configure.proto
+cat >> configure.proto << 'END'
+AC_PROG_CC
+AC_PROG_RANLIB
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+noinst_LIBRARIES = libtu.a
+libtu_a_SOURCES = foo.c
+libtu_a_LIBADD = $(LIBOBJS)
+
+include extra-checks.am
+.PHONY: $(extra_checks) pre-test
+
+pre-test: distdir
+       ls -l $(srcdir) $(builddir) $(distdir)
+       $(AR) tv libtu.a
+$(extra_checks): pre-test
+check-local: $(extra_checks)
+
+maude-src:
+       grep dummy_maude $(srcdir)/maude.c
+maude-dist:
+       grep dummy_maude $(distdir)/maude.c
+liver-src:
+       grep dummy_liver $(srcdir)/liver.c
+liver-dist:
+       grep dummy_liver $(distdir)/liver.c
+liver-not-dist:
+       test -d $(distdir)
+       test ! -r $(distdir)/liver.c
+maude-not-dist:
+       test -d $(distdir)
+       test ! -r $(distdir)/maude.c
+END
+
+cat > foo.c << 'END'
+extern int dummy_foo;
+END
+
+cat > maude.c << 'END'
+extern int dummy_maude;
+END
+
+cat > liver.c << 'END'
+extern int dummy_liver;
+END
+
+# AC_LIBSOURCE should work also if called after AC_OUTPUT.
+cat configure.proto - > configure.in <<END
+AC_LIBSOURCE([maude.c])
+END
+
+cat > extra-checks.am << 'END'
+extra_checks = maude-src maude-dist liver-not-dist
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+./configure
+
+$MAKE check
+$MAKE distcheck
+
+$MAKE distclean
+# Avoid timestamp-related differences.
+rm -rf autom4te*.cache
+
+cat > extra-checks.am << 'END'
+extra_checks = maude-src maude-dist liver-src liver-dist
+END
+
+# AC_LIBSOURCES should work also if called after AC_OUTPUT.
+cat configure.proto - > configure.in <<END
+AC_LIBSOURCES([maude.c, liver.c])
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+./configure
+
+$MAKE check
+$MAKE distcheck
+
+:
index 0d24741620f15bddaf80311e8be553f544bb43de..7897351aa62b49467ad26c17f5f7a721a4c6c403 100755 (executable)
@@ -1,5 +1,6 @@
 #! /bin/sh
-# Copyright (C) 1999, 2000, 2001, 2002, 2003  Free Software Foundation, Inc.
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 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
@@ -30,13 +31,22 @@ END
 
 cat > Makefile.am << 'END'
 noinst_LIBRARIES = libfoo.a
-libfoo_a_LIBADD = @LIBOBJS@
+libfoo_a_SOURCES =
+libfoo_a_LIBADD = $(LIBOBJS)
+BUILT_SOURCES = foo.c
+CLEANFILES = foo.c
+foo.c:
+       echo 'extern int dummy;' > $@
 END
 
 $ACLOCAL
-AUTOMAKE_fails
-grep 'Makefile.am:2:.*foo\.c' stderr
+$AUTOCONF
+$AUTOMAKE
 
-echo 'BUILT_SOURCES = foo.c' >> Makefile.am
+./configure
 
-$AUTOMAKE
+$MAKE
+ar t libfoo.a # for debugging
+$MAKE distcheck
+
+:
index 5f1d02908385465bc22b98c01dd69109b41771c2..747d7a0d9e79c9a0233723fdce6a80c41bc51d12 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2002, 2003  Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003, 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
 # 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 a file can be mentioned in LIBOBJS and explicitly.
 # (See libobj13.test for the LTLIBRARIES check.)
 
 . ./defs || Exit 1
+
 set -e
 
 cat >> configure.in << 'END'
@@ -48,22 +48,30 @@ END
 : > bar.c
 
 $ACLOCAL
-$AUTOMAKE
 
 # This however should be diagnosed, since foo.c and bar.c are in @LIBOBJS@.
-echo 'libfoo_a_SOURCES += foo.c' >> Makefile.am
-echo 'p1_SOURCES += bar.c' >> Makefile.am
+cat >> Makefile.am << 'END'
+libfoo_a_SOURCES += foo.c
+p1_SOURCES += bar.c
+END
+
 AUTOMAKE_fails
-$FGREP foo.c stderr
-$FGREP bar.c stderr
+grep 'foo\.c.*explicitly mentioned' stderr
+grep 'bar\.c.*explicitly mentioned' stderr
 
 # Global `LDADD' can also come into play.
 cat > Makefile.am << 'END'
 noinst_PROGRAMS = a b
 LDADD = @LIBOBJS@
 END
+
 $AUTOMAKE
 grep 'a_DEPENDENCIES.*LIBOBJS' Makefile.in
-echo 'a_SOURCES = foo.c' >> Makefile.am
+
+cat >> Makefile.am << 'END'
+a_SOURCES = foo.c
+END
 AUTOMAKE_fails
-$FGREP foo.c stderr
+grep 'foo\.c.*explicitly mentioned' stderr
+
+:
index 6ca68c9e6fcb370cc4513a1f5c0288e4e56c4a53..6d1e68dfd1cfb986ef7d72dae5efd79fce92fe78 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2002, 2003  Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003, 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
 # 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 a file can be mentioned in LTLIBOBJS and explicitly.
 # (Like libobj12.test, but for Libtool libraries.)
 
 required='libtoolize'
 . ./defs || Exit 1
+
 set -e
 
 cat >> configure.in << 'END'
@@ -47,4 +47,6 @@ $AUTOMAKE --add-missing
 # This however should be diagnosed, since foo.c is in @LIBOBJS@.
 echo 'libfoo_la_SOURCES += foo.c' >> Makefile.am
 AUTOMAKE_fails
-$FGREP foo.c stderr
+grep 'foo\.c.*explicitly mentioned' stderr
+
+:
index 0ee750c83fad18a5cda3e1e0ab5ed99dd0a3f36d..08841c36d46f4c954937c8c88ad60b03b3737989 100755 (executable)
@@ -27,7 +27,7 @@ set -e
 cat >>configure.in <<'EOF'
 AC_PROG_CC
 AC_LIBSOURCE([bar.c])
-AM_CONDITIONAL([CASE], :)
+AM_CONDITIONAL([CASE], [:])
 AC_OUTPUT
 EOF
 
@@ -43,3 +43,5 @@ EOF
 
 $ACLOCAL
 $AUTOMAKE
+
+:
similarity index 71%
rename from tests/libobj11.test
rename to tests/libobj15a.test
index 204ff8bb4c90b03167f2a4cb791e94eee8c5d93d..51da834bc62548ba77c3516b6cfe75563e45dd90 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2002, 2008  Free Software Foundation, Inc.
+# 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
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# AC_LIBOBJ must allow [] around its argument.
+# Nonexistent sources for AC_LIBOBJ should cause an Automake failure.
 
 . ./defs || Exit 1
 
-cat > configure.in << 'END'
-AC_INIT
-AM_INIT_AUTOMAKE(nonesuch, nonesuch)
+set -e
+
+cat >> configure.in << 'END'
 AC_PROG_CC
 AC_PROG_RANLIB
-AC_LIBOBJ([mountlist])
-AC_OUTPUT(Makefile)
+AC_LIBOBJ([foobar])
 END
 
 cat > Makefile.am << 'END'
 noinst_LIBRARIES = libtu.a
 libtu_a_SOURCES =
-libtu_a_LIBADD = @LIBOBJS@
+libtu_a_LIBADD = $(LIBOBJS)
 END
 
-: > mountlist.c
+$ACLOCAL
+AUTOMAKE_fails
+grep 'configure\.in:.*required file.*foobar\.c.*' stderr
 
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+:
diff --git a/tests/libobj15b.test b/tests/libobj15b.test
new file mode 100755 (executable)
index 0000000..000ba1f
--- /dev/null
@@ -0,0 +1,43 @@
+#! /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/>.
+
+# Nonexistent source for AC_LIBSOURCE should cause Automake to fail.
+
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_PROG_CC
+AC_PROG_RANLIB
+AC_LIBSOURCE([foobar.c])
+# FIXME: without a call to AC_OUTPUT, Automake does not fail when file(s)
+#        specified in AC_LIBSOURCE call(s) do not exist.  Should we fix
+#        this limitation?  Or is the current behaviour good enough?
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+noinst_LIBRARIES = libtu.a
+libtu_a_SOURCES =
+libtu_a_LIBADD = $(LIBOBJS)
+END
+
+$ACLOCAL
+AUTOMAKE_fails
+grep 'configure\.in:.*required file.*foobar\.c.*' stderr
+
+:
diff --git a/tests/libobj15c.test b/tests/libobj15c.test
new file mode 100755 (executable)
index 0000000..f1aa259
--- /dev/null
@@ -0,0 +1,50 @@
+#! /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/>.
+
+# Nonexistent sources for AC_LIBSOURCES should cause Automake to fail.
+
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_PROG_CC
+AC_PROG_RANLIB
+AC_LIBSOURCES([foobar.c, bazquux.c])
+# FIXME: without a call to AC_OUTPUT, Automake does not fail when file(s)
+#        specified in AC_LIBSOURCES call(s) do not exist.  Should we fix
+#        this limitation?  Or is the current behaviour good enough?
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+noinst_LIBRARIES = libtu.a
+libtu_a_SOURCES =
+libtu_a_LIBADD = $(LIBOBJS)
+END
+
+$ACLOCAL
+
+AUTOMAKE_fails
+grep 'configure\.in:.*required file.*foobar\.c.*' stderr
+grep 'configure\.in:.*required file.*bazquux\.c.*' stderr
+
+: > foobar.c
+AUTOMAKE_fails
+grep 'configure\.in:.*required file.*bazquux\.c.*' stderr
+grep 'foobar\.c' stderr && Exit 1
+
+:
diff --git a/tests/libobj16a.test b/tests/libobj16a.test
new file mode 100755 (executable)
index 0000000..a673819
--- /dev/null
@@ -0,0 +1,139 @@
+#! /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 AC_LIBOBJ and friends work.
+# Please keep this in sync with sister test `libobj16b.test'.
+
+. ./defs || Exit 1
+
+set -e
+
+mv configure.in configure.proto
+cat >> configure.proto << 'END'
+AC_PROG_CC
+AC_PROG_RANLIB
+%LIBOBJ-STUFF% # will be activated later
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+noinst_LIBRARIES = libtu.a
+libtu_a_SOURCES =
+libtu_a_LIBADD = $(LIBOBJS)
+
+include extra-checks.am
+.PHONY: $(extra_checks) pre-test
+
+pre-test: distdir
+       ls -l $(srcdir) $(builddir) $(distdir)
+       $(AR) tv libtu.a
+$(extra_checks): pre-test
+check-local: $(extra_checks)
+
+maude-src:
+       grep dummy_maude $(srcdir)/maude.c
+maude-dist:
+       grep dummy_maude $(distdir)/maude.c
+liver-src:
+       grep dummy_liver $(srcdir)/liver.c
+liver-dist:
+       grep dummy_liver $(distdir)/liver.c
+liver-not-dist: distdir
+       test ! -r $(distdir)/liver.c
+maude-not-dist: distdir
+       test ! -r $(distdir)/maude.c
+maude-lib:
+       $(AR) t libtu.a | grep maude
+maude-not-lib:
+       $(AR) t libtu.a | grep maude && exit 1; exit 0
+liver-lib:
+       $(AR) t libtu.a | grep liver
+liver-not-lib:
+       $(AR) t libtu.a | grep liver && exit 1; exit 0
+END
+
+cat > maude.c << 'END'
+extern int dummy_maude;
+END
+
+cat > liver.c << 'END'
+extern int dummy_liver;
+END
+
+sed '/%LIBOBJ-STUFF%/{
+s/.*//
+i\
+AC_LIBOBJ([maude])
+}' configure.proto > configure.in
+cat configure.in # for debugging
+
+cat > extra-checks.am << 'END'
+extra_checks = maude-src maude-dist maude-lib liver-not-dist
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+./configure
+
+$MAKE
+$MAKE check
+$MAKE distcheck
+$MAKE distclean
+
+# Avoid timestamp-related differences.
+rm -rf autom4te*.cache
+
+cat > extra-checks.am << 'END'
+extra_checks = maude-src maude-dist liver-src liver-dist
+if MAUDE_COND
+extra_checks += maude-lib liver-not-lib
+else
+extra_checks += maude-not-lib liver-lib
+endif
+END
+
+sed '/%LIBOBJ-STUFF%/{
+s/.*//
+i\
+AM_CONDITIONAL([MAUDE_COND], [test x"$MAUDE" = x"yes"])\
+if test x"$MAUDE" = x"yes"; then\
+  AC_LIBOBJ([maude])\
+else\
+  AC_LIBOBJ([liver])\
+fi\
+AC_LIBSOURCES([maude.c, liver.c])
+}' configure.proto > configure.in
+cat configure.in # for debugging
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+./configure MAUDE=yes
+$MAKE
+$MAKE check
+$MAKE distcheck
+$MAKE distclean
+
+./configure MAUDE=no
+$MAKE
+$MAKE check
+$MAKE distcheck
+$MAKE distclean
+
+:
diff --git a/tests/libobj16b.test b/tests/libobj16b.test
new file mode 100755 (executable)
index 0000000..f2ac76d
--- /dev/null
@@ -0,0 +1,140 @@
+#! /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 AC_LIBOBJ and friends work.
+# Please keep this in sync with sister test `libobj16b.test'.
+
+. ./defs || Exit 1
+
+set -e
+
+mv configure.in configure.proto
+cat >> configure.proto << 'END'
+AC_PROG_CC
+AC_PROG_RANLIB
+%LIBOBJ-STUFF% # will be activated later
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+noinst_LIBRARIES = libtu.a
+libtu_a_SOURCES =
+libtu_a_LIBADD = @LIBOBJS@
+
+include extra-checks.am
+.PHONY: $(extra_checks) pre-test
+
+pre-test: distdir
+       ls -l $(srcdir) $(builddir) $(distdir)
+       $(AR) tv libtu.a
+$(extra_checks): pre-test
+check-local: $(extra_checks)
+
+maude-src:
+       grep dummy_maude $(srcdir)/maude.c
+maude-dist:
+       grep dummy_maude $(distdir)/maude.c
+liver-src:
+       grep dummy_liver $(srcdir)/liver.c
+liver-dist:
+       grep dummy_liver $(distdir)/liver.c
+liver-not-dist: distdir
+       test ! -r $(distdir)/liver.c
+maude-not-dist: distdir
+       test ! -r $(distdir)/maude.c
+maude-lib:
+       $(AR) t libtu.a | grep maude
+maude-not-lib:
+       $(AR) t libtu.a | grep maude && exit 1; exit 0
+liver-lib:
+       $(AR) t libtu.a | grep liver
+liver-not-lib:
+       $(AR) t libtu.a | grep liver && exit 1; exit 0
+END
+
+cat > maude.c << 'END'
+extern int dummy_maude;
+END
+
+cat > liver.c << 'END'
+extern int dummy_liver;
+END
+
+sed '/%LIBOBJ-STUFF%/{
+s/.*//
+i\
+AC_LIBOBJ(maude) dnl: do not quote this!
+}' configure.proto > configure.in
+cat configure.in # for debugging
+
+cat > extra-checks.am << 'END'
+extra_checks = maude-src maude-dist maude-lib liver-not-dist
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+./configure
+
+$MAKE
+$MAKE check
+$MAKE distcheck
+$MAKE distclean
+
+# Avoid timestamp-related differences.
+rm -rf autom4te*.cache
+
+cat > extra-checks.am << 'END'
+extra_checks = maude-src maude-dist liver-src liver-dist
+if MAUDE_COND
+extra_checks += maude-lib liver-not-lib
+else
+extra_checks += maude-not-lib liver-lib
+endif
+END
+
+sed '/%LIBOBJ-STUFF%/{
+s/.*//
+i\
+AM_CONDITIONAL([MAUDE_COND], [test x"$MAUDE" = x"yes"])\
+if test x"$MAUDE" = x"yes"; then\
+  AC_LIBOBJ(maude) dnl: do not quote this!\
+else\
+  AC_LIBOBJ(liver) dnl: do not quote this!\
+fi\
+AC_LIBSOURCE(maude.c) dnl: do not quote this!\
+AC_LIBSOURCE(liver.c) dnl: do not quote this!
+}' configure.proto > configure.in
+cat configure.in # for debugging
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+./configure MAUDE=yes
+$MAKE
+$MAKE check
+$MAKE distcheck
+$MAKE distclean
+
+./configure MAUDE=no
+$MAKE
+$MAKE check
+$MAKE distcheck
+$MAKE distclean
+
+:
diff --git a/tests/libobj17.test b/tests/libobj17.test
new file mode 100755 (executable)
index 0000000..daf4039
--- /dev/null
@@ -0,0 +1,67 @@
+#! /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 AC_LIBOBJ accept non-literal arguments.
+
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_PROG_CC
+AC_PROG_RANLIB
+foo=${FOO-oops}
+AC_LIBSOURCES([quux.c, zardoz.c])
+AC_LIBOBJ([$foo])
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+noinst_LIBRARIES = libtu.a
+libtu_a_SOURCES =
+libtu_a_LIBADD = $(LIBOBJS)
+END
+
+cat > quux.c <<'END'
+extern int dummy;
+END
+
+cat > zardoz.c <<'END'
+extern int dummy;
+END
+
+# These might print warnings, but should not error out.
+$ACLOCAL
+$AUTOMAKE
+$AUTOCONF
+
+./configure FOO=quux
+$MAKE
+ls -l # for debugging
+test -f libtu.a
+ar t libtu.a | $FGREP quux
+ar t libtu.a | $FGREP zardoz && Exit 1
+
+$MAKE distclean
+
+./configure FOO=zardoz
+$MAKE
+ls -l # for debugging
+test -f libtu.a 
+ar t libtu.a | $FGREP zardoz
+ar t libtu.a | $FGREP quux && Exit 1
+
+:
diff --git a/tests/libobj18.test b/tests/libobj18.test
new file mode 100755 (executable)
index 0000000..e03493e
--- /dev/null
@@ -0,0 +1,46 @@
+#! /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 AC_LIBSOURCE and AC_LIBSOURCES use arguments literally.
+
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_PROG_CC
+AC_PROG_RANLIB
+foo=dummy bar=dummy baz=dummy
+AC_LIBSOURCE([$foo.c])
+AC_LIBSOURCES([$bar.c, $baz.c])
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+noinst_LIBRARIES = libtu.a
+libtu_a_SOURCES =
+libtu_a_LIBADD = $(LIBOBJS)
+END
+
+: > dummy.c
+
+$ACLOCAL
+AUTOMAKE_fails
+grep 'configure\.in:.*required file.*\$foo\.c.*not found' stderr
+grep 'configure\.in:.*required file.*\$bar\.c.*not found' stderr
+grep 'configure\.in:.*required file.*\$baz\.c.*not found' stderr
+
+:
diff --git a/tests/libobj19.test b/tests/libobj19.test
new file mode 100755 (executable)
index 0000000..4fd150b
--- /dev/null
@@ -0,0 +1,62 @@
+#! /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/>.
+
+# Test support for AC_CONFIG_LIBOBJ_DIR.
+
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_CONFIG_LIBOBJ_DIR([libobj-dir])
+AC_PROG_CC
+AC_PROG_RANLIB
+AC_LIBOBJ([foobar])
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+AUTOMAKE_OPTIONS = subdir-objects ## required for our setup to work
+noinst_LIBRARIES = libtu.a
+libtu_a_SOURCES =
+libtu_a_LIBADD = $(LIBOBJS)
+check-local: distdir
+       ls -l $(srcdir)/* $(builddir)/* $(distdir)/*
+       test -f libtu.a
+       test ! -r $(srcdir)/foobar.c
+       test -f $(srcdir)/libobj-dir/foobar.c
+       test ! -r $(distdir)/foobar.c
+       test -f $(distdir)/libobj-dir/foobar.c
+       $(AR) t libtu.a
+       $(AR) t libtu.a | grep foobar
+END
+
+mkdir libobj-dir
+cat > libobj-dir/foobar.c << 'END'
+extern int dummy;
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+./configure
+
+$MAKE
+$MAKE check
+$MAKE distcheck
+
+:
index 81b0e7222317cee244c13e26fd3957e8955c7cb2..913fef9bf84cb6019a28cab0b59aaef414c8b456 100755 (executable)
@@ -1,6 +1,6 @@
 #! /bin/sh
-# Copyright (C) 1996, 1997, 1999, 2000, 2001, 2002
-# Free Software Foundation, Inc.
+# Copyright (C) 1996, 1997, 1999, 2000, 2001, 2002, 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
 
 . ./defs || Exit 1
 
-cat > configure.in << 'END'
-AC_INIT
-AM_INIT_AUTOMAKE(nonesuch, nonesuch)
+set -e
+
+cat >> configure.in << 'END'
+AC_CONFIG_FILES([subdir/Makefile])
 AC_PROG_CC
 AC_PROG_RANLIB
 AC_LIBOBJ([fsusage])
-AC_OUTPUT(subdir/Makefile)
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+SUBDIRS = subdir
+check-local: distdir
+       ls -l $(srcdir) $(srcdir)/subdir
+       ls -l $(distdir) $(distdir)/subdir
+       ls -l $(builddir) $(builddir)/subdir
+       test -f $(srcdir)/subdir/fsusage.c
+       test -f $(distdir)/subdir/fsusage.c
+       $(AR) tv $(builddir)/subdir/libtu.a
 END
 
 mkdir subdir
@@ -37,9 +49,20 @@ libtu_a_SOURCES =
 libtu_a_LIBADD = @LIBOBJS@
 END
 
-: > subdir/fsusage.c
+cat > subdir/fsusage.c << 'END'
+extern int dummy;
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+# Older grepping check, kept "just to be sure".
+$FGREP 'fsusage.c' subdir/Makefile.in
+
+./configure
 
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$MAKE check
+$MAKE distcheck
 
-grep 'fsusage\.c' subdir/Makefile.in
+:
similarity index 67%
rename from tests/aclibobj.test
rename to tests/libobj20a.test
index 6ef6f6bcfad6af31be7221f8a88911832844d7ac..25c3cf331dc3e86f6312954c95c1eb1f9a1724ea 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2001, 2002, 2003, 2008  Free Software Foundation, Inc.
+# 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
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Make sure AC_LIBOBJ and friends work.
+# Test error reporting for AC_CONFIG_LIBOBJ_DIR.
+# See also sister tests `libobj20b.test' and `libobj20c.test' .
 
 . ./defs || Exit 1
 
+set -e
+
 cat >> configure.in << 'END'
+AC_CONFIG_LIBOBJ_DIR([libobj-dir])
 AC_PROG_CC
 AC_PROG_RANLIB
-AC_OUTPUT
+AC_LIBOBJ([foo])
 END
 
 cat > Makefile.am << 'END'
 noinst_LIBRARIES = libtu.a
 libtu_a_SOURCES =
-libtu_a_LIBADD = @LIBOBJS@
+libtu_a_LIBADD = $(LIBOBJS)
 END
 
-: > maude.c
-: > liver.c
+mkdir libobj-dir
+: > libobj-dir/foo.c
 
 $ACLOCAL
+AUTOMAKE_fails
+grep 'LIBOBJS.*used outside.*libobj-dir' stderr
+grep 'subdir-objects.*not set' stderr
 
-set -e
-
-cp configure.in X
-echo 'AC_LIBSOURCE(maude.c)' >> configure.in
-$AUTOMAKE
-
-# Avoid timestamp-related differences.
-rm -rf autom4te.cache
-
-cp X configure.in
-echo 'AC_LIBSOURCES([maude.c, liver.c])' >> configure.in
-$AUTOMAKE
+:
diff --git a/tests/libobj20b.test b/tests/libobj20b.test
new file mode 100755 (executable)
index 0000000..1662110
--- /dev/null
@@ -0,0 +1,57 @@
+#! /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/>.
+
+# Test error reporting for AC_CONFIG_LIBOBJ_DIR.
+# See also sister tests `libobj20a.test' and `libobj20c.test' .
+
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_CONFIG_LIBOBJ_DIR([libobj-dir])
+AC_PROG_CC
+AC_PROG_RANLIB
+AC_LIBSOURCE([foobar.c])
+# FIXME: without a call to AC_OUTPUT, Automake does not fail when file(s)
+#        specified in AC_LIBSOURCE call(s) do not exist.  Should we fix
+#        this limitation?  Or is the current behaviour good enough?
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+AUTOMAKE_OPTIONS = subdir-objects
+noinst_LIBRARIES = libtu.a
+libtu_a_SOURCES =
+libtu_a_LIBADD = $(LIBOBJS)
+END
+
+$ACLOCAL
+
+AUTOMAKE_fails
+grep 'configure\.in:.*required directory.*libobj-dir' stderr
+
+mkdir libobj-dir
+: > foobar.c # oops, it should be in libobj-dir...
+AUTOMAKE_fails
+grep 'configure\.in:.*required file.*libobj-dir/foobar.c.*' stderr
+
+rm -f foobar.c
+
+: > libobj-dir/foobar.c
+$AUTOMAKE # now we should succeed
+
+:
diff --git a/tests/libobj20c.test b/tests/libobj20c.test
new file mode 100755 (executable)
index 0000000..4884359
--- /dev/null
@@ -0,0 +1,53 @@
+#! /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/>.
+
+# Test error reporting for AC_CONFIG_LIBOBJ_DIR.
+# See also sister tests `libobj20a.test' and `libobj20b.test' .
+
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_CONFIG_LIBOBJ_DIR([libobj-dir])
+AC_PROG_CC
+AC_PROG_RANLIB
+AC_LIBOBJ([foobar])
+END
+
+cat > Makefile.am << 'END'
+AUTOMAKE_OPTIONS = subdir-objects ## required for our setup to work
+noinst_LIBRARIES = libtu.a
+libtu_a_SOURCES =
+libtu_a_LIBADD = $(LIBOBJS)
+END
+
+$ACLOCAL
+
+AUTOMAKE_fails
+grep 'configure\.in:.*required directory.*\./libobj-dir' stderr
+
+mkdir libobj-dir
+: > foobar.c # oops, it should be in libobj-dir!
+AUTOMAKE_fails
+grep 'configure\.in:.*required file.*libobj-dir/foobar.c.*' stderr
+
+rm -f foobar.c
+
+: > libobj-dir/foobar.c
+$AUTOMAKE # now we should succeed
+
+:
index 0aeced91b503f6e57de1a2a2786b7d5c7fe75d21..29aa6d55d8fff7b0fcc2051f8839ab5b1e820d0b 100755 (executable)
@@ -1,5 +1,6 @@
 #! /bin/sh
-# Copyright (C) 1996, 1997, 2001, 2002, 2003  Free Software Foundation, Inc.
+# Copyright (C) 1996, 1997, 2001, 2002, 2003, 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
@@ -14,7 +15,8 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Make sure we complain if @LIBOBJS@ is used without being set in configure.in
+# Make sure we complain if @LIBOBJS@ is used without being set in
+# configure.in.
 
 . ./defs || Exit 1
 
@@ -32,4 +34,6 @@ END
 
 $ACLOCAL
 AUTOMAKE_fails
-grep 'Makefile.am:3:.*LIBOBJS' stderr
+grep 'Makefile\.am:3:.*LIBOBJS' stderr
+
+:
index d6639be58b550bbd9a57e3bcd29040e895e63ce4..d31e5ff202b606af40cf58862e9f94e4155f8575 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 1996, 2001, 2002  Free Software Foundation, Inc.
+# Copyright (C) 1996, 2001, 2002, 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
 
 . ./defs || Exit 1
 
+set -e
+
 cat > Makefile.am << 'END'
 bin_PROGRAMS = foo
 END
 
 cat >> configure.in << 'END'
 AC_PROG_CC
-AC_REPLACE_FUNCS(foo)
+AC_REPLACE_FUNCS([foo])
 END
 
-$ACLOCAL || Exit 1
+$ACLOCAL
 $AUTOMAKE
+
+:
index 6add9e37ac19c1a3c13f02a87b7743b3a4b41e02..7aa218a9f47990690bd7d0bc47769d394dd08cc1 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 1996, 2001, 2002  Free Software Foundation, Inc.
+# Copyright (C) 1996, 2001, 2002, 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
@@ -19,6 +19,8 @@
 
 . ./defs || Exit 1
 
+set -e
+
 cat > Makefile.am << 'END'
 bin_PROGRAMS = joe
 LDADD = @LIBOBJS@
@@ -27,11 +29,13 @@ END
 cat >> configure.in << 'END'
 AC_PROG_CC
 AC_REPLACE_FUNCS(\
-   foo)
+   foo_bar_quux)
 END
 
-: > foo.c
+: > foo_bar_quux.c
+
+$ACLOCAL
+$AUTOMAKE
+$FGREP foo_bar_quux.c Makefile.in
 
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
-$FGREP foo.c Makefile.in
+:
index 73a8ab0e2fbc1efd420aeeb8cee7e8a94da088b4..be51db7fa3a4adea5af82b5e90b6699f1e9397d5 100755 (executable)
@@ -1,5 +1,6 @@
 #! /bin/sh
-# Copyright (C) 1997, 1998, 2000, 2001, 2002  Free Software Foundation, Inc.
+# Copyright (C) 1997, 1998, 2000, 2001, 2002, 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
 
 . ./defs || Exit 1
 
-cat > configure.in << 'END'
-AC_INIT
-AM_INIT_AUTOMAKE(nonesuch, nonesuch)
+set -e
+
+cat >> configure.in << 'END'
 AC_PROG_CC
 AC_PROG_RANLIB
-AC_REPLACE_FUNCS(basename dirname strsignal)
-AC_OUTPUT(Makefile)
+# `am__dummy_function' is there to ensure that at least one function is
+# replaced, to avoid creating an empty archive which can cause problems
+# with e.g. Solaris ar.
+AC_REPLACE_FUNCS([basename dirname am__dummy_function])
+AC_OUTPUT
 END
 
 cat > Makefile.am << 'END'
 noinst_LIBRARIES = libtu.a
 libtu_a_SOURCES =
 libtu_a_LIBADD = @LIBOBJS@
+check-local: test1 test2 test3
+.PHONY: test1 test2 test3
+test1: all
+       $(AR) tv libtu.a
+test2:
+       @echo DIST_COMMON = $(DIST_COMMON)
+       echo ' ' $(DIST_COMMON) ' ' | grep '[ /]basename\.c '
+       echo ' ' $(DIST_COMMON) ' ' | grep '[ /]dirname\.c '
+       echo ' ' $(DIST_COMMON) ' ' | grep '[ /]am__dummy_function\.c '
+test3: distdir
+       test -f $(distdir)/basename.c
+       test -f $(distdir)/dirname.c
+       test -f $(distdir)/am__dummy_function.c
+END
+
+cat > basename.c <<'END'
+extern int dummy1;
+END
+cat > dirname.c <<'END'
+extern int dummy2;
 END
+cat > am__dummy_function.c <<'END'
+extern int dummy3;
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+./configure
+
+$MAKE
+$MAKE check
+$MAKE distcheck
 
-: > basename.c
-: > dirname.c
-: > strsignal.c
-
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
-
-sed -n -e ': again
-  /^DIST_COMMON.*[^\]$/ p
-  /^DIST_COMMON/ {
-     s/^DIST_COMMON//p
-     n
-     s/^/DIST_COMMON/
-     b again
-  }' < Makefile.in | $FGREP dirname.c
+:
index c06746befaf5475cb90a7780c0d49764e1562c1c..95f21ed1e433a2ad8321d599195ffa1f6df921b9 100755 (executable)
@@ -1,5 +1,6 @@
 #! /bin/sh
-# Copyright (C) 1998, 2000, 2001, 2002, 2006  Free Software Foundation, Inc.
+# Copyright (C) 1998, 2000, 2001, 2002, 2006, 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
 
 . ./defs || Exit 1
 
-cat > configure.in << 'END'
-AC_INIT
-AM_INIT_AUTOMAKE(nonesuch, nonesuch)
+set -e
+
+cat >> configure.in << 'END'
 AC_PROG_CC
 AC_PROG_CC_STDC
 AC_PROG_RANLIB
 AC_REPLACE_FUNCS(basename dirname strsignal)
 AM_C_PROTOTYPES
-AC_OUTPUT(Makefile)
+AC_OUTPUT
 END
 
 cat > Makefile.am << 'END'
@@ -44,7 +45,9 @@ END
 : > ansi2knr.1
 : > ansi2knr.c
 
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
+
+$FGREP 'strsignal_.c:' Makefile.in
 
-grep 'strsignal_.c:' Makefile.in
+:
index fd664732465ef1d356a377a210b52511e133c929..e34e667e57ceebc5f04256774221a0bffa6309aa 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 1999, 2001, 2002  Free Software Foundation, Inc.
+# Copyright (C) 1999, 2001, 2002, 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
 required=libtool
 . ./defs || Exit 1
 
+set -e
+
 cat >> configure.in << 'END'
-AC_SUBST(LTLIBOBJS)
+AC_SUBST([LTLIBOBJS])
 AC_PROG_LIBTOOL
 END
 
@@ -35,5 +37,7 @@ END
 : > config.guess
 : > config.sub
 
-$ACLOCAL || Exit 1
+$ACLOCAL
 $AUTOMAKE
+
+: