Implement conditional AC_CONFIG_FILES: AM_COND_IF.
[automake/ericb.git] / tests / notrans.test
blob6d73547093fb83f8a45253f9dab3eb3de08af2e2
1 #! /bin/sh
2 # Copyright (C) 2008 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 3, 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 <http://www.gnu.org/licenses/>.
17 # Check all notrans_, dist_, nodist_ prefix combinations for MANS
18 # primary and install-man dependencies.
20 . ./defs || exit 1
22 set -e
24 cat >>configure.in <<'END'
25 AC_OUTPUT
26 END
28 cat > Makefile.am << 'EOF'
29 man_MANS = foo.1
30 dist_man_MANS = bar.2
31 nodist_man_MANS = baz.3
32 notrans_man_MANS = x-foo.4
33 notrans_dist_man_MANS = x-bar.5
34 notrans_nodist_man_MANS = x-baz.6
35 man7_MANS = y-foo.man
36 dist_man5_MANS = y-bar.man
37 nodist_man4_MANS = y-baz.man
38 notrans_man3_MANS = z-foo.man
39 notrans_dist_man2_MANS = z-bar.man
40 notrans_nodist_man1_MANS = z-baz.man
42 # These two are ignored
43 dist_notrans_man_MANS = nosuch.8
44 nodist_notrans_man9_MANS = nosuch.man
46 y-foo.man:
47 : >$@
48 y-bar.man:
49 : >$@
50 y-baz.man:
51 : >$@
52 z-foo.man:
53 : >$@
54 z-bar.man:
55 : >$@
56 z-baz.man:
57 : >$@
59 test-install: install
60 test -f inst/man/man1/gnu-foo.1
61 test -f inst/man/man2/gnu-bar.2
62 test -f inst/man/man3/gnu-baz.3
63 test -f inst/man/man4/x-foo.4
64 test -f inst/man/man5/x-bar.5
65 test -f inst/man/man6/x-baz.6
66 test -f inst/man/man7/gnu-y-foo.7
67 test -f inst/man/man5/gnu-y-bar.5
68 test -f inst/man/man4/gnu-y-baz.4
69 test -f inst/man/man3/z-foo.3
70 test -f inst/man/man2/z-bar.2
71 test -f inst/man/man1/z-baz.1
72 if test -d inst/man/man8; then (exit 1); else :; fi
73 if test -d inst/man/man9; then (exit 1); else :; fi
74 EOF
76 : > foo.1
77 : > bar.2
78 : > baz.3
79 : > x-foo.4
80 : > x-bar.5
81 : > x-baz.6
83 $ACLOCAL
84 $AUTOCONF
85 $AUTOMAKE
87 grep '^install-man1:' Makefile.in | grep '\$(man_MANS)'
88 grep '^install-man2:' Makefile.in | grep '\$(dist_man_MANS)'
89 grep '^install-man3:' Makefile.in | grep '\$(nodist_man_MANS)'
90 grep '^install-man4:' Makefile.in | grep '\$(notrans_man_MANS)'
91 grep '^install-man5:' Makefile.in | grep '\$(notrans_dist_man_MANS)'
92 grep '^install-man6:' Makefile.in | grep '\$(notrans_nodist_man_MANS)'
94 if grep '^install-man8:' Makefile.in; then exit 1; else :; fi
95 if grep '^install-man9:' Makefile.in; then exit 1; else :; fi
97 ./configure --program-prefix=gnu- --prefix "`pwd`"/inst --mandir "`pwd`"/inst/man
98 $MAKE
99 $MAKE test-install
100 test `find inst/man -type f -print | wc -l` = 12
101 $MAKE uninstall
102 test `find inst/man -type f -print | wc -l` = 0
104 # Opportunistically test for installdirs.
105 rm -rf inst
106 $MAKE installdirs
107 test -d inst/man/man1
108 test -d inst/man/man2
109 test -d inst/man/man3
110 test -d inst/man/man4
111 test -d inst/man/man5
112 test -d inst/man/man6
113 test -d inst/man/man7
114 if test -d inst/man/man8; then exit 1; else :; fi
115 if test -d inst/man/man9; then exit 1; else :; fi