[gobject-introspection] Add --disable-tests configure flag



commit d97145aa22544203ecb056772eb141b66776a4db
Author: Colin Walters <walters verbum org>
Date:   Sun Apr 18 15:46:38 2010 -0400

    Add --disable-tests configure flag
    
    This allows us to not hard depend on cairo.

 configure.ac    |    9 +++++++++
 gir/Makefile.am |    3 +++
 2 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index c809700..b9d2b89 100644
--- a/configure.ac
+++ b/configure.ac
@@ -125,6 +125,15 @@ PKG_CHECK_MODULES(GTHREAD, [gthread-2.0])
 PKG_CHECK_MODULES(GIO_UNIX, [gio-unix-2.0], have_gio_unix=true, have_gio_unix=false)
 AM_CONDITIONAL(HAVE_GIO_UNIX, test x$have_gio_unix = xtrue)
 
+AC_ARG_ENABLE(tests,[  --disable-tests           disable test libraries ], enable_tests=$enableval,enable_tests=yes)
+if test x$enable_tests != xno; then
+  PKG_CHECK_MODULES(CAIRO, [cairo], have_cairo=yes, have_cairo=no)
+  if test x$have_cairo != xyes; then
+    AC_MSG_ERROR([Tests enabled but cairo not found; pass --disable-tests or install cairo])
+  fi
+fi
+AM_CONDITIONAL(BUILD_TESTS, test x$enable_tests != xno)
+
 PKG_CHECK_MODULES(SCANNER, [gobject-2.0 gthread-2.0 gio-2.0])
 
 dnl libffi
diff --git a/gir/Makefile.am b/gir/Makefile.am
index 24e7675..dc3f2c4 100644
--- a/gir/Makefile.am
+++ b/gir/Makefile.am
@@ -167,6 +167,7 @@ if OS_WIN32
 libgirepository_everything_1_0_la_LDFLAGS += -no-undefined
 endif
 
+if BUILD_TESTS
 Everything-1.0.gir: Gio-2.0.gir libgirepository-everything-1.0.la
 
 Everything_1_0_gir_LIBS = libgirepository-everything-1.0.la
@@ -198,6 +199,8 @@ GIMarshallingTests_1_0_gir_FILES = $(srcdir)/gimarshallingtests.h $(srcdir)/gima
 
 INTROSPECTION_GIRS += GIMarshallingTests-$(TYPELIB_VERSION).gir
 
+endif
+
 # Generic rules
 CLEANFILES += $(INTROSPECTION_GIRS)
 



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