[geany/geany] c0bde0: Add check for lxml package if Python is enabled

Matthew Brush git-noreply at xxxxx
Tue Feb 16 05:52:09 UTC 2016


Branch:      refs/heads/master
Author:      Matthew Brush <mbrush at codebrainz.ca>
Committer:   Thomas Martitz <kugel at rockbox.org>
Date:        Tue, 16 Feb 2016 05:52:09 UTC
Commit:      c0bde0dbf487a9450c04472ccef10a9078e2333d
             https://github.com/geany/geany/commit/c0bde0dbf487a9450c04472ccef10a9078e2333d

Log Message:
-----------
Add check for lxml package if Python is enabled

This prevents a make-time error later if it can't be imported. lxml is
considered optional so there's no build failure if Python doesn't exist or if
the lxml package can't be imported.


Modified Paths:
--------------
    m4/geany-docutils.m4

Modified: m4/geany-docutils.m4
15 lines changed, 14 insertions(+), 1 deletions(-)
===================================================================
@@ -79,7 +79,20 @@ AC_DEFUN([GEANY_CHECK_PYTHON],
 [
 	AM_PATH_PYTHON([2.7], [], [])
 
-	AM_CONDITIONAL([WITH_PYTHON], [test -n "$PYTHON"])
+	have_python=no
+	AS_IF([test -n "$PYTHON"], [
+		AC_MSG_CHECKING([for python lxml package])
+		$PYTHON -c 'import lxml' 1>&2 2>/dev/null
+		AS_IF([test $? -eq 0], [
+			AC_MSG_RESULT([found])
+			have_python=yes
+		], [
+			AC_MSG_RESULT([not found])
+			have_python=no
+		])
+	])
+
+	AM_CONDITIONAL([WITH_PYTHON], [test "x$have_python" = "xyes"])
 	AM_COND_IF([WITH_PYTHON],
 		[GEANY_STATUS_ADD([Using Python version], [$PYTHON_VERSION])])
 ])



--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).


More information about the Commits mailing list