tests: Let 'ltorder.sh' run successfully with Guix dynamic loader
[automake.git] / t / distdir.sh
blob147a83b4eee1e23337cef6f31abb5380fbb79087
1 #! /bin/sh
2 # Copyright (C) 1996-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 # Test to make sure subdirs in EXTRA_DIST work. Also tests to make
18 # sure *srcdir is properly handled. Note that using './', as in
19 # EXTRA_DIST = ./joe
20 # does not work portably: it fails with HP-UX and Tru64 make.
21 # Also test DISTFILES containing a directory and a file in it,
22 # and repeated directories.
24 . test-init.sh
26 cat >> configure.ac << 'END'
27 AC_OUTPUT
28 END
30 cat > Makefile.am << 'END'
31 include_HEADERS = some/file another/sub/subsub/file2 yet/another/file3
32 EXTRA_DIST = foo/bar joe $(top_srcdir)/woo/doo $(srcdir)/dada \
33 some another/sub yet \
34 some another/sub yet
37 all-local:
38 $(MKDIR_P) another/sub/subsub
39 touch another/sub/subsub/file2
41 CLEANFILES = another/sub/subsub/file2
43 check-local:
44 test -f $(srcdir)/foo/bar
45 test -f $(srcdir)/woo/doo
46 test -f $(srcdir)/joe
47 test -f $(srcdir)/dada
48 test -f $(srcdir)/some/file
49 test -f $(srcdir)/another/sub/subsub/file2 \
50 || test -f /another/sub/subsub/file2
51 test -f $(srcdir)/yet/another/file3
52 END
54 $ACLOCAL
55 $AUTOCONF
56 $AUTOMAKE
58 mkdir foo woo some another another/sub another/sub/subsub yet yet/another
59 touch foo/bar joe woo/doo dada some/file another/sub/subsub/file2
60 touch yet/another/file3
62 mkdir build
63 cd build
64 ../configure
65 $MAKE distdir
66 # Check to make sure 'foo' isn't made in build directory.
67 test -d foo && exit 1
69 rm -rf $me-1.0
70 # Remove the dot from VERSION for the next grep.
71 run_make -O -e IGNORE VERSION=10 MKDIR_P='echo MKDIR_P' distdir
73 # Make sure no './' appear in the directory names. srcdir is '..', so
74 # this also checks that no directory is created in the source tree.
75 grep 'MKDIR_P.*\.' stdout && exit 1
77 cd ..
78 ./configure --prefix "$(pwd)"
79 $MAKE distcheck