[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] Extend tests on AC_LIBOBJ and friends.
From: |
Stefano Lattarini |
Subject: |
[PATCH] Extend tests on AC_LIBOBJ and friends. |
Date: |
Wed, 1 Sep 2010 13:45:40 +0200 |
User-agent: |
KMail/1.13.3 (Linux/2.6.30-2-686; KDE/4.4.4; i686; ; ) |
Patch tested with:
1. Debian GNU/Linux, GNU m4 1.4.11, autoconf/autom4te 2.62,
dash 0.5.2, GNU make 3.81
2. Debian GNU/Linux, GNU m4 1.4.14, autoconf/autom4te 2.67,
bash 2.0, GNU make 3.79
3. Debian GNU/Linux, GNU m4 1.4.14, autoconf/autom4te 2.65,
bash 4.0, FreeBSD make 8.1
4. Solaris 10, GNU m4 1.4.15, autoconf/autom4te 2.67, /bin/ksh
Version M-11/16/88i, GNU make 3.82, Solaris coreutils, mixed
Solaris and GNU tools (sed, grep, gawk, ...)
5. Solaris 10, GNU m4 1.4.15, autoconf/autom4te 2.62, /bin/sh,
Solaris tools (xpg4/ccs make, grep, sed, nawk, ...)
6. Debian GNU/Linux, GNU m4 1.4.14, autoconf/autom4te 2.65,
Heirloom shell, Heirloom make, mixed Heirloom tools and
GNU tools.
Regards,
Stefano
-*-*-
* 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.
---
ChangeLog | 49 +++++++++++
tests/Makefile.am | 14 +++-
tests/Makefile.in | 14 +++-
tests/libobj1.test | 113 ++++++++++++++++++++++++
tests/libobj10.test | 22 ++++--
tests/libobj12.test | 26 ++++--
tests/libobj13.test | 8 +-
tests/libobj14.test | 6 +-
tests/{libobj11.test => libobj15a.test} | 22 +++---
tests/{aclibobj.test => libobj15b.test} | 30 +++----
tests/{aclibobj.test => libobj15c.test} | 33 ++++----
tests/libobj16a.test | 141 ++++++++++++++++++++++++++++++
tests/libobj16b.test | 142 +++++++++++++++++++++++++++++++
tests/{aclibobj.test => libobj17.test} | 46 +++++++---
tests/{aclibobj.test => libobj18.test} | 28 +++----
tests/{aclibobj.test => libobj19.test} | 45 +++++++---
tests/libobj2.test | 42 +++++++--
tests/{aclibobj.test => libobj20a.test} | 37 ++++----
tests/{aclibobj.test => libobj20b.test} | 38 +++++---
tests/{aclibobj.test => libobj20c.test} | 36 +++++----
tests/libobj3.test | 10 ++-
tests/libobj4.test | 10 ++-
tests/libobj5.test | 16 ++--
tests/libobj7.test | 65 ++++++++++-----
tests/libobj8.test | 19 +++--
tests/ltlibobjs.test | 10 ++-
26 files changed, 803 insertions(+), 219 deletions(-)
create mode 100755 tests/libobj1.test
rename tests/{libobj11.test => libobj15a.test} (71%)
copy tests/{aclibobj.test => libobj15b.test} (63%)
copy tests/{aclibobj.test => libobj15c.test} (55%)
create mode 100755 tests/libobj16a.test
create mode 100755 tests/libobj16b.test
copy tests/{aclibobj.test => libobj17.test} (56%)
copy tests/{aclibobj.test => libobj18.test} (68%)
copy tests/{aclibobj.test => libobj19.test} (53%)
copy tests/{aclibobj.test => libobj20a.test} (60%)
copy tests/{aclibobj.test => libobj20b.test} (50%)
rename tests/{aclibobj.test => libobj20c.test} (56%)
From 7696a9bc0cef5e6b15084bd0616c5530034dd2cc Mon Sep 17 00:00:00 2001
From: Stefano Lattarini <address@hidden>
Date: Tue, 31 Aug 2010 15:14:29 +0200
Subject: [PATCH] Extend tests on AC_LIBOBJ and friends.
* 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.
---
ChangeLog | 49 +++++++++++
tests/Makefile.am | 14 +++-
tests/Makefile.in | 14 +++-
tests/libobj1.test | 113 ++++++++++++++++++++++++
tests/libobj10.test | 22 ++++--
tests/libobj12.test | 26 ++++--
tests/libobj13.test | 8 +-
tests/libobj14.test | 6 +-
tests/{libobj11.test => libobj15a.test} | 22 +++---
tests/{aclibobj.test => libobj15b.test} | 30 +++----
tests/{aclibobj.test => libobj15c.test} | 33 ++++----
tests/libobj16a.test | 141 ++++++++++++++++++++++++++++++
tests/libobj16b.test | 142 +++++++++++++++++++++++++++++++
tests/{aclibobj.test => libobj17.test} | 46 +++++++---
tests/{aclibobj.test => libobj18.test} | 28 +++----
tests/{aclibobj.test => libobj19.test} | 45 +++++++---
tests/libobj2.test | 42 +++++++--
tests/{aclibobj.test => libobj20a.test} | 37 ++++----
tests/{aclibobj.test => libobj20b.test} | 38 +++++---
tests/{aclibobj.test => libobj20c.test} | 36 +++++----
tests/libobj3.test | 10 ++-
tests/libobj4.test | 10 ++-
tests/libobj5.test | 16 ++--
tests/libobj7.test | 65 ++++++++++-----
tests/libobj8.test | 19 +++--
tests/ltlibobjs.test | 10 ++-
26 files changed, 803 insertions(+), 219 deletions(-)
create mode 100755 tests/libobj1.test
rename tests/{libobj11.test => libobj15a.test} (71%)
copy tests/{aclibobj.test => libobj15b.test} (63%)
copy tests/{aclibobj.test => libobj15c.test} (55%)
create mode 100755 tests/libobj16a.test
create mode 100755 tests/libobj16b.test
copy tests/{aclibobj.test => libobj17.test} (56%)
copy tests/{aclibobj.test => libobj18.test} (68%)
copy tests/{aclibobj.test => libobj19.test} (53%)
copy tests/{aclibobj.test => libobj20a.test} (60%)
copy tests/{aclibobj.test => libobj20b.test} (50%)
rename tests/{aclibobj.test => libobj20c.test} (56%)
diff --git a/ChangeLog b/ChangeLog
index 688f4be..f0c1fb3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,52 @@
+2010-09-01 Stefano Lattarini <address@hidden>
+
+ Extend tests on AC_LIBOBJ and friends.
+ * 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.
+
2010-08-27 Stefano Lattarini <address@hidden>
Fix bug in test missing6.test.
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 3ecc341..b63a2fb 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -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 \
@@ -400,6 +399,7 @@ lex5.test \
lflags.test \
lflags2.test \
libexec.test \
+libobj1.test \
libobj2.test \
libobj3.test \
libobj4.test \
@@ -407,10 +407,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/Makefile.in b/tests/Makefile.in
index 4671ad0..5ee12b7 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -275,7 +275,6 @@ pr401c-p.test
MAINTAINERCLEANFILES = $(parallel_tests)
TESTS = \
-aclibobj.test \
aclocal.test \
aclocal3.test \
aclocal4.test \
@@ -638,6 +637,7 @@ lex5.test \
lflags.test \
lflags2.test \
libexec.test \
+libobj1.test \
libobj2.test \
libobj3.test \
libobj4.test \
@@ -645,10 +645,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/libobj1.test b/tests/libobj1.test
new file mode 100755
index 0000000..7323570
--- /dev/null
+++ b/tests/libobj1.test
@@ -0,0 +1,113 @@
+#! /bin/sh
+# Copyright (C) 2010 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Make sure 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)
+ test x'$(srcdir)' = x'$(builddir)' || ls -l $(builddir)
+ ls -l $(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) # sanity check
+ test ! -r $(distdir)/liver.c
+maude-not-dist:
+ test -d $(distdir) # sanity check
+ 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
+$MAKE distclean
+
+:
diff --git a/tests/libobj10.test b/tests/libobj10.test
index 0d24741..7897351 100755
--- a/tests/libobj10.test
+++ b/tests/libobj10.test
@@ -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
+
+:
diff --git a/tests/libobj12.test b/tests/libobj12.test
index 5f1d029..747d7a0 100755
--- a/tests/libobj12.test
+++ b/tests/libobj12.test
@@ -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
@@ -14,11 +14,11 @@
# 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
@address@hidden
-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
+
+:
diff --git a/tests/libobj13.test b/tests/libobj13.test
index 6ca68c9..6d1e68d 100755
--- a/tests/libobj13.test
+++ b/tests/libobj13.test
@@ -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
@@ -14,12 +14,12 @@
# 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 @address@hidden
echo 'libfoo_la_SOURCES += foo.c' >> Makefile.am
AUTOMAKE_fails
-$FGREP foo.c stderr
+grep 'foo\.c.*explicitly mentioned' stderr
+
+:
diff --git a/tests/libobj14.test b/tests/libobj14.test
index ed20703..08841c3 100755
--- a/tests/libobj14.test
+++ b/tests/libobj14.test
@@ -20,14 +20,14 @@
# Report from Bill Davidson
required=gcc
-. ./defs
+. ./defs || Exit 1
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
+
+:
diff --git a/tests/libobj11.test b/tests/libobj15a.test
similarity index 71%
rename from tests/libobj11.test
rename to tests/libobj15a.test
index 204ff8b..51da834 100755
--- a/tests/libobj11.test
+++ b/tests/libobj15a.test
@@ -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
@@ -14,26 +14,26 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# 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/aclibobj.test b/tests/libobj15b.test
similarity index 63%
copy from tests/aclibobj.test
copy to tests/libobj15b.test
index 6ef6f6b..10f2b5b 100755
--- a/tests/aclibobj.test
+++ b/tests/libobj15b.test
@@ -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
@@ -14,36 +14,30 @@
# 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.
+# 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 god enough?
AC_OUTPUT
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
-
$ACLOCAL
+AUTOMAKE_fails
+grep 'configure\.in:.*required file.*foobar\.c.*' 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/aclibobj.test b/tests/libobj15c.test
similarity index 55%
copy from tests/aclibobj.test
copy to tests/libobj15c.test
index 6ef6f6b..da77719 100755
--- a/tests/aclibobj.test
+++ b/tests/libobj15c.test
@@ -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
@@ -14,36 +14,37 @@
# 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.
+# 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 god enough?
AC_OUTPUT
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
-
$ACLOCAL
-set -e
-
-cp configure.in X
-echo 'AC_LIBSOURCE(maude.c)' >> configure.in
-$AUTOMAKE
+AUTOMAKE_fails
+grep 'configure\.in:.*required file.*foobar\.c.*' stderr
+grep 'configure\.in:.*required file.*bazquux\.c.*' stderr
-# Avoid timestamp-related differences.
-rm -rf autom4te.cache
+: > foobar.c
+AUTOMAKE_fails
+grep 'configure\.in:.*required file.*bazquux\.c.*' stderr
+grep 'foobar\.c' stderr && Exit 1
-cp X configure.in
-echo 'AC_LIBSOURCES([maude.c, liver.c])' >> configure.in
-$AUTOMAKE
+:
diff --git a/tests/libobj16a.test b/tests/libobj16a.test
new file mode 100755
index 0000000..594aeb3
--- /dev/null
+++ b/tests/libobj16a.test
@@ -0,0 +1,141 @@
+#! /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)
+ test x'$(srcdir)' = x'$(builddir)' || ls -l $(builddir)
+ ls -l $(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
index 0000000..59dcf84
--- /dev/null
+++ b/tests/libobj16b.test
@@ -0,0 +1,142 @@
+#! /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)
+ test x'$(srcdir)' = x'$(builddir)' || ls -l $(builddir)
+ ls -l $(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/aclibobj.test b/tests/libobj17.test
similarity index 56%
copy from tests/aclibobj.test
copy to tests/libobj17.test
index 6ef6f6b..aacfe7e 100755
--- a/tests/aclibobj.test
+++ b/tests/libobj17.test
@@ -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
@@ -14,36 +14,54 @@
# 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.
+# 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@
+libtu_a_LIBADD = $(LIBOBJS)
END
-: > maude.c
-: > liver.c
+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
-set -e
+./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
-cp configure.in X
-echo 'AC_LIBSOURCE(maude.c)' >> configure.in
-$AUTOMAKE
+$MAKE distclean
-# Avoid timestamp-related differences.
-rm -rf autom4te.cache
+./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
-cp X configure.in
-echo 'AC_LIBSOURCES([maude.c, liver.c])' >> configure.in
-$AUTOMAKE
+:
diff --git a/tests/aclibobj.test b/tests/libobj18.test
similarity index 68%
copy from tests/aclibobj.test
copy to tests/libobj18.test
index 6ef6f6b..0888237 100755
--- a/tests/aclibobj.test
+++ b/tests/libobj18.test
@@ -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
@@ -14,36 +14,30 @@
# 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.
+# 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
+bar=foo
+AC_LIBSOURCES([$bar.c])
AC_OUTPUT
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
+: > foo.c
$ACLOCAL
+AUTOMAKE_fails
+grep 'configure\.in:.*required file.*\./\$bar\.c.*not found' 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/aclibobj.test b/tests/libobj19.test
similarity index 53%
copy from tests/aclibobj.test
copy to tests/libobj19.test
index 6ef6f6b..4ec29f0 100755
--- a/tests/aclibobj.test
+++ b/tests/libobj19.test
@@ -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
@@ -14,36 +14,51 @@
# 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 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@
+libtu_a_LIBADD = $(LIBOBJS)
+check-local: distdir
+ ls -l $(srcdir)/*
+ test x'$(srcdir)' = x'$(builddir)' || ls -l $(builddir)/*
+ ls -l $(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 # for debugging
+ $(AR) t libtu.a | grep foobar
END
-: > maude.c
-: > liver.c
+mkdir libobj-dir
+cat > libobj-dir/foobar.c << 'END'
+extern int dummy;
+END
$ACLOCAL
-
-set -e
-
-cp configure.in X
-echo 'AC_LIBSOURCE(maude.c)' >> configure.in
+$AUTOCONF
$AUTOMAKE
-# Avoid timestamp-related differences.
-rm -rf autom4te.cache
+./configure
-cp X configure.in
-echo 'AC_LIBSOURCES([maude.c, liver.c])' >> configure.in
-$AUTOMAKE
+$MAKE
+$MAKE check
+$MAKE distcheck
+
+:
diff --git a/tests/libobj2.test b/tests/libobj2.test
index 81b0e72..0f454aa 100755
--- a/tests/libobj2.test
+++ b/tests/libobj2.test
@@ -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
@@ -20,13 +20,25 @@
. ./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 # for debugging
+ ls -l $(distdir) $(distdir)/subdir # likewise
+ ls -l $(builddir) $(builddir)/subdir # likewise
+ test -f $(srcdir)/subdir/fsusage.c
+ test -f $(distdir)/subdir/fsusage.c
+ $(AR) tv $(builddir)/subdir/libtu.a
END
mkdir subdir
@@ -37,9 +49,19 @@ libtu_a_SOURCES =
libtu_a_LIBADD = @LIBOBJS@
END
-: > subdir/fsusage.c
+cat > subdir/fsusage.c << 'END'
+extern int dummy;
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+$FGREP 'fsusage.c' subdir/Makefile.in
+
+./configure
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$MAKE check
+$MAKE distcheck
-grep 'fsusage\.c' subdir/Makefile.in
+:
diff --git a/tests/aclibobj.test b/tests/libobj20a.test
similarity index 60%
copy from tests/aclibobj.test
copy to tests/libobj20a.test
index 6ef6f6b..01fdd1e 100755
--- a/tests/aclibobj.test
+++ b/tests/libobj20a.test
@@ -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
@@ -14,36 +14,35 @@
# 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 `aclibobj6b.test' and `aclibobj6c.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
+# We are not expected to be required to run this again after adding calls
+# to AC_LIBSOURCE/AC_LIBSOURCES, so just run it here once an for all.
+$ACLOCAL
+
cat > Makefile.am << 'END'
noinst_LIBRARIES = libtu.a
libtu_a_SOURCES =
-libtu_a_LIBADD = @LIBOBJS@
+libtu_a_LIBADD = $(LIBOBJS)
END
-: > maude.c
-: > liver.c
-
-$ACLOCAL
-
-set -e
-
-cp configure.in X
-echo 'AC_LIBSOURCE(maude.c)' >> configure.in
-$AUTOMAKE
+mkdir libobj-dir
+: > libobj-dir/foo.c
-# Avoid timestamp-related differences.
-rm -rf autom4te.cache
+AUTOMAKE_fails
+grep 'LIBOBJS.*used outside.*libobj-dir' stderr
+grep 'subdir-objects.*not set' stderr
-cp X configure.in
-echo 'AC_LIBSOURCES([maude.c, liver.c])' >> configure.in
-$AUTOMAKE
+:
diff --git a/tests/aclibobj.test b/tests/libobj20b.test
similarity index 50%
copy from tests/aclibobj.test
copy to tests/libobj20b.test
index 6ef6f6b..bc6b084 100755
--- a/tests/aclibobj.test
+++ b/tests/libobj20b.test
@@ -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
@@ -14,36 +14,44 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# Make sure AC_LIBOBJ and friends work.
+# Test error reporting for AC_CONFIG_LIBOBJ_DIR.
+# See also sister tests `aclibobj6a.test' and `aclibobj6c.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 god enough?
AC_OUTPUT
END
cat > Makefile.am << 'END'
+AUTOMAKE_OPTIONS = subdir-objects
noinst_LIBRARIES = libtu.a
libtu_a_SOURCES =
-libtu_a_LIBADD = @LIBOBJS@
+libtu_a_LIBADD = $(LIBOBJS)
END
-: > maude.c
-: > liver.c
-
$ACLOCAL
-set -e
+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
-cp configure.in X
-echo 'AC_LIBSOURCE(maude.c)' >> configure.in
-$AUTOMAKE
+rm -f foobar.c
-# Avoid timestamp-related differences.
-rm -rf autom4te.cache
+: > libobj-dir/foobar.c
+$AUTOMAKE # now we should succeed
-cp X configure.in
-echo 'AC_LIBSOURCES([maude.c, liver.c])' >> configure.in
-$AUTOMAKE
+:
diff --git a/tests/aclibobj.test b/tests/libobj20c.test
similarity index 56%
rename from tests/aclibobj.test
rename to tests/libobj20c.test
index 6ef6f6b..33c43b1 100755
--- a/tests/aclibobj.test
+++ b/tests/libobj20c.test
@@ -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
@@ -14,36 +14,40 @@
# 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 `aclibobj6a.test' and `aclibobj6b.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([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@
+libtu_a_LIBADD = $(LIBOBJS)
END
-: > maude.c
-: > liver.c
-
$ACLOCAL
-set -e
+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
-cp configure.in X
-echo 'AC_LIBSOURCE(maude.c)' >> configure.in
-$AUTOMAKE
+rm -f foobar.c
-# Avoid timestamp-related differences.
-rm -rf autom4te.cache
+: > libobj-dir/foobar.c
+$AUTOMAKE # now we should succeed
-cp X configure.in
-echo 'AC_LIBSOURCES([maude.c, liver.c])' >> configure.in
-$AUTOMAKE
+:
diff --git a/tests/libobj3.test b/tests/libobj3.test
index 0aeced9..29aa6d5 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, 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
+
+:
diff --git a/tests/libobj4.test b/tests/libobj4.test
index d6639be..d31e5ff 100755
--- a/tests/libobj4.test
+++ b/tests/libobj4.test
@@ -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,14 +19,18 @@
. ./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
+
+:
diff --git a/tests/libobj5.test b/tests/libobj5.test
index 6add9e3..7aa218a 100755
--- a/tests/libobj5.test
+++ b/tests/libobj5.test
@@ -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
+:
diff --git a/tests/libobj7.test b/tests/libobj7.test
index 73a8ab0..70c0ec0 100755
--- a/tests/libobj7.test
+++ b/tests/libobj7.test
@@ -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
@@ -18,33 +19,55 @@
. ./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) # for debugging
+ 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
+:
diff --git a/tests/libobj8.test b/tests/libobj8.test
index c06746b..95f21ed 100755
--- a/tests/libobj8.test
+++ b/tests/libobj8.test
@@ -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
@@ -19,15 +20,15 @@
. ./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
+:
diff --git a/tests/ltlibobjs.test b/tests/ltlibobjs.test
index fd66473..e34e667 100755
--- a/tests/ltlibobjs.test
+++ b/tests/ltlibobjs.test
@@ -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
@@ -19,8 +19,10 @@
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
+
+:
--
1.7.1
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [PATCH] Extend tests on AC_LIBOBJ and friends.,
Stefano Lattarini <=