Add --disable-man configure option
authorColin Walters <walters@verbum.org>
Wed, 5 Sep 2012 19:39:28 +0000 (15:39 -0400)
committerDavid Zeuthen <zeuthen@gmail.com>
Wed, 5 Sep 2012 20:04:58 +0000 (16:04 -0400)
This matches what is available in glib.  Allowing documentation
to be disabled is good for 3 reasons:

1) Embedded system developers don't want it - while it's not too
   hard for them to just rm -rf /usr/share/man, it makes sense
   to just skip building it entirely.
2) Documentation is the source of build dependency loops; having
   a method to disable it allows those loops to be cut manually
3) My gnome-ostree build system doesn't include Docbook because
   the schemas are only distributed as Zip files, and the build
   system only accepts git repositories.

Signed-off-by: David Zeuthen <zeuthen@gmail.com>
configure.ac
doc/man/Makefile.am

index eb30ad1..15f2a2f 100644 (file)
@@ -97,6 +97,22 @@ fi
 
 GTK_DOC_CHECK([1.3])
 
+AC_ARG_ENABLE(man,
+              [AS_HELP_STRING([--enable-man],
+                              [generate man pages [default=auto]])],,
+              enable_man=maybe)
+AS_IF([test "$enable_man" != no], [
+  AC_PATH_PROG([XSLTPROC], [xsltproc])
+  AS_IF([test -z "$XSLTPROC"], [
+    AS_IF([test "$enable_man" = yes], [
+      AC_MSG_ERROR([xsltproc is required for --enable-man])
+    ])
+    enable_man=no
+  ])
+  enable_man=yes
+])
+AM_CONDITIONAL(ENABLE_MAN, test "$enable_man" != no)
+
 GOBJECT_INTROSPECTION_CHECK([0.6.2])
 
 # Libraries
@@ -220,4 +236,5 @@ echo "
 
         Maintainer mode:            ${USE_MAINTAINER_MODE}
         Building api docs:          ${enable_gtk_doc}
+        Building man pages:         ${enable_man}
 "
index 5e4946d..421b7fc 100644 (file)
@@ -1,11 +1,15 @@
 
 NULL =
 
-man_MANS =                             \
+man_MANS =
+
+if ENABLE_MAN
+man_MANS +=                            \
        udisksctl.1                     \
        udisksd.8                       \
        udisks.8                        \
        $(NULL)
+endif
 
 udisksctl.1 : udisksctl.xml
        $(XSLTPROC) -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<