summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog12
-rw-r--r--cairo.pc.in2
-rw-r--r--configure.in28
-rw-r--r--src/Makefile.am8
-rw-r--r--src/cairo-features.h.in2
-rw-r--r--src/cairo.h10
6 files changed, 53 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index 1920b7a6..a8fecec9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,17 @@
2003-12-12 Carl Worth <cworth@east.isi.edu>
+ * src/cairo.h:
+ * src/cairo-features.h.in:
+ * src/Makefile.am (libcairo_ps_sources): Add conditionals for
+ ps_surface functions, etc.
+
+ * configure.in: Get rid of AC_PATH_XTRA. Instead, find X
+ includes/libraries only via pkg-config xrender.
+ Switch option from --without-x to --disable-xlib
+ Add option --disable-ps
+
+ * cairo.pc.in (Libs): Add -lz only if ps_surface backend is compiled.
+
* src/cairo.h (__external_linkage): Add missing definitions from
slim_import.h.
diff --git a/cairo.pc.in b/cairo.pc.in
index 6adeb90c..6c66150c 100644
--- a/cairo.pc.in
+++ b/cairo.pc.in
@@ -8,6 +8,6 @@ Description: Multi-platform 2D graphics library
Version: @VERSION@
Requires: fontconfig libpixman @XRENDER_REQUIRES@
-Libs: -L${libdir} -lcairo -lm -lz @FREETYPE_LIBS@
+Libs: -L${libdir} -lcairo -lm @PS_SURFACE_LIBS@ @FREETYPE_LIBS@
Cflags: -I${includedir} @FREETYPE_CFLAGS@
diff --git a/configure.in b/configure.in
index 8ff03736..855fbfac 100644
--- a/configure.in
+++ b/configure.in
@@ -36,22 +36,40 @@ AC_STDC_HEADERS
dnl ===========================================================================
-AC_PATH_XTRA
+AC_ARG_ENABLE(xlib,
+ AC_HELP_STRING([--disable-xlib], [Disable cairo's Xlib backend]),
+ [use_xlib=$enableval], [use_xlib=yes])
-if test "x$have_x" != "xyes"; then
+if test "x$use_xlib" != "xyes"; then
XLIB_SURFACE_FEATURE=CAIRO_HAS_NO_XLIB_SURFACE
+ AM_CONDITIONAL(CAIRO_HAS_XLIB_SURFACE, false)
else
XLIB_SURFACE_FEATURE=CAIRO_HAS_XLIB_SURFACE
PKG_CHECK_MODULES(XRENDER, xrender >= 0.6)
XRENDER_REQUIRES=xrender
+ AM_CONDITIONAL(CAIRO_HAS_XLIB_SURFACE, true)
fi
AC_SUBST(XLIB_SURFACE_FEATURE)
AC_SUBST(XRENDER_REQUIRES)
-dnl This is needed for conditional compilation of xlib code in Makefile.am :
-dnl XXX: I'd prefer to have only one test of $have_x, would that be easy?
-AM_CONDITIONAL(CAIRO_HAS_XLIB_SURFACE, test x$have_x = xyes)
+dnl ===========================================================================
+
+AC_ARG_ENABLE(ps,
+ AC_HELP_STRING([--disable-ps], [Disable cairo's PostScript backend]),
+ [use_ps=$enableval], [use_ps=yes])
+
+if test "x$use_ps" != "xyes"; then
+ PS_SURFACE_FEATURE=CAIRO_HAS_NO_PS_SURFACE
+ AM_CONDITIONAL(CAIRO_HAS_PS_SURFACE, false)
+else
+ PS_SURFACE_FEATURE=CAIRO_HAS_PS_SURFACE
+ PS_SURFACE_LIBS=-lz
+ AM_CONDITIONAL(CAIRO_HAS_PS_SURFACE, true)
+fi
+
+AC_SUBST(PS_SURFACE_LIBS)
+AC_SUBST(PS_SURFACE_FEATURE)
dnl ===========================================================================
diff --git a/src/Makefile.am b/src/Makefile.am
index fd42dc77..5dd831f9 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,10 +1,12 @@
lib_LTLIBRARIES = libcairo.la
include_HEADERS = cairo.h cairo-features.h
+if CAIRO_HAS_PS_SURFACE
+libcairo_ps_sources = cairo_ps_surface.c
+endif
+
if CAIRO_HAS_XLIB_SURFACE
libcairo_xlib_sources = cairo_xlib_surface.c
-else
-libcairo_xlib_sources =
endif
libcairo_la_SOURCES = \
@@ -24,11 +26,11 @@ libcairo_la_SOURCES = \
cairo_path_stroke.c \
cairo_pen.c \
cairo_polygon.c \
- cairo_ps_surface.c \
cairo_slope.c \
cairo_spline.c \
cairo_surface.c \
cairo_traps.c \
+ $(libcairo_ps_sources) \
$(libcairo_xlib_sources)\
cairoint.h
diff --git a/src/cairo-features.h.in b/src/cairo-features.h.in
index 9d83d070..62eee4a4 100644
--- a/src/cairo-features.h.in
+++ b/src/cairo-features.h.in
@@ -28,6 +28,8 @@
#ifndef _CAIRO_CONFIG_H_
#define _CAIRO_CONFIG_H_
+#define @PS_SURFACE_FEATURE@
+
#define @XLIB_SURFACE_FEATURE@
#endif
diff --git a/src/cairo.h b/src/cairo.h
index 39a088f1..dd7c3b41 100644
--- a/src/cairo.h
+++ b/src/cairo.h
@@ -98,6 +98,10 @@ cairo_set_target_image (cairo_t *cr,
int height,
int stride);
+#ifdef CAIRO_HAS_PS_SURFACE
+
+#include <stdio.h>
+
extern void __external_linkage
cairo_set_target_ps (cairo_t *cr,
FILE *file,
@@ -106,6 +110,8 @@ cairo_set_target_ps (cairo_t *cr,
double x_pixels_per_inch,
double y_pixels_per_inch);
+#endif /* CAIRO_HAS_PS_SURFACE */
+
#ifdef CAIRO_HAS_XLIB_SURFACE
#include <X11/extensions/Xrender.h>
@@ -618,6 +624,8 @@ cairo_image_surface_create_for_data (char *data,
int height,
int stride);
+#ifdef CAIRO_HAS_PS_SURFACE
+
/* PS-surface functions */
extern cairo_surface_t * __external_linkage
@@ -627,6 +635,8 @@ cairo_ps_surface_create (FILE *file,
double x_pixels_per_inch,
double y_pixels_per_inch);
+#endif /* CAIRO_HAS_PS_SURFACE */
+
#ifdef CAIRO_HAS_XLIB_SURFACE
/* XXX: This is a mess from the user's POV. Should the Visual or the