--- /dev/null
+Use a simpler check for Python's libs that return an actual linker
+invocation (e.g. -lpython2.6) instead of the .so file. This fixes the
+case with forced as-needed where the .so gets re-ordered to the front
+during link.
+
+--- configure.in.~1~ 2010-04-02 03:26:27.000000000 +0200
++++ configure.in 2010-04-09 16:06:10.271092660 +0200
+@@ -303,12 +303,7 @@
+ dnl enable_python=$enableval, enable_python=no)
+
+ AC_MSG_CHECKING(for Python)
+-PYTHON_LIBS=[$(python -c "from distutils import sysconfig
+-import os
+-cfg=sysconfig.get_config_vars()
+-lib = os.path.join(cfg['LIBDIR'], cfg['LDLIBRARY'])
+-if os.path.exists(lib):
+- print lib")]
++PYTHON_LIBS=[$(python -c 'import sys; print("-lpython%s.%s" % sys.version_info[:2])')]
+ PYTHON_CFLAGS=[$(python -c "from distutils import sysconfig
+ print sysconfig.get_python_inc()")]
+ PYTHON_CFLAGS="-I$PYTHON_CFLAGS"