Use AM_PATH_PYTHON macro to find Python binary.
A specific interpreter can now be passed to configure e.g: ./configure PYTHON=python3
This commit is contained in:
parent
db560903d1
commit
da89e23a28
10
Makefile.am
10
Makefile.am
|
@ -443,7 +443,7 @@ bindings/cxx/include/libsigrok/enums.hpp: bindings/cxx/enums.timestamp
|
||||||
|
|
||||||
bindings/cxx/enums.timestamp: bindings/cxx/enums.py doxy/xml/index.xml \
|
bindings/cxx/enums.timestamp: bindings/cxx/enums.py doxy/xml/index.xml \
|
||||||
bindings/cxx/ConfigKey_methods.cpp bindings/cxx/QuantityFlag_methods.cpp
|
bindings/cxx/ConfigKey_methods.cpp bindings/cxx/QuantityFlag_methods.cpp
|
||||||
$(AM_V_GEN)python $< doxy/xml/index.xml
|
$(AM_V_GEN)$(PYTHON) $< doxy/xml/index.xml
|
||||||
$(AM_V_at)touch $@
|
$(AM_V_at)touch $@
|
||||||
|
|
||||||
bindings/cxx/classes.lo: bindings/cxx/classes.cpp bindings/cxx/enums.cpp \
|
bindings/cxx/classes.lo: bindings/cxx/classes.cpp bindings/cxx/enums.cpp \
|
||||||
|
@ -473,23 +473,23 @@ PDOC = bindings/python/sigrok/core/doc.i
|
||||||
|
|
||||||
$(PDOC): bindings/swig/doc.py $(CPPXMLDOC)
|
$(PDOC): bindings/swig/doc.py $(CPPXMLDOC)
|
||||||
$(AM_V_at)test -d $(PDIR)/sigrok/core || mkdir -p $(PDIR)/sigrok/core
|
$(AM_V_at)test -d $(PDIR)/sigrok/core || mkdir -p $(PDIR)/sigrok/core
|
||||||
$(AM_V_GEN)python $< python $(CPPXMLDOC) > $@
|
$(AM_V_GEN)$(PYTHON) $< python $(CPPXMLDOC) > $@
|
||||||
|
|
||||||
python-build: $(PDIR)/timestamp
|
python-build: $(PDIR)/timestamp
|
||||||
|
|
||||||
python-quietclean:
|
python-quietclean:
|
||||||
$(AM_V_at)cd $(PDIR) && python $(abs_srcdir)/$(PDIR)/setup.py --quiet clean --all 3>&1 1>&2 2>&3 \
|
$(AM_V_at)cd $(PDIR) && $(PYTHON) $(abs_srcdir)/$(PDIR)/setup.py --quiet clean --all 3>&1 1>&2 2>&3 \
|
||||||
| grep -v "can.t clean it"; true
|
| grep -v "can.t clean it"; true
|
||||||
|
|
||||||
$(PDIR)/timestamp: bindings/cxx/libsigrokxx.la $(PDIR)/sigrok/core/classes.i \
|
$(PDIR)/timestamp: bindings/cxx/libsigrokxx.la $(PDIR)/sigrok/core/classes.i \
|
||||||
bindings/swig/classes.i $(PDOC) $(library_include_HEADERS)
|
bindings/swig/classes.i $(PDOC) $(library_include_HEADERS)
|
||||||
$(AM_V_at)$(MAKE) python-quietclean
|
$(AM_V_at)$(MAKE) python-quietclean
|
||||||
$(AM_V_GEN)cd $(PDIR) && python $(abs_srcdir)/$(PDIR)/setup.py --quiet build 3>&1 1>&2 2>&3 \
|
$(AM_V_GEN)cd $(PDIR) && $(PYTHON) $(abs_srcdir)/$(PDIR)/setup.py --quiet build 3>&1 1>&2 2>&3 \
|
||||||
| grep -v "command line option.*Wstrict-prototypes"; true
|
| grep -v "command line option.*Wstrict-prototypes"; true
|
||||||
$(AM_V_at)touch $(PDIR)/timestamp
|
$(AM_V_at)touch $(PDIR)/timestamp
|
||||||
|
|
||||||
python-install:
|
python-install:
|
||||||
cd $(PDIR) && python $(abs_srcdir)/$(PDIR)/setup.py --quiet install --prefix $(prefix)
|
cd $(PDIR) && $(PYTHON) $(abs_srcdir)/$(PDIR)/setup.py --quiet install --prefix $(prefix)
|
||||||
|
|
||||||
python-clean:
|
python-clean:
|
||||||
$(AM_V_at)$(MAKE) python-quietclean
|
$(AM_V_at)$(MAKE) python-quietclean
|
||||||
|
|
|
@ -199,10 +199,8 @@ if test "x$HAVE_DOXYGEN" != "xyes"; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Python is needed for the C++ bindings.
|
# Python is needed for the C++ bindings.
|
||||||
AC_CHECK_PROG([HAVE_PYTHON], [python], [yes])
|
AM_PATH_PYTHON([2.7], [HAVE_PYTHON="yes"],
|
||||||
if test "x$HAVE_PYTHON" != "xyes"; then
|
[HAVE_PYTHON="no"; BINDINGS_CXX="no"; cxx_msg="Python required"])
|
||||||
BINDINGS_CXX="no"; cxx_msg="Python required"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# The Python bindings need Python development files.
|
# The Python bindings need Python development files.
|
||||||
PKG_CHECK_MODULES([python], [python >= 2.7],
|
PKG_CHECK_MODULES([python], [python >= 2.7],
|
||||||
|
|
Loading…
Reference in New Issue