作図ソフト dia の改良版
リビジョン | ad54cac7c3f62edc5a8f003aa7a48fd998cda39e (tree) |
---|---|
日時 | 2014-07-06 21:57:22 |
作者 | Gokturk Yuksek <gokturk@bing...> |
コミッター | Hans Breuer |
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>
(cherry picked from commit ceb7265b65ed969698c358a850f8ff3ad42cc9d5)
Conflicts:
plug-ins/cairo/diacairo-renderer.c
plug-ins/cairo/diacairo.c
@@ -1,4 +1,4 @@ | ||
1 | - | |
1 | +if WITH_CAIRO | |
2 | 2 | plugin_sources = \ |
3 | 3 | diacairo.c \ |
4 | 4 | diacairo.h \ |
@@ -6,6 +6,9 @@ plugin_sources = \ | ||
6 | 6 | diacairo-renderer.c \ |
7 | 7 | diacairo-print.c \ |
8 | 8 | diacairo-print.h |
9 | +else | |
10 | +plugin_sources = | |
11 | +endif | |
9 | 12 | |
10 | 13 | pkglib_LTLIBRARIES = libcairo_filter.la |
11 | 14 |
@@ -34,33 +34,18 @@ | ||
34 | 34 | #include <pango/pangocairo.h> |
35 | 35 | #endif |
36 | 36 | |
37 | -/* | |
38 | - * To me the following looks rather suspicious. Why do we need to compile | |
39 | - * the Cairo plug-in at all if we don't have Cairo? As a result we'll | |
40 | - * show it in the menus/plugin details and the user expects something | |
41 | - * although there isn't any functionality behind it. Urgh. | |
42 | - * | |
43 | - * With Gtk+-2.7.x cairo must be available so this becomes even more ugly | |
44 | - * when the user has choosen to not build the diacairo plug-in. If noone | |
45 | - * can come up with a convincing reason to do it this way I'll probably | |
46 | - * go back to the dont-build-at-all approach when it breaks the next time. | |
47 | - * --hb | |
48 | - */ | |
49 | -#ifdef HAVE_CAIRO | |
50 | -# include <cairo.h> | |
51 | -/* some backend headers, win32 missing in official Cairo */ | |
52 | -# ifdef CAIRO_HAS_PNG_SURFACE_FEATURE | |
53 | -# include <cairo-png.h> | |
54 | -# endif | |
55 | -# ifdef CAIRO_HAS_PS_SURFACE | |
56 | -# include <cairo-ps.h> | |
57 | -# endif | |
58 | -# ifdef CAIRO_HAS_PDF_SURFACE | |
59 | -# include <cairo-pdf.h> | |
60 | -# endif | |
61 | -# ifdef CAIRO_HAS_SVG_SURFACE | |
62 | -# include <cairo-svg.h> | |
63 | -# endif | |
37 | +#include <cairo.h> | |
38 | +#ifdef CAIRO_HAS_PNG_SURFACE_FEATURE | |
39 | +#include <cairo-png.h> | |
40 | +#endif | |
41 | +#ifdef CAIRO_HAS_PS_SURFACE | |
42 | +#include <cairo-ps.h> | |
43 | +#endif | |
44 | +#ifdef CAIRO_HAS_PDF_SURFACE | |
45 | +#include <cairo-pdf.h> | |
46 | +#endif | |
47 | +#ifdef CAIRO_HAS_SVG_SURFACE | |
48 | +#include <cairo-svg.h> | |
64 | 49 | #endif |
65 | 50 | |
66 | 51 | #include "intl.h" |
@@ -30,38 +30,27 @@ | ||
30 | 30 | #include <glib.h> |
31 | 31 | #include <glib/gstdio.h> |
32 | 32 | |
33 | -/* | |
34 | - * To me the following looks rather suspicious. Why do we need to compile | |
35 | - * the Cairo plug-in at all if we don't have Cairo? As a result we'll | |
36 | - * show it in the menus/plugin details and the user expects something | |
37 | - * although there isn't any functionality behind it. Urgh. | |
38 | - * | |
39 | - * With Gtk+-2.7.x cairo must be available so this becomes even more ugly | |
40 | - * when the user has choosen to not build the diacairo plug-in. If noone | |
41 | - * can come up with a convincing reason to do it this way I'll probably | |
42 | - * go back to the dont-build-at-all approach when it breaks the next time. | |
43 | - * --hb | |
44 | - */ | |
45 | -#ifdef HAVE_CAIRO | |
46 | -# include <cairo.h> | |
33 | +#include <cairo.h> | |
47 | 34 | /* some backend headers, win32 missing in official Cairo */ |
48 | -# ifdef CAIRO_HAS_PNG_SURFACE_FEATURE | |
49 | -# include <cairo-png.h> | |
50 | -# endif | |
51 | -# ifdef CAIRO_HAS_PS_SURFACE | |
52 | -# include <cairo-ps.h> | |
53 | -# endif | |
54 | -# ifdef CAIRO_HAS_PDF_SURFACE | |
55 | -# include <cairo-pdf.h> | |
56 | -# endif | |
57 | -# ifdef CAIRO_HAS_SVG_SURFACE | |
58 | -# include <cairo-svg.h> | |
59 | -# endif | |
60 | -# ifdef CAIRO_HAS_WIN32_SURFACE | |
61 | -# include <cairo-win32.h> | |
62 | - /* avoid namespace collisions */ | |
63 | -# define Rectangle RectangleWin32 | |
64 | -# endif | |
35 | +#ifdef CAIRO_HAS_PNG_SURFACE_FEATURE | |
36 | +#include <cairo-png.h> | |
37 | +#endif | |
38 | +#ifdef CAIRO_HAS_PS_SURFACE | |
39 | +#include <cairo-ps.h> | |
40 | +#endif | |
41 | +#ifdef CAIRO_HAS_PDF_SURFACE | |
42 | +#include <cairo-pdf.h> | |
43 | +#endif | |
44 | +#ifdef CAIRO_HAS_SVG_SURFACE | |
45 | +#include <cairo-svg.h> | |
46 | +#endif | |
47 | +#ifdef CAIRO_HAS_WIN32_SURFACE | |
48 | +#include <cairo-win32.h> | |
49 | +/* avoid namespace collisions */ | |
50 | +#define Rectangle RectangleWin32 | |
51 | +#endif | |
52 | +#ifdef CAIRO_HAS_SCRIPT_SURFACE | |
53 | +#include <cairo-script.h> | |
65 | 54 | #endif |
66 | 55 | |
67 | 56 | #ifdef HAVE_PANGOCAIRO_H |