test: protect more yacc declarations against C vs. C++ linkage.
[automake.git] / t / disthook.sh
blobb2c12d17c1962bec2f356c1a3412d1a0e670841a
1 #! /bin/sh
2 # Copyright (C) 2012-2024 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 that 'dist-hook' works. See automake bug#10878.
19 . test-init.sh
21 echo AC_OUTPUT >> configure.ac
23 cat > Makefile.am <<'END'
24 EXTRA_DIST = write execute removed doc
26 removed:
27 echo I will be deleted > $@
28 DISTCLEANFILES = removed
30 dist-hook:
31 chmod u+w $(distdir)/write $(distdir)/doc
32 chmod u+x $(distdir)/execute
33 rm -f $(distdir)/removed
34 rm -f $(distdir)/doc/HACKING
35 rm -f $(distdir)/doc/RELEASE-DATE
36 date > $(distdir)/doc/RELEASE-DATE
37 echo all is ok > $(distdir)/write
39 check-local:
40 ls -l $(srcdir) $(srcdir)/doc
41 test "`cat $(srcdir)/write`" = "all is ok"
42 test -f $(srcdir)/doc/README
43 test -f $(srcdir)/doc/RELEASE-DATE
44 test ! -f $(srcdir)/removed
45 test ! -r $(srcdir)/removed
46 test ! -f $(srcdir)/doc/HACKING
47 test ! -r $(srcdir)/doc/HACKING
48 $(srcdir)/execute
49 $(srcdir)/execute | grep 'I run successfully'
50 ## Sanity check.
51 echo ok > $(srcdir)/../distcheck-run
52 END
54 $ACLOCAL
55 $AUTOMAKE
56 $AUTOCONF
58 ./configure
59 mkdir doc
60 : > doc/README
61 : > doc/HACKING
62 echo will be clobbered > write
63 cat > execute <<'END'
64 #!/bin/sh
65 echo I run successfully
66 END
68 chmod a-w write
69 chmod a-x execute
71 $MAKE distdir
72 ls -l $distdir $distdir/doc
73 cd $distdir
74 test "$(cat write)" = "all is ok"
75 test ! -e removed
76 test -f doc/README
77 test -f doc/RELEASE-DATE
78 test ! -e doc/HACING
79 ./execute
80 ./execute | grep 'I run successfully'
81 cd ..
83 $MAKE distcheck
84 test -f distcheck-run