diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2011-11-09 17:18:36 +0000 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2012-02-21 15:15:24 +0000 |
commit | 4b31fcf4d4c2d1205bd9133f56e8ca9f6c038046 (patch) | |
tree | 4daac9a5460e08ebcc509e0cd0022fccc420feef | |
parent | 674983689c75a98357823a64d10b14589c1c8349 (diff) | |
download | dbus-4b31fcf4d4c2d1205bd9133f56e8ca9f6c038046.tar.gz |
Allow a reduced set of installable tests (none yet) to be built without GLib
--enable-modular-tests=auto will build as many as possible, perhaps
excluding the GLib ones. --enable-modular-tests=yes or --enable-tests=yes
will insist on having GLib, to be able to run everything.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=42811
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
-rw-r--r-- | configure.ac | 24 | ||||
-rw-r--r-- | test/Makefile.am | 5 |
2 files changed, 20 insertions, 9 deletions
diff --git a/configure.ac b/configure.ac index 0414586a..0f8a5417 100644 --- a/configure.ac +++ b/configure.ac @@ -193,6 +193,9 @@ fi # These use GTest, from GLib, because life's too short. They're enabled by # default (unless you don't have GLib), because they don't bloat the library # or binaries. + +with_glib=yes + if test "x$enable_modular_tests" != xno; then PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.24, gio-2.0 >= 2.24], [], @@ -200,7 +203,7 @@ if test "x$enable_modular_tests" != xno; then AC_MSG_NOTICE([Full test coverage (--enable-modular-tests=yes or --enable-tests=yes) requires GLib]) AC_MSG_ERROR([$GLIB_ERRORS]) else # assumed to be "auto" - enable_modular_tests=no + with_glib=no fi]) # If dbus-gmain.[ch] returned to libdbus then we wouldn't need this PKG_CHECK_MODULES([DBUS_GLIB], [dbus-glib-1], @@ -209,19 +212,21 @@ if test "x$enable_modular_tests" != xno; then AC_MSG_NOTICE([Full test coverage (--enable-modular-tests=yes or --enable-tests=yes) requires dbus-glib]) AC_MSG_ERROR([$DBUS_GLIB_ERRORS]) else # assumed to be "auto" - enable_modular_tests=no + with_glib=no fi]) - if test "x$enable_modular_tests" != xno; then - # dependencies checked, switch from auto to yes - enable_modular_tests=yes - fi fi -if test "x$enable_modular_tests" = xyes; then +if test "x$enable_modular_tests" != xno; then AC_DEFINE([DBUS_ENABLE_MODULAR_TESTS], [1], - [Define to build independent test binaries (requires GLib)]) + [Define to build independent test binaries]) fi AM_CONDITIONAL([DBUS_ENABLE_MODULAR_TESTS], - [test "x$enable_modular_tests" = xyes]) + [test "x$enable_modular_tests" != xno]) + +if test "x$with_glib" != xno; then + AC_DEFINE([DBUS_WITH_GLIB], [1], + [Define if GLib, GObject, GIO are available]) +fi +AM_CONDITIONAL([DBUS_WITH_GLIB], [test "x$with_glib" != xno]) AC_ARG_ENABLE([installed-tests], AS_HELP_STRING([--enable-installed-tests], @@ -1743,6 +1748,7 @@ echo " gcc coverage profiling: ${enable_compiler_coverage} Building embedded tests: ${enable_embedded_tests} Building modular tests: ${enable_modular_tests} + - with GLib: ${with_glib} Building verbose mode: ${enable_verbose_mode} Building assertions: ${enable_asserts} Building checks: ${enable_checks} diff --git a/test/Makefile.am b/test/Makefile.am index 2eca473e..8457fcd1 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -100,6 +100,10 @@ testexecdir = $(libdir)/dbus-1.0/test testexec_PROGRAMS = installable_tests = \ + $(NULL) + +if DBUS_WITH_GLIB +installable_tests += \ test-corrupt \ test-dbus-daemon \ test-dbus-daemon-eavesdrop \ @@ -109,6 +113,7 @@ installable_tests = \ test-relay \ test-syslog \ $(NULL) +endif DBUS_WITH_GLIB installcheck_tests = installcheck_environment = \ |