summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac24
1 files changed, 24 insertions, 0 deletions
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"
+ ]
+ )