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_API_VERSION"
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_XSLTPROC, xsltproc, yes, no)
24 AC_CHECK_PROG(HAVE_JADETEX, jadetex, yes, no)
25 AC_CHECK_PROG(HAVE_PS2PDF, ps2pdf, yes, no)
27 dnl check if we can process docbook stuff
28 AS_DOCBOOK(have_docbook=yes, have_docbook=no)
30 dnl check for extra tools
31 AC_CHECK_PROG(HAVE_DVIPS, dvips, yes, no)
32 AC_CHECK_PROG(HAVE_XMLLINT, xmllint, yes, no)
34 AC_CHECK_PROG(HAVE_PNGTOPNM, pngtopnm, yes, no)
35 AC_CHECK_PROG(HAVE_PNMTOPS, pnmtops, yes, no)
36 AC_CHECK_PROG(HAVE_EPSTOPDF, epstopdf, yes, no)
38 dnl check if we can generate HTML
39 if test "x$HAVE_XSLTPROC" = "xyes" && \
40 test "x$enable_docbook" = "xyes" && \
41 test "x$HAVE_XMLLINT" = "xyes"; then
43 AC_MSG_NOTICE(Will output HTML documentation)
46 AC_MSG_NOTICE(Will not output HTML documentation)
49 dnl check if we can generate PS
50 if test "x$HAVE_DOCBOOK2PS" = "xyes" && \
51 test "x$enable_docbook" = "xyes" && \
52 test "x$HAVE_XMLLINT" = "xyes" && \
53 test "x$HAVE_JADETEX" = "xyes" && \
54 test "x$HAVE_DVIPS" = "xyes" && \
55 test "x$HAVE_PNGTOPNM" = "xyes" && \
56 test "x$HAVE_PNMTOPS" = "xyes"; then
58 AC_MSG_NOTICE(Will output PS documentation)
61 AC_MSG_NOTICE(Will not output PS documentation)
64 dnl check if we can generate PDF - using only ps2pdf
65 if test "x$DOC_PS" = "xyes" && \
66 test "x$enable_docbook" = "xyes" && \
67 test "x$HAVE_XMLLINT" = "xyes" && \
68 test "x$HAVE_PS2PDF" = "xyes"; then
70 AC_MSG_NOTICE(Will output PDF documentation)
73 AC_MSG_NOTICE(Will not output PDF documentation)
76 dnl if we don't have everything, we should disable
77 if test "x$have_docbook" != "xyes"; then
82 dnl if we're going to install documentation, tell us where
83 if test "x$have_docbook" = "xyes"; then
84 AC_MSG_NOTICE(Installing documentation in $docdir)
88 AM_CONDITIONAL(ENABLE_DOCBOOK, test x$enable_docbook = xyes)
89 AM_CONDITIONAL(DOC_HTML, test x$DOC_HTML = xyes)
90 AM_CONDITIONAL(DOC_PDF, test x$DOC_PDF = xyes)
91 AM_CONDITIONAL(DOC_PS, test x$DOC_PS = xyes)