2 dnl Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
4 dnl This program is free software; you can redistribute it and/or modify
5 dnl it under the terms of the GNU General Public License as published by
6 dnl the Free Software Foundation; either version 3 of the License, or
7 dnl (at your option) any later version.
9 dnl This program is distributed in the hope that it will be useful,
10 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
11 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 dnl GNU General Public License for more details.
13 dnl You should have received a copy of the GNU General Public License
14 dnl along with this program; if not, write to the Free Software
15 dnl Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17 AC_DEFUN([GNASH_DOCBOOK], [
19 AC_ARG_ENABLE(docbook, AC_HELP_STRING([--enable-docbook], [Enable support for building documentation with "make html" and "make pdf"]),
20 [case "${enableval}" in
23 *) AC_MSG_ERROR([bad value ${enableval} for enable-docbook option]) ;;
27 if test x"$docbook" = x"yes"; then
28 dnl install-info is used to update entries in the dirs file, used by
29 dnl info to find all of it files.
30 AC_PATH_PROG(INSTALL_INFO, install-info, $PATH:/usr/sbin)
31 AC_SUBST(INSTALL_INFO)
32 AM_CONDITIONAL(ENABLE_INFO, test x${INSTALL_INFO} != x)
35 AC_ARG_WITH(docbook_styles, AC_HELP_STRING([--with-docbook-styles], [directory where Docbook stylesheets are]), with_docbook_styles=${withval})
36 if test x"${with_docbook_styles}" != x ; then
37 if test -f ${with_docbook_styles}/html/docbook.xsl ; then
38 docbook_styles="`(cd ${with_docbook_styles}; pwd)`"
40 AC_MSG_ERROR([${with_docbook_styles}/html directory doesn't contain docbook.xsl])
43 AC_CACHE_CHECK([for docbook styles path],[gnash_cv_path_docbook_styles],[
44 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"
46 if test -f $i/html/docbook.xsl; then
47 gnash_cv_path_docbook_styles="`(cd $i; pwd)`"
52 if test x$gnash_cv_path_docbook_styles != x; then
53 docbook_styles=$gnash_cv_path_docbook_styles
58 AC_MSG_NOTICE([checking for other programs needed to process the DocBook files])
59 AC_PATH_PROG(FOP, fop.sh, [],
60 [$PATH:/usr/local/fop-0.20.5/:/usr/fop-0.20.5/:/usr/local/fop:/usr/lib/java/fop])
61 if test x"$FOP" = x; then
62 AC_PATH_PROG(FOP, fop, [],
63 [$PATH:/usr/local/fop-0.20.5/:/usr/fop-0.20.5/:/usr/local/fop:/usr/lib/java/fop])
65 if test x"$FOP" != x; then
66 dirlist="/usr /usr/lib/jre /usr/jre /opt/local/Java/JavaSDK ~/ReQuest/jre $J2REDIR"
69 if test -f $i/bin/java; then
70 version=`$i/bin/java -version 2>&1`
71 dnl See if it's Sun Java
72 tmp="`echo $version | grep -c "java version" `"
73 if test $tmp -gt 0; then
79 tmp="`echo $version | grep -c "java version" `"
80 if test $tmp -gt 0; then
81 AC_MSG_WARN([$i/bin/java not Sun version!])
87 AC_MSG_CHECKING(for Sun java runtime)
88 if test x"$JAVA" = x; then
89 AC_MSG_RESULT(not found)
90 AC_MSG_WARN([You need to install Sun Java and the JAI toolkit to run fop])
92 AC_MSG_RESULT([$JAVA])
96 AC_PATH_PROG(PDFXMLTEX, pdfxmltex, [],
97 [$PATH:/usr/bin:/usr/bin/X11:/usr/local/X11/bin])
99 dnl AC_PATH_PROG(DBLATEX, dblatex, [],
100 dnl [$PATH:/usr/bin:/usr/bin/X11:/usr/local/X11/bin])
102 AC_PATH_PROG(XSLTPROC, xsltproc, [],
103 [$PATH:/usr/bin:/usr/bin/X11:/usr/local/X11/bin])
105 AC_PATH_PROG(DB2X_XSLTPROC, db2x_xsltproc, [],
106 [$PATH:/usr/bin:/usr/bin/X11:/usr/local/X11/bin])
108 if test x$DB2X_XSLTPROC = x; then
109 AC_PATH_PROG(DB2X_XSLTPROC, db2x_xsltproc.pl, [],
110 [$PATH:/usr/bin:/usr/bin/X11:/usr/local/X11/bin])
113 dnl Find the programs we need to convert docbook into Texi for
114 dnl making info pages. The first catagory are the wrapper
115 dnl utilities included in most docbook2x packages.
116 dnl It turns out there are two sets of wrapper functions, the good
117 dnl ones from the newer DocBook2X tools are written in perl, and
118 dnl actually work correctly. There are other versions of the same
119 dnl tools ,but they are merely a 1 line wrapper for the OpenJade
120 dnl tools. These versions have big problems, namely they don't
121 dnl support the encoding of entities, so we get massive warnings
122 dnl about entities in included files we never heard about.
123 scripts="db2x_docbook2texi docbook2texi docbook2texi.pl"
124 for i in $scripts; do
125 AC_PATH_PROG(DB2X_TEXI, $i, [], [$PATH:/usr/bin:/usr/bin/X11:/usr/local/X11/bin])
126 if test x$DB2X_TEXI != x; then
127 type="`file $DB2X_TEXI | grep -ic " perl " 2>&1`"
128 if test $type -gt 0; then
136 dnl These look for the seperate utilities used by the wrapper
137 dnl scripts. If we don't find the wrappers, then we use the lower
138 dnl level utilities directly.
140 scripts="db2x_texixml db2x_texixml.pl"
141 for i in $scripts; do
142 AC_PATH_PROG(DB2X_TEXIXML, $i, [], [$PATH:/usr/bin:/usr/bin/X11:/usr/local/X11/bin])
143 if test x$DB2X_TEXIXML != x; then
148 dnl Find the programs we need to convert docbook into man pages.
149 scripts="db2x_docbook2man docbook2man docbook2man.pl"
150 for i in $scripts; do
151 AC_PATH_PROG(DB2X_MAN, $i, [], [$PATH:/usr/bin:/usr/bin/X11:/usr/local/X11/bin])
152 if test x$DB2X_MAN != x; then
153 type="`file $DB2X_MAN | grep -ic " perl " 2>&1`"
154 if test $type -gt 0; then
162 scripts="db2x_manxml db2x_manxml.pl"
163 for i in $scripts; do
164 AC_PATH_PROG(DB2X_MANXML, $i, [], [$PATH:/usr/bin:/usr/bin/X11:/usr/local/X11/bin])
165 if test x$DB2X_MANXML != x; then
170 AC_PATH_PROG(MAKEINFO, makeinfo, [], [$PATH:/usr/bin:/usr/bin/X11:/usr/local/X11/bin])
172 if test x"$XSLTPROC" = x -o x"$docbook_styles" = x ; then
173 AC_MSG_WARN([You need to install xsltproc and docbook style sheets before HTML output can be generated])
175 if test x"$DB2X_XSLTPROC" = x -o x"$DB2X_TEXIXML" = x -o x"$DB2X_MANXML" = x -o x"$MAKEINFO" = x ; then
176 AC_MSG_WARN([You need to install the docbook2X package before Texi output can be generated])
179 AC_PATH_PROG(DB2X_PDF, docbook2pdf, [], [$PATH:/usr/bin:/usr/bin/X11:/usr/local/X11/bin])
182 if test x"$FOP" != x -a x"$docbook_styles" != x ; then :
183 elif test x"$PDFXMLTEX" != x -a x"$XSLTPROC" != x -a x"$docbook_styles" != x ; then :
185 AC_MSG_WARN([No suitable fop nor pdfxmltex, PDF format files can't be generated - hint: apt-get install xmltex fop])
189 dnl AM_CONDITIONAL(HAVE_JAVA, [test x$JAVA != x])
190 AM_CONDITIONAL(ENABLE_TEXI, [ test x"$DB2X_TEXI" != x -o x"$DB2X_TEXIXML" != x ])
191 AM_CONDITIONAL(ENABLE_PDF, [ test x"$DB2X_PDF" ])
192 AM_CONDITIONAL(ENABLE_HTML, [ test x"$XSLTPROC" != x -a x"$docbook_styles" != x ])
193 AM_CONDITIONAL(ENABLE_FOP, [ test x"$FOP" != x -a x"$docbook_styles" != x ])
194 AM_CONDITIONAL(ENABLE_XMLTEX, [ test x"$PDFXMLTEX" != x -a x"$XSLTPROC" != x -a x"$docbook_styles" != x ])
195 dnl AM_CONDITIONAL(ENABLE_DBLATEX, [ test x"$DBLATEX" != x ])
196 AM_CONDITIONAL(ENABLE_MAN, [ test x"$DB2X_MAN" != x -o x"$DB2X_MANXML" != x ])
199 dnl See which version of the DocBook2x tools we have, because it
200 dnl forces a command line change in the Makefile.
202 dnl db2x_texixml (part of docbook2X 0.8.3)
203 dnl db2x_texixml (part of docbook2X 0.8.5)
204 dnl docbook2texi (part of docbook2X 0.8.8)
205 if test x"${DB2X_TEXIXML}" != x; then
206 db2x_version=`${DB2X_TEXIXML} --version | head -1 | sed -e 's/^.*docbook2X //' -e 's/).*$//' 2>&1`
207 DB2X_VERSION="${db2x_version}"
208 AC_SUBST(DB2X_VERSION)
211 dnl AM_CONDITIONAL(NEW_DOCBOOK2X, [test "$db2x_version" = "0.8.5"])
212 AC_SUBST(docbook_styles)
214 AC_SUBST(DB2X_XSLTPROC)
215 AC_SUBST(DB2X_TEXIXML)
223 # indent-tabs-mode: nil