test -z "$is_newest_files"
}
+# useless_vpath_rebuild
+# ---------------------
+# Tell whether $MAKE suffers of the bug triggering automake bug#7884.
+# For example, this happens with FreeBSD make, since in a VPATH build
+# it tends to rebuilt files for which there is an explicit or even just
+# a suffix rule, even if said files are already available in the VPATH
+# directory.
+useless_vpath_rebuild ()
+{
+ case $am__useless_vpath_rebuild in
+ yes) return 0;;
+ no) return 1;;
+ "") ;;
+ *) fatal_ "no_useless_builddir_remake: internal error";;
+ esac
+ if using_gmake; then
+ am__useless_vpath_rebuild=no
+ return 1
+ else
+ mkdir am__vpath.dir$$
+ cd am__vpath.dir$$
+ touch foo.a foo.b bar baz
+ mkdir build
+ cd build
+ unindent > Makefile << 'END'
+ .SUFFIXES: .a .b
+ VPATH = ..
+ all: foo.b baz
+ .PHONY: all
+ .a.b: ; cp $< $@
+ baz: bar ; cp ../baz bar
+END
+ if $MAKE all && test ! -f foo.b && test ! -f bar; then
+ am__useless_vpath_rebuild=no
+ else
+ am__useless_vpath_rebuild=yes
+ fi
+ cd ../..
+ rm -rf am__vpath.dir$$
+ fi
+}
+
+yl_distcheck () { useless_vpath_rebuild || $MAKE distcheck ${1+"$@"}; }
+
# using_gmake
# -----------
# Return success if $MAKE is GNU make, return failure otherwise.
test -f $distdir/foo.c
# Sanity check on distribution.
-$MAKE distcheck
+yl_distcheck
# While we are at it, make sure that foo.c is erased by
# maintainer-clean, and not by distclean.
$AUTOMAKE -Wno-override --add-missing
cd ..
-# Some checks here are slightly more tricky than we'd like, but we cannot
-# simply use "make distcheck", to avoid triggering a spurious failure due
-# to issues with FreeBSD make and VPATH builds (see automake bug#7884).
-
./configure
-$MAKE
-$MAKE dist
-test -f lib-dist-hook-has-run
-test -f subpack-1.tar.gz
-test ! -d subpack-1 # Make sure "dist" cleans up after itself.
-mkdir workdir
-cd workdir
-gzip -c -d ../subpack-1.tar.gz | tar xf -
-test -d subpack-1
-mkdir build
-cd build
-../subpack-1/configure
-$MAKE
$MAKE dist
test -f lib-dist-hook-has-run
test -f subpack-1.tar.gz
test ! -d subpack-1 # Make sure "dist" cleans up after itself.
-# Don't trust non-GNU makes to do distcheck with a Yacc-using
-# package (see bug referenced above).
-if using_gmake; then
- $MAKE distcheck || Exit 1
-fi
+rm -f lib-dist-hook-has-run subpack-1.tar.gz
+
+yl_distcheck
:
# be distributed, or properly cleaned by automake-generated rules.
# We don't want to set the exact semantics yet, but want to ensure
# they are are consistent.
-$MAKE distcheck
+yl_distcheck
# Make sure that the Yacc-derived C sources are erased by
# maintainer-clean, and not by distclean.
# must either not be distributed, or properly cleaned by automake-generated
# rules. We don't want to set the exact semantics yet, but want to ensure
# they are are consistent.
-$MAKE distcheck
+yl_distcheck
# Make sure that the Yacc-derived C++ sources are erased by
# maintainer-clean, and not by distclean.
test -f $distdir/baz/zardoz-parse.h
# Sanity check the distribution.
-$MAKE distcheck
+yl_distcheck
# While we are at it, make sure that `parse.c' and `parse.h' are erased
# by maintainer-clean, and not by distclean.
# The Yacc-derived C++ sources must be created, and not removed once
# compiled (i.e., not treated like "intermediate files" in the GNU
# make sense).
-$MAKE distcheck
+yl_distcheck
# Check that we can recover from deleted headers.
$MAKE clean
set -e
+# This test is bounded to fail for any implementation that
+# triggers automake bug#7884.
+useless_vpath_rebuild && skip_ "would trip on automake bug#7884"
+
cat >> configure.in << 'END'
AC_PROG_CC
AM_PROG_CC_C_O