Skip to content
Snippets Groups Projects
Commit 663f946a authored by Adrien Béraud's avatar Adrien Béraud
Browse files

python: build cython module with autotools

parent 42ba16d0
No related branches found
No related tags found
No related merge requests found
...@@ -18,6 +18,18 @@ AC_CHECK_PROGS([DOXYGEN], [doxygen]) ...@@ -18,6 +18,18 @@ AC_CHECK_PROGS([DOXYGEN], [doxygen])
if test -z "$DOXYGEN"; if test -z "$DOXYGEN";
then AC_MSG_WARN([Doxygen not found - continuing without Doxygen support]) then AC_MSG_WARN([Doxygen not found - continuing without Doxygen support])
fi fi
AM_CONDITIONAL([HAVE_DOXYGEN], [test -n "$DOXYGEN"])
AM_PATH_PYTHON([3.3],, [:])
AM_CONDITIONAL([HAVE_PYTHON], [test -n "$PYTHON"])
if test -n "$PYTHON"; then
AC_CHECK_PROGS([CYTHON], [cython])
if test -z "$CYTHON";
then AC_MSG_WARN([Cython not found - continuing without cython support])
fi
fi
AM_CONDITIONAL([USE_CYTHON], [test -n "$CYTHON"])
case "${host_os}" in case "${host_os}" in
"") "")
...@@ -64,8 +76,11 @@ PKG_CHECK_MODULES([GNUTLS], [gnutls >= 3.1]) ...@@ -64,8 +76,11 @@ PKG_CHECK_MODULES([GNUTLS], [gnutls >= 3.1])
AC_ARG_ENABLE([tools], AS_HELP_STRING([--disable-tools],[Disable tools (CLI DHT node)]),,build_tools=yes) AC_ARG_ENABLE([tools], AS_HELP_STRING([--disable-tools],[Disable tools (CLI DHT node)]),,build_tools=yes)
AM_CONDITIONAL(ENABLE_TOOLS, test x$build_tools == xyes) AM_CONDITIONAL(ENABLE_TOOLS, test x$build_tools == xyes)
AM_CONDITIONAL([HAVE_DOXYGEN], [test -n "$DOXYGEN"])
AM_COND_IF([HAVE_DOXYGEN], [AC_CONFIG_FILES([doc/Doxyfile doc/Makefile])]) AM_COND_IF([HAVE_DOXYGEN], [AC_CONFIG_FILES([doc/Doxyfile doc/Makefile])])
AM_COND_IF([USE_CYTHON], [AC_CONFIG_FILES([tools/python/Makefile])])
AC_CONFIG_FILES([Makefile src/Makefile tools/Makefile opendht.pc]) AC_CONFIG_FILES([Makefile
src/Makefile
tools/Makefile
opendht.pc])
AC_OUTPUT AC_OUTPUT
if USE_CYTHON
SUBDIRS = python
endif
libexec_PROGRAMS = dhtnode dhtchat libexec_PROGRAMS = dhtnode dhtchat
AM_CPPFLAGS = -I../include AM_CPPFLAGS = -I../include
......
if USE_CYTHON
pybuild.stamp:
LDFLAGS="-L$(top_srcdir)/src/.libs" $(PYTHON) setup.py build_ext --inplace
echo stamp > pybuild.stamp
CLEANFILES = pybuild.stamp
all-local: pybuild.stamp
clean-local:
rm -rf $(builddir)/build $(builddir)/*.so
endif
\ No newline at end of file
...@@ -20,12 +20,14 @@ ...@@ -20,12 +20,14 @@
from distutils.core import setup, Extension from distutils.core import setup, Extension
from Cython.Build import cythonize from Cython.Build import cythonize
from Cython.Distutils import build_ext
setup(name="opendht", setup(name="opendht",
version="0.1", version="0.1",
description="Cython generated wrapper for opendht", description="Cython generated wrapper for opendht",
author="Guillaume Roguez", author="Guillaume Roguez",
license="GPLv3", license="GPLv3",
cmdclass = { 'build_ext' : build_ext },
ext_modules = cythonize(Extension( ext_modules = cythonize(Extension(
"opendht", "opendht",
["opendht.pyx"], ["opendht.pyx"],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment