Imported Upstream version 2.6.0
[debian/amanda] / config / amanda / documentation.m4
1 # OVERVIEW
2 #
3 #   Configuration for the docbook-based manpages.
4 #
5 #   We require XSLTPROC, as well as specific versions of Docbook and the
6 #   Docbook DTD.
7
8 AC_DEFUN([AMANDA_SETUP_DOCUMENTATION],
9 [
10     AC_ARG_ENABLE(manpage-build,
11     AS_HELP_STRING([--enable-manpage-build],
12                    [Build the manpages from their XML source (shipped manpages are usually sufficient)]),
13         [ ENABLE_MANPAGE_BUILD=$enableval ],
14         [ ENABLE_MANPAGE_BUILD=no ])
15
16     # and ensure that everything docbook-related is OK if we'll be using it
17     if test "x$ENABLE_MANPAGE_BUILD" = "xyes"; then
18         DOC_BUILD_DATE=`date '+%d-%m-%Y'`
19
20         AC_PROG_XSLTPROC([--nonet])
21         AC_CHECK_DOCBOOK_XSLT([1.72.0])
22         AC_CHECK_DOCBOOK_XSLT_MIN([1.72.0])
23         AC_CHECK_DOCBOOK_DTD([4.1.2])
24         AC_CHECK_DOCBOOK_DTD([4.2])
25
26         if test -z "$XSLTPROC"; then
27             AC_MSG_ERROR([Cannot build manpages: 'xsltproc' was not found.])
28         fi
29
30         # if the 'current' Docbook revision is good enough, use that; otherwise,
31         # if 1.72.0 is available, use that.
32         XSLREL=current
33         if test "x$DOCBOOK_XSLT_CURRENT_VERSION" = "xno"; then
34             if test "x$HAVE_DOCBOOK_XSLT_1_72_0" = "xno"; then
35                 AC_MSG_ERROR([Cannot build manpages: docbook version 1.72.0 or higher required.])
36             else
37                 XSLREL=1.72.0
38             fi
39         fi
40
41         # disable validation if the correct DTDs are not available
42         if test "x$HAVE_DOCBOOK_DTD_4_1_2" = "xno" || test "x$HAVE_DOCBOOK_DTD_4_2" = "xno"; then
43             AMANDA_MSG_WARN([Docbook DTD versions 4.1.2 and 4.2 are required for manpage validation; disabling validation])
44             XSLTPROC_FLAGS="$XSLTPROC_FLAGS --novalid"
45         fi
46     fi
47
48     AM_CONDITIONAL(ENABLE_MANPAGE_BUILD, test "x$ENABLE_MANPAGE_BUILD" = "xyes")
49     AC_SUBST(XSLREL)
50     AC_SUBST(DOC_BUILD_DATE)
51 ])
52
53 # SYNOPSIS
54 #
55 #   AMANDA_SHOW_DOCUMENTATION_SUMMARY
56 #
57 # OVERVIEW
58 #
59 #   Show a summary of the settings from this file.
60 #
61 AC_DEFUN([AMANDA_SHOW_DOCUMENTATION_SUMMARY],
62 [
63     echo "Build documentation:" $ENABLE_MANPAGE_BUILD
64 ])