From: Daniel Elstner Date: Sun, 1 Nov 2015 20:40:28 +0000 (+0100) Subject: build: Match up Python headers with interpreter version X-Git-Tag: libsigrok-0.4.0~134 X-Git-Url: https://sigrok.org/gitweb/?a=commitdiff_plain;ds=sidebyside;h=3d8691326666a32925aa555f3088185ccd5d846b;hp=8105e82913aface2a430c51ef3e9a45cfce68170;p=libsigrok.git build: Match up Python headers with interpreter version Check for either Python 2 or Python 3 header files depending on the version of the Python interpreter. Also require the module version to exactly match the interpreter version. This may fix bug #645. --- diff --git a/configure.ac b/configure.ac index 91516fdb..af7db0db 100644 --- a/configure.ac +++ b/configure.ac @@ -335,9 +335,18 @@ AS_IF([test "x$BINDINGS_CXX" = xyes], [sr_python_missing=], [sr_python_missing='C++ bindings']) -# The Python bindings need Python development files. +# Extract major and minor version number of the Python interpreter. +sr_pymajor=${PYTHON_VERSION%%.*} +sr_pyminor=${PYTHON_VERSION#*.} + +# The Python bindings need Python development files. Check for either +# Python 3 or Python 2 headers depending on the interpreter version. SR_PKG_CHECK([python_dev], [SR_PKGLIBS_PYTHON], - [python >= 2.7], [python2 >= 2.7], [python27 >= 2.7], [python-2.7 >= 2.7]) + [python = $PYTHON_VERSION], + [python$sr_pymajor = $PYTHON_VERSION], + [python$sr_pymajor$sr_pyminor = $PYTHON_VERSION], + [python-$PYTHON_VERSION = $PYTHON_VERSION]) + AS_IF([test "x$sr_have_python_dev" != xyes], [SR_APPEND([sr_python_missing], [', '], [Headers])])