$OpenBSD: patch-config_configure_in,v 1.3 2006/06/07 07:50:47 espie Exp $
--- config/configure.in.orig	Sun May 21 09:55:24 2006
+++ config/configure.in	Wed Jun  7 09:37:39 2006
@@ -733,7 +733,7 @@ if test "$GD" != "no"; then
       PNG_LDFLAGS=`$PNGLIBCONFIG --ldflags`
       LDFLAGS="$LDFLAGS $PNG_LDFLAGS"
     fi
-    AC_CHECK_LIB(png, png_create_read_struct , [LIBPNG=yes])
+    AC_CHECK_LIB(png, png_create_read_struct , [LIBPNG=yes],, -lz -lm)
 # restore variables
     LIBS=$SAVE_LIBS_PNG
     CFLAGS=$SAVE_CFLAGS_PNG
@@ -761,7 +761,7 @@ if test "$GD" != "no"; then
         GD=yes
 	GD_PNG=yes
         AC_MSG_RESULT(yes)
-	AC_CHECK_LIB(png, png_access_version_number,[AC_DEFINE(HAVE_PNGVERSION, 1,)])
+	AC_CHECK_LIB(png, png_access_version_number,[AC_DEFINE(HAVE_PNGVERSION, 1,)],, -lz -lm)
         AC_DEFINE(HAVE_GD_PNG, 1, [Define to 1 if you have png support in libgd.])
       else
         AC_MSG_RESULT(no)
