--- acinclude.m4.org	2007-06-02 01:40:16.000000000 +0200
+++ acinclude.m4	2007-06-02 01:54:50.000000000 +0200
@@ -145,18 +145,28 @@
 AC_DEFUN([CHECK_WXWIDGETS],
 [
         AC_MSG_CHECKING(wxWidgets version)
-        TMP_WX_VERSION=`${WX_CONFIG} --version`
-        changequote(<<. >>)dnl
-        WX_MAJOR=`expr ${TMP_WX_VERSION} : '\([0-9]*\)'`
-        WX_MINOR=`expr ${TMP_WX_VERSION} : '[0-9]*\.\([0-9]*\)'`
-        changequote([, ])dnl
-        if test "$WX_MAJOR" -lt 2; then
-                AC_MSG_ERROR([wxWidgets 2.8.0 or newer is require to build pgAdmin])
-        fi
-        if test "$WX_MAJOR" -eq 2 && test "$WX_MINOR" -lt 8; then
-                AC_MSG_ERROR([wxWidgets 2.8.0 or newer is require to build pgAdmin])
-        fi
-        AC_MSG_RESULT(ok)
+        TMP_WX_VERSION=`${WX_CONFIG} --version=2.8 --version 2>/dev/null`
+	if test "x${TMP_WX_VERSION}" == "x"; then
+    	    TMP_WX_VERSION=`${WX_CONFIG} --version=2.9 --version 2>/dev/null`
+	fi
+	if test "x${TMP_WX_VERSION}" == "x"; then
+	    TMP_WX_VERSION=`${WX_CONFIG} --version=2.10 --version 2>/dev/null`
+	fi
+	if test "x${TMP_WX_VERSION}" != "x"; then
+    	    changequote(<<. >>)dnl
+    	    WX_MAJOR=`expr ${TMP_WX_VERSION} : '\([0-9]*\)'`
+	    WX_MINOR=`expr ${TMP_WX_VERSION} : '[0-9]*\.\([0-9]*\)'`
+    	    changequote([, ])dnl
+	    if test "$WX_MAJOR" -lt 2; then
+    		    AC_MSG_ERROR([wxWidgets 2.8.0 or newer is require to build pgAdmin])
+    	    fi
+	    if test "$WX_MAJOR" -eq 2 && test "$WX_MINOR" -lt 8; then
+    		AC_MSG_ERROR([wxWidgets 2.8.0 or newer is require to build pgAdmin])
+    	    fi
+	    AC_MSG_RESULT(ok)
+	else    
+	    AC_MSG_ERROR([wxWidgets 2.8.0 or newer is require to build pgAdmin])
+	fi
 ])
 
 

