automake-patches
[Top][All Lists]
Advanced

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

[FYI] {master} tests: don't let a known Solaris make bug poison too many


From: Stefano Lattarini
Subject: [FYI] {master} tests: don't let a known Solaris make bug poison too many tests
Date: Tue, 9 Aug 2011 17:57:54 +0200

See automake bug#7670 and bug#7824.

* tests/defs (make_can_chain_suffix_rules): New function, tell
whether the make implementation in use can chain suffix rules
automatically or not.
* tests/suffix3.test: Use it to avoid issuing calls to make that
are unportable to make implementations that are not smart enough
to chain suffix rules automatically.
* tests/suffix8.test: Use it to avoid issuing calls to make that
* tests/suffix10.test: Use it to avoid issuing calls to make that
* tests/suffix11.test: Use it to avoid issuing calls to make that
* tests/suffix-chain.test: New test, exposes the limitation that
we have papered over in the tests above.
---
 ChangeLog               |   16 +++++++++++++
 tests/Makefile.am       |    1 +
 tests/Makefile.in       |    1 +
 tests/defs              |   35 ++++++++++++++++++++++++++++
 tests/suffix-chain.test |   57 +++++++++++++++++++++++++++++++++++++++++++++++
 tests/suffix10.test     |    2 +
 tests/suffix11.test     |    3 ++
 tests/suffix3.test      |    2 +
 tests/suffix8.test      |    1 +
 9 files changed, 118 insertions(+), 0 deletions(-)
 create mode 100755 tests/suffix-chain.test

diff --git a/ChangeLog b/ChangeLog
index 2a8ab43..5a74f66 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,21 @@
 2011-08-09  Stefano Lattarini  <address@hidden>
 
