summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2009-09-08 17:51:33 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2009-09-08 17:51:33 +0100
commit9389cb78a8ea5b6579d091ab1030ab9f1b13efc2 (patch)
treeb5213d8be51e80d1c372336860483734a53cac90
parent45759e5a0fb20a632f66a8dd206833b55a95f840 (diff)
[build] Improve handling of missing test apparatus
Improve detection, reporting and disabling of test backends when we lack the required libraries and utilities.
-rw-r--r--boilerplate/Makefile.win32.features7
-rw-r--r--boilerplate/cairo-boilerplate-pdf.c2
-rw-r--r--boilerplate/cairo-boilerplate-ps.c2
-rw-r--r--boilerplate/cairo-boilerplate-svg.c2
-rw-r--r--build/Makefile.win32.features1
-rw-r--r--build/Makefile.win32.features-h3
-rw-r--r--build/configure.ac.features3
-rw-r--r--configure.ac20
-rw-r--r--perf/cairo-perf-compare-backends.c2
-rw-r--r--src/Makefile.win32.features7
-rw-r--r--test/Makefile.am2
-rw-r--r--test/any2ppm.c8
-rw-r--r--util/Makefile.am4
13 files changed, 52 insertions, 11 deletions
diff --git a/boilerplate/Makefile.win32.features b/boilerplate/Makefile.win32.features
index 498d0beb..ee45b084 100644
--- a/boilerplate/Makefile.win32.features
+++ b/boilerplate/Makefile.win32.features
@@ -354,3 +354,10 @@ ifeq ($(CAIRO_HAS_TRACE),1)
enabled_cairo_boilerplate_private += $(cairo_boilerplate_trace_private) $(cairo_boilerplate_trace_headers)
enabled_cairo_boilerplate_sources += $(cairo_boilerplate_trace_sources)
endif
+
+all_cairo_boilerplate_private += $(cairo_boilerplate_interpreter_private) $(cairo_boilerplate_interpreter_headers)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_interpreter_sources)
+ifeq ($(CAIRO_HAS_INTERPRETER),1)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_interpreter_private) $(cairo_boilerplate_interpreter_headers)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_interpreter_sources)
+endif
diff --git a/boilerplate/cairo-boilerplate-pdf.c b/boilerplate/cairo-boilerplate-pdf.c
index 591e16fd..191eb1b5 100644
--- a/boilerplate/cairo-boilerplate-pdf.c
+++ b/boilerplate/cairo-boilerplate-pdf.c
@@ -225,6 +225,7 @@ _cairo_boilerplate_pdf_force_fallbacks (cairo_surface_t *abstract_surface,
}
static const cairo_boilerplate_target_t targets[] = {
+#if CAIRO_CAN_TEST_PDF_SURFACE
{
"pdf", "pdf", ".pdf", NULL,
CAIRO_SURFACE_TYPE_PDF,
@@ -250,5 +251,6 @@ static const cairo_boilerplate_target_t targets[] = {
_cairo_boilerplate_pdf_cleanup,
NULL, TRUE, TRUE
},
+#endif
};
CAIRO_BOILERPLATE (pdf, targets)
diff --git a/boilerplate/cairo-boilerplate-ps.c b/boilerplate/cairo-boilerplate-ps.c
index 53fecd6d..899a321b 100644
--- a/boilerplate/cairo-boilerplate-ps.c
+++ b/boilerplate/cairo-boilerplate-ps.c
@@ -290,6 +290,7 @@ _cairo_boilerplate_ps_force_fallbacks (cairo_surface_t *abstract_surface,
}
static const cairo_boilerplate_target_t targets[] = {
+#if CAIRO_CAN_TEST_PS_SURFACE
{
"ps2", "ps", ".ps", NULL,
CAIRO_SURFACE_TYPE_PS,
@@ -340,5 +341,6 @@ static const cairo_boilerplate_target_t targets[] = {
_cairo_boilerplate_ps_cleanup,
NULL, TRUE, TRUE
},
+#endif
};
CAIRO_BOILERPLATE (ps, targets)
diff --git a/boilerplate/cairo-boilerplate-svg.c b/boilerplate/cairo-boilerplate-svg.c
index a8a4d8b9..316e33d3 100644
--- a/boilerplate/cairo-boilerplate-svg.c
+++ b/boilerplate/cairo-boilerplate-svg.c
@@ -266,6 +266,7 @@ _cairo_boilerplate_svg_force_fallbacks (cairo_surface_t *abstract_surface,
}
static const cairo_boilerplate_target_t targets[] = {
+#if CAIRO_CAN_TEST_SVG_SURFACE
/* It seems we should be able to round-trip SVG content perfectly
* through librsvg and cairo, but for some mysterious reason, some
* systems get an error of 1 for some pixels on some of the text
@@ -319,5 +320,6 @@ static const cairo_boilerplate_target_t targets[] = {
_cairo_boilerplate_svg_cleanup,
NULL, TRUE, TRUE
},
+#endif
};
CAIRO_BOILERPLATE (svg, targets)
diff --git a/build/Makefile.win32.features b/build/Makefile.win32.features
index eb10b236..af88c951 100644
--- a/build/Makefile.win32.features
+++ b/build/Makefile.win32.features
@@ -31,3 +31,4 @@ CAIRO_HAS_SVG_SURFACE=1
CAIRO_HAS_TEST_SURFACES=0
CAIRO_HAS_XML_SURFACE=1
CAIRO_HAS_TRACE=1
+CAIRO_HAS_INTERPRETER=1
diff --git a/build/Makefile.win32.features-h b/build/Makefile.win32.features-h
index 552a2d0a..1807aee9 100644
--- a/build/Makefile.win32.features-h
+++ b/build/Makefile.win32.features-h
@@ -102,4 +102,7 @@ endif
ifeq ($(CAIRO_HAS_TRACE),1)
@echo "#define CAIRO_HAS_TRACE 1" >> src/cairo-features.h
endif
+ifeq ($(CAIRO_HAS_INTERPRETER),1)
+ @echo "#define CAIRO_HAS_INTERPRETER 1" >> src/cairo-features.h
+endif
@echo "#endif" >> src/cairo-features.h
diff --git a/build/configure.ac.features b/build/configure.ac.features
index 2606850b..afa576a4 100644
--- a/build/configure.ac.features
+++ b/build/configure.ac.features
@@ -394,7 +394,8 @@ AC_DEFUN([CAIRO_REPORT],
echo " Eagle functions: $use_eagle"
echo ""
echo "The following features and utilies:"
- echo " cairo-trace: $use_trace"
+ echo " cairo-trace: $use_trace"
+ echo " cairo-script-interpreter: $use_interpreter"
echo ""
echo "And the following internal features:"
echo " gtk-doc: $enable_gtk_doc"
diff --git a/configure.ac b/configure.ac
index c4b38d89..985ea717 100644
--- a/configure.ac
+++ b/configure.ac
@@ -504,7 +504,7 @@ if test "x$use_ps" = "xyes"; then
libspectre_DEPENDENCY="libspectre >= $SPECTRE_VERSION_REQUIRED"
PKG_CHECK_MODULES(LIBSPECTRE, $libspectre_DEPENDENCY,
[any2ppm_ps=yes],
- [AC_MSG_RESULT(no)])
+ [test_ps="no (requires libspectre)"])
fi
AM_CONDITIONAL(CAIRO_CAN_TEST_PS_SURFACE, test "x$test_ps" = "xyes")
@@ -535,8 +535,8 @@ if test "x$use_pdf" = "xyes"; then
PKG_CHECK_MODULES(POPPLER, $poppler_DEPENDENCY,
[CAIRO_CHECK_FUNCS_WITH_FLAGS(poppler_page_render, [$POPPLER_CFLAGS], [$POPPLER_LIBS],
[test_pdf=yes; any2ppm_pdf=yes],
- [AC_MSG_RESULT(no); test_pdf="no (requires $poppler_DEPENDENCY)"])],
- [AC_MSG_RESULT(no); test_pdf="no (requires $poppler_DEPENDENCY)"])
+ [test_pdf="no (requires $poppler_DEPENDENCY)"])],
+ [test_pdf="no (requires $poppler_DEPENDENCY)"])
if test "x$test_pdf" = "xyes"; then
AC_DEFINE([CAIRO_CAN_TEST_PDF_SURFACE], 1, [Define to 1 if the PDF backend can be tested (need poppler and other dependencies for pdf2png)])
else
@@ -566,8 +566,8 @@ if test "x$use_svg" = "xyes"; then
PKG_CHECK_MODULES(LIBRSVG, $librsvg_DEPENDENCY gdk-2.0,
[CAIRO_CHECK_FUNCS_WITH_FLAGS(rsvg_pixbuf_from_file, [$LIBRSVG_CFLAGS], [$LIBRSVG_LIBS],
[test_svg=yes; any2ppm_svg=yes],
- [AC_MSG_RESULT(no); test_svg="no (requires $librsvg_DEPENDENCY)"])],
- [AC_MSG_RESULT(no); test_svg="no (requires $librsvg_DEPENDENCY)"])
+ [test_svg="no (requires $librsvg_DEPENDENCY)"])],
+ [test_svg="no (requires $librsvg_DEPENDENCY)"])
if test "x$test_svg" = "xyes"; then
AC_DEFINE([CAIRO_CAN_TEST_SVG_SURFACE], 1, [Define to 1 if the SVG backend can be tested])
else
@@ -645,12 +645,18 @@ case $host in
esac
CAIRO_ENABLE(trace, cairo-trace, yes, [
- if test "x$have_ld_preload" != "xyes" -o "x$have_libz" != "xyes"; then
+ if test "x$have_ld_preload" != "xyes" -o \
+ "x$have_libz" != "xyes" -o \
+ "x$have_dl" != "xyes"; then
use_trace="no (requires dynamic linker and zlib)"
fi
])
-AM_CONDITIONAL(BUILD_SCRIPT, test "x$have_libz" = "xyes")
+CAIRO_ENABLE(interpreter, cairo-script-interpreter, yes, [
+ if test "x$have_libz" != "xyes" "x$have_dl" != "xyes"; then
+ use_interpreter="no (requires zlib)"
+ fi
+])
AC_CHECK_LIB(bfd, bfd_openr,
[AC_CHECK_HEADER(bfd.h, [have_bfd=yes],
diff --git a/perf/cairo-perf-compare-backends.c b/perf/cairo-perf-compare-backends.c
index 1f737eb3..1448169b 100644
--- a/perf/cairo-perf-compare-backends.c
+++ b/perf/cairo-perf-compare-backends.c
@@ -263,7 +263,7 @@ cairo_perf_reports_compare (cairo_perf_report_t *reports,
diff = &diffs[i];
/* Discard as uninteresting a change which is less than the
- * minimum change required, (default may be overriden on
+ * minimum change required, (default may be overridden on
* command-line). */
if (fabs (diff->change) - 1.0 < options->min_change)
continue;
diff --git a/src/Makefile.win32.features b/src/Makefile.win32.features
index 51640960..b1c81c3c 100644
--- a/src/Makefile.win32.features
+++ b/src/Makefile.win32.features
@@ -472,3 +472,10 @@ ifeq ($(CAIRO_HAS_TRACE),1)
enabled_cairo_private += $(cairo_trace_private) $(cairo_trace_headers)
enabled_cairo_sources += $(cairo_trace_sources)
endif
+
+all_cairo_private += $(cairo_interpreter_private) $(cairo_interpreter_headers)
+all_cairo_sources += $(cairo_interpreter_sources)
+ifeq ($(CAIRO_HAS_INTERPRETER),1)
+enabled_cairo_private += $(cairo_interpreter_private) $(cairo_interpreter_headers)
+enabled_cairo_sources += $(cairo_interpreter_sources)
+endif
diff --git a/test/Makefile.am b/test/Makefile.am
index fafeb436..d6bcb277 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -54,6 +54,7 @@ test_sources += $(multi_page_surface_test_sources)
endif
# Include fallback-resolution (once!) if we have any of the vector surfaces
+if BUILD_ANY2PPM
if CAIRO_HAS_SVG_SURFACE
test = $(fallback_resolution_test_sources)
endif
@@ -63,6 +64,7 @@ endif
if CAIRO_HAS_PS_SURFACE
test = $(fallback_resolution_test_sources)
endif
+endif
test_sources += $(test)
TESTS += cairo-test-suite$(EXEEXT)
diff --git a/test/any2ppm.c b/test/any2ppm.c
index f35891fb..c93e457a 100644
--- a/test/any2ppm.c
+++ b/test/any2ppm.c
@@ -257,6 +257,7 @@ _create_image (void *closure,
return cairo_surface_reference (*out);
}
+#if CAIRO_HAS_INTERPRETER
static const char *
_cairo_script_render_page (const char *filename,
cairo_surface_t **surface_out)
@@ -303,6 +304,13 @@ cs_convert (char **argv, int fd)
return err;
}
+#else
+static const char *
+cs_convert (char **argv, int fd)
+{
+ return "compiled without CairoScript support.";
+}
+#endif
#if CAIRO_CAN_TEST_PDF_SURFACE
/* adapted from pdf2png.c */
diff --git a/util/Makefile.am b/util/Makefile.am
index 6ee0ba93..4394fe3f 100644
--- a/util/Makefile.am
+++ b/util/Makefile.am
@@ -2,7 +2,7 @@ include $(top_srcdir)/build/Makefile.am.common
SUBDIRS = .
-if BUILD_SCRIPT
+if CAIRO_HAS_INTERPRETER
SUBDIRS += cairo-script
endif
@@ -25,7 +25,7 @@ AM_CPPFLAGS = -I$(top_srcdir)/src \
$(CAIRO_CFLAGS)
EXTRA_PROGRAMS += show-traps show-edges show-events
-if BUILD_SCRIPT
+if CAIRO_HAS_INTERPRETER
EXTRA_PROGRAMS += trace-to-xml xml-to-trace
endif