2 # Copyright (C) 2003-2012 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)
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 # Test support for building HTML documentation, and the many
18 # install-DOC flavors.
20 required
='makeinfo tex texi2dvi'
23 cat >>configure.ac
<<\EOF
24 AC_CONFIG_FILES
([rec
/Makefile
])
26 # At the time of writing, Autoconf does not supplies any of these
27 # definitions (and those below are purposely not those of the standard).
28 AC_SUBST
([dvidir
], ['${datadir}/${PACKAGE}/dvi'])
29 AC_SUBST
([htmldir
], ['${datadir}/${PACKAGE}/html'])
30 AC_SUBST
([pdfdir
], ['${datadir}/${PACKAGE}/pdf'])
31 AC_SUBST
([psdir
], ['${datadir}/${PACKAGE}/ps'])
36 cat > Makefile.am
<< 'END'
37 check-local
: ps pdf dvi html
# For "make distcheck".
39 info_TEXINFOS
= main.texi sub
/main2.texi
42 cat > main.texi
<< 'END'
44 @setfilename main.info
52 cat > sub
/main2.texi
<< 'END'
54 @setfilename main2.info
62 cat > rec
/main3.texi
<< 'END'
64 @setfilename main3.info
71 cat > rec
/Makefile.am
<< 'END'
72 info_TEXINFOS
= main3.texi
75 @$
(MKDIR_P
) "$(pdfdir)"
78 rm -f "$(pdfdir)/hello"
80 check-local
: ps pdf dvi html
# For "make distcheck".
84 $AUTOMAKE --add-missing
87 .
/configure
--prefix "$(pwd)"
92 # Test production of split-per-node HTML.
95 test -d sub
/main2.html
96 test -d rec
/main3.html
98 # Rebuilding main.html should cause its timestamp to be updated.
99 is_newest main.html main.texi
103 is_newest main.html main.texi
107 test ! -e sub
/main2.html
108 test ! -e rec
/main3.html
110 # Test production of a single HTML file.
111 MAKEINFOFLAGS
=--no-split $MAKE -e html
113 test -f sub
/main2.html
114 test -f rec
/main3.html
117 test ! -e sub
/main2.html
118 test ! -e rec
/main3.html
120 # Make sure AM_MAKEINFOHTMLFLAGS is supported, and override AM_MAKEINFO.
122 cp Makefile.am Makefile.sav
123 cat >>Makefile.am
<<\EOF
124 AM_MAKEINFOHTMLFLAGS
= --no-headers --no-split
125 AM_MAKEINFOFLAGS
= --unsupported-option
128 .
/config.status Makefile
132 test -f sub
/main2.html
133 test -d rec
/main3.html
137 test ! -e sub
/main2.html
138 test ! -e rec
/main3.html
141 test -f share
/$me/html
/main.html
142 test -f share
/$me/html
/main2.html
143 test -d share
/$me/html
/main3.html
145 test ! -e share
/$me/html
/main.html
146 test ! -e share
/$me/html
/main2.html
147 test ! -e share
/$me/html
/main3.html
150 test -f share
/$me/dvi
/main.dvi
151 test -f share
/$me/dvi
/main2.dvi
152 test -f share
/$me/dvi
/main3.dvi
154 test ! -e share
/$me/dvi
/main.dvi
155 test ! -e share
/$me/dvi
/main2.dvi
156 test ! -e share
/$me/dvi
/main3.dvi
158 dvips
--help || skip_
"dvips is missing"
161 test -f share
/$me/ps
/main.ps
162 test -f share
/$me/ps
/main2.ps
163 test -f share
/$me/ps
/main3.ps
165 test ! -e share
/$me/ps
/main.ps
166 test ! -e share
/$me/ps
/main2.ps
167 test ! -e share
/$me/ps
/main3.ps
169 pdfetex
--help || pdftex
--help \
170 || skip_
"pdftex and pdfetex are both missing"
173 test -f share
/$me/pdf
/main.pdf
174 test -f share
/$me/pdf
/main2.pdf
175 test -f share
/$me/pdf
/main3.pdf
176 test -f share
/$me/pdf
/hello
178 test ! -e share
/$me/pdf
/main.pdf
179 test ! -e share
/$me/pdf
/main2.pdf
180 test ! -e share
/$me/pdf
/main3.pdf
181 test ! -e share
/$me/pdf
/hello
183 # Restore the makefile without a broken AM_MAKEINFOFLAGS definition.
184 mv -f Makefile.sav Makefile.am
186 .
/config.status Makefile