1 | #! /bin/sh
|
---|
2 | # Copyright (C) 2003, 2004, 2006 Free Software Foundation, Inc.
|
---|
3 | #
|
---|
4 | # This file is part of GNU Automake.
|
---|
5 | #
|
---|
6 | # GNU Automake is free software; you can redistribute it and/or modify
|
---|
7 | # it under the terms of the GNU General Public License as published by
|
---|
8 | # the Free Software Foundation; either version 2, or (at your option)
|
---|
9 | # any later version.
|
---|
10 | #
|
---|
11 | # GNU Automake is distributed in the hope that it will be useful,
|
---|
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
14 | # GNU General Public License for more details.
|
---|
15 | #
|
---|
16 | # You should have received a copy of the GNU General Public License
|
---|
17 | # along with Automake; see the file COPYING. If not, write to
|
---|
18 | # the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
---|
19 | # Boston, MA 02110-1301, USA.
|
---|
20 |
|
---|
21 | # Test support for building HTML documentation, and the many
|
---|
22 | # install-DOC flavors.
|
---|
23 |
|
---|
24 | required='makeinfo-html tex'
|
---|
25 | . ./defs || exit 1
|
---|
26 |
|
---|
27 | set -e
|
---|
28 |
|
---|
29 | cat >>configure.in <<\EOF
|
---|
30 | AC_CONFIG_FILES([rec/Makefile])
|
---|
31 |
|
---|
32 | # At the time of writing, Autoconf does not supplies any of these
|
---|
33 | # definitions (and those below are purposedly not those of the standard).
|
---|
34 | AC_SUBST([dvidir], ['${datadir}/${PACKAGE}/dvi'])
|
---|
35 | AC_SUBST([htmldir], ['${datadir}/${PACKAGE}/html'])
|
---|
36 | AC_SUBST([pdfdir], ['${datadir}/${PACKAGE}/pdf'])
|
---|
37 | AC_SUBST([psdir], ['${datadir}/${PACKAGE}/ps'])
|
---|
38 |
|
---|
39 | AC_OUTPUT
|
---|
40 | EOF
|
---|
41 |
|
---|
42 | cat > Makefile.am << 'END'
|
---|
43 | SUBDIRS = rec
|
---|
44 | info_TEXINFOS = main.texi sub/main2.texi
|
---|
45 | END
|
---|
46 |
|
---|
47 | cat > main.texi << 'END'
|
---|
48 | \input texinfo
|
---|
49 | @setfilename main.info
|
---|
50 | @settitle main
|
---|
51 | @node Top
|
---|
52 | Hello walls.
|
---|
53 | @bye
|
---|
54 | END
|
---|
55 |
|
---|
56 | mkdir sub
|
---|
57 | cat > sub/main2.texi << 'END'
|
---|
58 | \input texinfo
|
---|
59 | @setfilename main2.info
|
---|
60 | @settitle main2
|
---|
61 | @node Top
|
---|
62 | Hello walls.
|
---|
63 | @bye
|
---|
64 | END
|
---|
65 |
|
---|
66 | mkdir rec
|
---|
67 | cat > rec/main3.texi << 'END'
|
---|
68 | \input texinfo
|
---|
69 | @setfilename main3.info
|
---|
70 | @settitle main3
|
---|
71 | @node Top
|
---|
72 | Hello walls.
|
---|
73 | @bye
|
---|
74 | END
|
---|
75 |
|
---|
76 | cat > rec/Makefile.am << 'END'
|
---|
77 | info_TEXINFOS = main3.texi
|
---|
78 |
|
---|
79 | install-pdf-local:
|
---|
80 | @$(MKDIR_P) "$(pdfdir)"
|
---|
81 | :> "$(pdfdir)/hello"
|
---|
82 | uninstall-local:
|
---|
83 | rm -f "$(pdfdir)/hello"
|
---|
84 | END
|
---|
85 |
|
---|
86 | $ACLOCAL
|
---|
87 | $AUTOMAKE --add-missing
|
---|
88 | $AUTOCONF
|
---|
89 |
|
---|
90 | ./configure
|
---|
91 |
|
---|
92 | $MAKE
|
---|
93 |
|
---|
94 | $sleep
|
---|
95 | # Test production of split-per-node HTML.
|
---|
96 | $MAKE html
|
---|
97 | test -d main.html
|
---|
98 | test -d sub/main2.html
|
---|
99 | test -d rec/main3.html
|
---|
100 |
|
---|
101 | # Rebuilding main.html should cause its timestamp to be updated.
|
---|
102 | test `ls -1td main.texi main.html | sed 1q` = main.html
|
---|
103 | $sleep
|
---|
104 | touch main.texi
|
---|
105 | $MAKE html
|
---|
106 | test `ls -1td main.texi main.html | sed 1q` = main.html
|
---|
107 |
|
---|
108 | $MAKE clean
|
---|
109 | test ! -d main.html
|
---|
110 | test ! -d sub/main2.html
|
---|
111 | test ! -d rec/main3.html
|
---|
112 |
|
---|
113 | # Test production of a single HTML file.
|
---|
114 | MAKEINFOFLAGS=--no-split $MAKE -e html
|
---|
115 | test -f main.html
|
---|
116 | test -f sub/main2.html
|
---|
117 | test -f rec/main3.html
|
---|
118 | $MAKE clean
|
---|
119 | test ! -f main.html
|
---|
120 | test ! -f sub/main2.html
|
---|
121 | test ! -f rec/main3.html
|
---|
122 |
|
---|
123 | # Make sure AM_MAKEINFOHTMLFLAGS is supported, and override AM_MAKEINFO.
|
---|
124 | cat >>Makefile.am <<\EOF
|
---|
125 | AM_MAKEINFOHTMLFLAGS=--no-split
|
---|
126 | AM_MAKEINFOFLAGS=--unsupported-option
|
---|
127 | EOF
|
---|
128 | $AUTOMAKE
|
---|
129 | ./configure --prefix "`pwd`"
|
---|
130 | $MAKE html
|
---|
131 | test -f main.html
|
---|
132 | test -f sub/main2.html
|
---|
133 | test -d rec/main3.html
|
---|
134 | $MAKE clean
|
---|
135 | test ! -f main.html
|
---|
136 | test ! -f sub/main2.html
|
---|
137 | test ! -d rec/main3.html
|
---|
138 |
|
---|
139 | $MAKE install-html
|
---|
140 | test -f share/txinfo21/html/main.html
|
---|
141 | test -f share/txinfo21/html/main2.html
|
---|
142 | test -d share/txinfo21/html/main3.html
|
---|
143 | $MAKE uninstall
|
---|
144 | test ! -f share/txinfo21/html/main.html
|
---|
145 | test ! -f share/txinfo21/html/main2.html
|
---|
146 | test ! -d share/txinfo21/html/main3.html
|
---|
147 |
|
---|
148 | $MAKE install-dvi
|
---|
149 | test -f share/txinfo21/dvi/main.dvi
|
---|
150 | test -f share/txinfo21/dvi/main2.dvi
|
---|
151 | test -f share/txinfo21/dvi/main3.dvi
|
---|
152 | $MAKE uninstall
|
---|
153 | test ! -f share/txinfo21/dvi/main.dvi
|
---|
154 | test ! -f share/txinfo21/dvi/main2.dvi
|
---|
155 | test ! -f share/txinfo21/dvi/main3.dvi
|
---|
156 |
|
---|
157 | (dvips --help 2>/dev/null >/dev/null) || exit 77
|
---|
158 |
|
---|
159 | $MAKE install-ps
|
---|
160 | test -f share/txinfo21/ps/main.ps
|
---|
161 | test -f share/txinfo21/ps/main2.ps
|
---|
162 | test -f share/txinfo21/ps/main3.ps
|
---|
163 | $MAKE uninstall
|
---|
164 | test ! -f share/txinfo21/ps/main.ps
|
---|
165 | test ! -f share/txinfo21/ps/main2.ps
|
---|
166 | test ! -f share/txinfo21/ps/main3.ps
|
---|
167 |
|
---|
168 | (pdfetex --help 2>/dev/null >/dev/null) ||
|
---|
169 | (pdftex --help 2>/dev/null >/dev/null) || exit 77
|
---|
170 |
|
---|
171 | $MAKE install-pdf
|
---|
172 | test -f share/txinfo21/pdf/main.pdf
|
---|
173 | test -f share/txinfo21/pdf/main2.pdf
|
---|
174 | test -f share/txinfo21/pdf/main3.pdf
|
---|
175 | test -f share/txinfo21/pdf/hello
|
---|
176 | $MAKE uninstall
|
---|
177 | test ! -f share/txinfo21/pdf/main.pdf
|
---|
178 | test ! -f share/txinfo21/pdf/main2.pdf
|
---|
179 | test ! -f share/txinfo21/pdf/main3.pdf
|
---|
180 | test ! -f share/txinfo21/pdf/hello
|
---|