--- acinclude.m4.orig	2014-02-07 08:04:52.000000000 -0800
+++ acinclude.m4	2014-03-14 19:23:00.000000000 -0700
@@ -77,8 +77,8 @@
   dnl distinct variables so they can be overridden if need be.  However,
   dnl general consensus is that you shouldn't need this ability.
 
-  AC_SUBST([PYTHON_PREFIX], ['${prefix}'])
-  AC_SUBST([PYTHON_EXEC_PREFIX], ['${exec_prefix}'])
+  AC_SUBST([PYTHON_PREFIX], [`$PYTHON -c 'import sys; print(sys.prefix);'`])
+  AC_SUBST([PYTHON_EXEC_PREFIX], [`$PYTHON -c 'import sys; print(sys.exec_prefix);'`])
 
   dnl At times (like when building shared libraries) you may want
   dnl to know which OS platform Python thinks this is.
