vala-disable-valadoc.patch 3.14 KB
Newer Older
Emmanuele Bassi's avatar
Emmanuele Bassi committed
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 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136
From d120130cfe6a400adc15083c94efad43798408be Mon Sep 17 00:00:00 2001
From: Emmanuele Bassi <ebassi@gnome.org>
Date: Wed, 9 Aug 2017 12:59:19 +0100
Subject: [PATCH] Allow disabling the build of valadoc

The Continuous build does not build documentation, and enabling valadoc
adds a Graphviz, and new and fairly complex dependency.

Let's disable the valadoc build, conditionally, instead.
---
 Makefile.am  | 20 ++++++++++++++++++
 configure.ac | 67 +++++++++++++++++++++++++++++++++++-------------------------
 2 files changed, 59 insertions(+), 28 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index e5dc0cc97..8a0491943 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -2,6 +2,21 @@ ACLOCAL_AMFLAGS = --install -I m4 ${ACLOCAL_FLAGS}
 
 NULL =
 
+DIST_SUBDIRS = \
+	gee \
+	vala \
+	ccode \
+	codegen \
+	compiler \
+	vapi \
+	tests \
+	doc \
+	gobject-introspection \
+	vapigen \
+	libvaladoc \
+	valadoc \
+	$(NULL)
+
 SUBDIRS = \
 	gee \
 	vala \
@@ -13,9 +28,14 @@ SUBDIRS = \
 	doc \
 	gobject-introspection \
 	vapigen \
+	$(NULL)
+
+if HAVE_LIBGVC
+SUBDIRS += \
 	libvaladoc \
 	valadoc \
 	$(NULL)
+endif
 
 if ENABLE_UNVERSIONED
 aclocaldir = $(datadir)/aclocal
diff --git a/configure.ac b/configure.ac
index c73d5d6b1..22f732888 100644
--- a/configure.ac
+++ b/configure.ac
@@ -98,34 +98,45 @@ PKG_CHECK_MODULES(GMODULE, gmodule-2.0 >= $GLIB_REQUIRED)
 AC_SUBST(GMODULE_CFLAGS)
 AC_SUBST(GMODULE_LIBS)
 
-PKG_CHECK_MODULES(LIBGVC, libgvc >= $LIBGVC_REQUIRED)
-AC_MSG_CHECKING([for CGRAPH])
-cgraph_tmp_LIBADD="$LIBADD"
-cgraph_tmp_CFLAGS="$CFLAGS"
-LIBADD="$LIBADD $LIBGVC_LIBS"
-CFLAGS="$CFLAGS $LIBGVC_CFLAGS"
-AC_RUN_IFELSE(
-	[AC_LANG_SOURCE([
-		#include <gvc.h>
-
-		int main(void) {
-			#ifdef WITH_CGRAPH
-				return 0;
-			#else
-				return -1;
-			#endif
-		}
-	])], [
-		AC_MSG_RESULT([yes])
-		VALAFLAGS="$VALAFLAGS -D WITH_CGRAPH"
-		have_cgraph=yes
-	], [
-		AC_MSG_RESULT([no])
-		have_cgraph=no
-	]
-)
-LIBADD="$cgraph_tmp_LIBADD"
-CFLAGS="$cgraph_tmp_CFLAGS"
+AC_ARG_ENABLE(valadoc, AS_HELP_STRING([--disable-valadoc], [Disable valadoc]), enable_valadoc=$enableval, enable_valadoc=yes)
+if test x$enable_valadoc != xno; then
+        PKG_CHECK_MODULES(LIBGVC, libgvc >= $LIBGVC_REQUIRED, have_gvc=yes, have_gvc=no)
+else
+        have_gvc=no
+fi
+
+AM_CONDITIONAL(HAVE_LIBGVC, test $have_gvc = yes)
+
+if test x$have_gvc = xyes; then
+        AC_MSG_CHECKING([for CGRAPH])
+        cgraph_tmp_LIBADD="$LIBADD"
+        cgraph_tmp_CFLAGS="$CFLAGS"
+        LIBADD="$LIBADD $LIBGVC_LIBS"
+        CFLAGS="$CFLAGS $LIBGVC_CFLAGS"
+        AC_RUN_IFELSE(
+	        [AC_LANG_SOURCE([
+		        #include <gvc.h>
+
+        		int main(void) {
+	        		#ifdef WITH_CGRAPH
+		        		return 0;
+			        #else
+        				return -1;
+	        		#endif
+		        }
+        	])], [
+	        	AC_MSG_RESULT([yes])
+		        VALAFLAGS="$VALAFLAGS -D WITH_CGRAPH"
+        		have_cgraph=yes
+	        ], [
+		        AC_MSG_RESULT([no])
+        		have_cgraph=no
+	        ]
+        )
+        LIBADD="$cgraph_tmp_LIBADD"
+        CFLAGS="$cgraph_tmp_CFLAGS"
+fi
+
 AM_CONDITIONAL(HAVE_CGRAPH, test "$have_cgraph" = "yes")
 
 AC_PATH_PROG([XSLTPROC], [xsltproc], :)
-- 
2.13.3