--- fontforge-0.0.20100501.orig/configure.static.in
+++ fontforge-0.0.20100501/configure.static.in
@@ -158,7 +158,7 @@ if test "$python" = "yes" ; then
         python="no"
       elif test "$PySubVersion" \!= "" -a "$PySubVersion" -ge 3 -a -e $PyLib -a -e $PyInc; then
 	PyIncs=`python -c "import distutils.sysconfig ; print '-I%s' % distutils.sysconfig.get_config_var('INCLUDEPY')"`
-        PyLibs=`python -c "import distutils.sysconfig ; print '%s/%s %s' % (distutils.sysconfig.get_config_var('LIBPL'),distutils.sysconfig.get_config_var('LDLIBRARY'),distutils.sysconfig.get_config_var('LIBS'))"`
+        PyLibs=`${python_prog}-config --libs`
         LIBS="$LIBS $PyLibs"
 	CPPFLAGS="$CPPFLAGS $PyIncs"
       else
--- fontforge-0.0.20100501.orig/configure.dynamic.in
+++ fontforge-0.0.20100501/configure.dynamic.in
@@ -283,10 +283,10 @@ if test "$python" = "yes" ; then
       else
 	python="no"
       fi
-      PyLib=`$python_prog -c "import distutils.sysconfig ; print(distutils.sysconfig.get_config_var('LIBPL') + '/' + distutils.sysconfig.get_config_var('LDLIBRARY'))"`
+      PyLib=`${python_prog}-config --libs`
       if test "$py_lib" != "" ; then
         LIBS="$LIBS $py_lib"
-      elif test "$PyLib" != "" -a -e "$PyLib" ; then
+      elif test "$PyLib" != ""; then
         LIBS="$LIBS $PyLib"
       else
 	AC_SEARCH_LIBS(Py_Main, $PyName python, : , python="no")
