diff --git a/wx-config b/wx-config
index af98033..41f9c65 100644
--- a/wx-config
+++ b/wx-config
@@ -2,16 +2,18 @@
 #
 # Multilib-aware wrapper for the wx-config script
 #
-# Usage: wx-config [arch]
+# Usage: wx-config [--arch <arch>] <regular wx-config options>
 #
 
-if [ $# -eq 1 ]; then
-    arch=$1
-elif [ $# -eq 0 ]; then
+if [ $# -ge 2 ]; then
+    if [ $1 = "--arch" ]; then
+	arch=$2
+	shift 2
+    fi
+fi
+
+if [ -z $arch ]; then
     arch=`uname -m`
-else
-    echo "Usage: $0 [arch]"
-    exit 1
 fi
 
 case $arch in
@@ -23,14 +25,19 @@ case $arch in
         ;;
     *)
         echo "Unsupported architecture '$arch'"
-        exit 2
+        exit 8
         ;;
 esac
 
 wxconfig=$libdir/wx/config/gtk2-unicode-release-2.8
+# special case when using 32-bit userspace and 64-bit kernel
+if [ ! -f $wxconfig -a \( $arch = ppc64 -o $arch = sparc64 \) ]; then
+    wxconfig=/usr/lib/wx/config/gtk2-unicode-release-2.8
+fi
+
 if [ -x $wxconfig ]; then
-    exec $wxconfig
+    exec $wxconfig $@
 else
     echo "wxGTK-devel isn't installed for architecture '$arch'"
-    exit 3
+    exit 9
 fi
diff --git a/wxGTK.spec b/wxGTK.spec
index 8666417..f4fa5c0 100644
--- a/wxGTK.spec
+++ b/wxGTK.spec
@@ -1,6 +1,6 @@
 Name:           wxGTK
 Version:        2.8.10
-Release:        8%{?dist}
+Release:        9%{?dist}
 Summary:        GTK2 port of the wxWidgets GUI library
 License:        wxWidgets
 Group:          System Environment/Libraries
@@ -231,6 +231,9 @@ rm -rf $RPM_BUILD_ROOT
 
 
 %changelog
+* Wed Nov 25 2009 Dan Horák <dan[at]danny.cz> - 2.8.10-9
+- updated the wrapper script (#541087)
+
 * Fri Nov 20 2009 Dan Horák <dan[at]danny.cz> - 2.8.10-8
 - added multilib-aware wrapper for wx-config