[test/any2ppm] Do not attempt to compile PS without spectre

Since CAN_TEST_PS_SURFACE does not currently require spectre, we were
attempting to compile in spectre support for any2ppm even on systems
without libspectre installed. Fix that by adding a separate flag for
CAIRO_HAS_SPECTRE.
This commit is contained in:
Chris Wilson 2008-10-11 18:10:16 +01:00
parent b358711162
commit 6736faba3e
3 changed files with 25 additions and 10 deletions

View file

@ -357,7 +357,10 @@ if test "x$use_ps" = "xyes"; then
fi
AM_CONDITIONAL(CAIRO_CAN_TEST_PS_SURFACE, test "x$test_ps" = "xyes")
AM_CONDITIONAL(BUILD_PS2PNG, test "x$any2ppm_ps" = "xyes")
AM_CONDITIONAL(CAIRO_HAS_SPECTRE, test "x$any2ppm_ps" = "xyes")
if test "x$any2ppm_ps" = "xyes"; then
AC_DEFINE([CAIRO_HAS_SPECTRE], 1, [Define to 1 if libspectre is available])
fi
AC_SUBST(LIBSPECTRE_CFLAGS)
AC_SUBST(LIBSPECTRE_LIBS)

View file

@ -1098,7 +1098,7 @@ svg2png_LDFLAGS = $(CAIRO_TEST_UNDEFINED_LDFLAGS)
svg2png_LDADD = $(LDADD) $(LIBRSVG_LIBS)
endif
if BUILD_PS2PNG
if CAIRO_HAS_SPECTRE
check_PROGRAMS += ps2png
ps2png_CFLAGS = $(LIBSPECTRE_CFLAGS)
# add LDADD, so ps2png uses "our" cairo

View file

@ -72,7 +72,7 @@
#include <librsvg/rsvg-cairo.h>
#endif
#if CAIRO_CAN_TEST_PS_SURFACE
#if CAIRO_HAS_SPECTRE
#include <libspectre/spectre.h>
#endif
@ -293,6 +293,12 @@ pdf_convert (char **argv, int fd)
return err;
}
#else
static const char *
pdf_convert (char **argv, int fd)
{
return "compiled without PDF support.";
}
#endif
#if CAIRO_CAN_TEST_SVG_SURFACE
@ -347,9 +353,15 @@ svg_convert (char **argv, int fd)
return err;
}
#else
static const char *
svg_convert (char **argv, int fd)
{
return "compiled without SVG support.";
}
#endif
#if CAIRO_CAN_TEST_PS_SURFACE
#if CAIRO_HAS_SPECTRE
static const char *
_spectre_render_page (const char *filename,
const char *page_label,
@ -422,6 +434,12 @@ ps_convert (char **argv, int fd)
return err;
}
#else
static const char *
ps_convert (char **argv, int fd)
{
return "compiled without PostScript support.";
}
#endif
static const char *
@ -431,15 +449,9 @@ convert (char **argv, int fd)
const char *type;
const char *(*func) (char **, int);
} converters[] = {
#if CAIRO_CAN_TEST_PDF_SURFACE
{ "pdf", pdf_convert },
#endif
#if CAIRO_CAN_TEST_PS_SURFACE
{ "ps", ps_convert },
#endif
#if CAIRO_CAN_TEST_SVG_SURFACE
{ "svg", svg_convert },
#endif
{ NULL, NULL }
};
const struct converter *converter = converters;