-
Notifications
You must be signed in to change notification settings - Fork 3
/
docbook.m4
72 lines (72 loc) · 2.75 KB
/
docbook.m4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
dnl Copyright 2012-2013 Mo McRoberts.
dnl
dnl Licensed under the Apache License, Version 2.0 (the "License");
dnl you may not use this file except in compliance with the License.
dnl You may obtain a copy of the License at
dnl
dnl http://www.apache.org/licenses/LICENSE-2.0
dnl
dnl Unless required by applicable law or agreed to in writing, software
dnl distributed under the License is distributed on an "AS IS" BASIS,
dnl WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
dnl See the License for the specific language governing permissions and
dnl limitations under the License.
dnl
m4_pattern_forbid([^BT_])dnl
m4_pattern_forbid([^_BT_])dnl
AC_DEFUN([BT_BUILD_DOCS],[
AC_ARG_ENABLE([docs],[AS_HELP_STRING([--disable-docs],[disable re-building documentation (default=auto)])],[build_docs=$enableval],[build_docs=auto])
XML2MAN=true
XML2HTML=true
XSLTFILES=''
if test x"$build_docs" = x"yes" || test x"$build_docs" = x"auto" ; then
AC_CHECK_PROGS([XSLTPROC],[xsltproc],[false])
if test x"$XSLTPROC" = x"false" ; then
if test x"$build_docs" = x"yes" ; then
AC_MSG_ERROR([re-building documentation was requested, but the xsltproc utility cannot be found])
fi
build_docs=no
else
build_docs=yes
XML2MAN='${XSLTPROC} -nonet \
-param man.charmap.use.subset 0 \
-param make.year.ranges 1 \
-param make.single.year.ranges 1 \
-param man.authors.section.enabled 0 \
-param man.copyright.section.enabled 0 \
http://docbook.sourceforge.net/release/xsl-ns/current/manpages/docbook.xsl'
if test x"$use_docbook_html5" = x"yes" ; then
if test -d "$srcdir/docbook-html5" ; then
XSLTFILES='$(top_srcdir)/docbook-html5/docbook-html5.xsl \
$(top_srcdir)/docbook-html5/doc.xsl \
$(top_srcdir)/docbook-html5/block.xsl \
$(top_srcdir)/docbook-html5/inline.xsl \
$(top_srcdir)/docbook-html5/toc.xsl'
XML2HTML="\${XSLTPROC} --nonet --xinclude \$(XML2HTMLFLAGS) -o \$""@ \${top_srcdir}/docbook-html5/docbook-html5.xsl"
else
XML2HTML="\${XSLTPROC} --xinclude \$(XML2HTMLFLAGS) -o \$""@ http://bbcarchdev.github.io/docbook-html5/docbook-html5.xsl"
fi
else
XML2HTML='${XSLTPROC} -nonet \
-param docbook.css.link 0 \
-param generate.css.header 1 \
-param funcsynopsis.style ansi \
http://docbook.sourceforge.net/release/xsl-ns/current/xhtml5/docbook.xsl'
fi
fi
else
build_docs=no
fi
if test x"$dbh5htdocdir" = x"" ; then
dbh5htdocdir='${docdir}'
fi
if test x"$use_docbook_html5" = x"yes" ; then
test x"$build_docs" = x"yes" || install_docbook_html5=no
fi
AM_CONDITIONAL([INSTALL_DOCBOOK_HTML5],[test x"$install_docbook_html5" = x"yes"])
AC_MSG_CHECKING([whether to re-build documentation if needed])
AC_MSG_RESULT([$build_docs])
AC_SUBST([XML2MAN])
AC_SUBST([XML2HTML])
AC_SUBST([dbh5htdocdir])
])dnl