From: Mike Hommey <glandium@debian.org>
Date: Thu, 13 Mar 2008 07:33:42 +0100
Subject: Ignore system libjpeg, libpng and zlib version checking

Make sure we won't be bitten by upstream changing libjpeg, libpng or zlib
internal version, which makes system library not used even though
--with-system-* argument is given to configure.
---
 configure.in |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/configure.in b/configure.in
index bf3df69..ff7872a 100644
--- a/configure.in
+++ b/configure.in
@@ -4217,7 +4217,7 @@ else
     AC_CHECK_LIB(jpeg, jpeg_destroy_compress, [SYSTEM_JPEG=1 JPEG_LIBS="-ljpeg $JPEG_LIBS"], SYSTEM_JPEG=, $JPEG_LIBS)
 fi
 
-if test "$SYSTEM_JPEG" = 1; then
+if test "$SYSTEM_JPEG" = 0; then
     LIBS="$JPEG_LIBS $LIBS"
     AC_TRY_COMPILE([ #include <stdio.h>
                      #include <sys/types.h>
@@ -4257,7 +4257,7 @@ else
     AC_CHECK_LIB(z, gzread, [SYSTEM_ZLIB=1 ZLIB_LIBS="-lz $ZLIB_LIBS"], 
 	[SYSTEM_ZLIB= ZLIB_CFLAGS= ZLIB_LIBS=], $ZLIB_LIBS)
 fi
-if test "$SYSTEM_ZLIB" = 1; then
+if test "$SYSTEM_ZLIB" = 0; then
     LIBS="$ZLIB_LIBS $LIBS"
     AC_TRY_COMPILE([ #include <stdio.h>
                      #include <string.h>
@@ -4333,7 +4333,7 @@ else
                  AC_MSG_ERROR([--with-system-png won't work because the system's libpng doesn't have APNG support]),
                  $_SAVE_PNG_LIBS)
 fi
-if test "$SYSTEM_PNG" = 1; then
+if test "$SYSTEM_PNG" = 0; then
     LIBS="$PNG_LIBS $LIBS"
     AC_TRY_COMPILE([ #include <stdio.h>
                      #include <sys/types.h>
