maint: Update copyright years to 2018
[automake.git] / t / extra-dist-vpath-dir-merge.sh
bloba129e5820d33215499ac44b176df0703e5040915
1 #! /bin/sh
2 # Copyright (C) 2002-2018 Free Software Foundation, Inc.
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2, or (at your option)
7 # any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <https://www.gnu.org/licenses/>.
17 # Check to make sure that when distdir is invoked in a VPATH
18 # configuration and has to distribute directory X, it actually merge
19 # $(srcdir)/X and ./X, with the files from the later overriding the
20 # files from the former.
22 . test-init.sh
24 echo AC_OUTPUT >> configure.ac
26 cat > Makefile.am << 'END'
27 EXTRA_DIST=foo/bar baz
29 check: distdir
30 test -f $(distdir)/foo/bar/baz
31 test -f $(distdir)/foo/bar/baz2
32 test -f $(distdir)/baz/foo
33 test -f $(distdir)/baz/foo2
34 grep source $(distdir)/foo/bar/baz
35 grep build $(distdir)/foo/bar/baz2
36 grep source $(distdir)/baz/foo
37 grep build $(distdir)/baz/foo2
38 END
40 # Create some files in $(srcdir)
41 mkdir foo
42 mkdir foo/bar
43 echo source > foo/bar/baz
44 echo source > foo/bar/baz2
45 mkdir baz
46 echo source > baz/foo
47 echo source > baz/foo2
49 $ACLOCAL
50 $AUTOMAKE
51 $AUTOCONF
52 mkdir build
53 cd build
54 ../configure
56 # Create some files in $(builddir) that will override part of the
57 # files if $(srcdir) when the distribution is made.
58 mkdir foo
59 mkdir foo/bar
60 echo build > foo/bar/baz2
61 mkdir baz
62 echo build > baz/foo2
64 $MAKE check