python: Use distutils to build/install python bindings
automake version is a bit picky about installation location and uses different compiler flags from distutils. We prefer official distutils. Now nghttp2.c, which is generated by cython, is distributed in archive.
This commit is contained in:
parent
abdbd29d5f
commit
ddf6162528
|
@ -322,6 +322,10 @@ fi
|
||||||
AM_CONDITIONAL([ENABLE_PYTHON_BINDINGS],
|
AM_CONDITIONAL([ENABLE_PYTHON_BINDINGS],
|
||||||
[test "x${enable_python_bindings}" = "xyes"])
|
[test "x${enable_python_bindings}" = "xyes"])
|
||||||
|
|
||||||
|
# Produce cython conditional, so that we can distribute generated C
|
||||||
|
# source
|
||||||
|
AM_CONDITIONAL([HAVE_CYTHON], [test "x${CYTHON}" != "x"])
|
||||||
|
|
||||||
# failmalloc tests
|
# failmalloc tests
|
||||||
AM_CONDITIONAL([ENABLE_FAILMALLOC], [ test "x${enable_failmalloc}" = "xyes" ])
|
AM_CONDITIONAL([ENABLE_FAILMALLOC], [ test "x${enable_failmalloc}" = "xyes" ])
|
||||||
|
|
||||||
|
@ -406,6 +410,7 @@ AC_CONFIG_FILES([
|
||||||
src/Makefile
|
src/Makefile
|
||||||
examples/Makefile
|
examples/Makefile
|
||||||
python/Makefile
|
python/Makefile
|
||||||
|
python/setup.py
|
||||||
doc/Makefile
|
doc/Makefile
|
||||||
doc/conf.py
|
doc/conf.py
|
||||||
doc/index.rst
|
doc/index.rst
|
||||||
|
|
|
@ -21,27 +21,30 @@
|
||||||
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||||
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
EXTRA_DIST = cnghttp2.pxd setup.py
|
EXTRA_DIST = cnghttp2.pxd nghttp2.pyx setup.py
|
||||||
|
|
||||||
|
# Generate nghttp2.c only if we have cython installed
|
||||||
|
if HAVE_CYTHON
|
||||||
|
|
||||||
|
EXTRA_DIST += nghttp2.c
|
||||||
|
|
||||||
|
endif # HAVE_CYTHON
|
||||||
|
|
||||||
if ENABLE_PYTHON_BINDINGS
|
if ENABLE_PYTHON_BINDINGS
|
||||||
|
|
||||||
distclean-local:
|
all-local: nghttp2.c
|
||||||
-rm -f nghttp2.c
|
$(PYTHON) setup.py build
|
||||||
|
|
||||||
|
install-exec-local:
|
||||||
|
$(PYTHON) setup.py install --prefix=$(DESTDIR)$(prefix)
|
||||||
|
|
||||||
|
uninstall-local:
|
||||||
|
rm -rf $(DESTDIR)$(libdir)/python*/site-packages/*nghttp2*
|
||||||
|
|
||||||
|
clean-local:
|
||||||
|
$(PYTHON) setup.py clean --all
|
||||||
|
|
||||||
.pyx.c:
|
.pyx.c:
|
||||||
$(CYTHON) -o $@ $<
|
$(CYTHON) -o $@ $<
|
||||||
|
|
||||||
pyexec_LTLIBRARIES = nghttp2.la
|
|
||||||
nghttp2_la_SOURCES = nghttp2.pyx
|
|
||||||
nghttp2_la_CPPFLAGS = \
|
|
||||||
$(PYTHON_CPPFLAGS) \
|
|
||||||
-fno-strict-aliasing \
|
|
||||||
-I$(top_srcdir)/lib/includes \
|
|
||||||
-I$(top_builddir)/lib/includes \
|
|
||||||
-I$(top_srcdir)/lib
|
|
||||||
nghttp2_la_LDFLAGS = \
|
|
||||||
$(PYTHON_LDFLAGS) \
|
|
||||||
-avoid-version -module
|
|
||||||
nghttp2_la_LIBADD = $(top_builddir)/lib/libnghttp2.la
|
|
||||||
|
|
||||||
endif # ENABLE_PYTHON_BINDINGS
|
endif # ENABLE_PYTHON_BINDINGS
|
||||||
|
|
|
@ -32,6 +32,10 @@ setup(
|
||||||
keywords = [],
|
keywords = [],
|
||||||
ext_modules = [Extension("nghttp2",
|
ext_modules = [Extension("nghttp2",
|
||||||
["nghttp2.c"],
|
["nghttp2.c"],
|
||||||
|
include_dirs=['@top_srcdir@/lib',
|
||||||
|
'@top_srcdir@/lib/includes',
|
||||||
|
'@top_builddir@/lib/includes'],
|
||||||
|
library_dirs=['@top_builddir@/lib/.libs'],
|
||||||
libraries=['nghttp2'])],
|
libraries=['nghttp2'])],
|
||||||
long_description='TBD'
|
long_description='TBD'
|
||||||
)
|
)
|
Loading…
Reference in New Issue