summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2019-02-04 18:45:19 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2019-02-04 18:45:19 (GMT)
commitff187d24b7441e88e1f0361d59b0f6f55851791f (patch)
treee340d88fb8189ef79f2c2d4193eea97be4fa003e /configure.ac
parent9b35b89fce2499d5352f5323baec53abbf9a4af2 (diff)
Added an option to drop Python support at compilation time.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac23
1 files changed, 20 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index c8e6cf1..4e2967e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -279,13 +279,22 @@ AC_SUBST(LIBSSL_LIBS)
#--- Checks for Python
+AC_ARG_ENABLE([python-bindings],
+ AS_HELP_STRING([--disable-python-bindings], [disable Python bindings [default=no]]),
+ [], [enable_python_bindings=yes])
+
if test "x$enable_debug" = "xyes"; then
AC_CHECK_PROG(python3_cfg_binary, [python3-dbg-config] , yes)
else
AC_CHECK_PROG(python3_cfg_binary, [python3-config] , yes)
fi
-AM_CONDITIONAL([HAVE_PYTHON3_CONFIG], [test "x$python3_cfg_binary" = "xyes"])
+AM_CONDITIONAL([BUILD_PYTHON3_BINDINGS], [test "x$enable_python_bindings$python3_cfg_binary" = "xyesyes"])
+
+if test "x$BUILD_PYTHON3_BINDINGS_TRUE" = "x"; then
+ AC_DEFINE(HAVE_PYTHON3_BINDINGS, 1,
+ [Define to 1 if the Python bindings are available and enabled.])
+fi
if test "x$python3_cfg_binary" = "xyes"; then
@@ -303,7 +312,11 @@ if test "x$python3_cfg_binary" = "xyes"; then
AC_SUBST(LIBPYTHON_LIBS)
AC_DEFINE_UNQUOTED(LIBPYTHON_ABI_FLAGS, "${LIBPYTHON_ABI_FLAGS}", [ABI flags of the linked Python library])
- python3_version=`python3 --version | cut -d ' ' -f 2`
+ if test "x$enable_python_bindings" = "xyes"; then
+ python3_version=`python3 --version | cut -d ' ' -f 2`
+ else
+ python3_version="`python3 --version | cut -d ' ' -f 2` (skipped)"
+ fi
else
@@ -317,7 +330,11 @@ fi
PKG_CHECK_MODULES(LIBPYGOBJECT,pygobject-3.0 >= 3.12.1,[libpygobject_found=yes],[libpygobject_found=no])
if test "$libpygobject_found" = "yes"; then
- libpygobject_version=`pkg-config pygobject-3.0 --modversion`
+ if test "x$enable_python_bindings" = "xyes"; then
+ libpygobject_version=`pkg-config pygobject-3.0 --modversion`
+ else
+ libpygobject_version="`pkg-config pygobject-3.0 --modversion` (skipped)"
+ fi
else
libpygobject_version='-'
fi