--- gnumeric-1.4.1.orig/configure.in	2004-12-10 15:06:14.000000000 +0000
+++ gnumeric-1.4.1/configure.in	2004-12-17 13:22:25.025260553 +0000
@@ -768,6 +768,7 @@
     AC_MSG_CHECKING([for python >= 2.0])
     PY_PREFIX=`$PYTHON -c 'import sys ; print sys.prefix'`
     PY_EXEC_PREFIX=`$PYTHON -c 'import sys ; print sys.exec_prefix'`
+    PY_MAKEFILE=`$PYTHON -c 'from distutils.sysconfig import get_makefile_filename; print get_makefile_filename()'`
     [PY_VERSION=`$PYTHON -c 'import sys ; print sys.version[0:3]'`
     broken_py_initialize=`$PYTHON -c \
 'import sys
@@ -788,11 +789,12 @@
     if test -f $PY_PREFIX/include/python$PY_VERSION/Python.h; then
 	AC_MSG_RESULT($marker_ok)
 	PY_LIBS="python$PY_VERSION"
-	PY_LIB_LOC="-L$PY_EXEC_PREFIX/lib/python$PY_VERSION/config"
+    	PY_LIB_LOC=`$PYTHON -c 'from distutils.sysconfig import get_config_var; print get_config_var("LIBPL")'`
+    	PY_LIB_LOC="-L$PY_LIB_LOC"
 	PY_CFLAGS="-I$PY_PREFIX/include/python$PY_VERSION"
 	[echo 'echo_python_libs:
 	@echo $(MODLIBS) $(LIBS)' >confmake.tmp
-	PY_EXTRA_LIBS=`make -s -f confmake.tmp -f "$PY_EXEC_PREFIX/lib/python$PY_VERSION/config/Makefile"`
+	PY_EXTRA_LIBS=`make -s -f confmake.tmp -f "$PY_MAKEFILE"`
 	rm -f confmake.tmp]
     else
 	AC_MSG_RESULT($marker_fail)
