summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomeu Vizoso <tomeu.vizoso@collabora.co.uk>2011-01-19 12:43:13 +0100
committerTomeu Vizoso <tomeu.vizoso@collabora.co.uk>2011-01-20 16:38:15 +0100
commit934729dca1e5c66359366d1ee2b5080b3711d436 (patch)
treed590310fc6a159daf11c36934f189874aec62593
parenta258d3fdfbd0f598bfe287b656f240d95f6d4bc1 (diff)
downloadgobject-introspection-934729dca1e5c66359366d1ee2b5080b3711d436.tar.gz
Depend on cairo-gobject if available
And set library-name and package accordingly in the cairo .gir https://bugzilla.gnome.org/show_bug.cgi?id=639831
-rw-r--r--configure.ac26
-rw-r--r--gir/cairo-1.0.gir.in (renamed from gir/cairo-1.0.gir)2
2 files changed, 23 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac
index 3c78c0d1..91e6e999 100644
--- a/configure.ac
+++ b/configure.ac
@@ -126,14 +126,29 @@ 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
- AC_MSG_ERROR([Tests enabled but cairo not found; pass --disable-tests or install cairo])
- fi
+PKG_CHECK_MODULES(CAIRO, [cairo], have_cairo=yes, have_cairo=no)
+if test x$have_cairo != xyes && test x$enable_tests != xno; then
+ AC_MSG_ERROR([Tests enabled but cairo not found; pass --disable-tests or install cairo])
+fi
+
+have_cairo_gobject=no
+if test x$have_cairo = xyes; then
+ PKG_CHECK_MODULES(CAIRO_GOBJECT, [cairo-gobject], have_cairo_gobject=yes, have_cairo_gobject=no)
fi
+
+if test x$have_cairo_gobject = xyes; then
+ CAIRO_SHARED_LIBRARY="libcairo-gobject.so"
+ CAIRO_GIR_PACKAGE="cairo-gobject"
+elif test x$have_cairo = xyes; then
+ CAIRO_SHARED_LIBRARY="libcairo.so"
+ CAIRO_GIR_PACKAGE="cairo"
+fi
+AC_SUBST(CAIRO_SHARED_LIBRARY)
+AC_SUBST(CAIRO_GIR_PACKAGE)
+
AM_CONDITIONAL(BUILD_TESTS, test x$enable_tests != xno)
AM_CONDITIONAL(HAVE_CAIRO, test x$have_cairo != xno)
+AM_CONDITIONAL(HAVE_CAIRO_GOBJECT, test x$have_cairo_gobject != xno)
PKG_CHECK_MODULES(SCANNER, [gobject-2.0 gthread-2.0 gio-2.0])
@@ -241,6 +256,7 @@ AC_MSG_RESULT([$GLIBSRC])
AC_CONFIG_FILES([
Makefile
+gir/cairo-1.0.gir
giscanner/config.py
m4/Makefile
tests/Makefile
diff --git a/gir/cairo-1.0.gir b/gir/cairo-1.0.gir.in
index 0c9f24a5..2c29406d 100644
--- a/gir/cairo-1.0.gir
+++ b/gir/cairo-1.0.gir.in
@@ -3,7 +3,9 @@
xmlns="http://www.gtk.org/introspection/core/1.0"
xmlns:c="http://www.gtk.org/introspection/c/1.0"
xmlns:glib="http://www.gtk.org/introspection/glib/1.0">
+ <package name="@CAIRO_GIR_PACKAGE@"/>
<namespace name="cairo" version="1.0"
+ shared-library="@CAIRO_SHARED_LIBRARY@"
c:identifier-prefixes="cairo"
c:symbol-prefixes="cairo">
<record name="Context" c:type="cairo_t" foreign="1"