--- configure.orig	2009-10-06 18:31:12.000000000 +0200
+++ configure	2009-11-30 12:54:21.000000000 +0100
@@ -12149,7 +12149,7 @@
 VERSION_SCRIPT_FLAGS=
 $(/usr/bin/ld --help 2>&1 | grep -- --version-script >/dev/null) && \
     VERSION_SCRIPT_FLAGS=-Wl,--version-script=
-test "`uname`" == "SunOS" && \
+test "`uname`" = "SunOS" && \
     VERSION_SCRIPT_FLAGS="-Wl,-M -Wl,"
 
  if test -n "$VERSION_SCRIPT_FLAGS"; then
@@ -19856,11 +19856,12 @@
     fi
     if test "$PYTHON_VERSION" != ""
     then
+	with_python=`$PYTHON -c "import sys; print sys.exec_prefix"`
 	if test -r $with_python/include/python$PYTHON_VERSION/Python.h -a \
 	   -d $with_python/lib/python$PYTHON_VERSION/site-packages
 	then
 	    PYTHON_INCLUDES=$with_python/include/python$PYTHON_VERSION
-	    PYTHON_SITE_PACKAGES=$libdir/python$PYTHON_VERSION/site-packages
+	    PYTHON_SITE_PACKAGES=$with_python/lib/python$PYTHON_VERSION/site-packages
 	else
 	    if test -r $prefix/include/python$PYTHON_VERSION/Python.h
 	    then
@@ -20665,6 +20666,8 @@
 	       fi
 	   fi
        ;;
+       *freebsd*) THREAD_LIBS=""
+       ;;
     esac
     if test "$WITH_THREADS" = "1" ; then
 	THREAD_CFLAGS="$THREAD_CFLAGS -D_REENTRANT"
