File: ax_check_docbook.m4

package info (click to toggle)
sysbench 1.0.20%2Bds-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,840 kB
  • sloc: ansic: 11,830; sh: 1,752; xml: 736; makefile: 195
file content (65 lines) | stat: -rw-r--r-- 1,723 bytes parent folder | download | duplicates (3)
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
dnl ---------------------------------------------------------------------------
dnl Macro: AX_CHECK_DOCBOOK
dnl Check for availability of various DocBook utilities and perform necessary
dnl substitutions
dnl ---------------------------------------------------------------------------

AC_DEFUN([AX_CHECK_DOCBOOK], [
# It's just rude to go over the net to build
XSLTPROC_FLAGS=--nonet
DOCBOOK_ROOT=

for i in /etc/xml/catalog /usr/local/etc/xml/catalog /opt/local/etc/xml/catalog ;
do
	if test -f $i; then
  		XML_CATALOG="$i"
	fi
done

if test -z "$XML_CATALOG" ; then
	for i in /usr/share/sgml/docbook/stylesheet/xsl/nwalsh /usr/share/sgml/docbook/xsl-stylesheets/ /opt/local/share/xsl/docbook-xsl/xhtml/ ;
	do
		if test -d "$i"; then
			DOCBOOK_ROOT=$i
		fi
	done

	# Last resort - try net
	if test -z "$DOCBOOK_ROOT"; then
		XSLTPROC_FLAGS=
	fi
else
	CAT_ENTRY_START='<!--'
	CAT_ENTRY_END='-->'
fi

AC_CHECK_PROG(XSLTPROC,xsltproc,xsltproc,)
XSLTPROC_WORKS=no
if test -n "$XSLTPROC"; then
	AC_MSG_CHECKING([whether xsltproc works])

	if test -n "$XML_CATALOG"; then
		DB_FILE="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl"
	else
		DB_FILE="$DOCBOOK_ROOT/docbook.xsl"
	fi
	
	$XSLTPROC $XSLTPROC_FLAGS $DB_FILE >/dev/null 2>&1 << END
<?xml version="1.0" encoding='ISO-8859-1'?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
<book id="test">
</book>
END
	if test "$?" = 0; then
		XSLTPROC_WORKS=yes
	fi
	AC_MSG_RESULT($XSLTPROC_WORKS)
fi
AM_CONDITIONAL(have_xsltproc, test "$XSLTPROC_WORKS" = "yes")

AC_SUBST(XML_CATALOG)
AC_SUBST(XSLTPROC_FLAGS)
AC_SUBST(DOCBOOK_ROOT)
AC_SUBST(CAT_ENTRY_START)
AC_SUBST(CAT_ENTRY_END)
])