Skip to content

Commit

Permalink
Add check for lxml package if Python is enabled
Browse files Browse the repository at this point in the history
This prevents a make-time error later if it can't be imported.
  • Loading branch information
codebrainz committed Feb 7, 2016
1 parent 7abe35f commit 02c39a3
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions m4/geany-docutils.m4
Expand Up @@ -80,6 +80,15 @@ AC_DEFUN([GEANY_CHECK_PYTHON],
AM_PATH_PYTHON([2.7], [], [])
AM_CONDITIONAL([WITH_PYTHON], [test -n "$PYTHON"])
AM_COND_IF([WITH_PYTHON],
[GEANY_STATUS_ADD([Using Python version], [$PYTHON_VERSION])])
AM_COND_IF([WITH_PYTHON], [
AC_MSG_CHECKING([for python lxml package])
$PYTHON -c 'import lxml' 1>&2 2>/dev/null

This comment has been minimized.

Copy link
@b4n

b4n Feb 12, 2016

Collaborator

most people will to the contrary, 2>&1 >/dev/null, but fair enough :)

AS_IF([test $? -eq 0], [

This comment has been minimized.

Copy link
@b4n

b4n Feb 12, 2016

Collaborator

you could have the $PYTHON call directly as the condition instead of checking $? afterward

AC_MSG_RESULT([found])
], [
AC_MSG_RESULT([not found])
AC_MSG_ERROR([unable to import the python lxml package, is it installed?])
])
GEANY_STATUS_ADD([Using Python version], [$PYTHON_VERSION])
])
])

0 comments on commit 02c39a3

Please sign in to comment.