Skip to content

Commit

Permalink
Use python3-config --includes instead of get_python_inc()
Browse files Browse the repository at this point in the history
Fix #39 - Python.h check is wrong for Python 3.8
  • Loading branch information
unhammer committed Feb 26, 2020
1 parent e06ac4a commit b11465f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,16 @@ AS_IF([test ! "$SWIG"],
dnl =================
dnl Checks for Python
dnl =================

dnl The test must instead add the result of `python3-config --includes` to the build flags and only `#include <Python.h>`

AM_PATH_PYTHON([3.0],
[],
[AC_MSG_WARN([Python not found. Python is required to build divvun-gramcheck python bindings.])])
AS_IF([test "$PYTHON" != :],
[python_include_path=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_python_inc());"`
AC_CHECK_HEADERS([${python_include_path}/Python.h],
[AC_SUBST(PYTHONINCLUDE,["`python3-config --includes`"])
CPPFLAGS="$CPPFLAGS $PYTHONINCLUDE"
AC_CHECK_HEADERS([Python.h],
[have_python_header=true],
[AC_MSG_WARN([Python.h header file not found. Python development files are required to build the divvun-gramcheck python bindings.])],
[])])
Expand Down

0 comments on commit b11465f

Please sign in to comment.