summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--server/configure.ac8
-rw-r--r--server/external/docbook.m435
2 files changed, 40 insertions, 3 deletions
diff --git a/server/configure.ac b/server/configure.ac
index 1abaa15c..9cd30e20 100644
--- a/server/configure.ac
+++ b/server/configure.ac
@@ -57,6 +57,7 @@ m4_include([external/ldap.m4])
m4_include([external/libpcre.m4])
m4_include([external/krb5.m4])
m4_include([external/libcares.m4])
+m4_include([external/docbook.m4])
m4_include([util/signal.m4])
PKG_CHECK_MODULES([DBUS],[dbus-1])
@@ -72,9 +73,10 @@ fi
PKG_CHECK_MODULES([NSS],[nss])
if test x$HAVE_MANPAGES != x; then
- AC_CHECK_FILE($SGML_CATALOG_FILES, [], [AC_MSG_ERROR([could not find XML catalog])])
- AC_PATH_PROG([XSLTPROC], [xsltproc])
- AC_PATH_PROG([XMLLINT], [xmllint])
+ CHECK_XML_TOOLS
+ CHECK_STYLESHEET([$SGML_CATALOG_FILES],
+ [http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl],
+ [Docbook XSL templates])
fi
AC_CHECK_HEADERS([sys/inotify.h])
diff --git a/server/external/docbook.m4 b/server/external/docbook.m4
new file mode 100644
index 00000000..cae89feb
--- /dev/null
+++ b/server/external/docbook.m4
@@ -0,0 +1,35 @@
+dnl Checks for tools needed to generate manual pages
+AC_DEFUN([CHECK_XML_TOOLS],
+[
+ AC_PATH_PROG([XSLTPROC], [xsltproc])
+ if test ! -x "$XSLTPROC"; then
+ AC_MSG_ERROR([Could not find xsltproc])
+ fi
+
+ AC_PATH_PROG([XMLLINT], [xmllint])
+ if test ! -x "$XMLLINT"; then
+ AC_MSG_ERROR([Could not find xmllint])
+ fi
+
+ AC_PATH_PROG([XMLCATALOG], [xmlcatalog])
+ if test ! -x "$XMLCATALOG"; then
+ AC_MSG_ERROR([Could not find xmlcatalog])
+ fi
+])
+
+dnl Usage:
+dnl CHECK_STYLESHEET_URI(FILE, URI, [FRIENDLY-NAME])
+dnl Checks if the XML catalog given by FILE exists and
+dnl if a particular URI appears in the XML catalog
+AC_DEFUN([CHECK_STYLESHEET],
+[
+ AC_CHECK_FILE($1, [], [AC_MSG_ERROR([could not find XML catalog])])
+
+ AC_MSG_CHECKING([for ifelse([$3],,[$2],[$3]) in XML catalog])
+ if AC_RUN_LOG([$XMLCATALOG --noout "$1" "$2" >&2]); then
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_ERROR([could not find ifelse([$3],,[$2],[$3]) in XML catalog])
+ fi
+])
+