From: Ben Pfaff Date: Wed, 10 Feb 2010 04:55:00 +0000 (-0800) Subject: output: Support --without-cairo. X-Git-Tag: v0.7.4~10 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d6ecde013d55ee2ea64d5f0e770d6d6325b44a88;p=pspp-builds.git output: Support --without-cairo. This was supposed to be supported all along, but I forgot to test it before I did a commit. Reported by Michel Boaventura . --- diff --git a/src/output/ascii.c b/src/output/ascii.c index c5f30816..730a8244 100644 --- a/src/output/ascii.c +++ b/src/output/ascii.c @@ -487,6 +487,7 @@ 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_chart_item (output_item) && a->chart_file_name != NULL) { struct chart_item *chart_item = to_chart_item (output_item); @@ -506,6 +507,7 @@ 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); diff --git a/src/output/cairo.h b/src/output/cairo.h index 80b2b87e..bcbe8e09 100644 --- a/src/output/cairo.h +++ b/src/output/cairo.h @@ -1,5 +1,5 @@ /* PSPP - a program for statistical analysis. - Copyright (C) 2009 Free Software Foundation, Inc. + Copyright (C) 2009, 2010 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,6 +17,8 @@ #ifndef OUTPUT_CAIRO_H #define OUTPUT_CAIRO_H 1 +#ifdef HAVE_CAIRO + #include struct chart_item; @@ -36,4 +38,6 @@ void xr_draw_chart (const struct chart_item *, cairo_t *, char *xr_draw_png_chart (const struct chart_item *, const char *file_name_template, int number); +#endif /* HAVE_CAIRO */ + #endif /* output/cairo.h */ diff --git a/src/output/html.c b/src/output/html.c index 4a436cf5..989752b6 100644 --- a/src/output/html.c +++ b/src/output/html.c @@ -243,6 +243,7 @@ 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_chart_item (output_item) && html->chart_file_name != NULL) { struct chart_item *chart_item = to_chart_item (output_item); @@ -256,6 +257,7 @@ 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); diff --git a/tests/output/render-test.c b/tests/output/render-test.c index 729db850..54878d80 100644 --- a/tests/output/render-test.c +++ b/tests/output/render-test.c @@ -101,6 +101,7 @@ configure_drivers (int width, int length) exit (EXIT_FAILURE); output_driver_register (driver); +#ifdef HAVE_CAIRO /* Render to render.pdf. */ string_map_insert (&options, "output-file", "render.pdf"); string_map_insert (&options, "headers", "off"); @@ -114,6 +115,7 @@ configure_drivers (int width, int length) if (driver == NULL) exit (EXIT_FAILURE); output_driver_register (driver); +#endif string_map_destroy (&options); }