commit 0c1492da70cbcab25014ea4e2639c2a206e45a20 Author: vaydheesh Date: Mon Jun 17 18:48:15 2019 +0000 Added: --enable-python-bindings flag diff --git a/.gitignore b/.gitignore index a849096..946d2db 100644 --- a/.gitignore +++ b/.gitignore @@ -71,3 +71,9 @@ /lttoolbox/lttoolbox_config.h /lttoolbox/lt-tmxproc /lttoolbox/lt-expand +/python/Makefile +/python/Makefile.in +/python/lttoolbox_wrap.cpp +/python/lttoolbox.py +/python/setup.py +/python/build* \ No newline at end of file diff --git a/Makefile.am b/Makefile.am index 63441d2..93b9ce2 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,8 +1,12 @@ ACLOCAL_AMFLAGS=-I m4 -SUBDIRS = $(GENERIC_LIBRARY_NAME) python +SUBDIRS = $(GENERIC_LIBRARY_NAME) DIST_SUBDIRS = $(GENERIC_LIBRARY_NAME) +if HAVE_PYTHON_BINDINGS +SUBDIRS += python +endif + pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = lttoolbox.pc diff --git a/configure.ac b/configure.ac index 8c11910..bec2651 100644 --- a/configure.ac +++ b/configure.ac @@ -147,4 +147,11 @@ AX_PKG_SWIG(3.0.4) AX_SWIG_ENABLE_CXX AX_SWIG_PYTHON +AC_ARG_ENABLE([python-bindings], + AS_HELP_STRING([--enable-python-bindings], + [build python bindings (default=disabled)]), + [enable_python_bindings=$enableval], + [enable_python_bindings=no]) +AM_CONDITIONAL([HAVE_PYTHON_BINDINGS], [test x$enable_python_bindings = xyes]) + AC_OUTPUT([Makefile lttoolbox.pc lttoolbox/Makefile python/Makefile]) diff --git a/python/Makefile.am b/python/Makefile.am index 0009abf..b70baf8 100644 --- a/python/Makefile.am +++ b/python/Makefile.am @@ -1,8 +1,8 @@ -SWIG_SOURCES = lttoolbox.i +SWIG_INTERFACE = lttoolbox.i BUILT_SOURCES = lttoolbox_wrap.cpp lttoolbox.py -lttoolbox_wrap.cpp: $(SWIG_SOURCES) setup.py +lttoolbox_wrap.cpp: $(SWIG_INTERFACE) setup.py $(SWIG) $(AX_SWIG_PYTHON_OPT) -I$(top_srcdir) -o $@ $< $(PYTHON) setup.py build