| 1 | #! /bin/sh
|
|---|
| 2 | # Copyright (C) 2003 Free Software Foundation, Inc.
|
|---|
| 3 | #
|
|---|
| 4 | # This file is part of GNU Automake.
|
|---|
| 5 | #
|
|---|
| 6 | # GNU Automake is free software; you can redistribute it and/or modify
|
|---|
| 7 | # it under the terms of the GNU General Public License as published by
|
|---|
| 8 | # the Free Software Foundation; either version 2, or (at your option)
|
|---|
| 9 | # any later version.
|
|---|
| 10 | #
|
|---|
| 11 | # GNU Automake is distributed in the hope that it will be useful,
|
|---|
| 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|---|
| 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|---|
| 14 | # GNU General Public License for more details.
|
|---|
| 15 | #
|
|---|
| 16 | # You should have received a copy of the GNU General Public License
|
|---|
| 17 | # along with Automake; see the file COPYING. If not, write to
|
|---|
| 18 | # the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|---|
| 19 | # Boston, MA 02110-1301, USA.
|
|---|
| 20 |
|
|---|
| 21 | # Test to make sure config files are distributed, and only once.
|
|---|
| 22 | # This tries to distribute a file from a subdirectory, with
|
|---|
| 23 | # a Makefile in that directory. distcom4.test performs the same
|
|---|
| 24 | # test without Makefile in the directory.
|
|---|
| 25 |
|
|---|
| 26 | . ./defs || exit 1
|
|---|
| 27 |
|
|---|
| 28 | set -e
|
|---|
| 29 |
|
|---|
| 30 | cat >> configure.in << 'END'
|
|---|
| 31 | AC_CONFIG_FILES([tests/autoconf:tests/wrapper.in],
|
|---|
| 32 | [chmod +x tests/autoconf])
|
|---|
| 33 | AC_CONFIG_FILES([tests/autoheader:tests/wrapper.in],
|
|---|
| 34 | [chmod +x tests/autoheader])
|
|---|
| 35 | AC_CONFIG_FILES([tests/autom4te:tests/wrapper.in],
|
|---|
| 36 | [chmod +x tests/autom4te])
|
|---|
| 37 | AC_CONFIG_FILES([tests/autoreconf:tests/wrapper.in],
|
|---|
| 38 | [chmod +x tests/autoreconf])
|
|---|
| 39 | AC_CONFIG_FILES([tests/autoscan:tests/wrapper.in],
|
|---|
| 40 | [chmod +x tests/autoscan])
|
|---|
| 41 | AC_CONFIG_FILES([tests/autoupdate:tests/wrapper.in],
|
|---|
| 42 | [chmod +x tests/autoupdate])
|
|---|
| 43 | AC_CONFIG_FILES([tests/ifnames:tests/wrapper.in],
|
|---|
| 44 | [chmod +x tests/ifnames])
|
|---|
| 45 | AC_CONFIG_FILES([tests/Makefile])
|
|---|
| 46 | AC_OUTPUT
|
|---|
| 47 | END
|
|---|
| 48 |
|
|---|
| 49 | mkdir tests
|
|---|
| 50 | : > tests/wrapper.in
|
|---|
| 51 | : > tests/Makefile.am
|
|---|
| 52 | cat > Makefile.am << 'END'
|
|---|
| 53 | SUBDIRS = tests
|
|---|
| 54 | test: distdir
|
|---|
| 55 | test -f $(distdir)/tests/wrapper.in
|
|---|
| 56 | END
|
|---|
| 57 |
|
|---|
| 58 | $ACLOCAL
|
|---|
| 59 | $AUTOCONF
|
|---|
| 60 | $AUTOMAKE --add-missing
|
|---|
| 61 | ./configure
|
|---|
| 62 | $MAKE test
|
|---|
| 63 |
|
|---|
| 64 | sed -n -e '/^DIST_COMMON =.*\\$/ {
|
|---|
| 65 | :loop
|
|---|
| 66 | p
|
|---|
| 67 | n
|
|---|
| 68 | /\\$/ b loop
|
|---|
| 69 | p
|
|---|
| 70 | n
|
|---|
| 71 | }' -e '/^DIST_COMMON =/ p' Makefile.in > top.txt
|
|---|
| 72 |
|
|---|
| 73 | sed -n -e '/^DIST_COMMON =.*\\$/ {
|
|---|
| 74 | :loop
|
|---|
| 75 | p
|
|---|
| 76 | n
|
|---|
| 77 | /\\$/ b loop
|
|---|
| 78 | p
|
|---|
| 79 | n
|
|---|
| 80 | }' -e '/^DIST_COMMON =/ p' tests/Makefile.in > inner.txt
|
|---|
| 81 |
|
|---|
| 82 | test 0 = `grep tests top.txt | wc -l`
|
|---|
| 83 | test 1 = `grep wrapper inner.txt | wc -l`
|
|---|