Index: configure.in
===================================================================
--- configure.in.orig	2006-10-12 22:48:35.000000000 +0300
+++ configure.in	2006-10-12 22:49:17.000000000 +0300
@@ -669,21 +669,8 @@ AC_ARG_ENABLE(png,
   enable_png="$enableval", enable_png=yes)
 
 if test "$enable_png" = "yes"; then
-  dnl Test for libz
-  if test -z "$ZLIB_LIBS"; then
-    AC_CHECK_LIB(z, gzsetparams,
-      [
-	AC_CHECK_HEADER(zlib.h,
-	  ZLIB_LIBS='-lz',
-	  AC_MSG_WARN([
-*** libz header files not found. PNG image provider will not be built.]))
-      ],[
-        AC_MSG_WARN([ *** libz not found. PNG image provider will not be built.])
-      ])
-  fi
-
   dnl Test for libpng
-  if test -z "$LIBPNG" && test -n "$ZLIB_LIBS"; then
+  if test -z "$LIBPNG"; then
     AC_CHECK_LIB(png, png_read_info,
       [
 	AC_CHECK_HEADER(png.h,
@@ -694,7 +681,7 @@ if test "$enable_png" = "yes"; then
         AC_MSG_WARN([
 *** PNG library not found. PNG image provider will not be built.])
 	],
-      $ZLIB_LIBS -lm)
+      -lm)
     if test "$png_ok" = yes; then
       AC_MSG_CHECKING([for png_structp in png.h])
       AC_TRY_COMPILE([#include <png.h>],
@@ -706,7 +693,7 @@ if test "$enable_png" = "yes"; then
       AC_MSG_RESULT($png_ok)
       if test "$png_ok" = yes; then
 	PNG=yes
-        LIBPNG="-lpng $ZLIB_LIBS -lm"
+        LIBPNG="-lpng -lm"
       else
 	PNG=no
         AC_MSG_WARN([
@@ -1235,7 +1222,7 @@ AM_CONDITIONAL(BUILD_TOOLS, test "$with_
 AM_CONDITIONAL(CROSS_COMPILING, test "$cross_compiling" = "yes")
 
 CFLAGS="$CFLAGS $DFB_INTERNAL_CFLAGS"
-DFB_LDFLAGS="$LDFLAGS $ZLIB_LIBS"
+DFB_LDFLAGS="$LDFLAGS"
 
 
 
Index: src/core/Makefile.am
===================================================================
--- src/core/Makefile.am.orig	2006-10-12 22:50:05.000000000 +0300
+++ src/core/Makefile.am	2006-10-12 22:50:34.000000000 +0300
@@ -74,3 +74,6 @@ libdirectfb_core_la_SOURCES = \
 	windows.c		\
 	windowstack.c		\
 	wm.c
+
+libdirectfb_core_la_LIBADD = @ZLIB_LIBS@
+

