automake-commit
[Top][All Lists]
Advanced

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

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


From: Stefano Lattarini
Subject: [Automake-commit] [SCM] GNU Automake branch, master, updated. v1.11-564-g635a250
Date: Thu, 23 Dec 2010 22:37:57 +0000

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

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

The branch, master has been updated
       via  635a250ce47ad3a967bee1497b66af4fbb96cb60 (commit)
       via  3fe9baba0f1645f69bb5b404d4e580f2dba65bb2 (commit)
       via  d47051ef10f0f2bea552a8084edb70eff779fa72 (commit)
       via  20fb9cebd5ca7c48c0eeba32d6ea42bab1f5b912 (commit)
       via  9552ab180a2ecbccd8a2439ad860838a497315aa (commit)
       via  d7430fea6a8b878b1bfdf89af561a93f2746576d (commit)
      from  7e7a8a6497cbc2473a3e25dd1067f2d44346325e (commit)

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

- Log -----------------------------------------------------------------
commit 635a250ce47ad3a967bee1497b66af4fbb96cb60
Author: Stefano Lattarini <address@hidden>
Date:   Thu Dec 23 22:57:34 2010 +0100

    * NEWS: Add missing blank line between two entries.

commit 3fe9baba0f1645f69bb5b404d4e580f2dba65bb2
Merge: 7e7a8a6 d47051e
Author: Stefano Lattarini <address@hidden>
Date:   Thu Dec 23 21:41:45 2010 +0100

    Merge branch 'tests-suffix-extend'
    
    Conflicts:
        tests/suffix10.test