+       tests: don't let a known Solaris make bug poison too many tests
+       See automake bug#7670 and bug#7824.
+       * tests/defs (make_can_chain_suffix_rules): New function, tell
+       whether the make implementation in use can chain suffix rules
+       automatically or not.
+       * tests/suffix3.test: Use it to avoid issuing calls to make that
+       are unportable to make implementations that are not smart enough
+       to chain suffix rules automatically.
+       * tests/suffix8.test: Use it to avoid issuing calls to make that
+       * tests/suffix10.test: Use it to avoid issuing calls to make that
+       * tests/suffix11.test: Use it to avoid issuing calls to make that
+       * tests/suffix-chain.test: New test, exposes the limitation that
+       we have papered over in the tests above.
+
+2011-08-09  Stefano Lattarini  <address@hidden>
+
        gitignore: more use of anchors
        * .gitignore: Anchor files that are intended to be ignored only
        if found in the same directory of the `.gitignore' file, not also
diff --git a/tests/Makefile.am b/tests/Makefile.am
index dd1875e..82fb906 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -960,6 +960,7 @@ suffix10.test \
 suffix11.test \
 suffix12.test \
 suffix13.test \
+suffix-chain.test \
 symlink.test \
 symlink2.test \
 syntax.test \
diff --git a/tests/Makefile.in b/tests/Makefile.in
index 08ac8e8..d6d418c 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -1233,6 +1233,7 @@ suffix10.test \
 suffix11.test \
 suffix12.test \
 suffix13.test \
+suffix-chain.test \
 symlink.test \
 symlink2.test \
 syntax.test \
diff --git a/tests/defs b/tests/defs
index 701668d..dba01fb 100644
--- a/tests/defs
+++ b/tests/defs
@@ -204,6 +204,41 @@ using_gmake ()
   esac
 }
 
+# make_can_chain_suffix_rules
+# ---------------------------
+# Return 0 if $MAKE is a make implementation that can chain suffix rules
+# automatically, return 1 otherwise.  Caches the result for speed reasons.
+make_can_chain_suffix_rules ()
+{
+  if test -z "$am__can_chain_suffix_rules"; then
+    if using_gmake; then
+      am__can_chain_suffix_rules=yes
+      return 0
+    else
+      mkdir am__chain.dir$$
+      cd am__chain.dir$$
+      unindent > Makefile << 'END'
+        .u.v: ; cp $< $@
+        .v.w: ; cp $< $@
+END
+      echo make can chain suffix rules > foo.u
+      if $MAKE foo.w && diff foo.u foo.w; then
+        am__can_chain_suffix_rules=yes
+      else
+        am__can_chain_suffix_rules=no
+      fi
+      cd ..
+      rm -rf am__chain.dir$$
+    fi
+  fi
+  case $am__can_chain_suffix_rules in
+    yes) return 0;;
+     no) return 1;;
+      *) fatal_ "make_can_chain_suffix_rules: internal error";;
+  esac
+}
+am__can_chain_suffix_rules="" # Avoid interferences from the environment.
+
 commented_sed_unindent_prog='
   /^$/b                    # Nothing to do for empty lines.
   x                        # Get x<indent> into pattern space.
diff --git a/tests/suffix-chain.test b/tests/suffix-chain.test
new file mode 100755
index 0000000..c461cc9
--- /dev/null
+++ b/tests/suffix-chain.test
@@ -0,0 +1,57 @@
+#! /bin/sh
+# Copyright (C) 2002, 2003, 2010, 2011 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Check that Automake can emit code that work round the inability of
+# some make implementations to automatically chain suffix rules.
+# See automake bug#7824 and bug#7670.
+
+. ./defs || Exit 1
+
+cat >> configure.ac <<'END'
+AC_PROG_CC
+AC_OUTPUT
+END
+
+cat > Makefile.am <<'END'
+bin_PROGRAMS = foo
+foo_SOURCES = foo.e
+.e.d:
+      (echo 'int main (void)' && echo '{' && cat $<) > $@
+.d.c:
+      (cat $< && echo '}') > $@
+CLEANFILES = foo.d foo.c
+END
+
+echo 'return 0' > foo.e
+
+$ACLOCAL
+$AUTOMAKE
+$AUTOCONF
+./configure
+
+$MAKE
+$MAKE distcheck
+
+$MAKE clean
+
+cat >> Makefile <<'END'
+foo.c: foo.d
+foo.d: foo.e
+END
+
+$MAKE
+
+:
diff --git a/tests/suffix10.test b/tests/suffix10.test
index 026da24..091ca9f 100755
--- a/tests/suffix10.test
+++ b/tests/suffix10.test
@@ -61,6 +61,8 @@ $AUTOMAKE --add-missing
 
 ./configure
 $MAKE test
+
+make_can_chain_suffix_rules || skip_ "make doesn't chain suffix rules"
 $MAKE all
 
 :
diff --git a/tests/suffix11.test b/tests/suffix11.test
index daeba1c..8979bbe 100755
--- a/tests/suffix11.test
+++ b/tests/suffix11.test
@@ -68,6 +68,9 @@ $AUTOMAKE -a -Wno-portability
 
 OBJEXT=foo $MAKE -e test-fake
 $MAKE test-real
+
+make_can_chain_suffix_rules || skip_ "make doesn't chain suffix rules"
+
 $MAKE
 $MAKE distcheck
 
diff --git a/tests/suffix3.test b/tests/suffix3.test
index e0c01f6..029e5bd 100755
--- a/tests/suffix3.test
+++ b/tests/suffix3.test
@@ -47,6 +47,8 @@ $FGREP foo.c Makefile.in && Exit 1
 # transformed into foo.o, and use this latter file (to link foo).
 $FGREP 'foo.$(OBJEXT)' Makefile.in
 
+make_can_chain_suffix_rules || skip_ "make doesn't chain suffix rules"
+
 $AUTOCONF
 ./configure
 
diff --git a/tests/suffix8.test b/tests/suffix8.test
index 921c641..99582d7 100755
--- a/tests/suffix8.test
+++ b/tests/suffix8.test
@@ -79,6 +79,7 @@ $AUTOMAKE -a
 
 OBJEXT=foo $MAKE -e test0
 $MAKE test1
+make_can_chain_suffix_rules || skip_ "make doesn't chain suffix rules"
 $MAKE test2
 $MAKE all
 $MAKE distcheck
-- 
1.7.2.3




reply via email to

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