[everything] Depend on cairo properly
authorJohan Dahlin <johan@gnome.org>
Wed, 21 Apr 2010 02:04:47 +0000 (23:04 -0300)
committerJohan Dahlin <johan@gnome.org>
Wed, 21 Apr 2010 02:04:47 +0000 (23:04 -0300)
Don't try to build the everything library nor the gir if we
can't find cairo. Pass in the right flags so it can be built
when cairo is not in the same prefix as the rest of the dependencies.

configure.ac
gir/Makefile.am

index b9d2b8959ff5025c5d90921843eebbe4c61409b8..321c973dd2f229d222bf1985ce7c00a7bd6c88ec 100644 (file)
@@ -126,6 +126,7 @@ PKG_CHECK_MODULES(GIO_UNIX, [gio-unix-2.0], have_gio_unix=true, have_gio_unix=fa
 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
@@ -133,6 +134,7 @@ if test x$enable_tests != xno; 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])
 
index e090a61edce241417036199fe9b596e05b2e3c81..0c6a2aff68d3c15f2149877c8906c42f2489d181 100644 (file)
@@ -157,12 +157,12 @@ LT_AGE = 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
@@ -172,12 +172,16 @@ 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
-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