summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2010-06-28 09:56:47 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2010-06-30 08:46:14 +1000
commit03a5207d7479eeeefb209db8444c2bbd0701b519 (patch)
tree93f7a4919ec9bb16376f82ce9e865d145be1d8c2 /configure.ac
parentffd06a4b7d208f37ddcd55857b5b4e256a441808 (diff)
Double-use the README as man-page.
If asciidoc and xmlto is available at install time, convert the README to a man page. The autotool hack for this is a bit complicated, but does the job. It's essentially copied from libXi that uses asciidoc + xmlto for man page generation as well. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac19
1 files changed, 19 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 158b72af..6f51fc05 100644
--- a/configure.ac
+++ b/configure.ac
@@ -109,6 +109,25 @@ fi
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
[AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
+# Generate man page if asciidoc and xmlto are available.
+AC_ARG_VAR([XMLTO], [Path to xmlto command])
+AC_PATH_PROG([XMLTO], [xmlto])
+AC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
+AC_PATH_PROG([ASCIIDOC], [asciidoc])
+
+AM_CONDITIONAL([HAVE_DOCTOOLS], [test "x$XMLTO" != "x" && test "x$ASCIIDOC" != "x"])
+if test "x$XMLTO" = "x" || test "x$ASCIIDOC" = "x"; then
+ AC_MSG_WARN([xmlto or asciidoc not found - cannot create man pages without it])
+else
+ if test x$MISC_MAN_SUFFIX = x ; then
+ case $host_os in
+ solaris*) MISC_MAN_SUFFIX=5 ;;
+ *) MISC_MAN_SUFFIX=7 ;;
+ esac
+ fi
+ AC_SUBST(MISC_MAN_SUFFIX)
+fi
+
AC_CONFIG_FILES([
Makefile
check.sh