[librsvg: 1/2] build: Add --enable-gtk-doc flag




commit f20d11b768d89d1a50c2f620dca3c0442b4d7331
Author: Matt Turner <mattst88 gmail com>
Date:   Tue Apr 26 15:01:55 2022 -0700

    build: Add --enable-gtk-doc flag
    
    gtk-doc documentation relies on introspection, and introspection doesn't
    cross compile well, so it's nice to be able to disable documentation.
    
    Part-of: <https://gitlab.gnome.org/GNOME/librsvg/-/merge_requests/692>

 Makefile.am  |  2 +-
 configure.ac | 19 ++++++++++++++-----
 2 files changed, 15 insertions(+), 6 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 83e73c385..1e1ce8564 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,4 +1,4 @@
-if HAVE_GI_DOCGEN
+if ENABLE_GTK_DOC
 RSVG_DOC = doc
 endif
 
diff --git a/configure.ac b/configure.ac
index 9abc587ec..6cced25c0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -123,11 +123,19 @@ 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_WARN([gi-docgen not found - not building docs])
-)
-AM_CONDITIONAL(HAVE_GI_DOCGEN, [test "x$GI_DOCGEN" != "xno"])
+AC_ARG_ENABLE([gtk-doc],
+              [AS_HELP_STRING([--disable-gtk-doc],[Disable building documentation (requires 
introspection)])],
+              [enable_gtk_doc=$enableval],[enable_gtk_doc=auto])
+
+AS_IF([test "x$enable_gtk_doc" != xno],
+      [AC_CHECK_TOOL(GI_DOCGEN, [gi-docgen], [no])
+       AS_IF([test "x$GI_DOCGEN" = no],
+             [AS_CASE(["$enable_gtk_doc"],
+                      [yes], [AC_MSG_ERROR([gi-docgen not found - cannot build docs])],
+                      [auto], [AC_MSG_WARN([gi-docgen not found - not building docs])])
+              enable_gtk_doc=no]
+             [enable_gtk_doc=yes])])
+AM_CONDITIONAL(ENABLE_GTK_DOC, [test "x$enable_gtk_doc" = xyes])
 
 dnl ===========================================================================
 
@@ -359,4 +367,5 @@ librsvg-$VERSION
        Build introspectable bindings:  ${found_introspection}
        Build Vala bindings:            ${enable_vala}
        Build GdkPixbuf loader:         ${enable_pixbuf_loader}
+       Build developer documentation:  ${enable_gtk_doc}
 "


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