The TAP harness for glib only works with version 2.38 or later,
so must be disabled for earlier versions
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
configure.ac | 8 +++++++-
tests/Makefile.am | 18 ++++++++++++++----
2 files changed, 21 insertions(+), 5 deletions(-)
diff --git a/configure.ac b/configure.ac
index 4ad636a..d5b2971 100644
--- a/configure.ac
+++ b/configure.ac
@@ -12,6 +12,7 @@ AM_SILENT_RULES([yes])
LIBVIRT_REQUIRED=0.10.2
AC_SUBST([LIBVIRT_REQUIRED]) dnl used in the .spec file
GLIB2_REQUIRED=2.22.0
+GLIB2_TEST_REQUIRED=2.38.0
GOBJECT2_REQUIRED=2.10.0
GIO_REQUIRED=2.10.0
GOBJECT_INTROSPECTION_REQUIRED=0.10.8
@@ -91,12 +92,17 @@ m4_if(m4_version_compare([2.61a.100],
LIBVIRT_GLIB_COMPILE_WARNINGS
PKG_CHECK_MODULES(LIBVIRT, libvirt >= $LIBVIRT_REQUIRED)
-PKG_CHECK_MODULES(GLIB2, glib-2.0 >= $GLIB2_REQUIRED)
+enable_tests=no
+PKG_CHECK_MODULES(GLIB2, glib-2.0 >= $GLIB2_TEST_REQUIRED,
+ [enable_tests=yes],
+ [PKG_CHECK_MODULES(GLIB2, glib-2.0 >= $GLIB2_REQUIRED)])
PKG_CHECK_MODULES(GTHREAD2, gthread-2.0 >= $GLIB2_REQUIRED)
PKG_CHECK_MODULES(GOBJECT2, gobject-2.0 >= $GLIB2_REQUIRED)
PKG_CHECK_MODULES(GIO2, gio-2.0 >= $GLIB2_REQUIRED)
PKG_CHECK_MODULES(LIBXML2, libxml-2.0 >= $LIBXML2_REQUIRED)
+AM_CONDITIONAL([ENABLE_TESTS], [test "$enable_tests" = "yes"])
+
LIBVIRT_GLIB_GETTEXT
dnl Should be in m4/virt-gettext.m4 but intltoolize is too
dnl dumb to find it there
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 56887ce..8cb98e5 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -1,3 +1,11 @@
+EXTRA_DIST = \
+ xml/gconfig-domain.xml \
+ xml/gconfig-domain-clock.xml \
+ xml/gconfig-domain-os.xml \
+ $(NULL)
+
+if ENABLE_TESTS
+
include $(top_srcdir)/build-aux/glib-tap.mk
AM_CFLAGS = \
@@ -14,7 +22,9 @@ LDADD = \
test_programs = test-gconfig test-events
-dist_test_data = \
- xml/gconfig-domain.xml \
- xml/gconfig-domain-clock.xml \
- xml/gconfig-domain-os.xml
+else
+EXTRA_DIST += \
+ test-events.c \
+ test-gconfig.c \
+ $(NULL)
+endif
--
1.8.5.3