build: Add --disable-man
authorColin Walters <walters@verbum.org>
Thu, 28 Jan 2016 20:22:10 +0000 (15:22 -0500)
committerColin Walters <walters@verbum.org>
Thu, 28 Jan 2016 20:22:10 +0000 (15:22 -0500)
Gnome Continuous doesn't have docbook, so copy what we do for glib.

Makefile-man.am
configure.ac

index d2f31ca07ff9c33f2c7c6dddbaf825bfe2e43605..299e317784ddc2e217046821842940a4377fff47 100644 (file)
@@ -26,7 +26,7 @@ man5_MANS = $(addprefix man/,$(man5_files))
 
 EXTRA_DIST += $(man1_MANS) $(man5_MANS)
 
-if ENABLE_XSLTPROC
+if ENABLE_MAN
 
 XSLT_STYLESHEET = http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl
 
@@ -51,4 +51,4 @@ CLEANFILES += \
        $(man5_MANS) \
        $(NULL)
 
-endif # ENABLE_GTK_DOC
+endif
index 140b6c218ca05b89a499e422198bbe12468f6a40..c36134b92a899a4349358ddc4b79cb43390959c7 100644 (file)
@@ -126,8 +126,22 @@ enable_gtk_doc=no
 AM_CONDITIONAL([ENABLE_GTK_DOC], false)
 ])
 
-AC_PATH_PROG([XSLTPROC], [xsltproc])
-AM_CONDITIONAL([ENABLE_XSLTPROC], test -n "${XSLTPROC}")
+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)
 
 AC_ARG_WITH(libarchive,
            AS_HELP_STRING([--without-libarchive], [Do not use libarchive]),
@@ -248,7 +262,7 @@ echo "
     SELinux:                                      $with_selinux
     libarchive (parse tar files directly):        $with_libarchive
     static deltas:                                $enable_static_deltas
-    man pages (xsltproc):                         $XSLTPROC
+    man pages (xsltproc):                         $enable_man
     api docs (gtk-doc):                           $enable_gtk_doc
     gjs-based tests:                              $have_gjs
     dracut:                                       $with_dracut