cccbd83683b448e6d6d8828f62a6626ec6906216
[platform/upstream/automake.git] / tests / destdir.test
1 #! /bin/sh
2
3 # Make sure that `make distcheck' can find some $(DESTDIR) omissions.
4 # PR/186.
5
6 # The feature we test here relies on read-only files.
7 # It will only work for non-root users.
8 required='non-root'
9
10 . $srcdir/defs || exit 1
11
12 set -e
13
14 cat >> configure.in <<'EOF'
15 AC_OUTPUT
16 EOF
17
18 cat > Makefile.am <<'EOF'
19 dist_data_DATA = foo
20
21 # This rule is bogus because it doesn't use $(DESTDIR) on the
22 # second argument of cp.  distcheck is expected to catch this.
23 install-data-hook:
24         cp $(DESTDIR)$(datadir)/foo $(datadir)/bar
25
26 uninstall-local:
27         rm -f $(DESTDIR)$(datadir)/bar
28 EOF
29
30 : > foo
31
32 $ACLOCAL
33 $AUTOCONF
34 $AUTOMAKE -a
35 ./configure
36 $MAKE distcheck && exit 1
37 :