diff --git a/configure.ac b/configure.ac index f5952c82..09222f6b 100644 --- a/configure.ac +++ b/configure.ac @@ -73,6 +73,9 @@ AC_ARG_WITH([libxml2], [disable support for libxml2])], [], [with_libxml2=yes]) +dnl Define variables +AC_ARG_VAR([CYTHON], [the Cython executable]) + dnl Checks for programs AC_PROG_CC AC_PROG_CXX @@ -82,6 +85,7 @@ AC_PROG_MAKE_SET AM_PROG_CC_C_O PKG_PROG_PKG_CONFIG([0.20]) AM_PATH_PYTHON([2.6],, [:]) +AC_CHECK_PROGS([CYTHON], [cython.py cython]) AX_CXX_COMPILE_STDCXX_11([noext], [optional]) @@ -354,4 +358,6 @@ AC_MSG_NOTICE([summary of build options: Examples: ${enable_examples} Hdtest: ${enable_hdtest} Failmalloc: ${request_failmalloc} + Python: ${PYTHON} ${PYTHON_VERSION} + Cython: ${CYTHON} ]) diff --git a/python/Makefile.am b/python/Makefile.am index b688283b..d077f5db 100644 --- a/python/Makefile.am +++ b/python/Makefile.am @@ -25,12 +25,18 @@ EXTRA_DIST = README.rst cnghttp2.pxd nghttp2.pyx setup.py PYSETUP_INCLUDE_DIRS=$(top_srcdir)/lib/includes:$(top_srcdir)/lib PYSETUP_LIBDIRS=$(top_builddir)/lib/.libs +CYTHON = @CYTHON@ +PYTHON = @PYTHON@ + +.PHONY: help build_ext + +help: + @echo "Please use \`make \` where is one of" + @echo " build_ext to build Python @PYTHON_VERSION@ nghttp2 extension" nghttp2.c: nghttp2.pyx cnghttp2.pxd - cython nghttp2.pyx - -.PHONY: build_ext + $(CYTHON) nghttp2.pyx build_ext: nghttp2.c - python setup.py build_ext --include-dirs=$(PYSETUP_INCLUDE_DIRS) \ + $(PYTHON) setup.py build_ext --include-dirs=$(PYSETUP_INCLUDE_DIRS) \ --library-dirs=$(PYSETUP_LIBDIRS)