commit d47051ef10f0f2bea552a8084edb70eff779fa72
Author: Stefano Lattarini <address@hidden>
Date:   Fri Oct 15 17:37:38 2010 +0200

    Improve and extend tests `suffix*.test'.
    
    * tests/suffix.test: Check that suffix rules for C compilation are
    only included once.  Try also with a static library.
    * tests/suffix2.test: Add a new grep to help potential debugging.
    Do not run automake with the `--add-missing' options, since we
    already create all the needed auxiliary files.  Try also *without*
    the `no-dependencies' automake option.
    * tests/suffix4.test: Make grepping of Makefile.in stricter.
    * tests/suffix3.test: Rewritten to run also autoconf, ./configure
    and make.
    * tests/suffix5.test: Likewise.
    * tests/suffix6.test: Fix botched recipe indentation (eight spaces
    were used instead of a tabulation character).  Extend to check
    that `.obj' is handled like `.$(OBJEXT)' (as is done for `.o').
    Improved parsing & grepping of generated Makefile.in.  Other minor
    fixes and improvements.
    * tests/suffix10.test: Move some checks in Makefile.am.  Also run
    "make all".
    * tests/suffix12.test: Likewise, and account for VPATH issues in
    weaker make implementations.
    * tests/suffix11.test: Likewise.  Also, run "make distcheck", for
    completeness, and related changes.
    * tests/suffix8.test: Likewise.  Also, do not put `gcc' anymore
    in $required.
    * tests/suffix13.test: Do not use the `--force-missing' automake
    option unnecessarily.
    * tests/suffix6b.test: New test, semantic sister of `suffix6.test'.
    * tests/suffix6c.test: Likewise.
    * tests/Makefile.am (TESTS): Updated.

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

Summary of changes:
 ChangeLog                                |   71 +++++++++++++++++++++++
 NEWS                                     |    5 ++
 automake.in                              |   26 ++++++---
 doc/automake.texi                        |    3 +-
 tests/Makefile.am                        |    7 ++
 tests/Makefile.in                        |    7 ++
 tests/depcomp8a.test                     |   79 +++++++++++++++++++++++++
 tests/depcomp8b.test                     |   73 +++++++++++++++++++++++
 tests/parallel-tests8.test               |    5 +-
 tests/subobj11a.test                     |   82 ++++++++++++++++++++++++++
 tests/subobj11b.test                     |   87 ++++++++++++++++++++++++++++
 tests/{libobj20c.test => subobj11c.test} |   40 +++++++-------
 tests/suffix.test                        |   14 ++++-
 tests/suffix10.test                      |   32 +++++++---
 tests/suffix11.test                      |   37 ++++++++----
 tests/suffix12.test                      |   18 ++++--
 tests/suffix13.test                      |    5 +-
 tests/suffix2.test                       |   13 +++-
 tests/suffix3.test                       |   37 +++++++++++-
 tests/suffix4.test                       |    4 +-
 tests/suffix5.test                       |   24 +++++++-
 tests/suffix6.test                       |   37 +++++++++---
 tests/suffix6b.test                      |   77 +++++++++++++++++++++++++
 tests/suffix6c.test                      |   92 ++++++++++++++++++++++++++++++
 tests/suffix8.test                       |   67 ++++++++++++----------
 25 files changed, 826 insertions(+), 116 deletions(-)
 create mode 100755 tests/depcomp8a.test
 create mode 100755 tests/depcomp8b.test
 create mode 100755 tests/subobj11a.test
 create mode 100755 tests/subobj11b.test
 copy tests/{libobj20c.test => subobj11c.test} (51%)
 create mode 100755 tests/suffix6b.test
 create mode 100755 tests/suffix6c.test

diff --git a/ChangeLog b/ChangeLog
index 0540fc8..56aa429 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,74 @@
+2010-12-23  Stefano Lattarini  <address@hidden>
+
+       * NEWS: Add missing blank line between two entries.
+
+2010-12-23  Stefano Lattarini  <address@hidden>
+
+       Improve and extend tests `suffix*.test'.
+       * tests/suffix.test: Check that suffix rules for C compilation are
+       only included once.  Try also with a static library.
+       * tests/suffix2.test: Add a new grep to help potential debugging.
+       Do not run automake with the `--add-missing' options, since we
+       already create all the needed auxiliary files.  Try also *without*
+       the `no-dependencies' automake option.
+       * tests/suffix4.test: Make grepping of Makefile.in stricter.
+       * tests/suffix3.test: Rewritten to run also autoconf, ./configure
+       and make.
+       * tests/suffix5.test: Likewise.
+       * tests/suffix6.test: Fix botched recipe indentation (eight spaces
+       were used instead of a tabulation character).  Extend to check
+       that `.obj' is handled like `.$(OBJEXT)' (as is done for `.o').
+       Improved parsing & grepping of generated Makefile.in.  Other minor
+       fixes and improvements.
+       * tests/suffix10.test: Move some checks in Makefile.am.  Also run
+       "make all".
+       * tests/suffix12.test: Likewise, and account for VPATH issues in
+       weaker make implementations.
+       * tests/suffix11.test: Likewise.  Also, run "make distcheck", for
+       completeness, and related changes.
+       * tests/suffix8.test: Likewise.  Also, do not put `gcc' anymore
+       in $required.
+       * tests/suffix13.test: Do not use the `--force-missing' automake
+       option unnecessarily.
+       * tests/suffix6b.test: New test, semantic sister of `suffix6.test'.
+       * tests/suffix6c.test: Likewise.
+       * tests/Makefile.am (TESTS): Updated.
+
+2010-12-23  Ralf Wildenhues  <address@hidden>
+           Stefano Lattarini  <address@hidden>
+
+       Work around a bug in file-inclusion mechanism of Solaris make.
+       * automake.in (handle_single_transform): In the name of the
+       dependency file: collapse multiple slash characters into a single
+       one.
+       * tests/subobj11a.test: New test.
+       * tests/subobj11b.test: Likewise.
+       * tests/subobj11c.test: Likewise.
+       * tests/depcomp8a.test: Likewise.
+       * tests/depcomp8b.test: Likewise.
+       * tests/Makefile.am (TESTS): Updated.
+       * NEWS: Updated.
+       Report by Stefano Lattarini, quick fix by Ralf Wildenhues, final
+       patch and tests by Stefano Lattarini.
+
+2010-12-22  Stefano Lattarini  <address@hidden>
+
+       Fix two spurious testsuite failures on IRIX 6.5.
+       * tests/suffix13.test (Makefile.am): Account for VPATH issues on
+       weaker make implementations (e.g. IRIX 6.5).
+       * tests/parallel-tests8.test: Likewise, plus a required related
+       change.
+       Reported by Ralf Wildenhues.  The bugs have been there from the
+       first versions of the affected test scripts.
+
+2010-12-22  Stefano Lattarini  <address@hidden>
+
+       docs: cygnus mode doesn't require AM_CYGWIN32 macro.
+       * doc/automake.texi (Cygnus): Mode 'cygnus' does not require
+       the AM_CYGWIN32 macro (and indeed hasn't required it since at
+       least commit Release-1-2-31-g3038064 "merged changes from
+       Cygnus" of 1997-08-25).
+
 2010-12-22  Stefano Lattarini  <address@hidden>
 
        Add some tests on 'cygnus' mode.
diff --git a/NEWS b/NEWS
index 5e24313..a7c5914 100644
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,7 @@ New in 1.11a:
 * Changes to automake:
 
   - automake now generates silenced rules for texinfo outputs.
+
   - The deprecated options `--output-dir', `--Werror' and `--Wno-error'
     have been removed.
 
@@ -91,6 +92,10 @@ Bugs fixed in 1.11a:
   - Rules generated by Automake now try harder to not change any files when
     `make -n' is invoked.  Fixes include compilation of Emacs Lisp, Vala, or
     Yacc source files and the rule to update config.h.
+
+  - The code for automatic dependency tracking works around a Solaris
+    make bug triggered by sources containing repeated slashes when the
+    `subdir-objects' was used.
 
 New in 1.11:
 
diff --git a/automake.in b/automake.in
index 27904f0..bb30c73 100644
--- a/automake.in
+++ b/automake.in
@@ -2118,14 +2118,24 @@ sub handle_single_transform ($$$$$%)
 
        # Transform .o or $o file into .P file (for automatic
        # dependency code).
-       if ($lang && $lang->autodep ne 'no')
-       {
-           my $depfile = $object;
-           $depfile =~ s/\.([^.]*)$/.P$1/;
-           $depfile =~ s/\$\(OBJEXT\)$/o/;
-           $dep_files{dirname ($depfile) . '/$(DEPDIR)/'
-                        . basename ($depfile)} = 1;
-       }
+        # Properly flatten multiple adjacent slashes, as Solaris 10 make
+        # might fail over them in an include statement.
+        # Leading double slashes may be special, as per Posix, so deal
+        # with them carefully.
+        if ($lang && $lang->autodep ne 'no')
+        {
+            my $depfile = $object;
+            $depfile =~ s/\.([^.]*)$/.P$1/;
+            $depfile =~ s/\$\(OBJEXT\)$/o/;
+            my $maybe_extra_leading_slash = '';
+            $maybe_extra_leading_slash = '/' if $depfile =~ m,^//[^/],;
+            $depfile =~ s,/+,/,g;
+            my $basename = basename ($depfile);
+            # This might make $dirname empty, but we account for that below.
+            (my $dirname = dirname ($depfile)) =~ s/\/*$//;
+            $dirname = $maybe_extra_leading_slash . $dirname;
+            $dep_files{$dirname . '/$(DEPDIR)/' . $basename} = 1;
+        }
     }
 
     return @result;
diff --git a/doc/automake.texi b/doc/automake.texi
index 38142ec..4de6961 100644
--- a/doc/automake.texi
+++ b/doc/automake.texi
@@ -9857,8 +9857,7 @@ The options @option{no-installinfo} and 
@option{no-dependencies} are
 implied.
 
 @item
-The macros @code{AM_MAINTAINER_MODE} and @code{AM_CYGWIN32} are
-required.
+The macro @code{AM_MAINTAINER_MODE} is required.
 
 @item
 The @code{check} target doesn't depend on @code{all}.
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 05e15bc..ea0b64a 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -351,6 +351,8 @@ depcomp4.test \
 depcomp5.test \
 depcomp6.test \
 depcomp7.test \
+depcomp8a.test \
+depcomp8b.test \
 depdist.test \
 depend.test \
 depend2.test \
@@ -829,6 +831,9 @@ subobj7.test \
 subobj8.test \
 subobj9.test \
 subobj10.test \
+subobj11a.test \
+subobj11b.test \
+subobj11c.test \
 subobjname.test \
 subpkg.test \
 subpkg2.test \
@@ -848,6 +853,8 @@ suffix3.test \
 suffix4.test \
 suffix5.test \
 suffix6.test \
+suffix6b.test \
+suffix6c.test \
 suffix7.test \
 suffix8.test \
 suffix9.test \
diff --git a/tests/Makefile.in b/tests/Makefile.in
index d0e08a6..966d330 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -614,6 +614,8 @@ depcomp4.test \
 depcomp5.test \
 depcomp6.test \
 depcomp7.test \
+depcomp8a.test \
+depcomp8b.test \
 depdist.test \
 depend.test \
 depend2.test \
@@ -1092,6 +1094,9 @@ subobj7.test \
 subobj8.test \
 subobj9.test \
 subobj10.test \
+subobj11a.test \
+subobj11b.test \
+subobj11c.test \
 subobjname.test \
 subpkg.test \
 subpkg2.test \
@@ -1111,6 +1116,8 @@ suffix3.test \
 suffix4.test \
 suffix5.test \
 suffix6.test \
+suffix6b.test \
+suffix6c.test \
 suffix7.test \
 suffix8.test \
 suffix9.test \
diff --git a/tests/depcomp8a.test b/tests/depcomp8a.test
new file mode 100755
index 0000000..b4a0e3a
--- /dev/null
+++ b/tests/depcomp8a.test
@@ -0,0 +1,79 @@
+#! /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 for regressions in computation of names of .Po files for
+# automatic dependency tracking.
+# Keep this in sync with sister test `depcomp8b.test', which checks the
+# same thing for libtool objects.
+
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_PROG_CC
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+bin_PROGRAMS = zardoz
+zardoz_SOURCES = foo.c sub/bar.c
+END
+
+mkdir sub
+cat > foo.c << 'END'
+int main(void)
+{
+  extern int bar;
+  return bar;
+}
+END
+cat > sub/bar.c << 'END'
+extern int bar = 0;
+END
+
+$ACLOCAL
+$AUTOMAKE -a
+grep include Makefile.in # for debugging
+grep 'include.*\./\$(DEPDIR)/foo\.P' Makefile.in
+grep 'include.*\./\$(DEPDIR)/bar\.P' Makefile.in
+grep 'include.*/\./\$(DEPDIR)' Makefile.in && Exit 1
+
+$AUTOCONF
+./configure
+$MAKE
+./zardoz
+$MAKE distcheck
+
+# Try again with subdir-objects option.
+
+echo AM_PROG_CC_C_O >> configure.in
+echo AUTOMAKE_OPTIONS = subdir-objects >> Makefile.am
+
+$ACLOCAL
+$AUTOMAKE -a
+grep include Makefile.in # for debugging
+grep 'include.*\./\$(DEPDIR)/foo\.P' Makefile.in
+grep 'include.*[^a-zA-Z0-9_/]sub/\$(DEPDIR)/bar\.P' Makefile.in
+$EGREP 'include.*/(\.|sub)/\$\(DEPDIR\)' Makefile.in && Exit 1
+
+$AUTOCONF
+./configure
+$MAKE
+./zardoz
+$MAKE distcheck
+
+:
diff --git a/tests/depcomp8b.test b/tests/depcomp8b.test
new file mode 100755
index 0000000..1ae7459
--- /dev/null
+++ b/tests/depcomp8b.test
@@ -0,0 +1,73 @@
+#! /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 for regressions in computation of names of .Plo files for
+# automatic dependency tracking.
+# Keep this in sync with sister test `depcomp8a.test', which checks the
+# same thing for non-libtool objects.
+
+required=libtoolize
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_PROG_CC
+AC_PROG_LIBTOOL
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+lib_LTLIBRARIES = libzardoz.la
+libzardoz_la_SOURCES = foo.c sub/bar.c
+END
+
+mkdir sub
+echo 'extern int foo = 0;' > foo.c
+echo 'extern int bar = 0;' > sub/bar.c
+
+libtoolize
+
+$ACLOCAL
+$AUTOMAKE -a
+grep include Makefile.in # for debugging
+grep 'include.*\./\$(DEPDIR)/foo\.P' Makefile.in
+grep 'include.*\./\$(DEPDIR)/bar\.P' Makefile.in
+grep 'include.*/\./\$(DEPDIR)' Makefile.in && Exit 1
+
+$AUTOCONF
+./configure
+$MAKE
+$MAKE distcheck
+
+# Try again with subdir-objects option.
+
+echo AM_PROG_CC_C_O >> configure.in
+echo AUTOMAKE_OPTIONS = subdir-objects >> Makefile.am
+
+$ACLOCAL
+$AUTOMAKE -a
+grep include Makefile.in # for debugging
+grep 'include.*\./\$(DEPDIR)/foo\.P' Makefile.in
+grep 'include.*[^a-zA-Z0-9_/]sub/\$(DEPDIR)/bar\.P' Makefile.in
+$EGREP 'include.*/(\.|sub)/\$\(DEPDIR\)' Makefile.in && Exit 1
+
+$AUTOCONF
+./configure
+$MAKE
+$MAKE distcheck
+
+:
diff --git a/tests/parallel-tests8.test b/tests/parallel-tests8.test
index 784e07f..43e67df 100755
--- a/tests/parallel-tests8.test
+++ b/tests/parallel-tests8.test
@@ -38,7 +38,8 @@ TESTS = foo.test
 ## the next line will cause automake to error out:
 TESTS += $(srcdir)/bar.test $(top_srcdir)/baz.test
 .in.test:
-       cp $< $@
+## Account for VPATH issues on weaker make implementations (e.g. IRIX 6.5)
+       cp `test -f $< || echo $(srcdir)/`$< $@
        chmod +x $@
 check_SCRIPTS = $(TESTS)
 EXTRA_DIST = foo.in foo.test
@@ -57,7 +58,7 @@ AUTOMAKE_fails -a
 grep '(srcdir.*bar' stderr
 grep 'top_srcdir.*baz' stderr
 
-sed '/srcdir/d' < Makefile.am > t
+sed '/^TESTS +=.*srcdir/d' < Makefile.am > t
 mv -f t Makefile.am
 $AUTOMAKE -a
 
diff --git a/tests/subobj11a.test b/tests/subobj11a.test
new file mode 100755
index 0000000..c39e67c
--- /dev/null
+++ b/tests/subobj11a.test
@@ -0,0 +1,82 @@
+#! /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 that automake works around a bug of Solaris Make. The bug is the
+# following.  If we have a Makefile containg a file inclusion like this:
+#   include .//foo.mk
+# Solaris make fails with a message like:
+#   make: ... can't find `/foo.mk': No such file or directory
+#   make: fatal error ... read of include file `/foo.mk' failed
+# (even if the file `foo.mk' exists). The error disappear by collapsing
+# the repeated slash `/' characters into a single one.
+#
+# See also sister "grepping" test `subobj11b.test', and related test
+# `subobj11c.test'.
+
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_PROG_CC
+AM_PROG_CC_C_O
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+AUTOMAKE_OPTIONS = subdir-objects
+bin_PROGRAMS = foo
+## the `.//' is meant
+foo_SOURCES = .//src/foo.c
+END
+
+mkdir src
+
+cat > src/foo.c << 'END'
+int main(void)
+{
+  return 0;
+}
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
+
+./configure --enable-dependency-tracking
+
+depdir=`sed -n 's/^ *DEPDIR *= *//p' Makefile`
+if test x"$depdir" != x; then
+  depdir=src/$depdir
+else
+  echo "$me: cannot extract value of DEPDIR from Makefile" >&2
+  Exit 1
+fi
+
+ls -l "$depdir"
+test -f "$depdir"/foo.Po
+
+echo 'quux:; echo "address@hidden@z" >$@' >> "$depdir"/foo.Po
+
+$MAKE quux
+$FGREP "address@hidden@z" quux
+
+$MAKE
+
+$MAKE DISTCHECK_CONFIGURE_FLAGS='--enable-dependency-tracking' distcheck
+$MAKE DISTCHECK_CONFIGURE_FLAGS='--disable-dependency-tracking' distcheck
+
+:
diff --git a/tests/subobj11b.test b/tests/subobj11b.test
new file mode 100755
index 0000000..1db5fab
--- /dev/null
+++ b/tests/subobj11b.test
@@ -0,0 +1,87 @@
+#! /bin/sh
+# Copyright (C) 2010 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Test that automake works around a bug of Solaris Make. The bug is the
+# following.  If we have a Makefile containg a file inclusion like this:
+#   include .//foo.mk
+# Solaris make fails with a message like:
+#   make: ... can't find `/foo.mk': No such file or directory
+#   make: fatal error ... read of include file `/foo.mk' failed
+# (even if the file `foo.mk' exists). The error disappear by collapsing
+# the repeated slash `/' characters into a single one.
+#
+# See also "semantic" sister test `subobj11a.test', and related test
+# `subobj11c.test'.
+
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_PROG_CC
+AM_PROG_CC_C_O
+END
+
+cat > Makefile.am << 'END'
+AUTOMAKE_OPTIONS = subdir-objects
+bin_PROGRAMS = foo
+## The `zardoz' sources should activate a code paths in Automake that
+## cannot be sensibly tested by sister test `subobj11a.test'.  The other
+## sources provide some sort of stress testing.
+foo_SOURCES = \
+  //server/zardoz0.c \
+  //server//zardoz1.c \
+  //server/path/to/zardoz2.c \
+  //server/another//path///to////zardoz3.c \
+  /foobar0.c \
+  ///foobar1.c \
+  ////foobar2.c \
+  /sub///foobar3.c \
+  ///sub/foobar4.c \
+  .//foobar5.c \
+  .//sub/foobar6.c \
+  ./sub//foobar7.c \
+  .//sub//foobar8.c \
+  sub/sub//sub///sub////foobar9.c
+END
+
+$ACLOCAL
+$AUTOMAKE -a
+
+# Be lax in the regexp, to account for automake conditionals, the
+# use of @am__include@, and similar stuff.
+grep 'include.*//.*foobar' Makefile.in && Exit 1
+
+# These checks depend on automake internals, but presently this is
+# the only way to test the code path we are interested in.
+# Please update these checks when (and if) the relevant automake
+# internals are changed.
+for x in zardoz0 zardoz1 path/to/zardoz2 another/path/to/zardoz3; do
+  case $x in
+   */*) d=`echo $x | sed 's,[^/]*$,,'`; b=`echo $x | sed 's,^.*/,,'`;;
+     *) d=''; b=$x;;
+  esac
+  # Be a little lax in the regexp, to account for automake conditionals,
+  # quoting, and similar stuff.
+  grep "^[^/]*am__include[^/]*//server/$d\\\$(DEPDIR)/$b\\.[^/]*$" Makefile.in
+done
+
+# Sanity checks.
+for i in 0 1 2 3 4 5 6 7 8 9; do
+  grep "am__include.*/foobar$i\\." Makefile.in
+done
+
+:
diff --git a/tests/libobj20c.test b/tests/subobj11c.test
similarity index 51%
copy from tests/libobj20c.test
copy to tests/subobj11c.test
index 4635183..9262d15 100755
--- a/tests/libobj20c.test
+++ b/tests/subobj11c.test
@@ -14,40 +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/>.
 
-# Test error reporting for AC_CONFIG_LIBOBJ_DIR.
-# See also sister tests `libobj20a.test' and `libobj20b.test' .
+# Automatic dependency tracking with subdir-objects option active:
+# check for a pathological case of slash-collapsing in the name of
+# included makefile fragments (containing dependency info).
+# See also related tests `subobj11a.test' and `subobj11b.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])
+AM_PROG_CC_C_O
 END
 
 cat > Makefile.am << 'END'
 AUTOMAKE_OPTIONS = subdir-objects
-noinst_LIBRARIES = libtu.a
-libtu_a_SOURCES =
-libtu_a_LIBADD = $(LIBOBJS)
+bin_PROGRAMS = foo
+foo_SOURCES = //zardoz.c
 END
 
 $ACLOCAL
+$AUTOMAKE -a
 
-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
+#
+# This check depends on automake internals, but presently this is
+# the only way to test the code path we are interested in.
+# Please update these checks when (and if) the relevant automake
+# internals are changed.
+#
+# Be a little lax in the regexp, to account for automake conditionals,
+# quoting, and similar stuff.
+#
+# FIXME: Are we sure this is the most sensible output in our situation?
+#
+grep '^[^/]*am__include[^/]*//\$(DEPDIR)/zardoz\.[^/]*$' Makefile.in
 
 :
diff --git a/tests/suffix.test b/tests/suffix.test
index c790c66..4e81366 100755
--- a/tests/suffix.test
+++ b/tests/suffix.test
@@ -14,7 +14,9 @@
 # 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 a suffix rule for C compilation is produced.
+# Make sure proper suffix rules for C compilation are produced, and
+# only once.
+# See also related test `suffix2.test'.
 
 . ./defs || Exit 1
 
@@ -22,18 +24,24 @@ set -e
 
 cat >> configure.in << 'END'
 AC_PROG_CC
+AC_PROG_RANLIB
 END
 
 cat > Makefile.am << 'END'
 noinst_PROGRAMS = foo
+noinst_LIBRARIES = libbar.a
 END
 
 $ACLOCAL
 
 $AUTOMAKE -i
-grep '^\.c\.o' Makefile.in
+grep '^ *\.c' Makefile.in # for debugging
+test `grep -c '^\.c\.o:' Makefile.in` -eq 1
+test `grep -c '^\.c\.obj:' Makefile.in` -eq 1
 
 $AUTOMAKE
-grep '^\.c\.o' Makefile.in
+grep '^ *\.c' Makefile.in # for debugging
+test `grep -c '^\.c\.o:' Makefile.in` -eq 1
+test `grep -c '^\.c\.obj:' Makefile.in` -eq 1
 
 :
diff --git a/tests/suffix10.test b/tests/suffix10.test
index d85ad8f..0398d89 100755
--- a/tests/suffix10.test
+++ b/tests/suffix10.test
@@ -29,17 +29,31 @@ AC_PROG_LIBTOOL
 AC_OUTPUT
 EOF
 
-
 cat >Makefile.am << 'END'
 lib_LTLIBRARIES = libfoo.la
 libfoo_la_SOURCES = foo.x_
-
 .x_.y:
-       cp $< $@
+       rm -f $@ address@hidden
+## the leading `:;' works around a bug in bash <= 3.2
+       :; { echo '/* autogenerated */' \
+         && echo '%{' \
+         && echo 'int yylex () {return 0;}' \
+         && echo 'void yyerror (char *s) {}' \
+         && echo '%}' \
+         && echo '%%' \
+         && echo 'WORD: "foo";' \
+         && echo '%%' \
+## account for VPATH issues on weaker make implementations
+         && cat `test -f $< || echo $(srcdir)/`$<; \
+       } > address@hidden
+       mv -f address@hidden $@
+.PHONY: test
+test:
+       echo $(libfoo_la_OBJECTS) | grep '^foo\.lo$$'
+END
 
-.PHONY: print
-print:
-       @echo BEGIN: $(libfoo_la_OBJECTS) :END
+cat > foo.x_ << 'END'
+int foo (void) { return yyparse(); }
 END
 
 libtoolize --force
@@ -48,9 +62,7 @@ $AUTOCONF
 $AUTOMAKE --add-missing
 
 ./configure
-
-$MAKE print >stdout || { cat stdout; Exit 1; }
-cat stdout
-$FGREP 'BEGIN: foo.lo :END' stdout
+$MAKE test
+$MAKE all
 
 :
diff --git a/tests/suffix11.test b/tests/suffix11.test
index 91d2cf4..ec4f5a1 100755
--- a/tests/suffix11.test
+++ b/tests/suffix11.test
@@ -32,18 +32,30 @@ bin_PROGRAMS = foo bar baz
 foo_SOURCES = foo.x_
 bar_SOURCES = bar.y-z
 baz_SOURCES = baz1.x_ baz2.y-z
+
 .y-z.c .x_.c:
-       cp $< $@
-  .z_.c   .w_.x_ :
-       cp $< $@
+## account for VPATH issues on weaker make implementations (e.g. IRIX 6.5)
+       sed 's/INTEGER/int/g' `test -f $< || echo $(srcdir)/`$< >$@
+
+CLEANFILES = foo.c bar.c baz1.c baz2.c
 
-.PHONY: print
-print:
-       @echo BEGIN: $(foo_OBJECTS) :END
-       @echo BEGIN: $(bar_OBJECTS) :END
-       @echo BEGIN: $(baz_OBJECTS) :END
+.PHONY: test-real test-fake
+test-fake:
+       echo $(foo_OBJECTS) | grep '^foo\.foo$$'
+       echo $(bar_OBJECTS) | grep '^bar\.foo$$'
+       echo $(baz_OBJECTS) | grep '^baz1\.foo baz2\.foo$$'
+test-real:
+       echo $(foo_OBJECTS) | grep '^foo\.$(OBJEXT)$$'
+       echo $(bar_OBJECTS) | grep '^bar\.$(OBJEXT)$$'
+       echo $(baz_OBJECTS) | grep '^baz1\.$(OBJEXT) baz2\.$(OBJEXT)$$'
+check-local: test-real
 END
 
+echo 'INTEGER main(void) { return 0; }' > foo.x_
+echo 'INTEGER main(void) { return 0; }' > bar.y-z
+echo 'INTEGER main(void) { INTEGER baz(void); return baz(); }' > baz1.x_
+echo 'INTEGER baz(void) { return 0; }' > baz2.y-z
+
 $ACLOCAL
 $AUTOCONF
 
@@ -56,10 +68,9 @@ $AUTOMAKE -a -Wno-portability
 
 ./configure
 
-OBJEXT=foo $MAKE -e print >stdout || { cat stdout; Exit 1; }
-cat stdout
-$FGREP 'BEGIN: foo.foo :END' stdout
-$FGREP 'BEGIN: bar.foo :END' stdout
-$FGREP 'BEGIN: baz1.foo baz2.foo :END' stdout
+OBJEXT=foo $MAKE -e test-fake
+$MAKE test-real
+$MAKE
+$MAKE distcheck
 
 :
diff --git a/tests/suffix12.test b/tests/suffix12.test
index 21089a5..40f7b3f 100755
--- a/tests/suffix12.test
+++ b/tests/suffix12.test
@@ -31,14 +31,17 @@ AUTOMAKE_OPTIONS = subdir-objects
 SUFFIXES = .baz .o
 # we fake here:
 .baz.o:
-       cp $< $@
+       ## account for VPATH issues on weaker make implementations
+       cp `test -f $< || echo $(srcdir)/`$< $@
 
 bin_PROGRAMS = foo
 foo_SOURCES = foo.c sub/bar.baz
 
-.PHONY: print
-print:
-       @echo BEGIN: $(foo_OBJECTS) :END
+.PHONY: test-fake test-real
+test-fake:
+       echo $(foo_OBJECTS) | grep '^foo\.quux sub/bar\.quux$$'
+test-real:
+       echo $(foo_OBJECTS) | grep '^foo\.$(OBJEXT) sub/bar\.$(OBJEXT)$$'
 END
 
 mkdir sub
@@ -48,9 +51,10 @@ mkdir sub
 $ACLOCAL
 $AUTOCONF
 $AUTOMAKE -a
+
 ./configure
-OBJEXT=OBJ $MAKE -e print >stdout || { cat stdout; Exit 1; }
-cat stdout
-$FGREP 'BEGIN: foo.OBJ sub/bar.OBJ :END' stdout
+
+OBJEXT=quux $MAKE -e test-fake
+$MAKE test-real
 
 :
diff --git a/tests/suffix13.test b/tests/suffix13.test
index 2b39460..d37643a 100755
--- a/tests/suffix13.test
+++ b/tests/suffix13.test
@@ -38,7 +38,8 @@ AUTOMAKE_OPTIONS = subdir-objects
 SUFFIXES = .baz .c
 .baz.c:
        case $@ in sub/*) $(MKDIR_P) sub;; *) :;; esac
-       cp $< $@
+## Account for VPATH issues on weaker make implementations (e.g. IRIX 6.5)
+       cp `test -f $< || echo $(srcdir)/`$< $@
 
 DISTCLEANFILES = sub/bar.c
 
@@ -69,7 +70,7 @@ $MAKE distclean
 
 sed '/subdir-objects/d' < Makefile.am > t
 mv -f t Makefile.am
-$AUTOMAKE --force
+$AUTOMAKE
 ./configure
 $MAKE
 $MAKE distcheck
diff --git a/tests/suffix2.test b/tests/suffix2.test
index 405ce90..e2fd663 100755
--- a/tests/suffix2.test
+++ b/tests/suffix2.test
@@ -15,7 +15,9 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Test to make sure .c.o rule is only included once.
+# Make sure proper suffix rules for C compilation are produced,
+# and only once, even for libtool libraries.
+# See also related test `suffix.test'.
 required=libtoolize
 
 . ./defs || Exit 1
@@ -28,7 +30,6 @@ AC_PROG_LIBTOOL
 END
 
 cat > Makefile.am << 'END'
-AUTOMAKE_OPTIONS = no-dependencies
 lib_LTLIBRARIES = libltdl.la
 libltdl_la_SOURCES = ltdl.c ltdl.h
 END
@@ -41,8 +42,14 @@ END
 : > config.sub
 
 $ACLOCAL
-$AUTOMAKE -a
 
+$AUTOMAKE -i
+grep '^ *\.c' Makefile.in # for debugging
+test `grep -c '^\.c\.o:' Makefile.in` -eq 1
+test `grep -c '^\.c\.obj:' Makefile.in` -eq 1
+
+$AUTOMAKE
+grep '^ *\.c' Makefile.in # for debugging
 test `grep -c '^\.c\.o:' Makefile.in` -eq 1
 test `grep -c '^\.c\.obj:' Makefile.in` -eq 1
 
diff --git a/tests/suffix3.test b/tests/suffix3.test
index fc445bf..0ec457e 100755
--- a/tests/suffix3.test
+++ b/tests/suffix3.test
@@ -22,24 +22,55 @@ set -e
 
 cat >> configure.in << 'END'
 AC_PROG_CXX
+AC_OUTPUT
 END
 
 cat > Makefile.am << 'END'
 SUFFIXES = .zoo
 .zoo.cc:
-       convert-zoo whatever
+       sed 's/INTEGER/int/g' `test -f $< || echo $(srcdir)/`$< >$@
 bin_PROGRAMS = foo
 foo_SOURCES = foo.zoo
+# This is required by "make distcheck".  The useless indirection is
+# reequired to avoid false positives by the grepping checks below.
+FOO = foo
+CLEANFILES = $(FOO).cc
 END
 
 $ACLOCAL
 $AUTOMAKE
 
 # The foo.cc intermediate step is implicit, it's a mistake if
-# Automake requires this file somewhere.
-$FGREP foo.cc Makefile.in && Exit 1
+# Automake requires this file somewhere.  Also, Automake should
+# not require the file `foo.c' anywhere.
+$FGREP foo.c Makefile.in && Exit 1
 # However Automake must figure that foo.zoo is eventually
 # transformed into foo.o, and use this latter file (to link foo).
 $FGREP 'foo.$(OBJEXT)' Makefile.in
 
+$AUTOCONF
+./configure
+
+# This is deliberately valid C++, but invalid C.
+cat > foo.zoo <<'END'
+#include <iostream>
+using namespace std;
+INTEGER main(void)
+{
+  return 0;
+}
+END
+
+$MAKE
+# FIXME: should we check that intermediate file `foo.cc' has
+# been removed?  Or is this requiring too much from the make
+# implementation?
+
+# Intermediate files should not be distributed.
+$MAKE distdir
+test ! -r $me-1.0/foo.cc
+
+# Check the distribution.
+$MAKE distcheck
+
 :
diff --git a/tests/suffix4.test b/tests/suffix4.test
index e952283..b83c280 100755
--- a/tests/suffix4.test
+++ b/tests/suffix4.test
@@ -34,6 +34,8 @@ END
 
 $ACLOCAL
 $AUTOMAKE
-grep '.SUFFIXES:.*\.k' Makefile.in
+grep '^\.SUFFIXES:' Makefile.in | sed -e 's/$/ /' > suffixes
+cat suffixes
+$FGREP ' .k ' suffixes
 
 :
diff --git a/tests/suffix5.test b/tests/suffix5.test
index b3b36aa..f661620 100755
--- a/tests/suffix5.test
+++ b/tests/suffix5.test
@@ -24,23 +24,41 @@ required=libtool
 set -e
 
 cat >> configure.in << 'END'
+AC_SUBST([LINK], [:])
 AC_PROG_LIBTOOL
+AC_OUTPUT
 END
 
 cat > Makefile.am << 'END'
 .k.lo:
-       echo $< > $@
+## account for VPATH issues on weaker make implementations
+       (echo $< && cat `test -f $< || echo $(srcdir)/`$<) > $@
 
 noinst_LTLIBRARIES = libfoo.la
 libfoo_la_SOURCES = foo.k
+
+.PHONY: test
+test: all
+       grep '^=GREP=ME=$$' foo.lo
+## weaker regex to account for VPATH issues
+       grep 'foo\.k$$' foo.lo
+check-local: test
 END
 
 : > ltmain.sh
-: > config.guess
-: > config.sub
+
+cp "$testsrcdir/../lib/config.guess" "$testsrcdir/../lib/config.sub" .
 
 $ACLOCAL
 $AUTOMAKE
 grep '_OBJECTS.*foo\.lo' Makefile.in
 
+$AUTOCONF
+./configure
+
+echo '=GREP=ME=' > foo.k
+
+$MAKE test
+$MAKE distcheck
+
 :
diff --git a/tests/suffix6.test b/tests/suffix6.test
index ab7cf64..7bfabb3 100755
--- a/tests/suffix6.test
+++ b/tests/suffix6.test
@@ -15,32 +15,51 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # Test to make sure Automake supports implicit rules with dot-less
-# extensions.  Also make sure that `.o' is handled like `.$(OBJEXT)'.
+# extensions.  Also make sure that `.o' and `.obj' are handled like
+# `.$(OBJEXT)'.  See also related "semantic" tests suffix6b.test
+# and suffix6c.test.
 
 . ./defs || Exit 1
 
 set -e
 
 cat > Makefile.am << 'END'
-SUFFIXES = a b .$(OBJEXT) c .o
+SUFFIXES = a b .$(OBJEXT) c .o .obj
 bin_PROGRAMS = foo
-foo_SOURCES = fooa fuc
+foo_SOURCES = fooa barc bazc
 ab:
-        cp $< $@
+       dummy action 1
 b.$(OBJEXT):
-       cp $< $@
+       dummy action 2
 c.o:
-       cp $< $@
+       dummy action C
+c.obj:
+       dummy action C
 END
 
 $ACLOCAL
 $AUTOMAKE
 
+sed -n -e '/foo_OBJECTS *=.*\\$/ {
+  :loop
+  p
+  n
+  t clear
+  :clear
+  s/\\$/\\/
+  t loop
+  p
+  n
+}' -e 's/$/ /' -e 's/^.*foo_OBJECTS *= */ /p' Makefile.in > foo-objects
+cat foo-objects
+
 # Automake must figure that fooa translates to foo.$(OBJEXT) and
 # foo.$(OBJEXT) using the following rules:
 #  fooa --[ab]--> foob --[b.$(OBJEXT)]--> foo.$(OBJEXT)
-grep '_OBJECTS.* foo\.\$(OBJEXT)' Makefile.in
-#  fuc --[c.o]--> fu.$(OBJEXT)  ## This is really meant !
-grep '_OBJECTS.* fu\.\$(OBJEXT)' Makefile.in
+$FGREP ' foo.$(OBJEXT) ' foo-objects
+#  barc --[c.o]--> bar.$(OBJEXT)    ## This is really meant !
+$FGREP ' bar.$(OBJEXT) ' foo-objects
+#  bazc --[c.obj]--> baz.$(OBJEXT)  ## This is really meant !
+$FGREP ' baz.$(OBJEXT) ' foo-objects
 
 :
diff --git a/tests/suffix6b.test b/tests/suffix6b.test
new file mode 100755
index 0000000..a96c941
--- /dev/null
+++ b/tests/suffix6b.test
@@ -0,0 +1,77 @@
+#! /bin/sh
+# Copyright (C) 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
+# 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 to make sure Automake supports implicit rules with dot-less
+# extensions.  Se also related "grepping" test suffix6.test.
+
+required=GNUmake # other makes might not grok dot-less suffix rules
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+# $(LINK) is not defined automatically by Automake, since the *_SOURCES
+# variables don't contain any known extension (.c, .cc, .f ...),
+# So we need this hack -- but since such an hack can also serve as a
+# mild stress test, that's ok.
+AC_SUBST([LINK], ['cat >$@'])
+AC_SUBST([OBJEXT], [oOo])
+AC_SUBST([EXEEXT], [.XxX])
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+SUFFIXES = a b c .$(OBJEXT)
+bin_PROGRAMS = foo
+foo_SOURCES = fooa
+ab:
+       { echo '=ab=' && cat $<; } >$@
+bc:
+       { echo '=bc=' && cat $<; } >$@
+c.$(OBJEXT):
+       { echo '=b.obj=' && cat $<; } >$@
+test:
+       : for debugging
+       ls -l
+       : implicit intermediate files should be removed by GNU make
+       test ! -r foob
+       test ! -r fooc
+       : but object files should not
+       cat foo.$(OBJEXT)
+       : for debugging
+       cat foo.XxX
+       : now check that the chain of implicit rules has been executed
+       : completely and in the correct order
+       (echo =b.obj= && echo =bc= && echo =ab= && echo =src=) > exp
+       diff exp foo.XxX
+       rm -f exp
+.PHONY: test
+check-local: test
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+./configure
+
+echo =src= > fooa
+
+$MAKE
+$MAKE test
+$MAKE distcheck
+
+:
diff --git a/tests/suffix6c.test b/tests/suffix6c.test
new file mode 100755
index 0000000..e4b84cc
--- /dev/null
+++ b/tests/suffix6c.test
@@ -0,0 +1,92 @@
+#! /bin/sh
+# Copyright (C) 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
+# 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 to make sure that `.o' and `.obj' are handled like `.$(OBJEXT)'.
+# See also related "grepping" test suffix6.test.
+
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+# $(LINK) is not defined automatically by Automake, since the *_SOURCES
+# variables don't contain any known extension (.c, .cc, .f ...),
+# So we need this hack -- but since such an hack can also serve as a
+# mild stress test, that's ok.
+OBJEXT=${OBJEXT-oOo}
+AC_SUBST([LINK], ['cat >$@'])
+AC_SUBST([EXEEXT], [.XxX])
+AC_SUBST([OBJEXT])
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+SUFFIXES = .zoo .o .obj address@hidden@
+
+bin_PROGRAMS = foo
+foo_SOURCES = foo.zoo
+
+.zoo.o:
+       { echo '=.zoo.o=' && cat $<; } >$@
+.zoo.obj:
+       { echo '=.zoo.obj=' && cat $<; } >$@
address@hidden@:
+       { echo 'address@hidden@=' && cat $<; } >$@
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+./configure
+
+cat > foo.exp <<'END'
+=.zoo.oOo=
+%ONE%
+END
+echo %ONE% > foo.zoo
+$MAKE
+cat foo.oOo
+cat foo.XxX
+diff foo.XxX foo.exp
+
+rm -f foo.* exp
+
+cat > foo.exp <<'END'
+=.zoo.o=
+%TWO%
+END
+echo %TWO% > foo.zoo
+OBJEXT=o $MAKE -e
+cat foo.o
+cat foo.XxX
+diff foo.XxX foo.exp
+
+rm -f foo.* exp
+
+cat > foo.exp <<'END'
+=.zoo.obj=
+%THREE%
+END
+echo %THREE% > foo.zoo
+OBJEXT=obj $MAKE -e
+cat foo.obj
+cat foo.XxX
+diff foo.XxX foo.exp
+
+rm -f foo.* exp
+
+:
diff --git a/tests/suffix8.test b/tests/suffix8.test
index 70ff3a5..8760d7b 100755
--- a/tests/suffix8.test
+++ b/tests/suffix8.test
@@ -14,10 +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 to make sure Automake supports multiple derivations for the same suffix.
-# PR/37
+# Test to make sure Automake supports multiple derivations for the
+# same suffix.
+# From PR/37.
 
-required='gcc libtoolize'
+required=libtoolize
 . ./defs || Exit 1
 
 set -e
@@ -28,41 +29,48 @@ AC_OUTPUT
 END
 
 cat >Makefile.am << 'END'
+# $(LINK) is not defined automatically by Automake, since the *_SOURCES
+# variables don't contain any known extension (.c, .cc, .f ...),
+# So we need this hack.
+LINK = :
+
 bin_PROGRAMS = foo
 lib_LTLIBRARIES = libfoo.la
 
 foo_SOURCES = foo.x_
 libfoo_la_SOURCES = bar.x_
 
+# The elaborate cp commands below account for VPATH issues on
+# weaker make implementations (e.g. IRIX 6.5).
 .x_.y_:
-       cp $< $@
-
+       cp `test -f $< || echo $(srcdir)/`$< $@
 .y_.o:
-       cp $< $@
-
+       cp `test -f $< || echo $(srcdir)/`$< $@
 .y_.z_:
-       cp $< $@
-
+       cp `test -f $< || echo $(srcdir)/`$< $@
 .z_.lo:
-       cp $< $@
-
-# Add explicit dependencies to help make implementations that
-# don't otherwise chain implicit rules (e.g., Sun make).
-foo.$(OBJEXT): foo.y_
-bar.lo: bar.z_
-bar.z_: bar.y_
-
-print:
-       @echo BEGIN: $(foo_OBJECTS) :END
-       @echo BEGIN: $(libfoo_la_OBJECTS) :END
-
-test: $(foo_OBJECTS) $(libfoo_la_OBJECTS)
+       cp `test -f $< || echo $(srcdir)/`$< $@
+
+# Some make implementations don't remove intermediate files
+# automatically, thus causing "make distcheck" to fail if
+# this is not added.
+MOSTLYCLEANFILES = *.y_ *.z_
+
+.PHONY: test0 test1 test2
+test0:
+       echo $(foo_OBJECTS) | grep '^foo\.foo$$'
+       echo $(libfoo_la_OBJECTS) | grep '^bar\.lo$$'
+test1:
+       echo $(foo_OBJECTS) | grep '^foo\.$(OBJEXT)$$'
+       echo $(libfoo_la_OBJECTS) | grep '^bar\.lo$$'
+test2: $(foo_OBJECTS) $(libfoo_la_OBJECTS)
        test -f foo.$(OBJEXT)
        test -f bar.lo
+check-local: test1 test2
 END
 
-echo 'int main() { return 0; }' > foo.x_
-cp foo.x_ bar.x_
+echo 'int main(void) { return 0; }' > foo.x_
+echo 'int bar(void) { return 0; }' > bar.x_
 
 libtoolize
 $ACLOCAL
@@ -71,11 +79,10 @@ $AUTOMAKE -a
 
 ./configure
 
-OBJEXT=foo $MAKE -e print >stdout || { cat stdout; Exit 1; }
-cat stdout
-$FGREP 'BEGIN: foo.foo :END' stdout
-$FGREP 'BEGIN: bar.lo :END' stdout
-
-$MAKE test
+OBJEXT=foo $MAKE -e test0
+$MAKE test1
+$MAKE test2
+$MAKE all
+$MAKE distcheck
 
 :


hooks/post-receive
-- 
GNU Automake



reply via email to

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