From d97145aa22544203ecb056772eb141b66776a4db Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Sun, 18 Apr 2010 15:46:38 -0400 Subject: 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(+) diff --git a/configure.ac b/configure.ac index c8097002..b9d2b895 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 24e76752..dc3f2c4a 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) -- cgit v1.2.1