X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=configure.ac;h=af7db0dbbec2aa95e8d406cc1c385f88e3b13725;hb=3d8691326666a32925aa555f3088185ccd5d846b;hp=1f75be785942f09cf1fbdc13142cf7eccc5f99d4;hpb=739a1ec4f8714ee77f19c393345a67d321982c11;p=libsigrok.git diff --git a/configure.ac b/configure.ac index 1f75be78..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 = $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])]) @@ -449,11 +458,16 @@ AM_COND_IF([BINDINGS_CXX], [ # Check for specific libusb features, now that we know the CFLAGS. AC_LANG([C]) sr_save_cflags=$CFLAGS +sr_save_libs=$LIBS CFLAGS="$LIBSIGROK_CFLAGS $CFLAGS" +LIBS="$LIBSIGROK_LIBS $LIBS" AC_CHECK_TYPES([libusb_os_handle], [sr_have_libusb_os_handle=yes], [sr_have_libusb_os_handle=no], [[#include ]]) +AC_CHECK_FUNCS([zip_discard]) +LIBS=$sr_save_libs CFLAGS=$sr_save_cflags + AM_COND_IF([NEED_USB], [AS_CASE([$sr_have_libusb_os_handle:$host_os], [no:mingw*], [AC_MSG_ERROR([Windows builds require the event-abstraction branch of libusb])])])