[gobject-introspection] [everything] Depend on cairo properly



commit 5b896b3f93ffc8ecc10871e7665ab4dd1c71e91c
Author: Johan Dahlin <johan gnome org>
Date:   Tue Apr 20 23:04:47 2010 -0300

    [everything] Depend on cairo properly
    
    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    |    2 ++
 gir/Makefile.am |   12 ++++++++----
 2 files changed, 10 insertions(+), 4 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index b9d2b89..321c973 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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])
 
diff --git a/gir/Makefile.am b/gir/Makefile.am
index e090a61..0c6a2af 100644
--- a/gir/Makefile.am
+++ b/gir/Makefile.am
@@ -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



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