1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
https://gitlab.gnome.org/GNOME/librsvg/-/merge_requests/692
From 1c53068cbcfccb9c663dea2d1a61c8d7b24d317a Mon Sep 17 00:00:00 2001
From: Matt Turner <mattst88@gmail.com>
Date: Tue, 26 Apr 2022 15:01:55 -0700
Subject: [PATCH] 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.
---
Makefile.am | 2 +-
configure.ac | 19 ++++++++++++++-----
2 files changed, 15 insertions(+), 6 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 83e73c38..1e1ce856 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 9abc587e..6cced25c 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}
"
--
2.35.1
|