diff -durpN /home/zozo/rpmbuild/BUILD/gd-2.0.35/configure.ac gd-2.0.35/configure.ac
--- /home/zozo/rpmbuild/BUILD/gd-2.0.35/configure.ac	2007-04-25 14:48:41.000000000 +0200
+++ gd-2.0.35/configure.ac	2011-12-02 13:18:35.533393315 +0100
@@ -8,6 +8,7 @@ AC_PREREQ(2.54)
 AC_INIT([GD], [2.0.35], [http://bugs.libgd.org])
 AC_CONFIG_SRCDIR([gd.c])
 AC_CONFIG_AUX_DIR(config)
+AC_CONFIG_MACRO_DIR([config])
 AC_CANONICAL_TARGET([])
 
 GDLIB_MAJOR=2
@@ -33,6 +34,9 @@ case "$target" in
   *-*-cygwin*) XTRA_LDFLAGS="-no-undefined"
                os_cygwin=yes
                ;;
+  *-*-mingw32*) XTRA_LDFLAGS="-no-undefined"
+                os_cygwin=no
+                ;;
            *)  XTRA_LDFLAGS=
                os_cygwin=no
                ;;
@@ -40,13 +44,14 @@ esac
 AC_MSG_RESULT([$os_cygwin])
 AC_SUBST([XTRA_LDFLAGS])
 
+LT_INIT
 AC_PROG_CC
 AM_PROG_CC_STDC
 AC_PROG_INSTALL
 AC_PROG_LIBTOOL
+AC_LIBTOOL_WIN32_DLL
 AC_PROG_LN_S
 AC_PROG_MAKE_SET
-#AC_PROG_RANLIB
 
 dnl may be required for freetype and Xpm
 AC_PATH_X
@@ -348,16 +353,12 @@ AC_ARG_WITH(png,dnl
 # confusing autoconf into thinking the library itself will be named -lpng,
 # which it won't be. Awful. This code will suffice unless the libpng
 # authors decide to do this AGAIN. Which I really hope they won't. TBB
+#
+# On Fedora, Mingw-W64 has libpng 1.5.x, let's use libpng-config directly.
 
 if test "$withval" != no; then
-  AC_PATH_PROG([LIBPNG12_CONFIG], [libpng12-config])
   AC_PATH_PROG([LIBPNG_CONFIG], [libpng-config])
-  if test -n "$LIBPNG12_CONFIG"; then
-    libpng_CPPFLAGS=`libpng12-config --cflags`
-    # should be --ldopts, but it's currently broken
-    libpng_LDFLAGS=`libpng12-config --ldflags`
-    libpng_LDFLAGS=`echo " $libpng_LDFLAGS" | sed 's/ -l[[^ ]][[^ ]]*//g'`
-  elif test -n "$LIBPNG_CONFIG"; then
+  if test -n "$LIBPNG_CONFIG"; then
     libpng_CPPFLAGS=`libpng-config --cflags`
     # should be --ldopts, but it's currently broken
     libpng_LDFLAGS=`libpng-config --ldflags`
@@ -375,14 +376,7 @@ if test "$withval" != no; then
   _ldflags="$LDFLAGS"
   LDFLAGS="$libpng_LDFLAGS $LDFLAGS"
 
-  if test -n "$LIBPNG12_CONFIG"; then
-    AC_CHECK_LIB(png12,png_create_read_struct,
-      [LIBS="-lpng12 $LIBS"
-       FEATURES="GD_PNG $FEATURES"
-       AC_DEFINE(HAVE_LIBPNG, 1, [ Define if you have the png library. ])],
-      [LDFLAGS="$_ldflags"  
-       AC_MSG_WARN([libpng is required - see http://www.libpng.org/pub/png/])])
-  elif test -n "$LIBPNG_CONFIG"; then
+  if test -n "$LIBPNG_CONFIG"; then
     AC_CHECK_LIB(png,png_create_read_struct,
       [LIBS="-lpng $LIBS" 
        FEATURES="GD_PNG $FEATURES"
