        if $PKG_CONFIG --exists $l ; then
          png_REQUIRES=$l
          use_png=yes
+@@ -505,7 +505,7 @@
+ CAIRO_ENABLE_SURFACE_BACKEND(ps, PostScript, yes, [
+     # The ps backend requires zlib.
+     use_ps=$have_libz
+-    ps_NONPKGCONFIG_LIBS=-lz
++    ps_NONPKGCONFIG_LIBS=$ZLIB3RDLIB
+ ])
+ 
+ dnl ===========================================================================
+@@ -542,7 +542,7 @@
+ CAIRO_ENABLE_SURFACE_BACKEND(pdf, PDF, yes, [
+     # The pdf backend requires zlib.
+     use_pdf=$have_libz
+-    pdf_NONPKGCONFIG_LIBS=-lz
++    pdf_NONPKGCONFIG_LIBS=$ZLIB3RDLIB
+ ])
+ 
+ dnl ===========================================================================
+@@ -623,7 +623,7 @@
+ CAIRO_ENABLE_SURFACE_BACKEND(tee, tee, no)
+ CAIRO_ENABLE_SURFACE_BACKEND(xml, xml, no, [
+     use_xml=$have_libz
+-    xml_NONPKGCONFIG_LIBS=-lz
++    xml_NONPKGCONFIG_LIBS=$ZLIB3RDLIB
+ ])
+ 
+ dnl ===========================================================================
 --- misc/cairo-1.10.2/src/cairo-deflate-stream.c	2010-06-18 13:47:12.000000000 +0200
-+++ misc/build/cairo-1.10.2/src/cairo-deflate-stream.c	2011-12-16 11:48:52.381857312 +0100
++++ misc/build/cairo-1.10.2/src/cairo-deflate-stream.c	2010-06-18 13:47:12.000000000 +0200
 @@ -37,7 +37,11 @@
  #include "cairoint.h"
  #include "cairo-error-private.h"

 	      | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
 	      | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
--- misc/cairo-1.10.2/configure	2010-12-25 15:22:57.000000000 +0100
+++ misc/build/cairo-1.10.2/configure	2011-12-16 13:21:50.143725559 +0100
@@ -19259,61 +19259,11 @@
 rm -f confcache
 

 
     assert (decimal_point_len != 0);
--- misc/cairo-1.10.2/src/cairo-pdf-surface.c	2010-12-25 15:21:34.000000000 +0100
+++ misc/build/cairo-1.10.2/src/cairo-pdf-surface.c	2010-12-25 15:21:34.000000000 +0100
@@ -57,7 +57,11 @@
 #include "cairo-type3-glyph-surface-private.h"
 
