[dia] cairo: do not compile cairo plugin if '--without-cairo' is defined.
- From: Hans Breuer <hans src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dia] cairo: do not compile cairo plugin if '--without-cairo' is defined.
- Date: Tue, 10 Jun 2014 19:18:34 +0000 (UTC)
commit ceb7265b65ed969698c358a850f8ff3ad42cc9d5
Author: Gokturk Yuksek <gokturk binghamton edu>
Date: Fri May 9 15:30:08 2014 -0400
cairo: do not compile cairo plugin if '--without-cairo' is defined.
Passing '--without-cairo' option to the build system disables
the inclusion of cairo header files but does not prevent the
code from building. As a result the compilation fails with
'implicit declaration of function' errors.
To fix this, modify the Makefile.am so that it does not compile
the plugin if '--without-cairo' is defined. Note that this
option must be passed by the user explicitly as the build system
will always detect libcairo on the system since GTK depends on it.
See: https://bugzilla.gnome.org/show_bug.cgi?id=729668
See: https://bugs.gentoo.org/show_bug.cgi?id=509636
Signed-off-by: Gokturk Yuksek <gokturk binghamton edu>
plug-ins/cairo/Makefile.am | 5 ++-
plug-ins/cairo/diacairo-renderer.c | 26 ++++++++---------
plug-ins/cairo/diacairo.c | 54 +++++++++++++----------------------
3 files changed, 36 insertions(+), 49 deletions(-)
---
diff --git a/plug-ins/cairo/Makefile.am b/plug-ins/cairo/Makefile.am
index 8108764..cffc0ee 100644
--- a/plug-ins/cairo/Makefile.am
+++ b/plug-ins/cairo/Makefile.am
@@ -1,4 +1,4 @@
-
+if WITH_CAIRO
plugin_sources = \
diacairo.c \
diacairo.h \
@@ -6,6 +6,9 @@ plugin_sources = \
diacairo-renderer.c \
diacairo-print.c \
diacairo-print.h
+else
+plugin_sources =
+endif
pkglib_LTLIBRARIES = libcairo_filter.la
diff --git a/plug-ins/cairo/diacairo-renderer.c b/plug-ins/cairo/diacairo-renderer.c
index 9598c8e..7e77453 100644
--- a/plug-ins/cairo/diacairo-renderer.c
+++ b/plug-ins/cairo/diacairo-renderer.c
@@ -34,21 +34,19 @@
#include <pango/pangocairo.h>
#endif
-#ifdef HAVE_CAIRO
-# include <cairo.h>
+#include <cairo.h>
/* some backend headers, win32 missing in official Cairo */
-# ifdef CAIRO_HAS_PNG_SURFACE_FEATURE
-# include <cairo-png.h>
-# endif
-# ifdef CAIRO_HAS_PS_SURFACE
-# include <cairo-ps.h>
-# endif
-# ifdef CAIRO_HAS_PDF_SURFACE
-# include <cairo-pdf.h>
-# endif
-# ifdef CAIRO_HAS_SVG_SURFACE
-# include <cairo-svg.h>
-# endif
+#ifdef CAIRO_HAS_PNG_SURFACE_FEATURE
+#include <cairo-png.h>
+#endif
+#ifdef CAIRO_HAS_PS_SURFACE
+#include <cairo-ps.h>
+#endif
+#ifdef CAIRO_HAS_PDF_SURFACE
+#include <cairo-pdf.h>
+#endif
+#ifdef CAIRO_HAS_SVG_SURFACE
+#include <cairo-svg.h>
#endif
#include "intl.h"
diff --git a/plug-ins/cairo/diacairo.c b/plug-ins/cairo/diacairo.c
index ef5ac10..c06eecf 100644
--- a/plug-ins/cairo/diacairo.c
+++ b/plug-ins/cairo/diacairo.c
@@ -30,41 +30,27 @@
#include <glib.h>
#include <glib/gstdio.h>
-/*
- * To me the following looks rather suspicious. Why do we need to compile
- * the Cairo plug-in at all if we don't have Cairo? As a result we'll
- * show it in the menus/plugin details and the user expects something
- * although there isn't any functionality behind it. Urgh.
- *
- * With Gtk+-2.7.x cairo must be available so this becomes even more ugly
- * when the user has choosen to not build the diacairo plug-in. If noone
- * can come up with a convincing reason to do it this way I'll probably
- * go back to the dont-build-at-all approach when it breaks the next time.
- * --hb
- */
-#ifdef HAVE_CAIRO
-# include <cairo.h>
+#include <cairo.h>
/* some backend headers, win32 missing in official Cairo */
-# ifdef CAIRO_HAS_PNG_SURFACE_FEATURE
-# include <cairo-png.h>
-# endif
-# ifdef CAIRO_HAS_PS_SURFACE
-# include <cairo-ps.h>
-# endif
-# ifdef CAIRO_HAS_PDF_SURFACE
-# include <cairo-pdf.h>
-# endif
-# ifdef CAIRO_HAS_SVG_SURFACE
-# include <cairo-svg.h>
-# endif
-# ifdef CAIRO_HAS_WIN32_SURFACE
-# include <cairo-win32.h>
- /* avoid namespace collisions */
-# define Rectangle RectangleWin32
-# endif
-# ifdef CAIRO_HAS_SCRIPT_SURFACE
-# include <cairo-script.h>
-# endif
+#ifdef CAIRO_HAS_PNG_SURFACE_FEATURE
+#include <cairo-png.h>
+#endif
+#ifdef CAIRO_HAS_PS_SURFACE
+#include <cairo-ps.h>
+#endif
+#ifdef CAIRO_HAS_PDF_SURFACE
+#include <cairo-pdf.h>
+#endif
+#ifdef CAIRO_HAS_SVG_SURFACE
+#include <cairo-svg.h>
+#endif
+#ifdef CAIRO_HAS_WIN32_SURFACE
+#include <cairo-win32.h>
+/* avoid namespace collisions */
+#define Rectangle RectangleWin32
+#endif
+#ifdef CAIRO_HAS_SCRIPT_SURFACE
+#include <cairo-script.h>
#endif
#ifdef HAVE_PANGOCAIRO_H
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]