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 <stefano.lattarini@gmail.com>
+
+ 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 <stefano.lattarini@gmail.com>
gitignore: more use of anchors
suffix11.test \
suffix12.test \
suffix13.test \
+suffix-chain.test \
symlink.test \
symlink2.test \
syntax.test \
suffix11.test \
suffix12.test \
suffix13.test \
+suffix-chain.test \
symlink.test \
symlink2.test \
syntax.test \
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.
--- /dev/null
+#! /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
+
+:
./configure
$MAKE test
+
+make_can_chain_suffix_rules || skip_ "make doesn't chain suffix rules"
$MAKE all
:
OBJEXT=foo $MAKE -e test-fake
$MAKE test-real
+
+make_can_chain_suffix_rules || skip_ "make doesn't chain suffix rules"
+
$MAKE
$MAKE distcheck
# 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
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