summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorOmar Sandoval <osandov@fb.com>2017-12-18 00:31:25 -0800
committerDavid Sterba <dsterba@suse.com>2018-02-24 01:37:17 +0100
commit23c01b3c1b0803950657f3f29914cd59f3554a84 (patch)
tree970d902219a7c2a2bddc87ed883154c1dee79a65 /configure.ac
parentd51e8b128f598a31933367ca0fa14b6875b34ca0 (diff)
downloadbtrfs-progs-23c01b3c1b0803950657f3f29914cd59f3554a84.tar.gz
btrfs-progs-23c01b3c1b0803950657f3f29914cd59f3554a84.tar.bz2
btrfs-progs-23c01b3c1b0803950657f3f29914cd59f3554a84.zip
libbtrfsutil: add Python bindings
The C libbtrfsutil library isn't very useful for scripting, so we also want bindings for Python. Writing unit tests in Python is also much easier than doing so in C. Only Python 3 is supported; if someone really wants Python 2 support, they can write their own bindings. This commit is just the scaffolding. Signed-off-by: Omar Sandoval <osandov@fb.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac15
1 files changed, 15 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 46f22a4d..7d80aa49 100644
--- a/configure.ac
+++ b/configure.ac
@@ -210,6 +210,19 @@ fi
AS_IF([test "x$enable_zstd" = xyes], [BTRFSRESTORE_ZSTD=1], [BTRFSRESTORE_ZSTD=0])
AC_SUBST(BTRFSRESTORE_ZSTD)
+AC_ARG_ENABLE([python],
+ AS_HELP_STRING([--disable-python], [do not build libbtrfsutil Python bindings]),
+ [], [enable_python=yes]
+)
+
+if test "x$enable_python" = xyes; then
+ AM_PATH_PYTHON([3.4])
+fi
+
+AS_IF([test "x$enable_python" = xyes], [PYTHON_BINDINGS=1], [PYTHON_BINDINGS=0])
+AC_SUBST(PYTHON_BINDINGS)
+AC_SUBST(PYTHON)
+
# udev v190 introduced the btrfs builtin and a udev rule to use it.
# Our udev rule gives us the friendly dm names but isn't required (or valid)
# on earlier releases.
@@ -265,6 +278,8 @@ AC_MSG_RESULT([
backtrace support: ${enable_backtrace}
btrfs-convert: ${enable_convert} ${convertfs:+($convertfs)}
btrfs-restore zstd: ${enable_zstd}
+ Python bindings: ${enable_python}
+ Python interpreter: ${PYTHON}
Type 'make' to compile.
])