build: depends on cairo-gobject if introspection is enabled
authorNicola Fontana <ntd@entidi.it>
Fri, 5 Apr 2013 14:57:30 +0000 (5 16:57 +0200)
committerNicola Fontana <ntd@entidi.it>
Fri, 5 Apr 2013 14:57:30 +0000 (5 16:57 +0200)
If introspection is used, GObject support in cairo must be enabled
because gobject-introspection package relies on the presence of this
wrapper library. That support is present since cairo 1.10.0.

configure.ac

index bc66763..f8da108 100644 (file)
@@ -131,10 +131,6 @@ AC_CONFIG_COMMANDS([default],
 PKG_CHECK_MODULES([GLIB],[glib-2.0])
 PKG_CHECK_MODULES([GOBJECT],[gobject-2.0 >= ]gobject_prereq)
 PKG_CHECK_MODULES([CAIRO],[cairo >= ]cairo_prereq)
-PKG_CHECK_MODULES([CAIRO_GOBJECT],[cairo-gobject],
-                  [AC_DEFINE_UNQUOTED([CAIRO_GOBJECT_ENABLED],[1],
-                                      [Defined if GObject support in cairo is present.])],
-                  [:])
 
 
 # Check for optional packages
@@ -260,6 +256,15 @@ AM_COND_IF([HAVE_INTROSPECTION],
  Where to install the typelib files: ${with_typelibdir}"],
            [report_introspection=""])
 
+dnl If introspection is used GObject support in cairo must be enabled,
+dnl that is the cairo-gobject library must be present. That support
+dnl was introduced since cairo 1.10.0.
+PKG_CHECK_MODULES([CAIRO_GOBJECT],[cairo-gobject],
+                  [AC_DEFINE_UNQUOTED([CAIRO_GOBJECT_ENABLED],[1],
+                                      [Defined if GObject support in cairo is present.])],
+                  [AS_IF([test "x${enable_introspection}" = "xyes"],
+                         [AC_MSG_ERROR([GObject introspection requires the cairo-gobject library])])])
+
 dnl GLib test framework
 AC_ARG_ENABLE([test_framework],
               [AS_HELP_STRING([--enable-test-framework],