Commit cbc99d04 authored by Sebastian Dröge's avatar Sebastian Dröge 🍵

configure: Fix Python configure checks to work with all Python versions between 2.7 and 3.3

parent 11d1e09f
......@@ -43,9 +43,9 @@ AC_DEFUN([AM_CHECK_PYTHON_HEADERS],
AC_MSG_CHECKING(for headers required to compile python extensions)
py_prefix=`$PYTHON -c "import sys; print sys.prefix"`
py_exec_prefix=`$PYTHON -c "import sys; print sys.exec_prefix"`
if $PYTHON-config --help 2>/dev/null; then
py_prefix=`$PYTHON -c "import sys; print(sys.prefix)"`
py_exec_prefix=`$PYTHON -c "import sys; print(sys.exec_prefix)"`
if $PYTHON-config --help 1>/dev/null 2>/dev/null; then
PYTHON_INCLUDES=`$PYTHON-config --includes 2>/dev/null`
......@@ -73,9 +73,9 @@ AC_DEFUN([AM_CHECK_PYTHON_LIBS],
AC_MSG_CHECKING(for libraries required to embed python)
dnl deduce PYTHON_LIBS
if $PYTHON-config --help 2>/dev/null; then
if $PYTHON-config --help 1>/dev/null 2>/dev/null; then
PYTHON_LIBS=`$PYTHON-config --ldflags 2>/dev/null`
PYTHON_LIB=`$PYTHON -c "import distutils.sysconfig as s; print s.get_python_lib(standard_lib=1)"`
PYTHON_LIB=`$PYTHON -c "import distutils.sysconfig as s; print(s.get_python_lib(standard_lib=1))"`
if echo "$host_os" | grep darwin >/dev/null 2>&1; then
dnl OSX is a pain. Python as shipped by apple installs libpython in /usr/lib
dnl so we hardcode that. Other systems can use --with-libpython-dir to
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment