--- configure.ac~	2006-03-27 14:28:03.000000000 +0200
+++ configure.ac	2006-03-31 13:10:02.473950722 +0200
@@ -250,6 +250,34 @@
 	AC_MSG_CHECKING([for libgd libs])
 	GD_LIBS="`$GDLIB_CONFIG --ldflags` `$GDLIB_CONFIG --libs` -lgd"
 	AC_MSG_RESULT([$GD_LIBS])
+
+ 	GD_MAJORVERSION=`$GDLIB_CONFIG --majorversion`
+    	GD_MINORVERSION=`$GDLIB_CONFIG --minorversion`
+    	GD_REVISION=`$GDLIB_CONFIG --revision`
+
+    # GD version check >= 2.0.33
+    gd_version_ok=yes
+    REQ_GD_MAJORVERSION=2
+    REQ_GD_MINORVERSION=0
+    REQ_GD_REVISION=33
+    if test $GD_MAJORVERSION -lt $REQ_GD_MAJORVERSION; then
+        gd_version_ok=no
+    else
+        if test $GD_MAJORVERSION -eq $REQ_GD_MAJORVERSION; then
+            if test $GD_MINORVERSION -lt $REQ_GD_MINORVERSION; then
+                gd_version_ok=no
+            else
+                if test $GD_MINORVERSION -eq $REQ_GD_MINORVERSION; then
+                    if test $GD_REVISION -lt $REQ_GD_REVISION; then
+                        gd_version_ok=no
+                    fi
+                fi
+            fi
+        fi
+    fi
+    if test "x$gd_version_ok" = "xno"; then
+        AC_MSG_ERROR(GD library version < $REQ_GD_MAJORVERSION.$REQ_GD_MINORVERSION.$REQ_GD_REVISION)
+    fi
    
 	# since some linux systems evidently install gdlib-config but fail to
 	# install the headers (nice), check for the header too and fail if it
