summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2016-03-01 20:38:03 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2016-03-01 20:38:03 (GMT)
commit71f3b31f2e05dc3ed8201c409c9b9f39eb8bdfe0 (patch)
tree0592f686d321b3017b27e2df09e5c3c4e4ebbfff /configure.ac
parent2245e2b3c4f4ff96cf462e76e24c04d4d0941996 (diff)
Prevented compilation from breaking when Python3 is not found.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac38
1 files changed, 29 insertions, 9 deletions
diff --git a/configure.ac b/configure.ac
index 30ad629..b5a33c0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -223,19 +223,36 @@ AC_SUBST(LIBSQLITE_LIBS)
#--- Checks for Python
if test "x$enable_debug" = "xyes"; then
- LIBPYTHON_CFLAGS=`python3-dbg-config --cflags`
- LIBPYTHON_LIBS=`python3-dbg-config --libs`
- LIBPYTHON_ABI_FLAGS=`python3-dbg-config --abiflags`
+ AC_CHECK_PROG(python3_cfg_binary, [python3-dbg-config] , yes)
else
- LIBPYTHON_CFLAGS=`python3-config --cflags`
- LIBPYTHON_LIBS=`python3-config --libs`
- LIBPYTHON_ABI_FLAGS=`python3-config --abiflags`
+ AC_CHECK_PROG(python3_cfg_binary, [python3-config] , yes)
fi
-AC_SUBST(LIBPYTHON_CFLAGS)
-AC_SUBST(LIBPYTHON_LIBS)
-AC_DEFINE_UNQUOTED(LIBPYTHON_ABI_FLAGS, "${LIBPYTHON_ABI_FLAGS}", [ABI flags of the linked Python library])
+AM_CONDITIONAL([HAVE_PYTHON3_CONFIG], [test "x$python3_cfg_binary" = "xyes"])
+if test "x$python3_cfg_binary" = "xyes"; then
+
+ if test "x$enable_debug" = "xyes"; then
+ LIBPYTHON_CFLAGS=`python3-dbg-config --cflags`
+ LIBPYTHON_LIBS=`python3-dbg-config --libs`
+ LIBPYTHON_ABI_FLAGS=`python3-dbg-config --abiflags`
+ else
+ LIBPYTHON_CFLAGS=`python3-config --cflags`
+ LIBPYTHON_LIBS=`python3-config --libs`
+ LIBPYTHON_ABI_FLAGS=`python3-config --abiflags`
+ fi
+
+ AC_SUBST(LIBPYTHON_CFLAGS)
+ 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`
+
+else
+
+ python3_version='-'
+
+fi
#--- Checks for pygobject-3.0
@@ -381,6 +398,9 @@ echo The GNU Image Manipulation Program Toolkit... : $libgtk_version
echo The XML C parser and toolkit of Gnome........ : $libxml_version
echo The flexible interface for archives I/O...... : $libarchive_version
echo The small, fast and reliable database engine. : $libsqlite_version
+
+echo
+echo Available Python programming language........ : $python3_version
echo The Python GObject bindings.................. : $libpygobject_version
echo