summaryrefslogtreecommitdiff
path: root/t/distcom-subdir.sh
diff options
context:
space:
mode:
Diffstat (limited to 't/distcom-subdir.sh')
-rw-r--r--t/distcom-subdir.sh51
1 files changed, 26 insertions, 25 deletions
diff --git a/t/distcom-subdir.sh b/t/distcom-subdir.sh
index 257561ed8..df40f96cd 100644
--- a/t/distcom-subdir.sh
+++ b/t/distcom-subdir.sh
@@ -17,59 +17,60 @@
# Test to make sure that if an auxfile (here depcomp) is required
# by a subdir Makefile.am, it is distributed by that Makefile.am.
+required=cc
. test-init.sh
cat >> configure.ac << 'END'
AC_CONFIG_FILES([subdir/Makefile])
AC_PROG_CC
+AC_PROG_FGREP
AC_OUTPUT
END
cat > Makefile.am << 'END'
SUBDIRS = subdir
+test-distdir: distdir
+ test -f $(distdir)/depcomp
+.PHONY: test-distdir
+check-local: test-distdir
END
rm -f depcomp
mkdir subdir
-: > subdir/Makefile.am
+cat > subdir/Makefile.am << 'END'
+.PHONY: test-distcom
+test-distcom:
+ echo ' ' $(DIST_COMMON) ' ' | $(FGREP) ' $(top_srcdir)/depcomp '
+END
$ACLOCAL
$AUTOCONF
$AUTOMAKE
test ! -e depcomp
-cat > subdir/Makefile.am << 'END'
+cat >> subdir/Makefile.am << 'END'
bin_PROGRAMS = foo
+.PHONY: test-distcom
+test-distcom:
+ echo ' ' $(DIST_COMMON) ' ' | $(FGREP) ' $(top_srcdir)/depcomp '
+check-local: test-distcom
END
-: > subdir/foo.c
+cat > subdir/foo.c <<'END'
+int main (void)
+{
+ return 0;
+}
+END
$AUTOMAKE -a subdir/Makefile
test -f depcomp
-# FIXME: the logic of this check and other similar ones in other
-# FIXME: 'distcom*.sh' files should be factored out in a common
-# FIXME: subroutine in 'am-test-lib.sh'...
-sed -n -e "
- /^DIST_COMMON =.*\\\\$/ {
- :loop
- p
- n
- t clear
- :clear
- s/\\\\$/\\\\/
- t loop
- s/$/ /
- s/[$tab ][$tab ]*/ /g
- p
- n
- }" subdir/Makefile.in > dc.txt
-cat dc.txt
-$FGREP ' $(top_srcdir)/depcomp ' dc.txt
-
./configure
-$MAKE distdir
-test -f $distdir/depcomp
+(cd subdir && $MAKE test-distcom)
+$MAKE test-distdir
+
+$MAKE distcheck
: