Make the Cairo and Pango libraries required rather than optional.
authorBen Pfaff <blp@cs.stanford.edu>
Sat, 9 Jan 2021 03:48:00 +0000 (19:48 -0800)
committerBen Pfaff <blp@cs.stanford.edu>
Sat, 9 Jan 2021 03:48:00 +0000 (19:48 -0800)
This eliminates a lot of difficult-to-maintain conditional compilation.
It also fixes the broken build of the manual when Cairo was not available.

20 files changed:
INSTALL
NEWS
configure.ac
doc/invoking.texi
src/output/ascii.c
src/output/automake.mk
src/output/cairo-fsm.h
src/output/cairo-pager.h
src/output/driver.c
src/output/html.c
src/output/image-item.c
src/output/image-item.h
src/output/spv-driver.c
src/output/spv/spv-writer.c
src/output/spv/spv-writer.h
src/output/spv/spv.c
src/output/spv/spv.h
src/output/tex.c
tests/output/pivot-table-test.c
utilities/pspp-output.c

diff --git a/INSTALL b/INSTALL
index 5984cc609937a6fc573b43aae6901c369eb19553..5fe74b442d57a38c901b2b63df5a2ed83ce5417b 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -68,21 +68,16 @@ The following packages are required to install PSPP:
       If you don't have a version already, you can install GNU
       libiconv (http://www.gnu.org/software/libiconv/).
 
+    * Cairo (http://cairographics.org/), version 1.12 or later.
+
+    * Pango (http://www.pango.org/), version 1.22 or later.
+
     * zlib (http://www.zlib.net/).
 
     * libxml2 (http://xmlsoft.org/).
 
     * gettext version 0.20 or later.
 
-The following packages are required to enable PSPP's graphing
-features.  If you cannot arrange to install them, you must run
-`configure' with --without-cairo (in which case you will get no graphing
-capability).
-
-    * Cairo (http://cairographics.org/), version 1.12 or later.
-
-    * Pango (http://www.pango.org/), version 1.22 or later.
-
 The following packages are required to enable PSPPIRE, the graphical
 user interface for PSPP.  If you cannot install them or do not wish to
 use the GUI, you must run `configure' with --without-gui.
@@ -264,17 +259,10 @@ suffix on their names by giving `configure' the  option
 Optional Features
 =================
 
-`--without-cairo'
-    Don't compile in support for charts (using Cairo and Pango).  This
-    is useful if your system lacks these libraries.
-
 `--without-gui'
     Don't build the PSPPIRE gui.  Use this option if you only want to
     build the command line version of PSPP.
 
-    Cairo and Pango required to build the GUI, so --without-cairo
-    implies --without-gui.
-
 `--without-lib{xx}'
     Optional libraries should normally be detected and the relevant
     functionality will be built they exist.  However, on some poorly
diff --git a/NEWS b/NEWS
index 5ddd5bf3f566b64dcb5d43bf7bbdbb448dd39517..55ab109d61be25098bb14a053eef7c0bf0a14e6f 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -21,7 +21,11 @@ Changes from 1.4.1 to 1.5.2:
  * The user manual, in its Info and HTML versions, now includes
    graphical output examples and screenshots.
 
- * gettext 0.20 or later is required for building.
+ * Build changes:
+
+   - The Cairo and Pango libraries are now required.
+
+   - gettext 0.20 or later is now required.
 
  * Output improvements:
 
index dfa5625c7ce1448eadc5e9724c9a587ccbf2d47c..76e5cf01e7a81cb11f531763a18a1bda16f3b320 100644 (file)
@@ -94,20 +94,9 @@ AC_ARG_VAR([PSPP_LDFLAGS], [linker flags to be used for linking the pspp binary
 AC_ARG_VAR([PSPPIRE_LDFLAGS], [linker flags to be used for linking the psppire binary only])
 
 # Support for Cairo and Pango.
-AC_ARG_WITH([cairo],
-  [AS_HELP_STRING(
-    [--without-cairo],
-    [Don't build support for charts (using Cairo and Pango);
-     implies --without-gui])],
-  [], [with_cairo=yes])
-AM_CONDITIONAL([HAVE_CAIRO], [test "$with_cairo" != no])
-if test "$with_cairo" != no; then
-  PKG_CHECK_MODULES([CAIRO], [cairo >= 1.5 pango >= 1.22 pangocairo],
-    [CPPFLAGS="$CPPFLAGS $CAIRO_CFLAGS"
-     AC_DEFINE([HAVE_CAIRO], 1,
-       [Define to 1 if Cairo and Pango are available.])],
-    [PSPP_REQUIRED_PREREQ([cairo 1.5 or later and pango 1.22 or later (or use --without-cairo)])])
-fi
+PKG_CHECK_MODULES([CAIRO], [cairo >= 1.5 pango >= 1.22 pangocairo],
+  [CPPFLAGS="$CPPFLAGS $CAIRO_CFLAGS"],
+  [PSPP_REQUIRED_PREREQ([cairo 1.5 or later and pango 1.22 or later])])
 
 dnl One of the tests uses xmllint.
 AC_CACHE_CHECK([for an xmllint program which fits our needs],[ac_cv_path_XMLLINT],
@@ -124,9 +113,8 @@ AC_ARG_WITH([gui],
   [AS_HELP_STRING([--without-gui],
                   [Don't build the PSPPIRE GUI (using GTK+)])],
   [], [with_gui=yes])
-AM_CONDITIONAL([building_gui],
-               [test "$with_cairo" != no && test "$with_gui" != "no"])
-if test "$with_cairo" != no && test "$with_gui" != "no"; then
+AM_CONDITIONAL([building_gui], [test "$with_gui" != "no"])
+if test "$with_gui" != "no"; then
   PKG_CHECK_MODULES([GTHREAD], [gthread-2.0], [],
     [PSPP_REQUIRED_PREREQ([gthread 2.0 (or use --without-gui)])])
 
index cd3fc1bf364cd6aad1761b1819b677b20b6c3b18..3044efd48b113182802ef15c3dc882b47d86b415 100644 (file)
@@ -233,8 +233,7 @@ by @command{make check} and similar scripts.
 To produce output in PDF, PostScript, SVG, or PNG format, specify
 @option{-o @var{file}} on the @pspp{} command line, optionally
 followed by any of the options shown in the table below to customize
-the output format.  These output formats are only available if your
-installation of @pspp{} was compiled with the Cairo library.
+the output format.
 
 PDF, PostScript, and SVG use real units: each dimension among the
 options listed below may have a suffix @samp{mm} for millimeters,
@@ -343,9 +342,7 @@ chart is output, the @samp{#} is replaced by the chart number.  The
 default is the file name specified on @option{-o} with the extension
 stripped off and replaced by @file{-#.png}.
 
-Specify @code{none} to disable chart output.  Charts are always
-disabled if your installation of @pspp{} was compiled without the
-Cairo library.
+Specify @code{none} to disable chart output.
 
 @item @option{-O foreground-color=@var{color}}
 @itemx @option{-O background-color=@var{color}}
index b5c9c004b9eb2460b4fb6666ed256a0ee26f12f3..9649236cc855dce05d0d6e7c597b392eeeb0bef4 100644 (file)
@@ -47,9 +47,7 @@
 #include "libpspp/u8-line.h"
 #include "libpspp/version.h"
 #include "output/ascii.h"
-#ifdef HAVE_CAIRO
 #include "output/cairo-chart.h"
-#endif
 #include "output/chart-item-provider.h"
 #include "output/driver-provider.h"
 #include "output/image-item.h"
@@ -296,11 +294,9 @@ struct ascii_driver
     bool emphasis;              /* Enable bold and underline in output? */
     char *chart_file_name;      /* Name of files used for charts. */
 
-#ifdef HAVE_CAIRO
     /* Colours for charts */
     struct cell_color fg;
     struct cell_color bg;
-#endif
 
     /* How the page width is determined: */
     enum {
@@ -399,10 +395,8 @@ ascii_create (struct  file_handle *fh, enum settings_output_devices device_type,
                    : VIEW_WIDTH);
   a->min_hbreak = parse_int (opt (d, o, "min-hbreak", "-1"), -1, INT_MAX);
 
-#ifdef HAVE_CAIRO
   a->bg = parse_color (opt (d, o, "background-color", "#FFFFFFFFFFFF"));
   a->fg = parse_color (opt (d, o, "foreground-color", "#000000000000"));
-#endif
 
   const char *default_box = (terminal && (!strcmp (locale_charset (), "UTF-8")
                                           || term_is_utf8_xterm ())
@@ -603,7 +597,6 @@ ascii_submit (struct output_driver *driver,
 
   if (is_table_item (output_item))
     ascii_output_table_item (a, to_table_item (output_item));
-#ifdef HAVE_CAIRO
   else if (is_image_item (output_item) && a->chart_file_name != NULL)
     {
       struct image_item *image_item = to_image_item (output_item);
@@ -646,7 +639,6 @@ ascii_submit (struct output_driver *driver,
           free (file_name);
         }
     }
-#endif  /* HAVE_CAIRO */
   else if (is_text_item (output_item))
     {
       const struct text_item *text_item = to_text_item (output_item);
index 3e0b8f46f312fac895c9f2f3ccad41328dc076d6..005fb59d7ec9d9b606f692cfae53b34279ffed90 100644 (file)
@@ -23,42 +23,52 @@ src_output_liboutput_la_CPPFLAGS = $(LIBXML2_CFLAGS) $(AM_CPPFLAGS)
 src_output_liboutput_la_SOURCES = \
        src/output/ascii.c \
        src/output/ascii.h \
+       src/output/cairo-chart.c \
+       src/output/cairo-chart.h \
+       src/output/cairo-fsm.c \
+       src/output/cairo-fsm.h \
+       src/output/cairo-pager.c \
+       src/output/cairo-pager.h \
+       src/output/cairo.c \
        src/output/chart-item-provider.h \
        src/output/chart-item.c \
        src/output/chart-item.h \
+       src/output/charts/barchart-cairo.c \
+       src/output/charts/barchart.c \
+       src/output/charts/barchart.h \
+       src/output/charts/boxplot-cairo.c \
        src/output/charts/boxplot.c \
        src/output/charts/boxplot.h \
+       src/output/charts/np-plot-cairo.c \
        src/output/charts/np-plot.c \
        src/output/charts/np-plot.h \
-       src/output/charts/barchart.c \
-       src/output/charts/barchart.h \
+       src/output/charts/piechart-cairo.c \
        src/output/charts/piechart.c \
        src/output/charts/piechart.h \
+       src/output/charts/plot-hist-cairo.c \
        src/output/charts/plot-hist.c \
        src/output/charts/plot-hist.h \
+       src/output/charts/roc-chart-cairo.c \
        src/output/charts/roc-chart.c \
        src/output/charts/roc-chart.h \
-       src/output/charts/spreadlevel-plot.c \
-       src/output/charts/spreadlevel-plot.h \
-       src/output/charts/scree.c \
-       src/output/charts/scree.h \
+       src/output/charts/scatterplot-cairo.c \
        src/output/charts/scatterplot.c \
        src/output/charts/scatterplot.h \
+       src/output/charts/scree-cairo.c \
+       src/output/charts/scree.c \
+       src/output/charts/scree.h \
+       src/output/charts/spreadlevel-cairo.c \
+       src/output/charts/spreadlevel-plot.c \
+       src/output/charts/spreadlevel-plot.h \
        src/output/csv.c \
        src/output/driver-provider.h \
        src/output/driver.c \
        src/output/driver.h \
-       src/output/image-item.c \
-       src/output/image-item.h \
-       src/output/tex-glyphs.c \
-       src/output/tex-glyphs.h \
-       src/output/tex-parsing.c \
-       src/output/tex-parsing.h \
-       src/output/tex-rendering.c \
-       src/output/tex-rendering.h \
        src/output/group-item.c \
        src/output/group-item.h \
        src/output/html.c \
+       src/output/image-item.c \
+       src/output/image-item.h \
        src/output/journal.c \
        src/output/journal.h \
        src/output/measure.c \
@@ -89,28 +99,15 @@ src_output_liboutput_la_SOURCES = \
        src/output/table-provider.h \
        src/output/table.c \
        src/output/table.h \
+       src/output/tex-glyphs.c \
+       src/output/tex-glyphs.h \
+       src/output/tex-parsing.c \
+       src/output/tex-parsing.h \
+       src/output/tex-rendering.c \
+       src/output/tex-rendering.h \
        src/output/tex.c \
        src/output/text-item.c \
        src/output/text-item.h
-if HAVE_CAIRO
-src_output_liboutput_la_SOURCES += \
-       src/output/cairo-chart.c \
-       src/output/cairo-chart.h \
-       src/output/cairo-fsm.c \
-       src/output/cairo-fsm.h \
-       src/output/cairo-pager.c \
-       src/output/cairo-pager.h \
-       src/output/cairo.c \
-       src/output/charts/boxplot-cairo.c \
-       src/output/charts/np-plot-cairo.c \
-       src/output/charts/barchart-cairo.c \
-       src/output/charts/piechart-cairo.c \
-       src/output/charts/plot-hist-cairo.c \
-       src/output/charts/roc-chart-cairo.c \
-       src/output/charts/scree-cairo.c \
-       src/output/charts/spreadlevel-cairo.c \
-       src/output/charts/scatterplot-cairo.c
-endif
 nodist_src_output_liboutput_la_SOURCES =
 
 EXTRA_DIST += \
index e8fe5b7b3cf33940c00273deffb519c3c2a54062..e5a22362a10660f640341c142aa9e164f467f37c 100644 (file)
@@ -19,8 +19,6 @@
 
 #include <stdbool.h>
 
-#ifdef HAVE_CAIRO
-
 #include <cairo/cairo.h>
 #include <pango/pango-font.h>
 #include "output/table.h"
@@ -74,6 +72,4 @@ void xr_fsm_destroy (struct xr_fsm *);
 int xr_fsm_draw_slice (struct xr_fsm *, cairo_t *, int space);
 bool xr_fsm_is_empty (const struct xr_fsm *);
 
-#endif  /* HAVE_CAIRO */
-
 #endif /* output/cairo-fsm.h */
index 361c29798b549e4f5caf847eb0a2aa8a085bfd88..d492ba6933dfbbf98bbc865a656d4e4171a0c550 100644 (file)
@@ -19,8 +19,6 @@
 
 #include <stdbool.h>
 
-#ifdef HAVE_CAIRO
-
 /* Cairo output driver paginater. */
 
 #include <cairo/cairo.h>
@@ -69,6 +67,4 @@ void xr_pager_add_page (struct xr_pager *, cairo_t *);
 void xr_pager_finish_page (struct xr_pager *);
 bool xr_pager_needs_new_page (struct xr_pager *);
 
-#endif  /* HAVE_CAIRO */
-
 #endif /* output/cairo-pager.h */
index be60cb2746f4d0dc96b3ae6ee9ea5fc8e4c162e9..55eac27d186d49c23a6ca3c154db9a740b51f105 100644 (file)
@@ -418,19 +418,17 @@ output_driver_is_registered (const struct output_driver *driver)
   return output_driver_get_engine (driver) != NULL;
 }
 \f
-extern const struct output_driver_factory txt_driver_factory;
-extern const struct output_driver_factory list_driver_factory;
-extern const struct output_driver_factory html_driver_factory;
 extern const struct output_driver_factory csv_driver_factory;
+extern const struct output_driver_factory html_driver_factory;
+extern const struct output_driver_factory list_driver_factory;
 extern const struct output_driver_factory odt_driver_factory;
-extern const struct output_driver_factory spv_driver_factory;
-#ifdef HAVE_CAIRO
 extern const struct output_driver_factory pdf_driver_factory;
+extern const struct output_driver_factory png_driver_factory;
 extern const struct output_driver_factory ps_driver_factory;
+extern const struct output_driver_factory spv_driver_factory;
 extern const struct output_driver_factory svg_driver_factory;
-extern const struct output_driver_factory png_driver_factory;
-#endif
 extern const struct output_driver_factory tex_driver_factory;
+extern const struct output_driver_factory txt_driver_factory;
 
 static const struct output_driver_factory *factories[] =
   {
@@ -440,12 +438,10 @@ static const struct output_driver_factory *factories[] =
     &csv_driver_factory,
     &odt_driver_factory,
     &spv_driver_factory,
-#ifdef HAVE_CAIRO
     &pdf_driver_factory,
     &ps_driver_factory,
     &svg_driver_factory,
     &png_driver_factory,
-#endif
     &tex_driver_factory,
     NULL
   };
index e865642a6e518d9bb47e3afb00f8f1600631c90e..f14386335efe63deaa16a69e17f2da76467ce07d 100644 (file)
@@ -33,9 +33,7 @@
 #include "libpspp/i18n.h"
 #include "libpspp/message.h"
 #include "libpspp/version.h"
-#ifdef HAVE_CAIRO
 #include "output/cairo-chart.h"
-#endif
 #include "output/chart-item.h"
 #include "output/driver-provider.h"
 #include "output/image-item.h"
 struct html_driver
   {
     struct output_driver driver;
-#ifdef HAVE_CAIRO
     struct cell_color fg;
     struct cell_color bg;
-#endif
     struct file_handle *handle;
     char *chart_file_name;
 
@@ -202,10 +198,8 @@ html_create (struct file_handle *fh, enum settings_output_devices device_type,
                                                       fh_get_file_name (fh)));
   html->file = NULL;
   html->chart_cnt = 1;
-#ifdef HAVE_CAIRO
   html->bg = parse_color (opt (d, o, "background-color", "#FFFFFFFFFFFF"));
   html->fg = parse_color (opt (d, o, "foreground-color", "#000000000000"));
-#endif
   html->file = fn_open (html->handle, "w");
   if (html->file == NULL)
     {
@@ -266,7 +260,6 @@ html_submit (struct output_driver *driver,
       struct table_item *table_item = to_table_item (output_item);
       html_output_table (html, table_item);
     }
-#ifdef HAVE_CAIRO
   else if (is_image_item (output_item) && html->chart_file_name != NULL)
     {
       struct image_item *image_item = to_image_item (output_item);
@@ -296,7 +289,6 @@ html_submit (struct output_driver *driver,
           free (file_name);
         }
     }
-#endif  /* HAVE_CAIRO */
   else if (is_text_item (output_item))
     {
       struct text_item *text_item = to_text_item (output_item);
index 62efe7b5c32fbfc421aae5c425c31ea78905d178..371578ba222ecb00faef561e5eba46f20ec561db 100644 (file)
@@ -29,7 +29,6 @@
 #include "gl/xalloc.h"
 #include "gl/xvasprintf.h"
 
-#ifdef HAVE_CAIRO
 /* Creates and returns a new image item containing IMAGE.  Takes ownership of
    IMAGE. */
 struct image_item *
@@ -42,7 +41,6 @@ image_item_create (cairo_surface_t *image)
   };
   return item;
 }
-#endif
 
 /* Submits ITEM to the configured output drivers, and transfers ownership to
    the output subsystem. */
@@ -63,9 +61,7 @@ image_item_unshare (struct image_item *old)
   struct image_item *new = xmalloc (sizeof *new);
   *new = (struct image_item) {
     .output_item = OUTPUT_ITEM_CLONE_INITIALIZER (&old->output_item),
-#ifdef HAVE_CAIRO
     .image = cairo_surface_reference (old->image),
-#endif
   };
   return new;
 }
@@ -80,9 +76,7 @@ static void
 image_item_destroy (struct output_item *output_item)
 {
   struct image_item *item = to_image_item (output_item);
-#ifdef HAVE_CAIRO
   cairo_surface_destroy (item->image);
-#endif
   free (item);
 }
 
index 91d7c2e131f26cc554d05c2a0e24e5ae194ab8ae..4cb3614ba479206e671c34f21f66dd94f5b74712 100644 (file)
 #ifndef OUTPUT_IMAGE_ITEM_H
 #define OUTPUT_IMAGE_ITEM_H 1
 
-#ifdef HAVE_CAIRO
 #include <cairo.h>
-#endif
 #include <stdbool.h>
 #include "output/output-item.h"
 
 struct image_item
   {
     struct output_item output_item; /* Superclass */
-#ifdef HAVE_CAIRO
     cairo_surface_t *image;
-#endif
   };
 
-#ifdef HAVE_CAIRO
 struct image_item *image_item_create (cairo_surface_t *);
-#endif
-
 struct image_item *image_item_unshare (struct image_item *);
 \f
 /* This boilerplate for image_item, a subclass of output_item, was
index 0fb0928372debcdb4cdd8f1e1e1dc6689d8ebf28..a0cb023f3431a997551409a07647703cc95f40ec 100644 (file)
 
 #include "data/file-handle-def.h"
 #include "libpspp/cast.h"
-#ifdef HAVE_CAIRO
 #include "output/cairo-chart.h"
-#endif
 #include "output/chart-item.h"
 #include "output/group-item.h"
+#include "output/image-item.h"
 #include "output/page-eject-item.h"
 #include "output/page-setup-item.h"
 #include "output/table-item.h"
@@ -111,7 +110,6 @@ spv_submit (struct output_driver *driver,
       if (table_item->pt)
         spv_writer_put_table (spv->writer, table_item->pt);
     }
-#ifdef HAVE_CAIRO
   else if (is_chart_item (output_item))
     {
       cairo_surface_t *surface = xr_draw_image_chart (
@@ -122,7 +120,8 @@ spv_submit (struct output_driver *driver,
         spv_writer_put_image (spv->writer, surface);
       cairo_surface_destroy (surface);
     }
-#endif
+  else if (is_image_item (output_item))
+    spv_writer_put_image (spv->writer, to_image_item (output_item)->image);
   else if (is_text_item (output_item))
     {
       char *command_id = output_get_command_name ();
index c5a600571a8e869a4ceb5d6700c43e4a1fd0a7ce..c8cb28e3750bb12b45556f67d21b37b2e3a20609 100644 (file)
@@ -323,7 +323,6 @@ spv_writer_put_text (struct spv_writer *w, const struct text_item *text,
     spv_writer_close_file (w, "");
 }
 
-#ifdef HAVE_CAIRO
 static cairo_status_t
 write_to_zip (void *zw_, const unsigned char *data, unsigned int length)
 {
@@ -363,7 +362,6 @@ spv_writer_put_image (struct spv_writer *w, cairo_surface_t *image)
 
   free (uri);
 }
-#endif
 
 void
 spv_writer_eject_page (struct spv_writer *w)
index 4126a8606db273dc200277af3f870a1a305dc290..cc937216cb0189c47b15893a1255e8a9906c8ccb 100644 (file)
@@ -22,9 +22,7 @@ struct pivot_table;
 struct spv_writer;
 struct text_item;
 
-#ifdef HAVE_CAIRO
 #include <cairo.h>
-#endif
 
 #include "libpspp/compiler.h"
 
@@ -43,9 +41,7 @@ void spv_writer_put_text (struct spv_writer *, const struct text_item *,
                           const char *command_id);
 void spv_writer_put_table (struct spv_writer *, const struct pivot_table *);
 
-#ifdef HAVE_CAIRO
 void spv_writer_put_image (struct spv_writer *, cairo_surface_t *);
-#endif
 
 void spv_writer_eject_page (struct spv_writer *);
 
index 574f068f54077a6c69b0e46053e96bea7290fb02..c355a625dcebea6f9bafc41a205676724f8daff9 100644 (file)
@@ -201,7 +201,6 @@ spv_item_is_image (const struct spv_item *item)
   return item->type == SPV_ITEM_IMAGE;
 }
 
-#ifdef HAVE_CAIRO
 static cairo_status_t
 read_from_zip_member (void *zm_, unsigned char *data, unsigned int length)
 {
@@ -240,7 +239,6 @@ spv_item_get_image (const struct spv_item *item_)
 
   return item->image;
 }
-#endif
 
 struct spv_item *
 spv_item_next (const struct spv_item *item)
@@ -315,10 +313,8 @@ spv_item_destroy (struct spv_item *item)
       pivot_value_destroy (item->text);
 
       free (item->png_member);
-#ifdef HAVE_CAIRO
       if (item->image)
         cairo_surface_destroy (item->image);
-#endif
 
       free (item);
     }
@@ -623,10 +619,8 @@ spv_item_load (const struct spv_item *item)
 {
   if (spv_item_is_table (item))
     spv_item_get_table (item);
-#ifdef HAVE_CAIRO
   else if (spv_item_is_image (item))
     spv_item_get_image (item);
-#endif
 }
 
 bool
index fdcd9f9f8daf804d172e9a14e1d4ad33f6aa7905..eda7704dd70e746b257175df905dcdd67cafe59f 100644 (file)
    top-level headings as a child item.
  */
 
+#include <cairo.h>
 #include <stdbool.h>
 #include <stddef.h>
 #include <stdint.h>
 
-#ifdef HAVE_CAIRO
-#include <cairo.h>
-#endif
-
 #include "libpspp/compiler.h"
 
 struct fmt_spec;
@@ -145,9 +142,7 @@ struct spv_item
 
     /* SPV_ITEM_IMAGE only. */
     char *png_member;
-#ifdef HAVE_CAIRO
     cairo_surface_t *image;
-#endif
   };
 
 void spv_item_format_path (const struct spv_item *, struct string *);
@@ -170,9 +165,7 @@ bool spv_item_is_text (const struct spv_item *);
 const struct pivot_value *spv_item_get_text (const struct spv_item *);
 
 bool spv_item_is_image (const struct spv_item *);
-#ifdef HAVE_CAIRO
 cairo_surface_t *spv_item_get_image (const struct spv_item *);
-#endif
 
 bool spv_item_is_visible (const struct spv_item *);
 
index 7c4247f1a188eeb3d531d17eb8c7c79b688ad465..2d29c2aa85629affce079eb58cf146e347af703b 100644 (file)
@@ -36,9 +36,7 @@
 #include "libpspp/message.h"
 #include "libpspp/temp-file.h"
 #include "libpspp/version.h"
-#ifdef HAVE_CAIRO
 #include "output/cairo-chart.h"
-#endif
 #include "output/chart-item.h"
 #include "output/driver-provider.h"
 #include "output/image-item.h"
@@ -76,10 +74,8 @@ struct tex_driver
     /* A hash table containing any Tex macros which need to be emitted.  */
     struct hmap macros;
     bool require_graphics;
-#ifdef HAVE_CAIRO
     struct cell_color fg;
     struct cell_color bg;
-#endif
     struct file_handle *handle;
     char *chart_file_name;
 
@@ -141,10 +137,8 @@ tex_create (struct file_handle *fh, enum settings_output_devices device_type,
   tex->chart_file_name = parse_chart_file_name (opt (d, o, "charts",
                                                       fh_get_file_name (fh)));
   tex->chart_cnt = 1;
-#ifdef HAVE_CAIRO
   tex->bg = parse_color (opt (d, o, "background-color", "#FFFFFFFFFFFF"));
   tex->fg = parse_color (opt (d, o, "foreground-color", "#000000000000"));
-#endif
 
   tex->file = fn_open (tex->handle, "w");
   if (tex->file == NULL)
@@ -324,7 +318,6 @@ tex_submit (struct output_driver *driver,
       struct table_item *table_item = to_table_item (output_item);
       tex_output_table (tex, table_item);
     }
-#ifdef HAVE_CAIRO
   else if (is_image_item (output_item) && tex->chart_file_name != NULL)
     {
       struct image_item *image_item = to_image_item (output_item);
@@ -354,7 +347,6 @@ tex_submit (struct output_driver *driver,
           free (file_name);
         }
     }
-#endif  /* HAVE_CAIRO */
   else if (is_text_item (output_item))
     {
       struct text_item *text_item = to_text_item (output_item);
index 60053e9ba8a6234850543e52daf14e2c54e23082..04f3eb2401d4cdb9a30ead0a3971cf31c7f654a0 100644 (file)
@@ -129,7 +129,6 @@ configure_drivers (int width, int length UNUSED, int min_break)
   register_driver (&options, "-");
 
 
-#ifdef HAVE_CAIRO
   /* Render to <base>.pdf. */
   string_map_insert (&options, "top-margin", "0");
   string_map_insert (&options, "bottom-margin", "0");
@@ -138,7 +137,6 @@ configure_drivers (int width, int length UNUSED, int min_break)
   string_map_insert (&options, "paper-size", "99x99in");
   string_map_insert (&options, "trim", "true");
   register_driver (&options, "%s.pdf", output_base);
-#endif
 
   string_map_insert (&options, "box", "unicode");
   register_driver (&options, "%s.txt", output_base);
index 56a46f001d876c835936ecc172041730b3006197..ed45a4d148fc9a6ffc0e02457b3cef8a53cfb241 100644 (file)
@@ -16,9 +16,7 @@
 
 #include <config.h>
 
-#ifdef HAVE_CAIRO
 #include <cairo.h>
-#endif
 #include <getopt.h>
 #include <limits.h>
 #include <stdlib.h>
@@ -126,10 +124,8 @@ dump_item (const struct spv_item *item)
       break;
 
     case SPV_ITEM_IMAGE:
-#ifdef HAVE_CAIRO
       image_item_submit (image_item_create (cairo_surface_reference (
                                               spv_item_get_image (item))));
-#endif
       break;
 
     case SPV_ITEM_TREE: