summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--configure.ac38
-rw-r--r--plugins/Makefile.am6
3 files changed, 40 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index 0846995..6ae599c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+16-03-01 Cyrille Bagard <nocbos@gmail.com>
+
+ * configure.ac:
+ * plugins/Makefile.am:
+ Prevent compilation from breaking when Python3 is not found.
+
16-02-28 Cyrille Bagard <nocbos@gmail.com>
* plugins/androhelpers/params.c:
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
diff --git a/plugins/Makefile.am b/plugins/Makefile.am
index 726534f..22ef693 100644
--- a/plugins/Makefile.am
+++ b/plugins/Makefile.am
@@ -1,2 +1,6 @@
-SUBDIRS = androhelpers devdbg libcsem mobicore pychrysa python readelf ropgadgets stackvars
+if HAVE_PYTHON3_CONFIG
+ PYTHON3_SUBDIRS = pychrysa python
+endif
+
+SUBDIRS = androhelpers devdbg libcsem mobicore $(PYTHON3_SUBDIRS) readelf ropgadgets stackvars