1 AC_DEFUN([AG_GST_DOCBOOK_CHECK],
3 dnl choose a location to install docbook docs in
4 if test "x$PACKAGE_TARNAME" = "x"
6 AC_MSG_ERROR([Internal error - PACKAGE_TARNAME not set])
8 docdir="\$(datadir)/doc/$PACKAGE_TARNAME-$GST_MAJORMINOR"
10 dnl enable/disable docbook documentation building
11 AC_ARG_ENABLE(docbook,
12 AC_HELP_STRING([--enable-docbook],
13 [use docbook to build documentation [default=no]]),,
18 if test x$enable_docbook = xyes; then
19 dnl check if we actually have everything we need
21 dnl check for docbook tools
22 AC_CHECK_PROG(HAVE_DOCBOOK2PS, docbook2ps, yes, no)
23 AC_CHECK_PROG(HAVE_DOCBOOK2HTML, docbook2html, yes, no)
24 AC_CHECK_PROG(HAVE_JADETEX, jadetex, yes, no)
25 AC_CHECK_PROG(HAVE_PS2PDF, ps2pdf, yes, no)
27 # -V option appeared in 0.6.10
28 docbook2html_min_version=0.6.10
29 if test "x$HAVE_DOCBOOK2HTML" != "xno"; then
30 docbook2html_version=`docbook2html --version`
31 AC_MSG_CHECKING([docbook2html version ($docbook2html_version) >= $docbook2html_min_version])
33 (\$min_version_major, \$min_version_minor, \$min_version_micro ) = "$docbook2html_min_version" =~ /(\d+)\.(\d+)\.(\d+)/;
34 (\$docbook2html_version_major, \$docbook2html_version_minor, \$docbook2html_version_micro ) = "$docbook2html_version" =~ /(\d+)\.(\d+)\.(\d+)/;
35 exit (((\$docbook2html_version_major > \$min_version_major) ||
36 ((\$docbook2html_version_major == \$min_version_major) &&
37 (\$docbook2html_version_minor >= \$min_version_minor)) ||
38 ((\$docbook2html_version_major == \$min_version_major) &&
39 (\$docbook2html_version_minor >= \$min_version_minor) &&
40 (\$docbook2html_version_micro >= \$min_version_micro)))
51 dnl check if we can process docbook stuff
52 AS_DOCBOOK(have_docbook=yes, have_docbook=no)
54 dnl check for extra tools
55 AC_CHECK_PROG(HAVE_DVIPS, dvips, yes, no)
56 AC_CHECK_PROG(HAVE_XMLLINT, xmllint, yes, no)
58 dnl check for image conversion tools
59 AC_CHECK_PROG(HAVE_FIG2DEV, fig2dev, yes, no)
60 if test "x$HAVE_FIG2DEV" = "xno" ; then
61 AC_MSG_WARN([Did not find fig2dev (from xfig), images will not be generated.])
64 dnl The following is a hack: if fig2dev doesn't display an error message
65 dnl for the desired type, we assume it supports it.
67 if test "x$HAVE_FIG2DEV" = "xyes" ; then
68 fig2dev_quiet=`fig2dev -L eps </dev/null 2>&1 >/dev/null`
69 if test "x$fig2dev_quiet" = "x" ; then
74 if test "x$HAVE_FIG2DEV" = "xyes" ; then
75 fig2dev_quiet=`fig2dev -L png </dev/null 2>&1 >/dev/null`
76 if test "x$fig2dev_quiet" = "x" ; then
81 if test "x$HAVE_FIG2DEV" = "xyes" ; then
82 fig2dev_quiet=`fig2dev -L pdf </dev/null 2>&1 >/dev/null`
83 if test "x$fig2dev_quiet" = "x" ; then
88 AC_CHECK_PROG(HAVE_PNGTOPNM, pngtopnm, yes, no)
89 AC_CHECK_PROG(HAVE_PNMTOPS, pnmtops, yes, no)
90 AC_CHECK_PROG(HAVE_EPSTOPDF, epstopdf, yes, no)
92 dnl check if we can generate HTML
93 if test "x$HAVE_DOCBOOK2HTML" = "xyes" && \
94 test "x$enable_docbook" = "xyes" && \
95 test "x$HAVE_XMLLINT" = "xyes" && \
96 test "x$HAVE_FIG2DEV_PNG" = "xyes"; then
98 AC_MSG_NOTICE(Will output HTML documentation)
101 AC_MSG_NOTICE(Will not output HTML documentation)
104 dnl check if we can generate PS
105 if test "x$HAVE_DOCBOOK2PS" = "xyes" && \
106 test "x$enable_docbook" = "xyes" && \
107 test "x$HAVE_XMLLINT" = "xyes" && \
108 test "x$HAVE_JADETEX" = "xyes" && \
109 test "x$HAVE_FIG2DEV_EPS" = "xyes" && \
110 test "x$HAVE_DVIPS" = "xyes" && \
111 test "x$HAVE_PNGTOPNM" = "xyes" && \
112 test "x$HAVE_PNMTOPS" = "xyes"; then
114 AC_MSG_NOTICE(Will output PS documentation)
117 AC_MSG_NOTICE(Will not output PS documentation)
120 dnl check if we can generate PDF - using only ps2pdf
121 if test "x$DOC_PS" = "xyes" && \
122 test "x$enable_docbook" = "xyes" && \
123 test "x$HAVE_XMLLINT" = "xyes" && \
124 test "x$HAVE_PS2PDF" = "xyes"; then
126 AC_MSG_NOTICE(Will output PDF documentation)
129 AC_MSG_NOTICE(Will not output PDF documentation)
132 dnl if we don't have everything, we should disable
133 if test "x$have_docbook" != "xyes"; then
138 dnl if we're going to install documentation, tell us where
139 if test "x$have_docbook" = "xyes"; then
140 AC_MSG_NOTICE(Installing documentation in $docdir)
144 AM_CONDITIONAL(ENABLE_DOCBOOK, test x$enable_docbook = xyes)
145 AM_CONDITIONAL(DOC_HTML, test x$DOC_HTML = xyes)
146 AM_CONDITIONAL(DOC_PDF, test x$DOC_PDF = xyes)
147 AM_CONDITIONAL(DOC_PS, test x$DOC_PS = xyes)