2 dnl Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010,
3 dnl 2011 Free Software Foundation, Inc.
5 dnl This program is free software; you can redistribute it and/or modify
6 dnl it under the terms of the GNU General Public License as published by
7 dnl the Free Software Foundation; either version 3 of the License, or
8 dnl (at your option) any later version.
10 dnl This program is distributed in the hope that it will be useful,
11 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
12 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 dnl GNU General Public License for more details.
14 dnl You should have received a copy of the GNU General Public License
15 dnl along with this program; if not, write to the Free Software
16 dnl Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 AC_DEFUN([GNASH_DOCBOOK], [
20 AC_ARG_ENABLE(docbook, AC_HELP_STRING([--enable-docbook], [Enable support for building documentation with "make html" and "make pdf"]),
21 [case "${enableval}" in
24 *) AC_MSG_ERROR([bad value ${enableval} for enable-docbook option]) ;;
28 if test x"$docbook" = x"yes"; then dnl## {
29 dnl install-info is used to update entries in the dirs file, used by
30 dnl info to find all of it files.
31 AC_PATH_PROG(INSTALL_INFO, install-info, $PATH:/usr/sbin)
32 AC_SUBST(INSTALL_INFO)
33 AM_CONDITIONAL(ENABLE_INFO, test x${INSTALL_INFO} != x)
36 AC_ARG_WITH(docbook_styles, AC_HELP_STRING([--with-docbook-styles], [directory where Docbook stylesheets are]), with_docbook_styles=${withval})
37 if test x"${with_docbook_styles}" != x ; then dnl## {
39 if test -f ${with_docbook_styles}/html/docbook.xsl ; then dnl## {
40 docbook_styles="`(cd ${with_docbook_styles}; pwd)`"
42 AC_MSG_ERROR([${with_docbook_styles}/html directory doesn't contain docbook.xsl])
46 AC_CACHE_CHECK([for docbook styles path],[gnash_cv_path_docbook_styles],[
47 dirlist="/usr/share/xml/docbook/stylesheet/nwalsh /usr/share/xml/docbook/stylesheet/nwalsh/current /usr/share/sgml/docbook/xsl-stylesheets /usr/local/share/sgml/docbook/xsl-stylesheets /opt/share/sgml/docbook/xsl-stylesheets /home/latest/share/sgml/docbook/xsl-stylesheets /usr/share/sgml/docbook/stylesheet/xsl/nwalsh"
49 if test -f $i/html/docbook.xsl; then
50 gnash_cv_path_docbook_styles="`(cd $i; pwd)`"
56 if test x$gnash_cv_path_docbook_styles != x; then dnl## {
57 docbook_styles=$gnash_cv_path_docbook_styles
63 AC_MSG_NOTICE([checking for other programs needed to process the DocBook files])
64 AC_PATH_PROG(FOP, fop.sh, [],
65 [$PATH:/usr/local/fop-0.20.5/:/usr/fop-0.20.5/:/usr/local/fop:/usr/lib/java/fop])
66 if test x"$FOP" = x; then dnl## {
67 AC_PATH_PROG(FOP, fop, [],
68 [$PATH:/usr/local/fop-0.20.5/:/usr/fop-0.20.5/:/usr/local/fop:/usr/lib/java/fop])
71 if test x"$FOP" != x; then dnl## {
72 dirlist="/usr /usr/lib/jre /usr/jre /opt/local/Java/JavaSDK ~/ReQuest/jre $J2REDIR"
75 if test -f $i/bin/java; then dnl## {
76 version=`$i/bin/java -version 2>&1`
77 dnl See if it's Sun Java
78 tmp="`echo $version | grep -c "java version" `"
79 if test $tmp -gt 0; then dnl## {
86 tmp="`echo $version | grep -c "java version" `"
87 if test $tmp -gt 0; then dnl## {
88 AC_MSG_WARN([$i/bin/java not Sun version!])
96 AC_MSG_CHECKING(for Sun java runtime)
97 if test x"$JAVA" = x; then dnl## {
98 AC_MSG_RESULT(not found)
99 AC_MSG_WARN([You need to install Sun Java and the JAI toolkit to run fop])
101 AC_MSG_RESULT([$JAVA])
106 AC_PATH_PROG(PDFXMLTEX, pdfxmltex, [],
107 [$PATH:/usr/bin:/usr/bin/X11:/usr/local/X11/bin])
109 dnl AC_PATH_PROG(DBLATEX, dblatex, [],
110 dnl [$PATH:/usr/bin:/usr/bin/X11:/usr/local/X11/bin])
112 AC_PATH_PROG(XSLTPROC, xsltproc, [],
113 [$PATH:/usr/bin:/usr/bin/X11:/usr/local/X11/bin])
115 AC_PATH_PROG(DB2X_XSLTPROC, db2x_xsltproc, [],
116 [$PATH:/usr/bin:/usr/bin/X11:/usr/local/X11/bin])
118 if test x$DB2X_XSLTPROC = x; then dnl## {
119 AC_PATH_PROG(DB2X_XSLTPROC, db2x_xsltproc.pl, [],
120 [$PATH:/usr/bin:/usr/bin/X11:/usr/local/X11/bin])
123 dnl Find the programs we need to convert docbook into Texi for
124 dnl making info pages. The first catagory are the wrapper
125 dnl utilities included in most docbook2x packages.
126 dnl It turns out there are two sets of wrapper functions, the good
127 dnl ones from the newer DocBook2X tools are written in perl, and
128 dnl actually work correctly. There are other versions of the same
129 dnl tools ,but they are merely a 1 line wrapper for the OpenJade
130 dnl tools. These versions have big problems, namely they don't
131 dnl support the encoding of entities, so we get massive warnings
132 dnl about entities in included files we never heard about.
133 scripts="db2x_docbook2texi docbook2texi docbook2texi.pl"
134 for i in $scripts; do dnl## {
135 AC_PATH_PROG(DB2X_TEXI, $i, [], [$PATH:/usr/bin:/usr/bin/X11:/usr/local/X11/bin])
136 if test x$DB2X_TEXI != x; then
137 type="`file $DB2X_TEXI | grep -ic "perl " 2>&1`"
138 if test $type -gt 0; then
146 dnl These look for the seperate utilities used by the wrapper
147 dnl scripts. If we don't find the wrappers, then we use the lower
148 dnl level utilities directly.
150 scripts="db2x_texixml db2x_texixml.pl"
151 for i in $scripts; do
152 AC_PATH_PROG(DB2X_TEXIXML, $i, [], [$PATH:/usr/bin:/usr/bin/X11:/usr/local/X11/bin])
153 if test x$DB2X_TEXIXML != x; then
158 dnl Find the programs we need to convert docbook into man pages.
159 scripts="db2x_docbook2man docbook2man docbook2man.pl"
160 for i in $scripts; do
161 AC_PATH_PROG(DB2X_MAN, $i, [], [$PATH:/usr/bin:/usr/bin/X11:/usr/local/X11/bin])
162 if test x$DB2X_MAN != x; then
163 type="`file $DB2X_MAN | grep -ic "perl " 2>&1`"
164 if test $type -gt 0; then
172 scripts="db2x_manxml db2x_manxml.pl"
173 for i in $scripts; do
174 AC_PATH_PROG(DB2X_MANXML, $i, [], [$PATH:/usr/bin:/usr/bin/X11:/usr/local/X11/bin])
175 if test x$DB2X_MANXML != x; then
180 AC_PATH_PROG(MAKEINFO, makeinfo, [], [$PATH:/usr/bin:/usr/bin/X11:/usr/local/X11/bin])
182 if test x"$XSLTPROC" = x -o x"$docbook_styles" = x ; then
183 AC_MSG_WARN([You need to install xsltproc and docbook style sheets before HTML output can be generated])
186 if test x"$DB2X_XSLTPROC" = x -o x"$DB2X_TEXIXML" = x -o x"$DB2X_MANXML" = x -o x"$MAKEINFO" = x ; then
187 AC_MSG_WARN([You need to install the docbook2X package before Texi output can be generated])
190 AC_PATH_PROG(DB2X_PDF, docbook2pdf, [], [$PATH:/usr/bin:/usr/bin/X11:/usr/local/X11/bin])
193 if test x"$FOP" != x -a x"$docbook_styles" != x ; then :
194 elif test x"$PDFXMLTEX" != x -a x"$XSLTPROC" != x -a x"$docbook_styles" != x ; then :
196 AC_MSG_WARN([No suitable fop nor pdfxmltex, PDF format files can't be generated - hint: apt-get install xmltex fop])
201 dnl AM_CONDITIONAL(HAVE_JAVA, [test x$JAVA != x])
202 AM_CONDITIONAL(ENABLE_TEXI, [ test x"$DB2X_TEXI" != x -o x"$DB2X_TEXIXML" != x ])
203 AM_CONDITIONAL(ENABLE_PDF, [ test x"$DB2X_PDF" ])
204 AM_CONDITIONAL(ENABLE_HTML, [ test x"$XSLTPROC" != x -a x"$docbook_styles" != x ])
205 AM_CONDITIONAL(ENABLE_FOP, [ test x"$FOP" != x -a x"$docbook_styles" != x ])
206 AM_CONDITIONAL(ENABLE_XMLTEX, [ test x"$PDFXMLTEX" != x -a x"$XSLTPROC" != x -a x"$docbook_styles" != x ])
207 dnl AM_CONDITIONAL(ENABLE_DBLATEX, [ test x"$DBLATEX" != x ])
208 AM_CONDITIONAL(ENABLE_MAN, [ test x"$DB2X_MAN" != x -o x"$DB2X_MANXML" != x ])
211 dnl See which version of the DocBook2x tools we have, because it
212 dnl forces a command line change in the Makefile.
214 dnl db2x_texixml (part of docbook2X 0.8.3)
215 dnl db2x_texixml (part of docbook2X 0.8.5)
216 dnl docbook2texi (part of docbook2X 0.8.8)
217 if test x"${DB2X_TEXIXML}" != x; then dnl## {
218 db2x_version=`${DB2X_TEXIXML} --version | head -1 | sed -e 's/^.*docbook2X //' -e 's/).*$//' 2>&1`
219 DB2X_VERSION="${db2x_version}"
220 AC_SUBST(DB2X_VERSION)
223 dnl AM_CONDITIONAL(NEW_DOCBOOK2X, [test "$db2x_version" = "0.8.5"])
224 AC_SUBST(docbook_styles)
226 AC_SUBST(DB2X_XSLTPROC)
227 AC_SUBST(DB2X_TEXIXML)
235 # indent-tabs-mode: nil