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)
+have_cairo=no
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
fi
fi
AM_CONDITIONAL(BUILD_TESTS, test x$enable_tests != xno)
+AM_CONDITIONAL(HAVE_CAIRO, test x$have_cairo != xno)
PKG_CHECK_MODULES(SCANNER, [gobject-2.0 gthread-2.0 gio-2.0])
LT_VERSION = $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
TYPELIB_VERSION = $(LT_CURRENT).0
-lib_LTLIBRARIES = libgirepository-everything-1.0.la
+lib_LTLIBRARIES =
libgirepository_everything_1_0_la_SOURCES = $(srcdir)/everything.c $(srcdir)/everything.h
-libgirepository_everything_1_0_la_CFLAGS = $(GOBJECT_CFLAGS)
+libgirepository_everything_1_0_la_CFLAGS = $(GOBJECT_CFLAGS) $(CAIRO_CFLAGS)
libgirepository_everything_1_0_la_LDFLAGS = -version-info $(LT_VERSION)
-libgirepository_everything_1_0_la_LIBADD = $(GOBJECT_LIBS) -lcairo
+libgirepository_everything_1_0_la_LIBADD = $(GOBJECT_LIBS) $(CAIRO_LIBS)
if OS_WIN32
libgirepository_everything_1_0_la_LDFLAGS += -no-undefined
Everything-1.0.gir: Gio-2.0.gir libgirepository-everything-1.0.la
Everything_1_0_gir_LIBS = libgirepository-everything-1.0.la
-Everything_1_0_gir_PACKAGES = gobject-2.0
+Everything_1_0_gir_PACKAGES = gobject-2.0 cairo
Everything_1_0_gir_INCLUDES = GObject-2.0 cairo-1.0
Everything_1_0_gir_FILES = $(srcdir)/everything.h $(srcdir)/everything.c
+if HAVE_CAIRO
INTROSPECTION_GIRS += Everything-$(TYPELIB_VERSION).gir
EXPECTEDGIRS += Everything-$(TYPELIB_VERSION)-expected.gir
+lib_LTLIBRARIES += libgirepository-everything-1.0.la
+endif
+
# marshalling tests
lib_LTLIBRARIES += libgirepository-gimarshallingtests-1.0.la