applied patch from Joseph Sacco changing slightly the python detection

* configure.in: applied patch from Joseph Sacco changing slightly
  the python detection scheme should fix bug #338526
Daniel
diff --git a/configure.in b/configure.in
index 2bff06b..835958d 100644
--- a/configure.in
+++ b/configure.in
@@ -661,6 +661,7 @@
 	    if test -x "$PYTHON"
 	    then
 	        echo Found python in environment PYTHON=$PYTHON
+		with_python=`$PYTHON -c "import sys; print sys.exec_prefix"`
 	    else
 		AC_PATH_PROG(PYTHON, python python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5)
 	    fi
@@ -677,17 +678,17 @@
 	   -d $with_python/lib/python$PYTHON_VERSION/site-packages
 	then
 	    PYTHON_INCLUDES=$with_python/include/python$PYTHON_VERSION
-	    PYTHON_SITE_PACKAGES=$with_python/lib/python$PYTHON_VERSION/site-packages
+	    PYTHON_SITE_PACKAGES=$libdir/lib/python$PYTHON_VERSION/site-packages
 	else
 	    if test -r $prefix/include/python$PYTHON_VERSION/Python.h
 	    then
-	        PYTHON_INCLUDES='$(prefix)/include/python$(PYTHON_VERSION)'
-		PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages'
+	        PYTHON_INCLUDES=$prefix/include/python$PYTHON_VERSION
+		PYTHON_SITE_PACKAGES=$libdir/python$PYTHON_VERSION/site-packages
 	    else
 		if test -r /usr/include/python$PYTHON_VERSION/Python.h
 		then
 		    PYTHON_INCLUDES=/usr/include/python$PYTHON_VERSION
-		    PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages'
+		    PYTHON_SITE_PACKAGES=$(libdir)/python$(PYTHON_VERSION)/site-packages
 		else
 		    echo could not find python$PYTHON_VERSION/Python.h
 		fi
@@ -700,9 +701,9 @@
     fi
     if test "$with_python" != ""
     then
-        pythondir='$(PYTHON_SITE_PACKAGES)'
+        pythondir=$PYTHON_SITE_PACKAGES
     else
-        pythondir='$(libdir)/python${PYTHON_VERSION}/site-packages'
+        pythondir=$libdir/python$PYTHON_VERSION/site-packages
     fi
 else
     PYTHON=