[glib] build: Add --disable-modular-tests build option



commit f084b603771f78126bc0b07229a1574b76e776bb
Author: Colin Walters <walters verbum org>
Date:   Fri Jan 13 10:09:10 2012 -0500

    build: Add --disable-modular-tests build option
    
    This patch solves two problems:
    
    First, it allows builders to optionally cut the circular dependency
    between dbus and glib by disabling the modular tests (just like how
    the tests can be disabled in dbus).
    
    Second, the tests are entirely pointless to build if cross-compiling.
    
    It also moves us slightly closer to the long term future we want where
    the tests are a separate ./configure invocation and run against the
    INSTALLED glib, not the one in the source tree. This would allow us to
    run the tests constantly, not just when glib is built.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=667806

 Makefile.am         |    7 ++++++-
 configure.ac        |   19 +++++++++++++------
 gio/Makefile.am     |    7 ++++++-
 glib/Makefile.am    |    8 +++++++-
 gobject/Makefile.am |    8 +++++++-
 5 files changed, 39 insertions(+), 10 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index f5c510d..55be9d2 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -6,8 +6,13 @@ include $(top_srcdir)/Makefile.decl
 
 ACLOCAL_AMFLAGS = -I m4macros ${ACLOCAL_FLAGS}
 
-SUBDIRS = . m4macros glib gmodule gthread gobject gio tests po docs
+SUBDIRS = . m4macros glib gmodule gthread gobject gio po docs
 DIST_SUBDIRS = $(SUBDIRS) build
+if BUILD_MODULAR_TESTS
+SUBDIRS += tests 
+else
+DIST_SUBDIRS += tests
+endif
 
 bin_SCRIPTS = glib-gettextize
 
diff --git a/configure.ac b/configure.ac
index 0c4e645..c93fcec 100644
--- a/configure.ac
+++ b/configure.ac
@@ -247,6 +247,11 @@ AC_ARG_ENABLE(rebuilds,
               [AC_HELP_STRING([--disable-rebuilds],
                               [disable all source autogeneration rules])],,
               [enable_rebuilds=yes])
+AC_ARG_ENABLE(modular_tests,
+              AC_HELP_STRING([--disable-modular-tests],
+                             [Disable build of test programs (default: no)]),,
+              [enable_modular_tests=yes])
+AM_CONDITIONAL(BUILD_MODULAR_TESTS, test x$enable_modular_tests = xyes)
 
 AC_MSG_CHECKING([whether to enable garbage collector friendliness])
 if test "x$enable_gc_friendly" = "xyes"; then
@@ -3449,12 +3454,14 @@ AC_CHECK_ALIGNOF([unsigned long])
 # Check for libdbus1 - Optional - is only used in the GDBus test cases
 #
 # 1.2.14 required for dbus_message_set_serial
-PKG_CHECK_MODULES(DBUS1,
-                  dbus-1 >= 1.2.14,
-                  [AC_DEFINE(HAVE_DBUS1, 1, [Define if dbus-1 is available]) have_dbus1=yes],
-                  have_dbus1=no)
-AC_SUBST(DBUS1_CFLAGS)
-AC_SUBST(DBUS1_LIBS)
+if test x$enable_modular_tests = xyes; then
+   PKG_CHECK_MODULES(DBUS1,
+                     dbus-1 >= 1.2.14,
+                     [AC_DEFINE(HAVE_DBUS1, 1, [Define if dbus-1 is available]) have_dbus1=yes],
+                     have_dbus1=no)
+   AC_SUBST(DBUS1_CFLAGS)
+   AC_SUBST(DBUS1_LIBS)
+fi
 AM_CONDITIONAL(HAVE_DBUS1, [test "x$have_dbus1" = "xyes"])
 
 dnl
diff --git a/gio/Makefile.am b/gio/Makefile.am
index b0ae4de..edb534a 100644
--- a/gio/Makefile.am
+++ b/gio/Makefile.am
@@ -2,6 +2,7 @@ include $(top_srcdir)/Makefile.decl
 
 NULL =
 
+DIST_SUBDIRS =
 SUBDIRS = gdbus-2.0/codegen
 
 if OS_UNIX
@@ -302,7 +303,11 @@ giowin32include_HEADERS = \
 
 endif
 
-SUBDIRS += tests
+if BUILD_MODULAR_TESTS
+SUBDIRS += tests 
+else
+DIST_SUBDIRS += tests
+endif
 
 libgio_2_0_la_SOURCES =		\
 	gappinfo.c 		\
diff --git a/glib/Makefile.am b/glib/Makefile.am
index ac73a8c..ac232d2 100644
--- a/glib/Makefile.am
+++ b/glib/Makefile.am
@@ -35,7 +35,13 @@ else
 MAYBE_PCRE = pcre 
 endif
 
-SUBDIRS = libcharset $(PRINTF_SUBDIR) $(MAYBE_PCRE) update-pcre . tests
+SUBDIRS = libcharset $(PRINTF_SUBDIR) $(MAYBE_PCRE) update-pcre .
+DIST_SUBDIRS =
+if BUILD_MODULAR_TESTS
+SUBDIRS += tests 
+else
+DIST_SUBDIRS += tests
+endif
 
 DIST_SUBDIRS = libcharset gnulib pcre update-pcre tests
 
diff --git a/gobject/Makefile.am b/gobject/Makefile.am
index cc265b4..3dc277f 100644
--- a/gobject/Makefile.am
+++ b/gobject/Makefile.am
@@ -4,7 +4,13 @@
 ## Process this file with automake to produce Makefile.in
 include $(top_srcdir)/Makefile.decl
 
-SUBDIRS = . tests
+SUBDIRS = .
+DIST_SUBDIRS =
+if BUILD_MODULAR_TESTS
+SUBDIRS += tests 
+else
+DIST_SUBDIRS += tests
+endif
 
 BUILT_SOURCES=
 CLEANFILES=



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