adg: make cairo-gobject optional
authorNicola Fontana <ntd@entidi.it>
Thu, 4 Apr 2013 22:21:36 +0000 (5 00:21 +0200)
committerNicola Fontana <ntd@entidi.it>
Thu, 4 Apr 2013 22:21:36 +0000 (5 00:21 +0200)
cairo-gobject has been added to cairo only recently (2010), so including
it only optionally. In case it does not exist, use the yet existing
fallbacks (or provide the missing ones if there will be).

configure.ac
src/adg/adg-internal.h

index 97ae638..c612449 100644 (file)
@@ -132,7 +132,10 @@ 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 >= ]cairo_gobject_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
index 0a739f5..d2ccac5 100644 (file)
 
 #include <config.h>
 #define G_LOG_DOMAIN  PACKAGE
+
+#ifdef CAIRO_GOBJECT_ENABLED
 #include <cairo-gobject.h>
+#endif
+
 #include <cpml.h>
 
 /* The following headers are autogenerated, so they could be hosted