1
AC_DEFUN([GST_DOCBOOK_CHECK],
3
dnl choose a location to install docbook docs in
4
docdir="\$(datadir)/doc/$PACKAGE-$GST_MAJORMINOR"
6
dnl enable/disable docbook documentation building
8
AC_HELP_STRING([--enable-docbook],
9
[use docbook to build documentation [default=no]]),,
14
if test x$enable_docbook = xyes; then
15
dnl check if we actually have everything we need
17
dnl check for docbook tools
18
AC_CHECK_PROG(HAVE_DOCBOOK2PS, docbook2ps, yes, no)
19
AC_CHECK_PROG(HAVE_DOCBOOK2HTML, docbook2html, yes, no)
20
AC_CHECK_PROG(HAVE_JADETEX, jadetex, yes, no)
21
AC_CHECK_PROG(HAVE_PS2PDF, ps2pdf, yes, no)
23
# -V option appeared in 0.6.10
24
docbook2html_min_version=0.6.10
25
if test "x$HAVE_DOCBOOK2HTML" != "xno"; then
26
docbook2html_version=`docbook2html --version`
27
AC_MSG_CHECKING([docbook2html version ($docbook2html_version) >= $docbook2html_min_version])
29
(\$min_version_major, \$min_version_minor, \$min_version_micro ) = "$docbook2html_min_version" =~ /(\d+)\.(\d+)\.(\d+)/;
30
(\$docbook2html_version_major, \$docbook2html_version_minor, \$docbook2html_version_micro ) = "$docbook2html_version" =~ /(\d+)\.(\d+)\.(\d+)/;
31
exit (((\$docbook2html_version_major > \$min_version_major) ||
32
((\$docbook2html_version_major == \$min_version_major) &&
33
(\$docbook2html_version_minor >= \$min_version_minor)) ||
34
((\$docbook2html_version_major == \$min_version_major) &&
35
(\$docbook2html_version_minor >= \$min_version_minor) &&
36
(\$docbook2html_version_micro >= \$min_version_micro)))
47
dnl check if we can process docbook stuff
48
AS_DOCBOOK(have_docbook=yes, have_docbook=no)
50
dnl check for extra tools
51
AC_CHECK_PROG(HAVE_DVIPS, dvips, yes, no)
52
AC_CHECK_PROG(HAVE_XMLLINT, xmllint, yes, no)
54
dnl check for image conversion tools
55
AC_CHECK_PROG(HAVE_FIG2DEV, fig2dev, yes, no)
56
if test "x$HAVE_FIG2DEV" = "xno" ; then
57
AC_MSG_WARN([Did not find fig2dev (from xfig), images will not be generated.])
60
dnl The following is a hack: if fig2dev doesn't display an error message
61
dnl for the desired type, we assume it supports it.
63
if test "x$HAVE_FIG2DEV" = "xyes" ; then
64
fig2dev_quiet=`fig2dev -L eps </dev/null 2>&1 >/dev/null`
65
if test "x$fig2dev_quiet" = "x" ; then
70
if test "x$HAVE_FIG2DEV" = "xyes" ; then
71
fig2dev_quiet=`fig2dev -L png </dev/null 2>&1 >/dev/null`
72
if test "x$fig2dev_quiet" = "x" ; then
77
if test "x$HAVE_FIG2DEV" = "xyes" ; then
78
fig2dev_quiet=`fig2dev -L pdf </dev/null 2>&1 >/dev/null`
79
if test "x$fig2dev_quiet" = "x" ; then
84
AC_CHECK_PROG(HAVE_PNGTOPNM, pngtopnm, yes, no)
85
AC_CHECK_PROG(HAVE_PNMTOPS, pnmtops, yes, no)
86
AC_CHECK_PROG(HAVE_EPSTOPDF, epstopdf, yes, no)
88
dnl check if we can generate HTML
89
if test "x$HAVE_DOCBOOK2HTML" = "xyes" && \
90
test "x$enable_docbook" = "xyes" && \
91
test "x$HAVE_XMLLINT" = "xyes" && \
92
test "x$HAVE_FIG2DEV_PNG" = "xyes"; then
94
AC_MSG_NOTICE(Will output HTML documentation)
97
AC_MSG_NOTICE(Will not output HTML documentation)
100
dnl check if we can generate PS
101
if test "x$HAVE_DOCBOOK2PS" = "xyes" && \
102
test "x$enable_docbook" = "xyes" && \
103
test "x$HAVE_XMLLINT" = "xyes" && \
104
test "x$HAVE_JADETEX" = "xyes" && \
105
test "x$HAVE_FIG2DEV_EPS" = "xyes" && \
106
test "x$HAVE_DVIPS" = "xyes" && \
107
test "x$HAVE_PNGTOPNM" = "xyes" && \
108
test "x$HAVE_PNMTOPS" = "xyes"; then
110
AC_MSG_NOTICE(Will output PS documentation)
113
AC_MSG_NOTICE(Will not output PS documentation)
116
dnl check if we can generate PDF - using only ps2pdf
117
if test "x$DOC_PS" = "xyes" && \
118
test "x$enable_docbook" = "xyes" && \
119
test "x$HAVE_XMLLINT" = "xyes" && \
120
test "x$HAVE_PS2PDF" = "xyes"; then
122
AC_MSG_NOTICE(Will output PDF documentation)
125
AC_MSG_NOTICE(Will not output PDF documentation)
128
dnl if we don't have everything, we should disable
129
if test "x$have_docbook" != "xyes"; then
134
dnl if we're going to install documentation, tell us where
135
if test "x$have_docbook" = "xyes"; then
136
AC_MSG_NOTICE(Installing documentation in $docdir)
140
AM_CONDITIONAL(ENABLE_DOCBOOK, test x$enable_docbook = xyes)
141
AM_CONDITIONAL(DOC_HTML, test x$DOC_HTML = xyes)
142
AM_CONDITIONAL(DOC_PDF, test x$DOC_PDF = xyes)
143
AM_CONDITIONAL(DOC_PS, test x$DOC_PS = xyes)