From bf9653667a39e32973466a202fdf9edcf881075a Mon Sep 17 00:00:00 2001 From: Eric Leblond Date: Tue, 19 Jun 2018 23:46:53 +0200 Subject: python: installation of binding via make install setup.py is used to build and install the python binding. Call to setup.py are done in Makefile to proceed to build and installation. Signed-off-by: Eric Leblond Signed-off-by: Pablo Neira Ayuso --- configure.ac | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 9f5d0f9a..b1a790d0 100644 --- a/configure.ac +++ b/configure.ac @@ -125,6 +125,22 @@ AC_DEFINE([HAVE_LIBJANSSON], [1], [Define if you have libjansson]) AC_SUBST(with_json) AM_CONDITIONAL([BUILD_JSON], [test "x$with_json" != xno]) +AC_ARG_ENABLE(python, + AS_HELP_STRING([--enable-python], [Enable python]),,[enable_python=check] + ) + +AC_ARG_WITH([python_bin], + [AS_HELP_STRING([--with-python-bin], [Specify Python binary to use])], + [PYTHON_BIN="$withval"], [AC_PATH_PROGS(PYTHON_BIN, python python2 python2.7)] + ) + +AS_IF([test "x$PYTHON_BIN" == "x"], [ + AS_IF([test "x$enable_python" == "xyes"], [AC_MSG_ERROR([Python asked but not found])]) + AS_IF([test "x$enable_python" == "xcheck"], [AC_MSG_WARN([Python not found, continuing anyway])]) + ]) + +AM_CONDITIONAL([HAVE_PYTHON], [test "x$PYTHON_BIN" != "x"]) + AC_CONFIG_FILES([ \ Makefile \ libnftables.pc \ @@ -140,6 +156,7 @@ AC_CONFIG_FILES([ \ files/Makefile \ files/nftables/Makefile \ doc/Makefile \ + py/Makefile \ ]) AC_OUTPUT @@ -152,3 +169,10 @@ nft configuration: enable pdf documentation: ${enable_pdf_doc} libxtables support: ${with_libxtables} json output support: ${with_json}" + +AS_IF([test "x$PYTHON_BIN" != "x"], [ + echo " enable Python: yes (with $PYTHON_BIN)" + ], [ + echo " enable Python: no" + ] + ) -- cgit v1.2.3