Commit c9b8b0edd537b0247d11dc2aff3b11cca0391e76

Authored by Jürgen Knödlseder
1 parent 1a484534

Detect also Python3 headers.

In Python3, the print method was replaced by a print() function. We have thus to distinguish between both possibilities during the configuration.
Showing 1 changed file with 7 additions and 2 deletions
configure.ac
@@ -545,8 +545,13 @@ if test "x$has_python" = "xyes"; then @@ -545,8 +545,13 @@ if test "x$has_python" = "xyes"; then
545 # If we have distutils then get python path from distutils ... 545 # If we have distutils then get python path from distutils ...
546 if test -z "$ac_distutils_result"; then 546 if test -z "$ac_distutils_result"; then
547 AC_MSG_CHECKING([for Python include path]) 547 AC_MSG_CHECKING([for Python include path])
548 - python_path=`$PYTHON -c "import distutils.sysconfig; \  
549 - print distutils.sysconfig.get_python_inc();"` 548 + if test ${PYTHON_VERSION} '<' 3; then
  549 + python_path=`$PYTHON -c "import distutils.sysconfig; \
  550 + print distutils.sysconfig.get_python_inc();"`
  551 + else
  552 + python_path=`$PYTHON -c "import distutils.sysconfig; \
  553 + print(distutils.sysconfig.get_python_inc());"`
  554 + fi
550 if test -n "${python_path}"; then 555 if test -n "${python_path}"; then
551 AC_CHECK_HEADERS($python_path/Python.h, [has_python_h="yes"], [has_python_h="no"]) 556 AC_CHECK_HEADERS($python_path/Python.h, [has_python_h="yes"], [has_python_h="no"])
552 python_path="-I$python_path" 557 python_path="-I$python_path"