[vala/staging: 1/5] build: Allow disabling the build of valadoc



commit a4c0c6915271b1d9f126ef0bc520aba8821970b7
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Sun Aug 27 16:03:03 2017 +0200

    build: Allow disabling the build of valadoc
    
    Allow disabling build of valadoc with configure option --disable-valadoc
    
    Fixes https://gitlab.gnome.org/GNOME/vala/issues/596

 Makefile.am     | 10 ++++++++++
 configure.ac    | 60 +++++++++++++++++++++++++++++----------------------------
 doc/Makefile.am | 23 ++++++++++++++++++++--
 3 files changed, 62 insertions(+), 31 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 88bef90ed..e4d46741f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -13,9 +13,19 @@ SUBDIRS = \
        doc \
        gobject-introspection \
        vapigen \
+       $(NULL)
+
+if ENABLE_VALADOC
+SUBDIRS += \
        libvaladoc \
        valadoc \
        $(NULL)
+endif
+
+DISTCHECK_CONFIGURE_FLAGS = \
+       --enable-valadoc \
+       --enable-unversioned \
+       $(NULL)
 
 if ENABLE_UNVERSIONED
 aclocaldir = $(datadir)/aclocal
diff --git a/configure.ac b/configure.ac
index 88ca0f94b..f39fd9684 100644
--- a/configure.ac
+++ b/configure.ac
@@ -119,35 +119,37 @@ 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"
-AM_CONDITIONAL(HAVE_CGRAPH, test "$have_cgraph" = "yes")
+AC_ARG_ENABLE(valadoc, AS_HELP_STRING([--disable-valadoc], [Disable valadoc]), enable_valadoc=$enableval, 
enable_valadoc=yes)
+if test x$enable_valadoc = xyes; then
+       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"
+fi
+AM_CONDITIONAL(ENABLE_VALADOC, test x$enable_valadoc = xyes)
 
 AC_PATH_PROG([XSLTPROC], [xsltproc], :)
 AM_CONDITIONAL(HAVE_XSLTPROC, test "$XSLTPROC" != :)
diff --git a/doc/Makefile.am b/doc/Makefile.am
index 758ad733a..3688f0535 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -6,11 +6,16 @@ SUBDIRS = \
 
 dist_man_MANS = \
        valac.1 \
-       valadoc.1 \
        vala-gen-introspect.1 \
        vapigen.1 \
        $(NULL)
 
+if ENABLE_VALADOC
+dist_man_MANS += \
+       valadoc.1 \
+       $(NULL)
+endif
+
 EXTRA_DIST = \
        valac.h2m \
        valadoc.h2m \
@@ -19,7 +24,11 @@ EXTRA_DIST = \
        $(NULL)
 
 if HAVE_HELP2MAN
+if ENABLE_VALADOC
 manpages: valac.1 valadoc.1 vala-gen-introspect.1 vapigen.1
+else
+manpages: valac.1 vala-gen-introspect.1 vapigen.1
+endif
        @rm $^
        $(MAKE) $(AM_MAKEFLAGS) $^
 
@@ -28,11 +37,13 @@ valac.1:
                --include $(srcdir)/valac.h2m \
                --libtool --no-info \
                --output=$@
+if ENABLE_VALADOC
 valadoc.1:
        $(HELP2MAN) $(top_builddir)/valadoc/valadoc \
                --include $(srcdir)/valadoc.h2m \
                --libtool --no-info \
                --output=$@
+endif
 vala-gen-introspect.1:
        $(HELP2MAN) $(top_builddir)/gobject-introspection/gen-introspect \
                --include $(srcdir)/vala-gen-introspect.h2m \
@@ -49,7 +60,9 @@ endif
 if ENABLE_UNVERSIONED
 install-data-hook:
        cd $(DESTDIR)$(man1dir) && $(LN_S) -f valac@PACKAGE_SUFFIX@.1 valac.1
+if ENABLE_VALADOC
        cd $(DESTDIR)$(man1dir) && $(LN_S) -f valadoc@PACKAGE_SUFFIX@.1 valadoc.1
+endif
        cd $(DESTDIR)$(man1dir) && $(LN_S) -f vala-gen-introspect@PACKAGE_SUFFIX@.1 vala-gen-introspect.1
        cd $(DESTDIR)$(man1dir) && $(LN_S) -f vapigen@PACKAGE_SUFFIX@.1 vapigen.1
 endif
@@ -70,7 +83,7 @@ COMMON_VALADOCFLAGS = \
        --basedir=internal-apis/ \
        $(NULL)
 
-if HAVE_CGRAPH
+if ENABLE_VALADOC
 COMMON_VALADOCFLAGS += -D WITH_CGRAPH
 endif
 
@@ -115,6 +128,7 @@ internal-apis/codegen: $(codegen_VALASOURCES) internal-apis/vala internal-apis/c
                $(filter %.vala,$^)
        @touch $@
 
+if ENABLE_VALADOC
 valadoc_VALASOURCES = $(top_srcdir)/libvaladoc/*.vala $(top_srcdir)/libvaladoc/*/*.vala
 internal-apis/valadoc: $(valadoc_VALASOURCES) internal-apis/codegen
        $(AM_V_GEN)$(top_builddir)/valadoc/valadoc\
@@ -128,8 +142,13 @@ internal-apis/valadoc: $(valadoc_VALASOURCES) internal-apis/codegen
                --vapidir=$(top_builddir)/codegen --pkg codegen \
                $(filter %.vala,$^)
        @touch $@
+endif
 
+if ENABLE_VALADOC
 internal-api-docs: internal-apis/gee internal-apis/vala internal-apis/ccode internal-apis/codegen 
internal-apis/valadoc
+else
+internal-api-docs: internal-apis/gee internal-apis/vala internal-apis/ccode internal-apis/codegen
+endif
 
 clean-local:
        rm -rf $(builddir)/internal-apis


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