[librsvg/kleisauke/librsvg-optional-man-doc] (#859): Make rst2man and gi-docgen optional




commit 479df58acb5e0774b04eca7b6f6c9bb32bce98d2
Author: Kleis Auke Wolthuizen <github kleisauke nl>
Date:   Thu Mar 24 18:40:37 2022 +0100

    (#859): Make rst2man and gi-docgen optional
    
    Fixes #859.
    
    Part-of: <https://gitlab.gnome.org/GNOME/librsvg/-/merge_requests/687>

 Makefile.am  | 15 ++++++++++++++-
 configure.ac |  6 ++++--
 2 files changed, 18 insertions(+), 3 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index a2ec6f42e..83e73c385 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,4 +1,8 @@
-SUBDIRS = . gdk-pixbuf-loader tests doc win32
+if HAVE_GI_DOCGEN
+RSVG_DOC = doc
+endif
+
+SUBDIRS = . gdk-pixbuf-loader tests $(RSVG_DOC) win32
 
 NULL =
 
@@ -229,11 +233,20 @@ rsvg-convert$(EXEEXT): $(RSVG_CONVERT_BIN)
        cd $(LIBRSVG_BUILD_DIR) && mv $(RSVG_CONVERT_BIN) rsvg-convert$(EXEEXT)
 
 rsvg-convert.1: rsvg-convert.rst
+if HAVE_RST2MAN
        $(RST2MAN) $(top_srcdir)/rsvg-convert.rst rsvg-convert.1
+else
+       @echo "========================================"
+       @echo "You need rst2man installed to make dist"
+       @echo "========================================"
+       @false
+endif
 
+if HAVE_RST2MAN
 man1_MANS = rsvg-convert.1
 
 CLEANFILES += rsvg-convert.1
+endif
 
 dist_doc_DATA =                                \
        COMPILING.md                    \
diff --git a/configure.ac b/configure.ac
index a4e356a94..a88b55d36 100644
--- a/configure.ac
+++ b/configure.ac
@@ -117,15 +117,17 @@ dnl Man page generator
 
 AC_CHECK_PROGS(RST2MAN, [rst2man rst2man.py], [no])
 AS_IF(test x$RST2MAN = xno,
-    AC_MSG_ERROR([rst2man is required.  Please install python3-docutils.])
+    AC_MSG_WARN([rst2man not found - not building man pages])
 )
+AM_CONDITIONAL(HAVE_RST2MAN, [test "x$RST2MAN" != "xno"])
 
 dnl Gi-docgen
 
 AC_CHECK_TOOL(GI_DOCGEN, [gi-docgen], [no])
 AS_IF(test x$GI_DOCGEN = xno,
-    AC_MSG_ERROR([gi-docgen is required.  Please install it.])
+    AC_MSG_WARN([gi-docgen not found - not building docs])
 )
+AM_CONDITIONAL(HAVE_GI_DOCGEN, [test "x$GI_DOCGEN" != "xno"])
 
 dnl ===========================================================================
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]